/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
 * $Rev: 5685 $
 */
(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};
/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.1, 11.09.2007
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Changelog:
 *    11.09.2007 Version 1.1
 *    - removed noConflict
 *    - added png-support for input type=image
 *    - 01.08.2007 CSS background-image support extension added by Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
 *    31.05.2007 initial Version 1.0
 * --------------------------------------------------------------------
 * @example $(function(){$(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready
 *
 * jQuery(function(){jQuery(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready when using noConflict
 *
 * @example $(function(){$('div.examples').pngFix();});
 * @desc Fixes all PNG's within div with class examples
 *
 * @example $(function(){$('div.examples').pngFix( { blankgif:'ext.gif' } );});
 * @desc Fixes all PNG's within div with class examples, provides blank gif for input with png
 * --------------------------------------------------------------------
 */

(function($) {

jQuery.fn.pngFix = function(settings) {

	// Settings
	settings = jQuery.extend({
		blankgif: 'blank.gif'
	}, settings);

	var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
	var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

	if (jQuery.browser.msie && (ie55 || ie6)) {

		//fix images with png-source
		jQuery(this).find("img[@src$=.png]").each(function() {

			jQuery(this).attr('width',jQuery(this).width());
			jQuery(this).attr('height',jQuery(this).height());

			var prevStyle = '';
			var strNewHTML = '';
			var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : '';
			var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : '';
			var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : '';
			var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : '';
			var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : '';
			var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : '';
			if (this.style.border) {
				prevStyle += 'border:'+this.style.border+';';
				this.style.border = '';
			}
			if (this.style.padding) {
				prevStyle += 'padding:'+this.style.padding+';';
				this.style.padding = '';
			}
			if (this.style.margin) {
				prevStyle += 'margin:'+this.style.margin+';';
				this.style.margin = '';
			}
			var imgStyle = (this.style.cssText);

			strNewHTML += '<span '+imgId+imgClass+imgTitle+imgAlt;
			strNewHTML += 'style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;
			strNewHTML += 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;';
			strNewHTML += 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + jQuery(this).attr('src') + '\', sizingMethod=\'scale\');';
			strNewHTML += imgStyle+'"></span>';
			if (prevStyle != ''){
				strNewHTML = '<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;'+'">' + strNewHTML + '</span>';
			}

			jQuery(this).hide();
			jQuery(this).after(strNewHTML);

		});

		// fix css background pngs
		jQuery(this).find("*").each(function(){
			var bgIMG = jQuery(this).css('background-image');
			if(bgIMG.indexOf(".png")!=-1){
				var iebg = bgIMG.split('url("')[1].split('")')[0];
				jQuery(this).css('background-image', 'none');
				jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
			}
		});
		
		//fix input with png-source
		jQuery(this).find("input[@src$=.png]").each(function() {
			var bgIMG = jQuery(this).attr('src');
			jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');';
   		jQuery(this).attr('src', settings.blankgif)
		});
	
	}
	
	return jQuery;

};

})(jQuery);

/**
 * jQuery (PNG Fix) v1.2
 * Microsoft Internet Explorer 24bit PNG Fix
 *
 * The MIT License
 * 
 * Copyright (c) 2007 Paul Campbell (pauljamescampbell.co.uk)
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * @param		Object
 * @return		Array
 */
(function($) {
	
	$.fn.pngfix = function(options) {
		
		// Review the Microsoft IE developer library for AlphaImageLoader reference 
		// http://msdn2.microsoft.com/en-us/library/ms532969(VS.85).aspx
		
		// ECMA scope fix
		var elements 	= this;
		var settings 	= $.extend({
			imageFixSrc: 	false,
			sizingMethod: 	false 
		}, options);
		
		if(!$.browser.msie || ($.browser.msie &&  $.browser.version >= 7)) {
			return(elements);
		}

		function setFilter(el, path, mode) {
			var fs = el.attr("filters");
			var alpha = "DXImageTransform.Microsoft.AlphaImageLoader";
			if (fs[alpha]) {
				fs[alpha].enabled = true;
				fs[alpha].src = path; 
				fs[alpha].sizingMethod = mode;
			} else {
				el.css("filter", 'progid:' + alpha + '(enabled="true", sizingMethod="' + mode + '", src="' + path + '")');			
			}
		}
		
		function setDOMElementWidth(el) {
			if(el.css("width") == "auto" & el.css("height") == "auto") {
				el.css("width", el.attr("offsetWidth") + "px");
			}
		}

		return(
			elements.each(function() {
				
				// Scope
				var el = $(this);
				
				if(el.attr("tagName").toUpperCase() == "IMG" && (/\.png/i).test(el.attr("src"))) {
					if(!settings.imageFixSrc) {
						
						// Wrap the <img> in a <span> then apply style/filters, 
						// removing the <img> tag from the final render 
						el.wrap("<span></span>");
						var par = el.parent();
						par.css({
							height: 	el.height(),
							width: 		el.width(),
							display: 	"inline-block"
						});
						setFilter(par, el.attr("src"), "scale");
						el.remove();
					} else if((/\.gif/i).test(settings.imageFixSrc)) {
						
						// Replace the current image with a transparent GIF
						// and apply the filter to the background of the 
						// <img> tag (not the preferred route)
						setDOMElementWidth(el);
						setFilter(el, el.attr("src"), "image");
						el.attr("src", settings.imageFixSrc);
					}
					
				} else {
					var bg = new String(el.css("backgroundImage"));
					var matches = bg.match(/^url\("(.*)"\)$/);
					if(matches && matches.length) {
						
						// Elements with a PNG as a backgroundImage have the
						// filter applied with a sizing method relevant to the 
						// background repeat type
						setDOMElementWidth(el);
						el.css("backgroundImage", "none");
						
						// Restrict scaling methods to valid MSDN defintions (or one custom)
						var sc = "crop";
						if(settings.sizingMethod) {
							sc = settings.sizingMethod;
						} 
						setFilter(el, matches[1], sc);
						
						// Fix IE peek-a-boo bug for internal links
						// within that DOM element
						el.find("a").each(function() {
							$(this).css("position", "relative");
						});
					}
				}
				
			})
		);
	}

})(jQuery)
// Browser Detect  v2.1.6
// documentation: http://www.dithered.com/javascript/browser_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)


function BrowserDetect() {
   var ua = navigator.userAgent.toLowerCase(); 

   // browser engine name
   this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
   this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);

   // browser name
   this.isKonqueror   = (ua.indexOf('konqueror') != -1); 
   this.isSafari      = (ua.indexOf('safari') != - 1);
   this.isOmniweb     = (ua.indexOf('omniweb') != - 1);
   this.isOpera       = (ua.indexOf('opera') != -1); 
   this.isIcab        = (ua.indexOf('icab') != -1); 
   this.isAol         = (ua.indexOf('aol') != -1); 
   this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) ); 
   this.isMozilla     = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
   this.isFirebird    = (ua.indexOf('firebird/') != -1);
   this.isNS          = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
   
   // spoofing and compatible browsers
   this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
   
   // rendering engine versions
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
   this.appleWebKitVersion = ( (this.isAppleWebKit) ? parseFloat( ua.substring( ua.indexOf('applewebkit/') + 12) ) : -1 );
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 
   
   // correct version number
   if (this.isGecko && !this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
   }
   else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   }
   else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   }
   else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('safari/') + 7 ) );
   }
   else if (this.isOmniweb) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('omniweb/') + 8 ) );
   }
   else if (this.isOpera) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera') + 6 ) );
   }
   else if (this.isIcab) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab') + 5 ) );
   }
   
   this.versionMajor = parseInt(this.versionMinor); 
   
   // dom support
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   
   // css compatibility mode
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';

   // platform
   this.isWin    = (ua.indexOf('win') != -1);
   this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   this.isMac    = (ua.indexOf('mac') != -1);
   this.isUnix   = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux  = (ua.indexOf('linux') != -1);
   
   // specific browser shortcuts
   this.isNS4x = (this.isNS && this.versionMajor == 4);
   this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
   this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
   this.isNS4up = (this.isNS && this.versionMinor >= 4);
   this.isNS6x = (this.isNS && this.versionMajor == 6);
   this.isNS6up = (this.isNS && this.versionMajor >= 6);
   this.isNS7x = (this.isNS && this.versionMajor == 7);
   this.isNS7up = (this.isNS && this.versionMajor >= 7);
   
   this.isIE4x = (this.isIE && this.versionMajor == 4);
   this.isIE4up = (this.isIE && this.versionMajor >= 4);
   this.isIE5x = (this.isIE && this.versionMajor == 5);
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE5up = (this.isIE && this.versionMajor >= 5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
   this.isIE6up = (this.isIE && this.versionMajor >= 6);
   
   this.isIE4xMac = (this.isIE4x && this.isMac);
   
   /**
    * getPageWidth
    *
    * returns the width of the browser window or the
    * width of the content; whichever is greater.
    *
    */
   this.getPageWidth = function() {
      if( this.getScrollWidth() < this.getWindowWidth() ){	
         return this.getWindowWidth();
      } else {
         return this.getScrollWidth();
      }
   }

   /**
    * getScrollWidth
    *
    * returns the width of the content.
    *
    */
   this.getScrollWidth = function() {
      if ( window.innerHeight && window.scrollMaxY )
      {
         return document.body.scrollWidth;
      }
      else if ( document.body.scrollHeight > document.body.offsetHeight )
      {
         return document.body.scrollWidth;
      }
      else {
         return document.body.offsetWidth;
      }
   }

   /**
    * getWindowWidth
    *
    * returns the width of the browser window.
    *
    */
   this.getWindowWidth = function() {
      if ( self.innerHeight )
      {
         return self.innerWidth;
      }
      else if ( document.documentElement && document.documentElement.clientHeight )
      {
         return document.documentElement.clientWidth;
      }
      else if ( document.body )
      {
         return document.body.clientWidth;
      }	
   }

   /**
    * getPageHeight
    *
    * returns the height of the browser window or the
    * height of the content; whichever is greater.
    *
    */
   this.getPageHeight = function() {
      if ( this.getScrollHeight() < this.getWindowHeight() )
      {
         return this.getWindowHeight();
      }
      else {
         return this.getScrollHeight();
      }
   }

   /**
    * getScrollHeight
    *
    * returns the height of the content.
    *
    */
   this.getScrollHeight = function() {
      if ( window.innerHeight && window.scrollMaxY )
      {
         return window.innerHeight + window.scrollMaxY;
      }
      else if ( document.body.scrollHeight > document.body.offsetHeight )
      {
         return document.body.scrollHeight;
      }
      else {
         return document.body.offsetHeight;
      }
   }

   /**
    * getWindowHeight
    *
    * returns the height of the browser window.
    *
    */
   this.getWindowHeight = function() {
      if ( self.innerHeight )
      {
         return self.innerHeight;
      }
      else if ( document.documentElement && document.documentElement.clientHeight )
      {
         return document.documentElement.clientHeight;
      }
      else if ( document.body )
      {
         return document.body.clientHeight;
      }	
   }

   /**
    * changeAttribute
    *
    * browser safe implementation for altering attributes of elements
    * within the html: show or hide layers; alter width or height; change
    * other style attributes, etc.
    *
    */
   this.changeAttribute = function( elementName, attributeName, newValue ) {
      var element = this.findElement( elementName );
      var isAttributeNotFound = false;

      if ( element != null ) {
         if ( element[ attributeName ] != null )
         {
            element[ attributeName ] = newValue;
            return true;
         }
         else if ( element.style )
         {
            if ( element.style[ attributeName ] != null )
            {
               element.style[ attributeName ] = newValue;
               return true;
            }
            else {
               isAttributeNotFound = true;
            }
         }
      }

      if ( isAttributeNotFound ) {
         // alert( "Attribute not found..." );
      }

      return false;
   }

   /**
    * findElement
    *
    * while this may be used to grab a reference to an element, it is
    * primarily used by the changeAttribute function to attain the reference
    * to the element of which it will alter properties.
    *
    */
   this.findElement = function( elementName ) {
      var isItemNotFound = false;

      if ( document.all )
      {
         if ( document.all[ elementName ] )
         {
            return document.all[ elementName ];
         }
         else {
            isItemNotFound = true;
         }
      }
      else if ( document.layers )
      {
         if ( document.layers[ elementName ] )
         {
            return document.layers[ elementName ];
         }
         else {
            isItemNotFound = true;
         }
      }
      else if ( document.getElementById )
      {
         if ( document.getElementById( elementName ) )
         {
            return document.getElementById( elementName );
         }
         else {
            isItemNotFound = true;
         }
      }

      if ( isItemNotFound ) {
         // alert( "Item not found..." );
      }
      return null;
   }
   
   /**
    * sizeIFrame
    *
    * very handy function for changing the size of an iframe.
    *
    */
   this.sizeIFrame = function( name, width, height ) {
      this.changeAttribute( name, "height", height );
      this.changeAttribute( name, "width", width );
   }
   
   /**
    * getUrl
    *
    * returns the entire url as a string.
    *
    */
   this.getUrl = function() {
      return new String( document.location );
   }

   /**
    * getDomain
    *
    * returns the domain portion of the url:
    * WWW.THECURRENTURL.COM
    *
    * @return 
    *
    */
   this.getDomain = function() {
      var url = this.getUrl();

      var start = url.indexOf( '//' ) + 2;
      var end   = url.indexOf( '/', start );

      return url.substring( start, end );
   }

   /**
    * getCurrentPath
    *
    * returns the current url to the directory:
    * WWW.THECURRENTURL.COM/DIRECTORY/SUBDIRECTORY
    *
    * @return String path to directory
    *
    */
   this.getCurrentPath = function() {
      var url = this.getUrl();

      var end = url.lastIndexOf( '/' );

      return url.substring( 0, end );
   }

   /**
    * getCurrentFile
    *
    * returns the file of the page being displayed:
    * THEFILE.HTML
    *
    * @return String filename
    *
    */
   this.getCurrentFile = function() {
      var url = this.getUrl();

      var start = url.lastIndexOf( '/' ) + 1;
      var end   = url.indexOf( '?' );

      if ( end == -1 ) {
         end = url.length + 1;
      }

      return url.substring( start, end );
   }

   /**
    * getParams
    *
    * returns the query string of the current request:
    * NAME=VALUE&NAME2=VALUE2&NAME3=VALUE3
    *
    * @return String query string part of url
    *
    */
   this.getParams = function() {
      var url = this.getUrl();

      start = url.indexOf( '?' ) + 1;

      if ( start == -1 ) {
         return "";
      }

      return url.substring( start );
   }

   /**
    * getParamArray
    *
    * returns the query string as an array of:
    * NAME=VALUE
    *
    * @return Array query string name=value pairs
    *
    */
   this.getParamArray = function() {
      var params = this.getParams();

      if ( params.indexOf( '&' ) > -1 ) {
         return params.split( '&' );
      }

      return new Array();
   }

   /**
    * getParamObject
    *
    * returns and object containing query string data:
    * "NAME" => "VALUE"
    *
    * @return Object query string object
    *
    */
   this.getParamObject = function() {
      var params = this.getParamArray();
      var queryObj = new Object();
      var tmpArray = new Array();

      for ( var i = 0; i < params.length; i++ ) {
         tmpArray = params[ i ].split( '=' );
         queryObj[ tmpArray[ 0 ] ] = tmpArray[ 1 ];
      }

      return queryObj;
   }

   /**
    * getParameter
    *
    * returns the value of the supplied parameter
    *
    * @argument String paramName name of the parameter to be returned
    * @return   String value
    *
    */
   this.getParameter = function( paramName ) {
      var queryObj = this.getParamObject();

      if ( queryObj[ paramName ] != null ) {
         return queryObj[ paramName ];
      }

      return "";
   }

   this.draw = function( elementName, strHTML ) {
      var layerRef = this.findElement( elementName );

      if ( layerRef != null ) {
         layerRef.innerHTML = strHTML;
      }
   }

   this.show = function( layerId ) {
      this.changeAttribute( layerId, 'visibility', 'visible' );
   }

   this.hide = function( layerId ) {
      this.changeAttribute( layerId, 'visibility', 'hidden' );
   }

   this.changeStyle = function( layerId, newClass ) {
      this.changeAttribute( layerId, 'class', newClass );
      this.changeAttribute( layerId, 'className', newClass );
   }
}
var browser = new BrowserDetect();

function safariCheck()
{
	if (browser.isSafari == true)
	{
		document.getElementById('searchInput').style.display="none";
		document.getElementById('searchInputSafari').style.display="block";
	}
}

/*
 * Function to open popup window
 * @param url
 *     The url to open - string
 * @param win_width
 *     The window width - int
 * @param win_height
 *     The window height - int
*/
function openWin(url, win_width, win_height) {
		
	win_left = (screen.width - win_width) / 2;
	win_top = (screen.height - win_height) / 2;
	
	window.open(url , '', 'width='+win_width+', height='+win_height+', left='+win_left+', top='+win_top+', resizable=1, scrollbars=1');
}

function openDialog(url, win_width, win_height, id) {
  window.open(url, id, 'width='+win_width+', height='+win_height+',toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1');
}

/*
 * Function to set a cookie
 * @param cookie_name - string
 *     name of the cookie
 * @param cookie_key - string
 *     the key
 * @param cookie_value - string
 *     the value to be assigned to the key
 * 
 * Requires: readCookie(), createCookie()
 */
function modCookie(cookie_name, cookie_key, cookie_value){
	
	var change_value=false;
  var cookie_changed = false;
	var str_newcookie="";
	
	var cookie = readCookie(cookie_name);

	if (cookie){
		cookie = unescape(cookie);
		var arr_cookie_fields = cookie.split("&");

		for(var i=0; i<arr_cookie_fields.length; i++)
		{
      if (change_value) { 
         arr_cookie_fields[i] = cookie_value + "";
         change_value = false;
         cookie_changed = true;
      }
			else if (arr_cookie_fields[i] && arr_cookie_fields[i].indexOf(cookie_key) == 0)
			{
				change_value = true;
			}		
			if (arr_cookie_fields[i].length>0) {
        str_newcookie += arr_cookie_fields[i];
      }
      if(i+1 < arr_cookie_fields.length) {
         str_newcookie += '&';
      }
		}
	  if (cookie_changed) {
	    createCookie(cookie_name, str_newcookie, 1);
	  } else {  // value not set in cookie
      str_newcookie += cookie_key+"&"+cookie_value;
	    createCookie(cookie_name, str_newcookie, 1);
    }
	} else { // no cookie found
    str_newcookie += cookie_key+"&"+cookie_value;
    createCookie(cookie_name, str_newcookie, 1);
  }
	

}

/*
 * Function to read a cookie
 * @param name - string
 *     name of the cookie
 * @returns string with all cookie keys and values
 */
function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

/*
 * Function to create a cookie
 * @param name - string
 *     name of the cookie
 * @param value - string
 *     the list of values and key to be assigned to the cookie
 */
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else
		var expires = "";
	document.cookie = name+"="+value+expires+"; domain=.guba.com; path=/";
	readCookie(name);
}

function getCookie( _name )
{
    var _value = '';
    if (typeof document.cookie != 'undefined' && document.cookie != null)
    {
        var _cookieStr = document.cookie.replace (new RegExp (' ','g'),'');
        var _cookies = _cookieStr.split (';');
        
        for (var _cookieNo = 0; _cookieNo < _cookies.length; _cookieNo++)
        {
            var _cookie = _cookies [_cookieNo].split ('=');
            
            if (unescape (_cookie [0]) == _name)
            {
                _value = (typeof _cookie [1] == 'string') ? unescape (_cookie [1]) : '';
                break;
            }
        }
    }
    return _value;
};

function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
function sfHoverEvents(sfEls) {
  var len = sfEls.length;
  for (var i=0; i<len; i++) {
    sfEls[i].onmouseover=function() {
      this.className+=" sfhover";
    }
    sfEls[i].onmouseout=function() {
      this.className=this.className.replace(" sfhover", "");
    }
  }
}
function sfHover() {
var ULs = document.getElementsByTagName("UL");
var len = ULs.length;
  for(var i=0;i<len;i++) {
    if(ULs[i].className.indexOf("drop") != -1)
      sfHoverEvents(ULs[i].getElementsByTagName("LI"));
  }
}

if (window.attachEvent) window.attachEvent("onload", sfHover);
function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}
function FlashPlayer( config, newBid, newQueryParams, newAffiliateId, newVideoUrl, newPreviewBid, newSampleId )
{
    this.width = "100%";
    this.height = "100%";
    this.target = null;
    this.rootFile = "skinVideoroot.swf";
    this.autoPlay = null;
    this.limitedPlay = null;
    this.activeStatus = null;
    this.mute = false;

    this.queryParams = escape( newQueryParams );
    this.bid = newBid;
    this.affiliateId = newAffiliateId;
    this.videoUrl = newVideoUrl;
    this.previewBid = newPreviewBid;
    this.sampleId = newSampleId;

    this.domainUrl = null;
    this.rootUrl = null;

    /**
     * covers the params:
     * => width
     * => height
     * => target
     * => rootFile
     */
    if ( this.isValueSet( config ) ) {
        var args = config.split( ',' );
        for ( var i = 0; i < args.length; i++ ) {
            var param = args[ i ].split( '=' );
            eval( "this." + param[ 0 ] + " = '" + param[ 1 ] + "'" );
        }
    }

    this.setWidth = function( newWidth ) {
        this.width = newWidth;
    }

    this.setHeight = function( newHeight ) {
        this.height = newHeight;
    }

    this.setTarget = function( newTarget ) {
        this.target = newTarget;
    }

    this.getFlashPlayerEmbed = function( isEmbeddedPlayer ) {
        var output = '<embed src="' + this.getRootUrl( isEmbeddedPlayer ) + '" '
            + 'quality="best" '
            + 'bgcolor="#FFFFFF" '
            + 'menu="true" '
            + 'width="' + this.width + '" '
            + 'height="' + this.height + '" '
            + 'name="root" '
            + 'id="root" '
            + 'align="middle" '
            + 'scaleMode="noScale" '
            + 'allowScriptAccess="sameDomain" '
            + 'allowFullScreen="true" '
            + 'type="application/x-shockwave-flash" '
            + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
            + '</embed>';

        return output;
    }

    this.writeBlogFlashPlayer = function() {
        var output = this.getFlashPlayerEmbed( true );
	    var div_block = document.getElementById( this.target );
        
	    div_block.value = output;
    }

    this.writeFlashPlayer = function() {
      var output = this.getFlashPlayerEmbed( false );
	    var div_block = document.getElementById( this.target );

	    div_block.innerHTML = output;
    }

    this.writeFlashPlayerToDiv = function(target) {
      var output = this.getFlashPlayerEmbed( false );
	    var div_block = document.getElementById( this.target );
      jQuery(target).html(output);
    }

    this.getRootUrl = function( isEmbeddedPlayer )
    {
        if ( !this.isValueSet( this.rootUrl ) )
        {
            this.rootUrl = this.getDomain();

            if ( this.isValueSet( this.affiliateId ) )
            {
                this.rootUrl += '/a/' + this.affiliateId + '/a';
            }

            this.rootUrl += '/f/' + this.rootFile + '?';
        
            if ( this.isValueSet( this.affiliateId ) )
            {
                this.rootUrl += 'aid=' + this.affiliateId + '&';
            }

            if ( this.isValueSet( this.queryParams ) )
            {
                this.rootUrl += 'query_params=' + this.queryParams;
            }
            else if ( this.isValueSet( this.bid ) )
            {
                this.rootUrl += 'bid=' + this.bid;
            }
            else if ( this.isValueSet( this.videoUrl ) )
            {
                this.rootUrl += 'video_url=' + this.videoUrl;
            }

            if ( this.isValueSet( this.previewBid ) )
            {
                this.rootUrl += '&preview_bid=' + this.previewBid;
            }

            if ( this.isValueSet( this.autoPlay ) )
            {
                this.rootUrl += '&autoPlay=' + this.autoPlay;
                this.rootUrl += '&isEmbeddedPlayer=false';
            }
            else {
                this.rootUrl += '&isEmbeddedPlayer=' + isEmbeddedPlayer;
            }

            if (this.isValueSet( this.limitedPlay ) )
            {
              this.rootUrl += '&maxPlayTime=' + this.limitedPlay;
            }

            if (this.isValueSet( this.activeStatus ) )
            {
              this.rootUrl += '&activeStatus=' + this.activeStatus;
            }

            if ( this.isValueSet( this.mute ) )
            {
                this.rootUrl += '&mute=' + this.mute;
            }

            if ( this.isValueSet( this.sampleId ) ) {
                this.rootUrl += '&sample=' + this.sampleId;
            }
        }
        return this.rootUrl;
    }

    this.getDomain = function() {
        if ( this.domainUrl == null ) {
            this.domainUrl = String( document.location );
            while ( this.domainUrl.lastIndexOf( '/' ) > 8 ) {
                this.domainUrl = this.domainUrl.substring( 0, this.domainUrl.lastIndexOf( '/' ) );
            }
        }
        return this.domainUrl;
    }

}

FlashPlayer.prototype.isValueSet = function( value ) {
    if ( value == null
      || value == 'null'
      || typeof( value ) == 'undefined'
      || value == '' )
    {
        return false;
    }
    return true;
}

var NcqLbrFM='';
/*
jQuery(document).ready(function() {
  try { var a = top.location.href; }
  catch (e) { jQuery.get('/ah', {w : window.location.href, c : NcqLbrFM } ); }
});
*/

function svPlayerStatus(s) { }

jQuery(document).ready(function() {
  jQuery('.dvd_scene_montage').click(function() {
    setupSceneOverlay(this,this.attr("bid"),0);
  });
});

function setupSceneOverlay(div,bid,limitedPlay)
{
  var str = 'width=700px,height=480px,target=flash_player,rootFile=/f/skinVideoRoot.swf,autoPlay=false';
  if (limitedPlay > 0) {
    str += ',limitedPlay=' + limitedPlay;
  }
  var fp = new FlashPlayer(str,bid, null, null, null, null, '' );
  fp.writeFlashPlayerToDiv(div);
}


var mysv_cookie = '/';
var contractsymbol='/art/btn_arrow_open.gif';
var expandsymbol='/art/btn_arrow_closed.gif';
function expandcontent(a,id) {
  jQuery('#' + id).toggle();
  if (jQuery('#' + id).css('display') == 'none') {
    a.src = expandsymbol;
  } else {
    a.src = contractsymbol;
  }

  var s = ''
  jQuery('.module_guts').each(function(i) {
    var isOn = jQuery(this).css('display') != 'none';
    s += this.id + "=" + isOn + "|";
  });
  jQuery.cookie(mysv_cookie,s,{ expires: 30, path: '/', domain: 'skinvideo.com' });
}


jQuery(document).ready(function() {
  var c = jQuery.cookie(mysv_cookie)
  if ( c && c.length > 0) {
    var arr = c.split('|');
    for (var i=0;i<arr.length;i++) {
      var a = arr[i].split('=');
      if (a.length > 1) {
        if (a[1] == "true") {
          jQuery('#' + a[0]).show();
          jQuery('#btn_' + a[0]).attr("src",contractsymbol);
        } else {
          jQuery('#' + a[0]).hide();
          jQuery('#btn_' + a[0]).attr("src",expandsymbol);
        }
      }
    }
  }
});

// this is sticking around for the pink pages that need it, 
// but it's horseshit and we're not using it in the blue

//   Copyright 2000 William and Mari Bontrager
//   Copyright 2003 Bontrager Connection, LLC
//
// For more information and instructions, please 
//    see the "Double Click Trapper" article at 
//    http://willmaster.com/possibilities/archives


// When the form's submit button is clicked a second 
//    time, the click trap is set. Here, specify how 
//    many seconds the trap exist before it's released.

TrapClicksForHowManySeconds = 300;

// If the user clicks the submit button and causes a 
//    trap, or clicks when a trip is set, you may spawn 
//    an alert box with a message. If you do want to 
//    spawn the alert box, specify the message between 
//    the quotation marks. Otherwise, leave it blank.
//(Blank is two consecutive quotation mark characters, 
//    with nothing between them.)
// Note: If you use any quotation marks in the message 
//       itself, those must be preceeded with a back-slash 
//       character. Example: "My name is \"tall\", okay?"

AlertBoxMessage = "";



// If the user clicks the submit button and causes a trap, 
//    or clicks when a trip is set, you may spawn a popup 
//    box. If you want to spawn the popup box, specify 
//    the URL of the web page to insert into the popup. 
//    Otherwise, leave it blank. You may also specify 
//    the height of the popup and the width of the popup.

PopUpBoxURL = "";
PopUpBoxHeight = 300;
PopUpBoxWidth = 500;



// If you want the submit button to change its text when 
//    it is clicked, specify the name you assigned to the 
//    form, the name you assigned to the submit button 
//    form field, and the new text for the submit button. 
//    Otherwise, leave at least one of these blank.

NameOfForm = "pageForm";
NameOfSubmitButton = "submitter";
NewTextForSubmitButton = "Now Processing . . .";



// ////////////////////////////////////////// //
// NO CUSTOMIZATION REQUIRED BELOW THIS POINT //
// ////////////////////////////////////////// //


TrapTime = 0;
DoubleClickTrapperCounter = 0;


function DoubleClickTrapperAction() {
  DoubleClickTrapperCounter++;
  var trapTheClick = false;
  if(DoubleClickTrapperCounter > 1 ) { trapTheClick = true; }
  if(trapTheClick == true) {
    if(TrapTime == 0) {
      var tDate = new Date;
      TrapTime = tDate.valueOf();
    }
    else {
      var tDate = new Date;
      var localTrapTime = tDate.valueOf();
      if((localTrapTime - TrapTime) > (TrapClicksForHowManySeconds * 1000)) {
        TrapTime = 0;
        trapTheClick = false;
        DoubleClickTrapperCounter = 0;
      }
    }
  }
  var valueToReturn = true;
  if(trapTheClick == true) {
    valueToReturn = false;
    DoubleClickTrapperPopUp();
    DoubleClickTrapperAlert();
  }
  return valueToReturn;
} // end of function DoubleClickTrapperAction()


function DoubleClickTrapperButton() {
  var formname   = StripSpaces(NameOfForm);
  var submitname = StripSpaces(NameOfSubmitButton);
  var newtext    = StripSpaces(NewTextForSubmitButton);
  if(formname.length > 0 && submitname.length > 0 && newtext.length > 0) {
    var s = 'document.' + NameOfForm + '.' + NameOfSubmitButton + ".value = '" + NewTextForSubmitButton + "'";
    eval(s);
  }
} // end of function DoubleClickTrapperButton()


function DoubleClickTrapperPopUp() {
  var url = StripSpaces(PopUpBoxURL);
  if(url.length > 0) {
    if(PopUpBoxHeight < 1) { PopUpBoxHeight = 200; }
    if(PopUpBoxWidth < 1) { PopUpBoxWidth = 300; }
    window.open(url,'',('height=' + PopUpBoxHeight + ',width=' + PopUpBoxWidth + ',resizable=yes,scrollbars=yes'));
  }
} // end of function DoubleClickTrapperPopUp()


function DoubleClickTrapperAlert() {
  var message = StripSpaces(AlertBoxMessage);
  if(message.length > 0) { alert(AlertBoxMessage); }
} // end of function DoubleClickTrapperAlert()


function StripSpaces(s) {
  while(s.indexOf(' ') == 0) { s = s.substr(1); }
  return s;
} // end of function StripSpaces()

function blankstate() 
{
  document.postform.state.options[0].selected = true;
}

function blankprovince()
{
  if (document.postform.state.selectedIndex > 0) {
    document.postform.province.value = '';
  }
}


function tab_click(url,val) {
  var mv = jQuery.cookie('VER');
  if (val != mv) { jQuery.cookie('VER',val,{ expires: 30, path: '/', domain: 'skinvideo.com' }); }
  window.location = url;   
}

//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

function AjaxObject() {
   this.POST = "POST";
   this.GET  = "GET";

   this.ASYNCHRONOUS_REQUEST = true;
   this.LINIER_REQUEST = false;

   this.url = "";
   this.params = "";
   this.urlParams = "";
   this.requestMethod = this.GET;
   this.writeToLayer = document.getElementsByTagName( "body" ).item( 0 );
   this.xmlHttpReq = false;
   this.responseText = "";
   this.responseHandler = function() {
      if ( local.xmlHttpReq.readyState == 4 )
      {
         local.responseText = local.xmlHttpReq.responseText;
         local.writeToLayer.innerHTML = local.responseText;
      }
   }

   this.intializeConnection = function() {
      if ( this.xmlHttpReq == false ) {
         if ( window.XMLHttpRequest )
         {
            this.xmlHttpReq = new XMLHttpRequest();
         }
         else if (window.ActiveXObject) {
            this.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
         }
      }
   }

   this.setUrl = function( newUrl ) {
      this.url = newUrl;
   }

   this.setParams = function( newParams ) {
      this.params = newParams;
   }

   this.setUrlParams = function( newUrlParams ) {
      this.urlParams = newUrlParams;
   }

   this.getUrlParams = function() {
      if ( this.urlParams != "" ) {
         return '?' + this.urlParams;
      }
      else {
         return '';
      }
   }

   this.getFinalUrlParams = function() {
      if ( this.requestMethod == this.POST ) {
         return '';
      }
      else {
         return this.getParams();
      }
   }

   this.getParams = function() {
      if ( this.params != '' ) {
         if ( this.urlParams != '' ) {
            return '&' + this.params;
         }
         else {
            return '?' + this.params;
         }
      }
      else {
         return "";
      }
   }

   this.getFinalSendParams = function() {
      if ( this.requestMethod == this.POST ) {
         return this.params;
      }
      else {
         return null;
      }
   }

   this.setRequestMethod = function( newRequestMethod ) {
      this.requestMethod = newRequestMethod;
   }

   this.setReponseHandler = function( newResponseHandler ) {
      this.responseHandler = newResponseHandler;
   }

   this.setWriteToLayer = function( newWriteToLayer ) {
      this.writeToLayer = document.getElementById( newWriteToLayer );
   }

   this.setResponseText = function( newResponseText ) {
      this.responseText = newResponseText;
   }

   this.getFinalUrl = function() {
      return this.url + this.getUrlParams() + this.getFinalUrlParams();
   }
   
   this.xmlhttpPost = function() {
      this.xmlHttpReq.open( this.requestMethod, this.getFinalUrl(), this.ASYNCHRONOUS_REQUEST );
      
      // alert( "FINAL URL: " + this.getFinalUrl() + "\nFINAL PARAMS: " + this.getFinalSendParams() + "\nMETHOD: " + this.requestMethod );
      
      // this.xmlHttpReq.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );

      this.xmlHttpReq.onreadystatechange = this.responseHandler;
      
      this.xmlHttpReq.send( this.getFinalSendParams() );
   }
   
   local = this;
}

ajaxInstance = new AjaxObject();
ajaxInstance.intializeConnection();

function SVMenu( menuArg, menuTypeArg ) {
   this.menu = menuArg;
   if(menuTypeArg == 'myfavorites') {
      menuClass = 'myfavorites';
      menuType = 'pro';
   } else {
      menuClass = menuType = menuTypeArg;
   }
   this.children = new Array();
   host = this.menu.host;
   contentType = this.menu.contentType;
   categoryPathPrefix = '/' + menuType + '/' + contentType.replace (/s$/,'') + '/';

   this.init = function()
   {
      var kidCount = 0;
      for ( var i = 0; i < this.menu.categories.length; i++ ) {
         if ( !this.menu.categories[ i ].authRequired
            || d_menu_data.auth_info.value != 'guest' )
         {
             this.children[ kidCount++ ] = new Category( this.menu.categories[ i ], this );
         }
      }
   }

   this.draw = function( targetArg )
   {
      if ( arguments.length > 0 ) {
         target = targetArg;
      }

      this.drawMenu();
   }

   this.drawMenu = function()
   {
      var output = '<table width="165" cellpadding="0" cellspacing="0" border="0">';
      
      for ( var i = 0; i < this.children.length; i++ ) {
         output += this.children[ i ].draw();
      }
      
      output += '</table>';

      document.getElementById( target ).innerHTML = output;
   }

   this.setCurrentPage = function( pageLocation )
   {
      currentLocation = pageLocation;

      this.init();

      this.drawMenu();  
   }
}

function Category( menuItemObjArg, parentRefArg ) {
   this.menuItemObj = menuItemObjArg;
   this.name = this.menuItemObj.name;
   this.page = null;
   this.children = new Array();
   this.itemArray = this.menuItemObj.items;
   this.className = this.menuItemObj.className;
   this.parentRef = parentRefArg;
   this.id = "menu_" + ++menuNum;
   this.itemLinkPrefix = null;
   this.open = false;

   this.selected = false;

   menuContainerMap[ this.id ] = this;
   this.itemLinkPrefix = categoryPathPrefix + escape( this.name ) + '/';

   if ( this.menuItemObj.page != 'directLink' ) {
     this.page = makeLinkUrl( this.menuItemObj.page, this.itemLinkPrefix );
   }
   else {
     this.page = this.menuItemObj.url;
   }
      
   if ( this.itemArray ) {
      this.checkOpen( this.page );
      subMenuNum = 0;

      for ( var i = 0; i < this.itemArray.length; i++ )
      {
         var linkUrl;
         if ( this.itemArray[ i ].page != 'directLink' ) {
            linkUrl = makeLinkUrl( this.itemArray[ i ].page, categoryPathPrefix + escape( this.name ) + '/' );
         }
         else {
            linkUrl = '/' + menuType + this.itemArray[ i ].url;
         }
         this.children[ i ] = new SubCategory( this.itemArray[ i ].name, linkUrl, this );
         this.checkOpen( this.children[ i ].page );
      }
   }

   this.isRoot = function()
   {
      return this.name == 'root'
         && this.parentRef == null;
   }

   this.hasChildren = function()
   {
      return this.children != null
         && this.children.length > 0;
   }

   this.isVisible = function()
   {
      return this.isRoot()
            || this.hasChildren()
            || this.visibility;
   }

   this.draw = function() {
      var className = 'categoryItem';

      if ( this.open ) {
         className += 'Open';
		}

      if ( this.className ) {
        className = this.className;
      }

      var output = '<tr class="' + menuClass + 'MenuBar ' + className + '">'
         + '<td width="19" id="td1_' + this.id + '" ';
         
         if ( this.hasChildren() ) {
    		 output += 'onclick="openMenu( \'' + this.id + '\' )"';
         }

         output += 'class="' + className + ' ' + menuClass + '_leftnav"'
		 + 'onMouseOver="hoverRow( \'td1_' + this.id + '\', \'' + menuClass + 'Hover_leftnav\' );" '
         + 'onMouseOut="hoverRow( \'td1_' + this.id + '\', \'' + menuClass + '_leftnav\' );">';

      if ( this.hasChildren() ) {
         output += '<img id="img_' + this.id + '" ';
         
         if ( this.open ) {
            output += 'src="/art/img_arrow_down.gif" style="padding-right:7px;"';
         }
         else {
            output += 'src="/art/img_arrow_right.gif"';
         }
         
         output += ' border="0">';
      }
      else {
         output += '&nbsp;';
      }
      output += '</td>'
         + '<td id="td2_' + this.id + '" '
         + 'class="' + className + ' ' + menuClass + '_right"'
		 + 'onclick="document.location=(\'' + this.page + '\')"'
         + 'onMouseOver="hoverRow( \'td2_' + this.id + '\', \'' + menuClass + 'Hover\' );" '
		 + 'onMouseOut="hoverRow( \'td2_' + this.id + '\', \'' + menuClass + '_right\' );">'
         + this.name
         + '</td>'
         + '</tr>';
         
         if ( this.open )
         {
            for ( var i = 0; i < this.children.length; i++ )
            {
               output += this.children[ i ].draw();
            }
         }

      return output;
   }

   this.setOpen = function( isOpen )
   {
      this.open = isOpen;

      if ( isOpen )
      {
         document.getElementById( 'img_' + this.id ).src = '/art/img_arrow_down.gif';
      }
      else {
         document.getElementById( 'img_' + this.id ).src = '/art/img_arrow_right.gif';
      }
   }

}

Category.prototype.checkOpen = function( checkPage ) {
   if ( currentLocation.indexOf( this.page.substring( 0, this.page.length - 1 ) ) > -1 ) {
      currentOpenMenu = this;
      this.open = true;
   }
}

function SubCategory( nameArg, pageArg, parentRefArg )
{
   this.name = nameArg;
   this.page = pageArg;
   this.parentRef = parentRefArg;
   this.id = "menu_" + menuNum + "_" + subMenuNum++;

   this.visibility = false;
   this.selected = false;

   if ( isSelectedPage( this.page ) ) {
      this.selected = true;
      this.parentRef.open = true;
      currentOpenMenu = this.parentRef;
   }
   
   this.isRoot = function() {
      return false;
   }
   
   this.hasChildren = function() {
      return false;
   }

   this.setSelected = function( selectedArg ) {
      this.selected = selectedArg;
   }

   this.draw = function() {
      var className = 'subCategoryItem';

      if ( this.selected ) {
         className += 'Selected';
      }
      
      var output = '<tr id="subRow_' + this.id + '" '
        + 'class="' + className + '" '
        + 'onMouseOver="hoverRow( \'subRow_' + this.id + '\', \'' + className + 'Hover\' );" '
        + 'onMouseOut="hoverRow( \'subRow_' + this.id + '\', \'' + className + '\' );">'
        + '<td width="15">&nbsp;</td>'
        + '<td>'
        + '<a href="' + this.page + '"   >';
      
      if ( this.selected ) {
        output += '<b>';
      }
      
      output += this.name;
      
      if ( this.selected ) {
        output += '</b>';
      }
      
      output += '</a>'
        + '</td>'
        + '</tr>';

      return output;
   }
}

var menuContainerMap = new Object();
var menuNum = 0;
var subMenuNum = 0;
var currentOpenMenu = null;
var currentLocation = String( document.location );
var target = null;
var host;
var contentType;
var categoryPathPrefix;
var menuType;
var menuClass;

function isSelectedPage( menuPageUrl ) {
   if ( menuPageUrl.search( /\/page[0-9]+/ ) > -1 )
   {
      menuPageUrl = menuPageUrl.substring( 0, menuPageUrl.lastIndexOf( "page" ) + 4 );
   }

   if ( menuPageUrl.indexOf( "\/" ) == 0 )
   {
      menuPageUrl = menuPageUrl.substring( menuPageUrl.indexOf( "\/", 1 ) );
      menuPageUrl = menuPageUrl.substring( menuPageUrl.indexOf( "\/", 1 ) );
   }

   return ( currentLocation.indexOf( menuPageUrl.substring( 0, menuPageUrl.length - 1 ) ) + currentLocation.indexOf( escape( menuPageUrl.substring( 0, menuPageUrl.length - 1 ) ) ) ) > -2;
}

function openMenu( menuId ) {
   // clearTimeout( trackOne );
   // clearTimeout( trackTwo );

   menuRef = menuContainerMap[ menuId ];

   if ( currentOpenMenu != null ) {
      if ( menuRef != currentOpenMenu ) {
         currentOpenMenu.setOpen( false );
      }
   }

   menuRef.setOpen( !menuRef.open );
   // trackOne = setTimeout( runOne, 50 );

   svMenu.draw();
   // trackTwo = setTimeout( runTwo, 100 );

   currentOpenMenu = menuRef;
}

function hoverRow( rowId, hoverClass ) {
   document.getElementById( rowId ).className = hoverClass;
}

function makeLinkUrl( linkPath, itemLinkPrefix )
{
    return ( linkPath.search( /^[a-z]+:\/\//i ) > -1 ? '' : ( ( typeof host == 'string' ? host : '' )
        + ( linkPath.charAt( 0 ) == '/' || !itemLinkPrefix ? '' : itemLinkPrefix))) + linkPath;
}

var isFavored = 0;
var currentFavRef = null;

function loadXMLDoc(url, theMethod, processReqChange)
{
   if ( window.XMLHttpRequest )
   {
      req = new XMLHttpRequest();
      req.onreadystatechange = processReqChange;
      req.open( theMethod, url, true );
      req.send( null );
   }
   else if ( window.ActiveXObject )
   {
      req = new ActiveXObject( "Microsoft.XMLHTTP" );
      if ( req )
      {
         req.onreadystatechange = processReqChange;
         req.open( theMethod, url, true );
         req.send();
      }
   }
}

function addFavorite(currentBid)
{
   if ( isFavored < 2 )
   {
      isFavored++;
      var favURL="/ajax/addFavorite/" + currentBid;
      var theMethod="GET";
      loadXMLDoc( favURL, theMethod, addedFavorite );
   }
}

function addGalleryFavorite( videoBid, imageRef )
{
   var favGalUrl = "/ajax/addFavorite/" + videoBid;
   currentFavRef = imageRef;
   var theFavMethod = "GET";
   loadXMLDoc( favGalUrl, theFavMethod, addedGalleryFavorite );
}

function addListFavorite( videoBid, imageRef )
{
   var favGalUrl = "/ajax/addFavorite/" + videoBid;
   currentFavRef = imageRef;
   var theFavMethod = "GET";
   loadXMLDoc( favGalUrl, theFavMethod, addedListFavorite );
}

function addedListFavorite()
{
   currentFavRef.src = "/art/btn_favorites_off.gif";
}

function addActorFavorite( addUrl, imageRef )
{
   currentFavRef = imageRef;
   var theFavMethod = "GET";
   loadXMLDoc( addUrl, theFavMethod, addedActorFavorite );
}

function addedActorFavorite()
{
   currentFavRef.src = "/art/btn_favorites_off.gif";
}

function addedGalleryFavorite()
{
   currentFavRef.src = "/art/icon_favorite_16x16_off.gif";
}

function addedFavorite()
{
   if ( isFavored < 2 )
   {
      if ( req.readyState == 4 )
      {
         if ( req.status == 200 )
         {
            if ( req.statusText.indexOf( 'error' ) != -1 )
            {
               alert( "There was an error:" + req.statusText );
            }
            else {
               isFavored++;
               document.images[ "addToFavorite" ].src = "/art/btn_favorites_off.gif";
            }
         }
         else {
            alert("There was an error:\n" + req.statusText);
         }
      }
   }
}

function checkAll( field )
{
   for ( i = 0; i < field.length; i++ )
   {
      field[ i ].checked = true;
   }
}   

/**
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(9($){$.1s.B=9(o){z 4.1b(9(){3h r(4,o)})};8 q={W:J,23:1,1X:1,u:7,15:3,17:7,1I:\'2O\',2b:\'2E\',1i:0,C:7,1h:7,1D:7,2x:7,2w:7,2v:7,2t:7,2r:7,2q:7,2o:7,1Q:\'<Y></Y>\',1P:\'<Y></Y>\',2k:\'2j\',2g:\'2j\',1L:7,1J:7};$.B=9(e,o){4.5=$.1a({},q,o||{});4.P=J;4.E=7;4.H=7;4.t=7;4.U=7;4.Q=7;4.N=!4.5.W?\'1E\':\'27\';4.F=!4.5.W?\'26\':\'25\';6(e.20==\'3p\'||e.20==\'3n\'){4.t=$(e);4.E=4.t.1p();6($.D.1e(4.E[0].D,\'B-H\')){6(!$.D.1e(4.E[0].3k.D,\'B-E\'))4.E=4.E.C(\'<Y></Y>\');4.E=4.E.1p()}10 6(!$.D.1e(4.E[0].D,\'B-E\'))4.E=4.t.C(\'<Y></Y>\').1p();8 a=e.D.3g(\' \');1n(8 i=0;i<a.O;i++){6(a[i].3c(\'B-3b\')!=-1){4.t.1y(a[i]);4.E.R(a[i]);1m}}}10{4.E=$(e);4.t=$(e).2m(\'32,2Z\')}4.H=4.t.1p();6(!4.H.O||!$.D.1e(4.H[0].D,\'B-H\'))4.H=4.t.C(\'<Y></Y>\').1p();4.Q=$(\'.B-13\',4.E);6(4.Q.u()==0&&4.5.1P!=7)4.Q=4.H.1w(4.5.1P).13();4.Q.R(4.D(\'B-13\'));4.U=$(\'.B-16\',4.E);6(4.U.u()==0&&4.5.1Q!=7)4.U=4.H.1w(4.5.1Q).13();4.U.R(4.D(\'B-16\'));4.H.R(4.D(\'B-H\'));4.t.R(4.D(\'B-t\'));4.E.R(4.D(\'B-E\'));8 b=4.5.17!=7?1k.1M(4.1j()/4.5.17):7;8 c=4.t.2m(\'1u\');8 d=4;6(c.u()>0){8 f=0,i=4.5.1X;c.1b(9(){d.1O(4,i++);f+=d.T(4,b)});4.t.y(4.N,f+\'S\');6(!o||o.u==L)4.5.u=c.u()}4.E.y(\'1x\',\'1B\');4.U.y(\'1x\',\'1B\');4.Q.y(\'1x\',\'1B\');4.2p=9(){d.16()};4.2s=9(){d.13()};$(2D).1W(\'2B\',9(){d.29()});6(4.5.1h!=7)4.5.1h(4,\'28\');4.1F()};8 r=$.B;r.1s=r.2z={B:\'0.2.2\'};r.1s.1a=r.1a=$.1a;r.1s.1a({1F:9(){4.A=7;4.G=7;4.Z=7;4.11=7;4.14=J;4.1c=7;4.M=7;4.V=J;6(4.P)z;4.t.y(4.F,4.1r(4.5.1X)+\'S\');8 p=4.1r(4.5.23);4.Z=4.11=7;4.1g(p,J)},24:9(){4.t.22();4.t.y(4.F,\'21\');4.t.y(4.N,\'21\');6(4.5.1h!=7)4.5.1h(4,\'24\');4.1F()},29:9(){6(4.M!=7&&4.V)4.t.y(4.F,r.K(4.t.y(4.F))+4.M);4.M=7;4.V=J;6(4.5.1D!=7)4.5.1D(4);6(4.5.17!=7){8 a=4;8 b=1k.1M(4.1j()/4.5.17),N=0,F=0;$(\'1u\',4.t).1b(9(i){N+=a.T(4,b);6(i+1<a.A)F=N});4.t.y(4.N,N+\'S\');4.t.y(4.F,-F+\'S\')}4.15(4.A,J)},2y:9(){4.P=1f;4.1q()},3m:9(){4.P=J;4.1q()},u:9(s){6(s!=L){4.5.u=s;6(!4.P)4.1q()}z 4.5.u},1e:9(i,a){6(a==L||!a)a=i;1n(8 j=i;j<=a;j++){8 e=4.I(j).I(0);6(!e||$.D.1e(e,\'B-19-1C\'))z J}z 1f},I:9(i){z $(\'.B-19-\'+i,4.t)},3l:9(i,s){8 e=4.I(i),1Y=0;6(e.O==0){8 c,e=4.1A(i),j=r.K(i);1o(c=4.I(--j)){6(j<=0||c.O){j<=0?4.t.2u(e):c.1V(e);1m}}}10 1Y=4.T(e);e.1y(4.D(\'B-19-1C\'));1U s==\'3j\'?e.3f(s):e.22().3d(s);8 a=4.5.17!=7?1k.1M(4.1j()/4.5.17):7;8 b=4.T(e,a)-1Y;6(i>0&&i<4.A)4.t.y(4.F,r.K(4.t.y(4.F))+b+\'S\');4.t.y(4.N,r.K(4.t.y(4.N))+b+\'S\');z e},1T:9(i){8 e=4.I(i);6(!e.O||(i>=4.A&&i<=4.G))z;8 d=4.T(e);6(i<4.A)4.t.y(4.F,r.K(4.t.y(4.F))+d+\'S\');e.1T();4.t.y(4.N,r.K(4.t.y(4.N))-d+\'S\')},16:9(){4.1z();6(4.M!=7&&!4.V)4.1S(J);10 4.15(((4.5.C==\'1R\'||4.5.C==\'G\')&&4.5.u!=7&&4.G==4.5.u)?1:4.A+4.5.15)},13:9(){4.1z();6(4.M!=7&&4.V)4.1S(1f);10 4.15(((4.5.C==\'1R\'||4.5.C==\'A\')&&4.5.u!=7&&4.A==1)?4.5.u:4.A-4.5.15)},1S:9(b){6(4.P||4.14||!4.M)z;8 a=r.K(4.t.y(4.F));!b?a-=4.M:a+=4.M;4.V=!b;4.Z=4.A;4.11=4.G;4.1g(a)},15:9(i,a){6(4.P||4.14)z;4.1g(4.1r(i),a)},1r:9(i){6(4.P||4.14)z;6(4.5.C!=\'18\')i=i<1?1:(4.5.u&&i>4.5.u?4.5.u:i);8 a=4.A>i;8 b=r.K(4.t.y(4.F));8 f=4.5.C!=\'18\'&&4.A<=1?1:4.A;8 c=a?4.I(f):4.I(4.G);8 j=a?f:f-1;8 e=7,l=0,p=J,d=0;1o(a?--j>=i:++j<i){e=4.I(j);p=!e.O;6(e.O==0){e=4.1A(j).R(4.D(\'B-19-1C\'));c[a?\'1w\':\'1V\'](e)}c=e;d=4.T(e);6(p)l+=d;6(4.A!=7&&(4.5.C==\'18\'||(j>=1&&(4.5.u==7||j<=4.5.u))))b=a?b+d:b-d}8 g=4.1j();8 h=[];8 k=0,j=i,v=0;8 c=4.I(i-1);1o(++k){e=4.I(j);p=!e.O;6(e.O==0){e=4.1A(j).R(4.D(\'B-19-1C\'));c.O==0?4.t.2u(e):c[a?\'1w\':\'1V\'](e)}c=e;8 d=4.T(e);6(d==0){3a(\'39: 38 1E/27 37 1n 36. 35 34 33 31 30 2Y. 2X...\');z 0}6(4.5.C!=\'18\'&&4.5.u!==7&&j>4.5.u)h.2W(e);10 6(p)l+=d;v+=d;6(v>=g)1m;j++}1n(8 x=0;x<h.O;x++)h[x].1T();6(l>0){4.t.y(4.N,4.T(4.t)+l+\'S\');6(a){b-=l;4.t.y(4.F,r.K(4.t.y(4.F))-l+\'S\')}}8 n=i+k-1;6(4.5.C!=\'18\'&&4.5.u&&n>4.5.u)n=4.5.u;6(j>n){k=0,j=n,v=0;1o(++k){8 e=4.I(j--);6(!e.O)1m;v+=4.T(e);6(v>=g)1m}}8 o=n-k+1;6(4.5.C!=\'18\'&&o<1)o=1;6(4.V&&a){b+=4.M;4.V=J}4.M=7;6(4.5.C!=\'18\'&&n==4.5.u&&(n-k+1)>=1){8 m=r.X(4.I(n),!4.5.W?\'1l\':\'1H\');6((v-m)>g)4.M=v-g-m}1o(i-->o)b+=4.T(4.I(i));4.Z=4.A;4.11=4.G;4.A=o;4.G=n;z b},1g:9(p,a){6(4.P||4.14)z;4.14=1f;8 b=4;8 c=9(){b.14=J;6(p==0)b.t.y(b.F,0);6(b.5.C==\'1R\'||b.5.C==\'G\'||b.5.u==7||b.G<b.5.u)b.2i();b.1q();b.1N(\'2h\')};4.1N(\'2V\');6(!4.5.1I||a==J){4.t.y(4.F,p+\'S\');c()}10{8 o=!4.5.W?{\'26\':p}:{\'25\':p};4.t.1g(o,4.5.1I,4.5.2b,c)}},2i:9(s){6(s!=L)4.5.1i=s;6(4.5.1i==0)z 4.1z();6(4.1c!=7)z;8 a=4;4.1c=2U(9(){a.16()},4.5.1i*2T)},1z:9(){6(4.1c==7)z;2S(4.1c);4.1c=7},1q:9(n,p){6(n==L||n==7){8 n=!4.P&&4.5.u!==0&&((4.5.C&&4.5.C!=\'A\')||4.5.u==7||4.G<4.5.u);6(!4.P&&(!4.5.C||4.5.C==\'A\')&&4.5.u!=7&&4.G>=4.5.u)n=4.M!=7&&!4.V}6(p==L||p==7){8 p=!4.P&&4.5.u!==0&&((4.5.C&&4.5.C!=\'G\')||4.A>1);6(!4.P&&(!4.5.C||4.5.C==\'G\')&&4.5.u!=7&&4.A==1)p=4.M!=7&&4.V}8 a=4;4.U[n?\'1W\':\'2f\'](4.5.2k,4.2p)[n?\'1y\':\'R\'](4.D(\'B-16-1v\')).1K(\'1v\',n?J:1f);4.Q[p?\'1W\':\'2f\'](4.5.2g,4.2s)[p?\'1y\':\'R\'](4.D(\'B-13-1v\')).1K(\'1v\',p?J:1f);6(4.U.O>0&&(4.U[0].1d==L||4.U[0].1d!=n)&&4.5.1L!=7){4.U.1b(9(){a.5.1L(a,4,n)});4.U[0].1d=n}6(4.Q.O>0&&(4.Q[0].1d==L||4.Q[0].1d!=p)&&4.5.1J!=7){4.Q.1b(9(){a.5.1J(a,4,p)});4.Q[0].1d=p}},1N:9(a){8 b=4.Z==7?\'28\':(4.Z<4.A?\'16\':\'13\');4.12(\'2x\',a,b);6(4.Z!=4.A){4.12(\'2w\',a,b,4.A);4.12(\'2v\',a,b,4.Z)}6(4.11!=4.G){4.12(\'2t\',a,b,4.G);4.12(\'2r\',a,b,4.11)}4.12(\'2q\',a,b,4.A,4.G,4.Z,4.11);4.12(\'2o\',a,b,4.Z,4.11,4.A,4.G)},12:9(a,b,c,d,e,f,g){6(4.5[a]==L||(1U 4.5[a]!=\'2e\'&&b!=\'2h\'))z;8 h=1U 4.5[a]==\'2e\'?4.5[a][b]:4.5[a];6(!$.2R(h))z;8 j=4;6(d===L)h(j,c,b);10 6(e===L)4.I(d).1b(9(){h(j,4,d,c,b)});10{1n(8 i=d;i<=e;i++)6(!(i>=f&&i<=g))4.I(i).1b(9(){h(j,4,i,c,b)})}},1A:9(i){z 4.1O(\'<1u></1u>\',i)},1O:9(e,i){8 a=$(e).R(4.D(\'B-19\')).R(4.D(\'B-19-\'+i));a.1K(\'2Q\',i);z a},D:9(c){z c+\' \'+c+(!4.5.W?\'-2P\':\'-W\')},T:9(e,d){8 a=e.2l!=L?e[0]:e;8 b=!4.5.W?a.1t+r.X(a,\'2d\')+r.X(a,\'1l\'):a.2c+r.X(a,\'2n\')+r.X(a,\'1H\');6(d==L||b==d)z b;8 w=!4.5.W?d-r.X(a,\'2d\')-r.X(a,\'1l\'):d-r.X(a,\'2n\')-r.X(a,\'1H\');$(a).y(4.N,w+\'S\');z 4.T(a)},1j:9(){z!4.5.W?4.H[0].1t-r.K(4.H.y(\'2N\'))-r.K(4.H.y(\'2M\')):4.H[0].2c-r.K(4.H.y(\'2L\'))-r.K(4.H.y(\'2K\'))},2J:9(i,s){6(s==L)s=4.5.u;z 1k.2I((((i-1)/s)-1k.3e((i-1)/s))*s)+1}});r.1a({2H:9(d){$.1a(q,d)},X:9(e,p){6(!e)z 0;8 a=e.2l!=L?e[0]:e;6(p==\'1l\'&&$.2G.2F){8 b={\'1x\':\'1B\',\'3i\':\'2C\',\'1E\':\'1i\'},1G,1Z;$.2a(a,b,9(){1G=a.1t});b[\'1l\']=0;$.2a(a,b,9(){1Z=a.1t});z 1Z-1G}z r.K($.y(a,p))},K:9(v){v=2A(v);z 3o(v)?0:v}})})(3q);',62,213,'||||this|options|if|null|var|function||||||||||||||||||||list|size||||css|return|first|jcarousel|wrap|className|container|lt|last|clip|get|false|intval|undefined|tail|wh|length|locked|buttonPrev|addClass|px|dimension|buttonNext|inTail|vertical|margin|div|prevFirst|else|prevLast|callback|prev|animating|scroll|next|visible|circular|item|extend|each|timer|jcarouselstate|has|true|animate|initCallback|auto|clipping|Math|marginRight|break|for|while|parent|buttons|pos|fn|offsetWidth|li|disabled|before|display|removeClass|stopAuto|create|block|placeholder|reloadCallback|width|setup|oWidth|marginBottom|animation|buttonPrevCallback|attr|buttonNextCallback|ceil|notify|format|buttonPrevHTML|buttonNextHTML|both|scrollTail|remove|typeof|after|bind|offset|old|oWidth2|nodeName|0px|empty|start|reset|top|left|height|init|reload|swap|easing|offsetHeight|marginLeft|object|unbind|buttonPrevEvent|onAfterAnimation|startAuto|click|buttonNextEvent|jquery|children|marginTop|itemVisibleOutCallback|funcNext|itemVisibleInCallback|itemLastOutCallback|funcPrev|itemLastInCallback|prepend|itemFirstOutCallback|itemFirstInCallback|itemLoadCallback|lock|prototype|parseInt|resize|none|window|swing|safari|browser|defaults|round|index|borderBottomWidth|borderTopWidth|borderRightWidth|borderLeftWidth|normal|horizontal|jcarouselindex|isFunction|clearTimeout|1000|setTimeout|onBeforeAnimation|push|Aborting|loop|ol|infinite|an|ul|cause|will|This|items|set|No|jCarousel|alert|skin|indexOf|append|floor|html|split|new|float|string|parentNode|add|unlock|OL|isNaN|UL|jQuery'.split('|'),0,{}))


function showLogin() {
  jQuery('#loginBtn').parent().hide();
  jQuery('#joinBtn').parent().hide();
  jQuery('.loginForm').show();

  return false;
}


/*
  <h3>Style</h3>
  <ul>
    <li class="on"><a href="">Amateur</a></li>
    <li><a href="">BDSM</a></li>
  </ul>
*/
function hcMenu( menuArg, menuTypeArg, selected ) {
   this.self = this;
   this.init = function() { }
   this.menu = menuArg;
   if(menuTypeArg == 'myfavorites') {
      this.menuClass = 'myfavorites';
      this.menuType = 'pro';
   } else {
      this.menuClass = this.menuType = menuTypeArg;
   }
   host = this.menu.host;
   contentType = this.menu.contentType;

   this.draw = function(targetDiv)
   {
      var content ='';
      urlPrefix = '/' + this.menuType + '/';
      for ( var i = 0; i < this.menu.categories.length; i++ ) {
        if ( !this.menu.categories[ i ].authRequired || d_menu_data.auth_info.value != 'guest' ) {
          if (this.menu.categories[i].items) {
            content += '<div class="tag_nav" menu_id="' + this.menu.categories[ i ].id + '"><h3 class="menu_header">' + this.menu.categories[ i ].name + '</h3><ul class="subMenu">';
            for (var j=0; j < this.menu.categories[i].items.length ; j++) {
              var s = "";
              if (this.menu.categories[i].items[j].tag == selected) {
                s = ' class="current_tag_subheader"';
              }
              content += '<li' + s + '><a href="' +  urlPrefix + this.menu.categories[i].items[j].page + '">' + this.menu.categories[i].items[j].name + '</a></li>'; 
            }
            content += '</ul></div>';
          } else if ( this.menu.categories[ i ].page = 'directLink' ) {
            content += '<div class="menu_group"><a href="' + this.menu.categories[ i ].url + '">' + this.menu.categories[ i ].name + '</a></div>';
          }
        }
      }

      jQuery('#' + targetDiv).html(content);

      if (jQuery.cookie('JSM')) {
        this.loadMenuState();
      }

      jQuery('.menu_header').hover(function() {
        jQuery(this).addClass("hover");
      },function() {
        jQuery(this).removeClass("hover");
      }).click(function() {
        jQuery(this).parent('.tag_nav').children('.subMenu').toggle();
        svMenu.saveMenuState();
      });

   }

   this.loadMenuState = function()
   {
     if (jQuery.cookie('JSM')) {
       var arr = jQuery.cookie('JSM').split(',');
       jQuery('.tag_nav').each(function() {
         if (jQuery.inArray(jQuery(this).attr('menu_id'),arr) >= 0) {
           jQuery(this).children('.subMenu').hide();
         }
       });
     }
   }

   this.saveMenuState = function()
   {
     var s='';

     jQuery('.tag_nav').each(function() {
       if (jQuery(this).children('.subMenu').css('display') == 'none') { s += jQuery(this).attr('menu_id') + ','; }
     });

     jQuery.cookie('JSM',s,{ expires: 30, path: '/', domain: 'skinvideo.com' });
   }
}


function groupQuery( formRef, alternateSubmitURL )
{  
   if( formRef.group ) {
      if( formRef.group.checked )
      {
         formRef.action = alternateSubmitURL;
      }
   }
   return true;
}

// if its closed do something like
// show hide image and video search fields
// Precondition: the obj_id passed should be of radio button type.
function vid_type()
{
   var obj_1 = document.getElementById('type_1');
   var obj_2 = document.getElementById('type_2');
   if(obj_2 == null && obj_1 == null)
   {
      document.getElementById('image_filter').style.display = 'block';
      document.getElementById('video_filter').style.display = 'none';
      return;
   }
   else if (obj_2.checked && obj_2.value == 0) //image
   {
      document.getElementById('image_filter').style.display = 'block';
      document.getElementById('video_filter').style.display = 'none';
   }
   else if (obj_1.checked && obj_1.value == 1) //video
   {
      document.getElementById('image_filter').style.display = 'none';
      document.getElementById('video_filter').style.display = 'block';
   }
}

function checkMinMax()
{
   if (document.getElementById('minsize').value == 'Min')
      document.getElementById('minsize').value = '';

   if (document.getElementById('maxsize').value == 'Max')
      document.getElementById('maxsize').value = '';
}

jQuery(document).ready(function() {
  jQuery("img.search").hover(  
    function() { jQuery(this).addClass('link_hover'); },
    function() { jQuery(this).removeClass('link_hover'); }
  );

  jQuery("img.search").click(function() {
    jQuery("form.search").submit();
  });
  jQuery("#searchButton").remove();
  jQuery("img.search").css({display:'inline'});
});



function stateprovince() {
  if (jQuery('#country').val() == 'us') {
    jQuery('#province').attr('disabled','disabled').addClass('disabled');
    jQuery('#state').attr('disabled',false).removeClass('disabled');
  } else {
    jQuery('#province').attr('disabled',false).removeClass('disabled');
    jQuery('#state').attr('disabled','disabled').addClass('disabled');
  }
}

var formSubmitted = false;

// Basic validation for signup form.  Do all fields have data, etc
function validateForm() {
  if (formSubmitted) { return false; }
  var errors = false;
  var strError = "Please enter the following information:\n";
  var formRef = document.getElementById( "pageForm" );
  if ( formRef.name.value.length > 3) {
     var arrName = formRef.name.value.split( ' ' );
     var count = 0;
     if ( arrName.length > 1 ) {
        for ( var i = 0; i < arrName.length;  
              i++ ) {
           if ( arrName[ i ].length >= 1 ) {
             count++;
           }
        }
        if (count < 2) { errors = true; }
     } else {
        errors = true;
     }
  } else {
     errors = true;
  }
  if ( errors ) {
     strError += "\t   -Valid Cardholder Name\n";
  }

  if ( formRef.country.value == 'us' ) {
     if ( formRef.state.value == '' ) {
        errors = true;
        strError += "\t   -Valid State\n";
     }
  }

  var now = new Date();
  var thisMonth = now.getMonth() + 1;
  var thisYear = now.getFullYear() - 2000;
  if ( ( formRef.cc_year.value < thisYear ) ||
       ( ( formRef.cc_year.value == thisYear ) && ( formRef.cc_month.value < thisMonth ) ) ) {
    errors = true;
    strError += "\t   -Valid Expiration Date and Month\n";
  }

  if ( formRef.username.value == '' ) {
    errors = true;
    strError += "\t   -Please provide a username\n";
  }

  if ( formRef.pass1.value == '' ) {
    errors = true;
    strError += "\t   -Please provide a password\n";
  }

  if ( formRef.pass2.value == '' ) {
    errors = true;
    strError += "\t   -Please confirm your password\n";
  }

  if ( formRef.ccnumber.value == '' ) {
    errors = true;
    strError += "\t   -Please enter a Credit Card Number\n";
  }

  if ( formRef.cvv2.value == '' ) {
    errors = true;
    strError += "\t   -Please enter a CVV2 number\n";
  }

  if ( formRef.email.value == '' ) {
    errors = true;
    strError += "\t   -You must enter an email address\n";
  }

  if ( formRef.address.value == '' ) {
    errors = true;
    strError += "\t   -You must enter a street address\n";
  }

  if ( formRef.city.value == '' ) {
    errors = true;
    strError += "\t   -You must enter a city\n";
  }

  // if there are errors, report them in an alert box
  if ( errors ) {
    alert( strError );
    return false;
  } else {
    formSubmitted = true;
    jQuery('#join').attr('src',"/art/signup/processing-button-pink.gif");
    return true;
  }
}

function checkUsername()
{
  if (jQuery("#username").val() == '') {
    return; 
  }
  
  jQuery.ajax({
    type: "GET",
    url: "/signup/checkusername",
    data: "username=" + escape(jQuery("#username").val()),
    success: function(msg) {
      if (msg.indexOf("OK") == 0) {
        jQuery("#username").removeClass('error');
        jQuery("#username").removeClass('account_notice');
        jQuery("#check_username").hide();
        return true;
       } else {
        jQuery("#check_username").html(msg).show("slow");
        jQuery("#check_username").addClass('account_notice');
        jQuery("#username").addClass('error');
       }
    }
  });
}

function fillinUsername(username)
{
  jQuery("#username").removeClass('error').val(username);
  jQuery("#check_username").hide();
  jQuery("#pass1").focus();
}

function setup_signup_functions() {
  var preload = new Image();
  preload.src = '/art/signup/processing-button-pink.gif';

  jQuery(document).ready(function() {
    stateprovince();

    jQuery('#country').change(function() {
      stateprovince();
    });

    function redrawPlans() {
      jQuery(".plan").removeClass("selected");
      jQuery(".plan input:checked").parent().addClass("selected");

      if (jQuery("#trial:checked").size() > 0) {
        jQuery("input[name$=_UPSELL]").attr("disabled", "true");
        jQuery("label[for$=_UPSELL]").addClass("disabled");
      } else {
        jQuery("input[name$=_UPSELL]").removeAttr("disabled");
        jQuery("label[for$=_UPSELL]").removeClass("disabled");
      }
    }

    redrawPlans();

    jQuery(".plan input").change(redrawPlans); 

    jQuery(".plan").click(function() {
        jQuery("input", this).attr("checked", "true");
        redrawPlans();
      });

    jQuery("#username").blur(checkUsername);
    jQuery("#username").focus();

  });
}

function setup_signup_functions_1_step() {
  jQuery(document).ready(function() {

    jQuery("#join_button").click(function() {
      jQuery("#join_button").hide();
      jQuery("#join_spinner").show();
      jQuery.ajax({
        type: "POST",
        url: "/signup/checkstep0",
        data: "username=" + escape(jQuery("#username").val()) + "&pass1=" + escape(jQuery("#pass1").val()) + "&username_taken=1" +
              "&pass2=" + escape(jQuery("#pass2").val()) + "&email=" + escape(jQuery("#email").val()) +
              "&name=" + escape(jQuery("#name").val()) + "&ccnumber=" + escape(jQuery("#ccnumber").val()) + "&cvv2=" + escape(jQuery("#cvv2").val()) + 
              "&cc_month=" + escape(jQuery("#cc_month").val()) + "&cc_year=" + escape(jQuery("#cc_year").val()) + "&cc_expiration_date=1" +
              "&address=" + escape(jQuery("#address").val()) + "&city=" + escape(jQuery("#city").val()) + 
              "&state=" + escape(jQuery("#state").val()) +  "&zip=" + escape(jQuery("#zip").val()) + 
              "&username_taken=1" + "&country_and_state=1" + "&country_and_zip=1" +
              "&country=" + escape(jQuery("#country").val()) + "&verify=" + escape(jQuery("#verify").val()),
        success: function(msg) {
          if (msg.indexOf("OK") == 0) {
            jQuery("#signup_errors").hide();
            jQuery("#check_username").hide();
            document.signup.submit();
          } else {
            jQuery("#signup_errors").hide();
            jQuery("#check_username").hide();
            jQuery("#check_username").addClass('account_notice');
            jQuery("#check_username").html(msg).show("slow");
            jQuery("#check_username_target").focus();
            jQuery("#join_spinner").hide();
            jQuery("#join_button").show();
          }
        }
      });
      return false;
    }); // join_button
  });
}

function setup_signup_functions_2_step(show_step) {
  jQuery(document).ready(function() {

    if (show_step == 2) {
      jQuery("#step_1_div").hide();
      jQuery("#step_2_div").show();
    } else {
      jQuery("#step_1_div").show();
      jQuery("#step_2_div").hide();
    }

    // Do not display step two unless there are no errors and the form is filled out.
    jQuery("#step_1_button").click(function() {
      jQuery("#step_1_button").hide();
      jQuery("#step_1_spinner").show();
      jQuery.ajax({
        type: "GET",
        url: "/signup/checkstep1",
        data: "username=" + escape(jQuery("#username").val()) + "&pass1=" + escape(jQuery("#pass1").val()) + "&username_taken=1" +
              "&pass2=" + escape(jQuery("#pass2").val()) + "&email=" + escape(jQuery("#email").val()), 
        success: function(msg) {
          if (msg.indexOf("OK") == 0) {
            jQuery("#check_username").removeClass('account_notice');
            jQuery("#check_username").hide();
            jQuery("#step_1_div").hide(); 
            jQuery("#step_2_div").show();
            jQuery("#step2_errors").hide();
            jQuery("#top_target").focus();
            jQuery("#name").focus();
          } else {
            jQuery("#step_2_div").hide(); 
            jQuery("#step_1_div").show();
            jQuery("#check_username").addClass('account_notice');
            jQuery("#check_username").html(msg).show("slow");
          }
          jQuery("#step_1_spinner").hide();
          jQuery("#step_1_button").show();
        }
      });
      return false; 
    }); // step_1_button

    jQuery("#step_2_button").click(function() {
      jQuery("#step_2_button").hide();
      jQuery("#step_2_spinner").show();
      jQuery.ajax({
        type: "POST",
        url: "/signup/checkstep2",
        data: "name=" + escape(jQuery("#name").val()) + "&ccnumber=" + escape(jQuery("#ccnumber").val()) + "&cvv2=" + escape(jQuery("#cvv2").val()) + 
              "&cc_month=" + escape(jQuery("#cc_month").val()) + "&cc_year=" + escape(jQuery("#cc_year").val()) + "&cc_expiration_date=1" +
              "&address=" + escape(jQuery("#address").val()) + "&city=" + escape(jQuery("#city").val()) + 
              "&state=" + escape(jQuery("#state").val()) +  "&zip=" + escape(jQuery("#zip").val()) + 
              "&username_taken=1" + "&country_and_state=1" + "&country_and_zip=1" +
              "&country=" + escape(jQuery("#country").val()) + "&verify=" + escape(jQuery("#verify").val()),
        success: function(msg) {
          if (msg.indexOf("OK") == 0) {
            jQuery("#step2_errors").hide();
            document.signup.submit();
          } else {
            jQuery("#step_1_div").hide(); 
            jQuery("#step_2_div").show();
            jQuery("#step2_errors").html(msg).show("slow");
            jQuery("#step2_errors_target").focus();

            jQuery("#step_2_spinner").hide();
            jQuery("#step_2_button").show();
          }
        }
      });
      return false;
    }); // step_2_button

  });
}


function SimilarBrowsing() {
   this.layers = new Array();
   this.layers[ 0 ] = 'moreFromAuthorDisplay';
   this.layers[ 1 ] = 'similarContentLinksDisplay';
   this.layers[ 2 ] = 'moreFromDVDDisplay';
   this.tabs = new Array();
   this.tabs[ 0 ] = 'moreFromAuthor';
   this.tabs[ 1 ] = 'similarContent';
   this.tabs[ 2 ] = 'moreFromDVD';

   this.draw = function( strHTML ) {
      browser.draw( 'similar_clear', strHTML );
   }

   this.toggleDisplay = function( layerId ) {
      jQuery(".similarItemsDisplay").each( function(item) {
          jQuery(this).hide();
        }
      );
      jQuery("#" + this.layers[layerId] ).show();

      jQuery(".selecto").each( function() {
          jQuery(this).removeClass("selecto");
          jQuery(this).addClass("linked");
        }
      );
      jQuery("#" + this.tabs[layerId]).removeClass("linked");
      jQuery("#" + this.tabs[layerId]).addClass("selecto");
   }
}

var similarBrowsing = new SimilarBrowsing();

var hashC = { };

function loadC() {
  var cookie = jQuery.cookie('GDPRF2');

  if (cookie != null) {
    var arr = cookie.split('&');
    for (var i=0;i<arr.length;i+=2) { hashC[arr[i]] = arr[i+1]; }
  }
}

function setC() {
  var s = "";
  jQuery.each( hashC,function(a,b) { s += a + '&' + b + '&'; });
  s = s.substring(0,s.length-1);
  jQuery.cookie('GDPRF2',s,{ expires: 30, path: '/', domain: '.skinvideo.com' });
}

function updateC(key,val) {
  if (! hashC['t']) {
    loadC();
  }
  hashC[key] = val;
  setC();
  window.location = window.location;
}



