// JavaScript Document

Function.prototype.bind=function(A){var B=this;return function(){return B.apply(A,arguments)}};function EventBroadcaster(){this.x={};this.events=[];this.builtinEvts=[]}EventBroadcaster.prototype.getActionIdx=function(B,E,F){if(B){var D=this.events[B];if(D){var A=D.length;for(var C=A-1;C>=0;C--){if(D[C].action==E&&D[C].binding==F){return C}}}else{return -1}}return -1};EventBroadcaster.prototype.addListener=function(B,C,D){if(this.events[B]){if(this.getActionIdx(B,C,D)==-1){var A=this.events[B];A[A.length]={action:C,binding:D}}}else{this.events[B]=[];this.events[B][0]={action:C,binding:D}}};EventBroadcaster.prototype.removeListener=function(B,C,D){if(this.events){if(this.events[B]){var A=this.actionExists(B,C,D);if(A>=0){this.events[B].splice(A,1)}}}};EventBroadcaster.prototype.removeAllListeners=function(A){delete this.events;this.events=[]};EventBroadcaster.prototype.dispatchEvent=function(B,G,D){if(!G){G=window.event}if(this.events){var C=this.events;if(C){var E=C[B];if(E){for(var A in E){var F=E[A].action;if(E[A].binding){F=F.bind(E[A].binding)}F(G,D)}}}}};TimeManager=function(){if(window.__TimeManager__){return }window.__TimeManager=this;this.timers=[];this.time=0;this.ids=0;this.frequency=250;this.timerId=setInterval("__TimeManager__.interval()",this.frequency)};TimeManager.prototype.interval=function(){var D;this.time+=this.frequency;var C=this.time;var B=[];for(var A=0;A<this.timers.length;A++){D=this.timers[A];if(D.endTime<C){D.obj[D.method](D.parameters);if(D.type=="timeout"){D.dead=true}else{D.endTime=this.time+D.time;B.push(D)}}else{B.push(D)}}this.timers=B};TimeManager.prototype.addTimer=function(A){A.startTime=this.time;A.endTime=this.time+A.time;A.id=this.ids++;this.timers.push(A);return A.id};TimeManager.prototype.kill=function(C){var B=[];for(var A=0;A<this.timers.length;A++){if(this.timers[A].id!=C){B.push(this.timers[A])}else{this.timers[A].dead=true}}this.timers=B};Timer=function(){if(!window.__TimeManager__){window.__TimeManager__=new TimeManager()}this.type="timeout";this.timerId=-1;this.obj=null;this.method="";this.time=0;this.parameters=[];this.dead=false};Timer.prototype.setTimeout=function(C,D,B,A){this.obj=C;this.method=D;this.time=B;this.triggerTime=this.startTime+B;this.parameters=A;__TimeManager__.addTimer(this)};Timer.prototype.setInterval=function(C,D,B,A){this.obj=C;this.type="interval";this.method=D;this.time=B;this.triggerTime=this.startTime+B;this.parameters=A;__TimeManager__.addTimer(this)};Timer.prototype.kill=function(){__TimeManager__.kill(this.id)};var hiddenAdFunctions=new Array();function addHiddenAdFunction(B,C){var A=hiddenAdFunctions[B];if(A==null){A=new Array()}A.push(C);hiddenAdFunctions[B]=A}function showHiddenAds(D){var B=Math.random()*10000000000000000;var A=hiddenAdFunctions[D];if(A==null){return }for(var C=0;C<A.length;++C){var E=A[C];E(B)}}var popupAdFunctions=new Array();function setPopupAdFunction(A,B){popupAdFunctions[A]=B}function getPopupAdFunction(A){return popupAdFunctions[A]}function adReload(A){if(A.contentWindow.location){A.contentWindow.location.reload(false)}else{A.src=A.src}}function adReloadAll(){setDoubleclickOrd();var B=document.getElementsByTagName("iframe");for(var A=0;A<B.length;++A){if(B[A].className=="WWD2DartAdUnitLocal"){adReload(B[A])}}}function getIFrameDocument(A){var B=(A.contentDocument||A.contentWindow.document||A.document);return B}function adAutoResizeHeight(D){var B=document.getElementById(D);var C=getIFrameDocument(B);var A=C.getElementById("bottom_div").offsetTop;B.height=(A)+"px"}(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)}})})();jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0}})(jQuery);(function(B){B.fn.ajaxSubmit=function(L){if(!this.length){A("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof L=="function"){L={success:L}}L=B.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},L||{});var N={};this.trigger("form-pre-serialize",[this,L,N]);if(N.veto){A("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}var H=this.formToArray(L.semantic);if(L.data){L.extraData=L.data;for(var E in L.data){H.push({name:E,value:L.data[E]})}}if(L.beforeSubmit&&L.beforeSubmit(H,this,L)===false){A("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[H,this,L,N]);if(N.veto){A("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var D=B.param(H);if(L.type.toUpperCase()=="GET"){L.url+=(L.url.indexOf("?")>=0?"&":"?")+D;L.data=null}else{L.data=D}var M=this,G=[];if(L.resetForm){G.push(function(){M.resetForm()})}if(L.clearForm){G.push(function(){M.clearForm()})}if(!L.dataType&&L.target){var J=L.success||function(){};G.push(function(O){B(L.target).html(O).each(J,arguments)})}else{if(L.success){G.push(L.success)}}L.success=function(R,P){for(var Q=0,O=G.length;Q<O;Q++){G[Q](R,P,M)}};var C=B("input:file",this).fieldValue();var K=false;for(var F=0;F<C.length;F++){if(C[F]){K=true}}if(L.iframe||K){if(B.browser.safari&&L.closeKeepAlive){B.get(L.closeKeepAlive,I)}else{I()}}else{B.ajax(L)}this.trigger("form-submit-notify",[this,L]);return this;function I(){var R=M[0];var P=B.extend({},B.ajaxSettings,L);var Q="jqFormIO"+(new Date().getTime());var V=B('<iframe id="'+Q+'" name="'+Q+'" />');var X=V[0];if(B.browser.msie||B.browser.opera){X.src='javascript:false;document.write("");'}V.css({position:"absolute",top:"-1000px",left:"-1000px"});var Y={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var W=P.global;if(W&&!B.active++){B.event.trigger("ajaxStart")}if(W){B.event.trigger("ajaxSend",[Y,P])}var O=0;var S=0;setTimeout(function(){var c=M.attr("target"),Z=M.attr("action");M.attr({target:Q,encoding:"multipart/form-data",enctype:"multipart/form-data",method:"POST",action:P.url});if(P.timeout){setTimeout(function(){S=true;T()},P.timeout)}var b=[];try{if(L.extraData){for(var d in L.extraData){b.push(B('<input type="hidden" name="'+d+'" value="'+L.extraData[d]+'" />').appendTo(R)[0])}}V.appendTo("body");X.attachEvent?X.attachEvent("onload",T):X.addEventListener("load",T,false);R.submit()}finally{M.attr("action",Z);c?M.attr("target",c):M.removeAttr("target");B(b).remove()}},10);function T(){if(O++){return }X.detachEvent?X.detachEvent("onload",T):X.removeEventListener("load",T,false);var a=0;var b=true;try{if(S){throw"timeout"}var c,f;f=X.contentWindow?X.contentWindow.document:X.contentDocument?X.contentDocument:X.document;if(f.body==null&&!a&&B.browser.opera){a=1;O--;setTimeout(T,100);return }Y.responseText=f.body?f.body.innerHTML:null;Y.responseXML=f.XMLDocument?f.XMLDocument:f;Y.getResponseHeader=function(g){var e={"content-type":P.dataType};return e[g]};if(P.dataType=="json"||P.dataType=="script"){var Z=f.getElementsByTagName("textarea")[0];Y.responseText=Z?Z.value:Y.responseText}else{if(P.dataType=="xml"&&!Y.responseXML&&Y.responseText!=null){Y.responseXML=U(Y.responseText)}}c=B.httpData(Y,P.dataType)}catch(d){b=false;B.handleError(P,Y,"error",d)}if(b){P.success(c,"success");if(W){B.event.trigger("ajaxSuccess",[Y,P])}}if(W){B.event.trigger("ajaxComplete",[Y,P])}if(W&&!--B.active){B.event.trigger("ajaxStop")}if(P.complete){P.complete(Y,b?"success":"error")}setTimeout(function(){V.remove();Y.responseXML=null},100)}function U(Z,a){if(window.ActiveXObject){a=new ActiveXObject("Microsoft.XMLDOM");a.async="false";a.loadXML(Z)}else{a=(new DOMParser()).parseFromString(Z,"text/xml")}return(a&&a.documentElement&&a.documentElement.tagName!="parsererror")?a:null}}};B.fn.ajaxForm=function(C){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){B(this).ajaxSubmit(C);return false}).each(function(){B(":submit,input:image",this).bind("click.form-plugin",function(E){var D=this.form;D.clk=this;if(this.type=="image"){if(E.offsetX!=undefined){D.clk_x=E.offsetX;D.clk_y=E.offsetY}else{if(typeof B.fn.offset=="function"){var F=B(this).offset();D.clk_x=E.pageX-F.left;D.clk_y=E.pageY-F.top}else{D.clk_x=E.pageX-this.offsetLeft;D.clk_y=E.pageY-this.offsetTop}}}setTimeout(function(){D.clk=D.clk_x=D.clk_y=null},10)})})};B.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){B(":submit,input:image",this).unbind("click.form-plugin")})};B.fn.formToArray=function(N){var M=[];if(this.length==0){return M}var D=this[0];var H=N?D.getElementsByTagName("*"):D.elements;if(!H){return M}for(var I=0,K=H.length;I<K;I++){var E=H[I];var F=E.name;if(!F){continue}if(N&&D.clk&&E.type=="image"){if(!E.disabled&&D.clk==E){M.push({name:F+".x",value:D.clk_x},{name:F+".y",value:D.clk_y})}continue}var O=B.fieldValue(E,true);if(O&&O.constructor==Array){for(var G=0,C=O.length;G<C;G++){M.push({name:F,value:O[G]})}}else{if(O!==null&&typeof O!="undefined"){M.push({name:F,value:O})}}}if(!N&&D.clk){var J=D.getElementsByTagName("input");for(var I=0,K=J.length;I<K;I++){var L=J[I];var F=L.name;if(F&&!L.disabled&&L.type=="image"&&D.clk==L){M.push({name:F+".x",value:D.clk_x},{name:F+".y",value:D.clk_y})}}}return M};B.fn.formSerialize=function(C){return B.param(this.formToArray(C))};B.fn.fieldSerialize=function(D){var C=[];this.each(function(){var H=this.name;if(!H){return }var F=B.fieldValue(this,D);if(F&&F.constructor==Array){for(var G=0,E=F.length;G<E;G++){C.push({name:H,value:F[G]})}}else{if(F!==null&&typeof F!="undefined"){C.push({name:this.name,value:F})}}});return B.param(C)};B.fn.fieldValue=function(H){for(var G=[],E=0,C=this.length;E<C;E++){var F=this[E];var D=B.fieldValue(F,H);if(D===null||typeof D=="undefined"||(D.constructor==Array&&!D.length)){continue}D.constructor==Array?B.merge(G,D):G.push(D)}return G};B.fieldValue=function(C,I){var E=C.name,N=C.type,O=C.tagName.toLowerCase();if(typeof I=="undefined"){I=true}if(I&&(!E||C.disabled||N=="reset"||N=="button"||(N=="checkbox"||N=="radio")&&!C.checked||(N=="submit"||N=="image")&&C.form&&C.form.clk!=C||O=="select"&&C.selectedIndex==-1)){return null}if(O=="select"){var J=C.selectedIndex;if(J<0){return null}var L=[],D=C.options;var G=(N=="select-one");var K=(G?J+1:D.length);for(var F=(G?J:0);F<K;F++){var H=D[F];if(H.selected){var M=B.browser.msie&&!(H.attributes.value.specified)?H.text:H.value;if(G){return M}L.push(M)}}return L}return C.value};B.fn.clearForm=function(){return this.each(function(){B("input,select,textarea",this).clearFields()})};B.fn.clearFields=B.fn.clearInputs=function(){return this.each(function(){var D=this.type,C=this.tagName.toLowerCase();if(D=="text"||D=="password"||C=="textarea"){this.value=""}else{if(D=="checkbox"||D=="radio"){this.checked=false}else{if(C=="select"){this.selectedIndex=-1}}}})};B.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};B.fn.enable=function(C){if(C==undefined){C=true}return this.each(function(){this.disabled=!C})};B.fn.select=function(C){if(C==undefined){C=true}return this.each(function(){var D=this.type;if(D=="checkbox"||D=="radio"){this.checked=C}else{if(this.tagName.toLowerCase()=="option"){var E=B(this).parent("select");if(C&&E[0]&&E[0].type=="select-one"){E.find("option").select(false)}this.selected=C}}})};function A(){if(B.fn.ajaxSubmit.debug&&window.console&&window.console.log){window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}}})(jQuery);

wwd={initialize:function(){wwd.logger.log("WWD Starting up");this.fixPng();this.formSetup();wwd.events.addListener("pageLoad",function(){wwd.onPageLoad()});wwd.events.addListener("loggedIn",function(){wwd.onLogin()});if(wwd.history){wwd.history.initialize()}if(wwd.clipping){wwd.clipping.initialize()}if(wwd.user){wwd.user.initialize()}if(wwd.slideshow){wwd.slideshow.initialize()}if(wwd.comments){wwd.comments.initialize()}if(wwd.components){wwd.components.initialize()}if(wwd.stats){wwd.stats.initialize()}if(wwd.content){wwd.content.initialize()}if(wwd.toc){wwd.toc.initialize()}},onLogin:function(){wwd.logger.verbose("WWD.onLogin()");wwd.comments.initialize();wwd.clipping.setup()},onPageLoad:function(){adReloadAll();emailafriend.getValues();sizeText.init("content","size-text","div");var A=$("#article-title").text();document.title=A+" - WWD.com";showHiddenAds("article");wwd.comments.initialize();wwd.stats.call();this.jsHover()},formSetup:function(){$(":text, :password").focus(function(){$(this).addClass("focused")});$(":text, :password").blur(function(){$(this).removeClass("focused")})},fixPng:function(){if(jQuery.browser.msie==true&&jQuery.browser.version>=5.5){for(var G=0;G<document.images.length;G++){var D=document.images[G];var F=D.src.toUpperCase();if(F.substring(F.length-3,F.length)=="PNG"){var B=(D.id)?"id='"+D.id+"' ":"";var E=(D.className)?"class='"+D.className+"' ":"";var H=(D.title)?"title='"+D.title+"' ":"title='"+D.alt+"' ";var C="display:inline-block;"+D.style.cssText;if(D.align=="left"){C="float:left;"+C}if(D.align=="right"){C="float:right;"+C}if(D.parentElement.href){C="cursor:hand;"+C}var A="<span "+B+E+H+' style="width:'+D.width+"px; height:"+D.height+"px;"+C+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+D.src+"', sizingMethod='scale');\"></span>";D.outerHTML=A;G=G-1}}}},jsHover:function(E,B,A){var D=E?("."+E):".js-list";var C=B?B:"li";var F=A?A:"over";$(D+" "+C).hover(function(){$(this).addClass(F)},function(){$(this).removeClass(F)})}};wwd.contactus={MESSAGE_ERROR:"(Please add a message)",CONCERNING_ERROR:"(Please select a topic)",validate:function(){var A=false;if($("#message").val()==""){$("#message").attr("class","alert");$("#message-error").html(wwd.contactus.MESSAGE_ERROR);A=true}else{$("#message").attr("class","");$("#message-error").html("")}if($("#concerning").val()=="Select a topic"){$("#concerning").attr("class","alert");$("#concerning-error").html(wwd.contactus.CONCERNING_ERROR);A=true}else{$("#concerning").attr("class","");$("#concerning-error").html("")}if(A){return false}else{return true}}};wwd.logger={level:3,useDebugger:false,inited:false,bugger:null,dragging:false,dragOffset:{x:0,y:0},initialize:function(){var C=self.location.search;var B=C.indexOf("debug=");if(B==-1){this.level=0;return }this.useDebugger=true;this.inited=true;if($.browser.msie==true){var D=$("<div>");D.attr("id","debug-panel");D.css("background-color","#cccccc");D.css("text-align","left");D.css("position","absolute");D.css("left",20);D.css("top",20);D.css("font-size","110%");D.width(400);D.height(400);D.css("overflow","auto");$("body").append(D);this.bugger=D;var A=$("<div>Debugger</div>");A.mousedown(function(E){wwd.logger.startDrag();wwd.logger.dragOffset.x=E.target.offsetLeft;wwd.logger.dragOffset.y=E.target.offsetTop});A.mouseup(function(E){wwd.logger.stopDrag()});this.bugger.append(A)}this.log("Logger.initialize()")},startDrag:function(){this.dragging=true;$(document).mousemove(function(A){wwd.logger.drag(A)})},stopDrag:function(){wwd.logger.dragging=false;$(document).unbind("mousedown")},drag:function(A){if(this.dragging){$("#debug-panel").css("left",(A.pageX+this.dragOffset.x));$("#debug-panel").css("top",(A.pageY-$(document).scrollTop()+this.dragOffset.y))}},createElement:function(D,A,C){var E;C=(C)?(C):(0);A=(A)?(A):("");if(typeof (D)!="object"||C>1){E=$("<div>").addClass("debug-line").attr("style","font-size:80%;font-family:sans-serif;background-color:#efefef;border-bottom:1px solid #cccccc").text(A+D)}else{E=$("<div>"+A+"[Object]</div>");E.attr("style","font-family:sans-serif;font-size:80%;background-color:#fefefe");E=$("<div>").append(E);E.height(12);E.css("overflow","hidden");E.click(function(){if($(this).height()==12){$(this).height("auto")}else{$(this).height(12)}});C++;for(var B in D){E.append(this.createElement(D[B],". "+A+B+"=",C))}}return E},log:function(B,A){A=(A)?(A):(false);if(!this.inited){this.initialize()}if(!A&&this.level==0){return }if(this.useDebugger){var C=this.createElement(B);if(this.bugger){this.bugger.append(C)}}if(jQuery.browser.mozilla==true&&window.console&&window.console.log){if(A){alert(B)}console.log(B)}else{}},error:function(A){this.log("Error: "+A,true)},verbose:function(A){if(this.level>2){this.log(A)}}};function setupWindow(){wwd.logger.setupWindow()}$(document).ready(function(){wwd.events.dispatchEvent("domReady")});var dartCalls=[];wwd.events={broadcaster:(new EventBroadcaster()),addListener:function(B,C,A){return this.broadcaster.addListener(B,C,A)},dispatchEvent:function(C,B,A){return this.broadcaster.dispatchEvent(C,B,A)}};wwd.history={links:[],timer:null,interval:200,hash:"",newhash:"",inited:false,frameLoaded:false,managed:true,initialize:function(){wwd.logger.log("History.initialization()");this.inited=true;if(window.location.hash.length>0){this.setHash(window.location.hash.substr(2))}var A=self.location.search;if(A.indexOf("unmanaged=")>-1){this.managed=false}timer=new Timer();timer.setInterval(this,"checkHash",this.interval)},checkHash:function(){var B=window.location.href;var A=(B.substr(B.indexOf("#")).substr(2)).toLowerCase();A=(A)?(A):("");if(A!=this.hash){this.hash=A;this.links.push(A);wwd.logger.verbose("  history: "+this.links);wwd.events.dispatchEvent("hashChanged",this.hash)}},onFrameLoaded:function(A){if(wwd.history.inited&&$.browser.msie==true&&$.browser.version>=7){window.location.hash=A}},clearHash:function(){this.setHash("")},setHash:function(B){wwd.logger.verbose("History.setHash("+B+")");if(this.managed){var D=window.location.href;if(D.indexOf("#")!=-1){D=D.substr(0,D.indexOf("#"))}D=D+"#/"+B;var C;if($.browser.msie==true&&$.browser.version>=7){C="/"+B;var A=document.getElementById("historyFrame").contentWindow.document;A.open("javascript:'<html></html>'");A.write('<html><head><script type="text/javascript">document.domain=\''+document.domain+"';parent.onFrameLoaded('"+C+"');<\/script></head><body></body></html>");A.close()}else{window.location.hash="/"+B}}else{this.hash=B;wwd.events.dispatchEvent("hashChanged",this.hash)}},createAnchor:function(B){var A=B},getHash:function(){return this.hash},hasBack:function(){wwd.logger.verbose("History.hasBack()");if(this.links.length>1){return true}return false},back:function(){wwd.logger.verbose("History.back()");if(this.hasBack()){this.links.pop();var A=this.links.pop();this.setHash(A)}}};function onFrameLoaded(A){wwd.logger.log("History.onFrameLoaded("+A+")");if(!wwd.history.inited){wwd.initialize()}else{if($.browser.msie==true&&$.browser.version>=7){window.location.hash=A}}}wwd.user={username:"",timerId:-1,initialize:function(){wwd.logger.verbose("-- User --");wwd.logger.verbose("name: "+this.getName());wwd.logger.verbose("level: "+this.getSubscriptionLevel());wwd.logger.verbose("----------");this.initializeLockIcon();if(this.isLoggedIn()){this.onLogin()}else{$("#log-in-container").show();$("#log-in-container").toggle(function(){wwd.user.open()},function(){wwd.user.close()});var A='<iframe src="'+$("#secure-host").val()+'/account/login-iframe?init" allowtransparency="false" scrolling="no" id="log-in-iframe" frameborder="0" ></iframe>';$("#secure-host").after(A);$("#login-roadblock").submit(checkIfEmpty)}wwd.events.addListener("pageLoad",function(){wwd.onPageLoad()})},onPageLoad:function(){},checkLogin:function(){if(this.isLoggedIn()){clearInterval(this.timerId);if($(".roadblock-container").length>0){window.location.href=window.location}else{this.close();this.onLogin()}}},open:function(){wwd.logger.verbose("User.open()");$("#log-in-container>div").slideDown();this.timerId=setInterval("wwd.user.checkLogin()",500)},close:function(){wwd.logger.verbose("User.close()");$("#log-in-container>div").slideUp();clearInterval(this.timerId)},getUserHash:function(){var B="unknown";try{B=(($.cookie("HD")).split("|"))[0]}catch(A){}return B},getName:function(){if(!this.username||this.username==""){this.username=(!$.cookie("username"))?(""):($.cookie("username"))}return this.username},isLoggedIn:function(){var A=this.getName();return(A.length>0&&A.length<20)},getSubscriptionLevel:function(){var H="free";try{var B=$.cookie("AD");var A=B.split("|");var D=A[0];var G=(A[1]&&A[1]=="true")?(true):(false);var F=A[2];wwd.logger.log("User: "+this.getName()+" sub"+D+":"+G+":"+F);var C=D;if(F){C=F}if(C&&G){H="combo"}else{if(C=="WD"){H="print"}else{if(C=="WA"){H="archive"}else{if(C=="WO"){H="online"}}}}if(F){H="trial-"+H}}catch(E){}return H},isArchive:function(){return(this.getSubscriptionLevel()=="archive")},isOnline:function(){return(this.getSubscriptionLevel()=="online")},isPrint:function(){return(this.getSubscriptionLevel()=="print")},initializeLockIcon:function(){$(".lockable").each(function(){if(wwd.user.isArchive()){$(this).removeClass("lockable")}else{if(wwd.user.isOnline()){if($(this).hasClass("is-archived")){$(this).removeClass("clippable")}else{$(this).removeClass("lockable")}}else{if(wwd.user.isPrint()){$(this).removeClass("clippable")}}}})},onLogin:function(){$("#log-in-container").hide();$(".username span").text(this.getName());$("body").addClass("logged-in");wwd.user.initializeLockIcon();wwd.events.dispatchEvent("loggedIn")}};function checkIfEmpty(){var A=true;$(this).find(":text, :password").each(function(){if($(this).val()==""){$(this).parent().addClass("isEmpty");$(this).addClass("alert");$(this).focus();A=false}});return A}var userPrefsCookie=function(){this.totalCookieString=null;this.searchResultValue=null;this.cookieStringArray=null;this.tempCookieString=null;this.getCookieNameValuePair=function(B){userPrefsCookie.totalCookieString=$.cookie("user-prefs-cookie");if(userPrefsCookie.totalCookieString!=null){userPrefsCookie.cookieStringArray=userPrefsCookie.totalCookieString.split(",");for(var A=0;A<userPrefsCookie.cookieStringArray.length;A++){if(userPrefsCookie.cookieStringArray[A].indexOf(B)!=-1){userPrefsCookie.tempCookieString=userPrefsCookie.cookieStringArray[A];userPrefsCookie.tempCookieString=userPrefsCookie.tempCookieString.substring(B.indexOf("=")+1,userPrefsCookie.tempCookieString.length);break}}}return userPrefsCookie.tempCookieString};this.setCookieString=function(C,A){if(userPrefsCookie.totalCookieString!=null){if(userPrefsCookie.tempCookieString!=null){for(var B=0;B<userPrefsCookie.cookieStringArray.length;B++){userPrefsCookie.cookieStringArray[B]=C+A;userPrefsCookie.cookieStringArray.join(",");userPrefsCookie.totalCookieString=userPrefsCookie.cookieStringArray;break}}else{userPrefsCookie.cookieStringArray.join(",");userPrefsCookie.totalCookieString=userPrefsCookie.cookieStringArray+","+C+A}}else{userPrefsCookie.totalCookieString=C+A}$.cookie("user-prefs-cookie",userPrefsCookie.totalCookieString,{path:"/"})}};var userPrefCookieObj=new userPrefsCookie();function checkIfEmpty(){var A=true;$(this).find(":text, :password").each(function(){if($(this).val()==""){$(this).parent().addClass("isEmpty");$(this).addClass("alert");$(this).focus();A=false}});return A}var clippingModuleContainer="clipping-mod-container";var clippingExpander="clipping-collapse-expand";var clippable="clippable";var clippableModule="clippable-module";var clippingBar="clipping-bar";var clippingThumbs="clipping-thumbs";var clippingInfo="clipping-info";var clippingThumb="clipping-thumb";var clippingCounts="clipping-counts";var clippableContainer="clippable-container";var clippedClass="clip-link";var unclippedClass="remove-link";var clipOver="clippable-over";var expandedObj={x:0,y:-55,width:0,height:75};var collapsedObj={x:0,y:1,width:0,height:17};wwd.clipping={CLIPPING_THUMB_MAX:13,clippables:[],clipped:[],folders:[],currentFolderIndex:0,isExpanded:undefined,isGallery:false,galleryClips:[],currentPage:1,numPerRow:4,numRowsPerPage:3,pagers:[],clippedArticleId:null,clippedArticleUrl:null,initialize:function(){this.folders=new Array();this.clipped=new Array();this.clips=new Array();if($("#"+clippingExpander).length==0){return }if($("#clipping-gallery").length==1){this.isGallery=true}wwd.events.addListener("pageLoad",function(){wwd.clipping.onPageLoad()})},onPageLoad:function(){$("#toolbox .clipfile").show();this.whichAreClipped()},setup:function(){wwd.logger.log("Clipping.setup()");wwd.logger.log(" user: "+wwd.user.getName());$("#clipping-mod-container").css("display","block");if($.browser.msie==true&&$.browser.version<7){$(window).scroll(function(B){var C=$(window).height()+$(window).scrollTop()-collapsedObj.height;$("#"+clippingModuleContainer).css({left:0,top:C})});$(window).resize(function(B){var C=$(window).height()+$(window).scrollTop()-collapsedObj.height;$("#"+clippingModuleContainer).css({left:0,top:C})});var A=$(window).height()+$(window).scrollTop()-collapsedObj.height;$("#"+clippingModuleContainer).css({left:0,top:A})}$("#toolbox .clipfile").show();this.getFolders()},prepareClippables:function(){this.clippables=new Array();$("."+clippable).each(function(){var B=wwd.clipping.wrapClippable(this);wwd.clipping.clippables.push(B)});var A=$(".clippable-link");$.merge(this.clippables,[A]);$("."+clippableContainer).hover(function(){$(this).addClass(clipOver);var B=$(this).find("."+clippableModule);B.addClass(clipOver);B.each(function(C){var D=$(this).parent().offset().left+$(this).parent().width()-$("#content-container").offset().left-59;$(this).css("left",D)})},function(){$(this).removeClass(clipOver);$(this).find("."+clippableModule).removeClass(clipOver)});$(".clippable-module").each(function(){if($(this).parents().find(".clippable-container").length==0){$(this).parent().hover(function(){$(this).addClass(clipOver);var B=$(this).find("."+clippableModule);B.addClass(clipOver);B.each(function(C){var D=$(this).offset().left+$(this).width()-$("#content-container").offset().left-58})},function(){$(this).removeClass(clipOver);$(this).find("."+clippableModule).removeClass(clipOver)})}})},wrapClippable:function(E){wwd.logger.verbose("wrapClippable()");try{var D=$(E).width();var A=$(E).height();if($(E).find(".clippable-module").length==0){var G,C,B;G=$(E).attr("id");G=G.substr(G.lastIndexOf("-")+1);C=$("<div></div>");C.addClass(clippableModule);C.css("text-align","left");B=$('<a href="javascript:void(0);" class="'+clippedClass+'"><span>+ clip</span></a>');B.attr("id","unclip-link-"+G);B.click(function(){var H=$(this).attr("id");H=H.substr(H.lastIndexOf("-")+1);wwd.clipping.clip(H);return false});C.append(B);B=$('<a href="javascript:void(0);" class="'+unclippedClass+'"><span>- remove</span></a>');B.attr("id","clip-link-"+G);B.click(function(){var H=$(this).attr("id");H=H.substr(H.lastIndexOf("-")+1);wwd.clipping.unclip(H);return false});C.append(B);C.css("opacity",0.8);$(E).prepend(C)}}catch(F){}return $(E)},isClipped:function(D){var C;var B=[];for(var A=0;A<D.length;A++){wwd.logger.log(D[A]);C=D[A];var E=C.attr("id");if(E){E=E.substr(E.lastIndexOf("-")+1);E=parseInt(E);if(!isNaN(E)){B.push(parseInt(E))}}}wwd.logger.log("checking if clipped: ["+B+"]");ClippingController.whichAreClipped(B,function(F){wwd.logger.log("whichAreClipped result");wwd.clipping.setClipped(F)})},setClipped:function(E){wwd.logger.log("setClipped()");wwd.logger.log(E);this.clipped=E;var F;var A=new Array();for(var C=0;C<this.clippables.length;C++){$("#"+this.clippables[C].attr("id")+" ."+clippableModule+" ."+clippedClass).show();$("#"+this.clippables[C].attr("id")+" ."+clippableModule+" ."+unclippedClass).hide()}var D=$(".clippable-link").each(function(){var G=$(this).attr("id");G=parseInt(G.substr(G.lastIndexOf("-")+1));$(this).text("Add to ClipFile");$(this).removeClass("removefile");$(this).addClass("clipfile");$(this).attr("href","javascript:wwd.clipping.clip("+G+")")});wwd.logger.log(E.length+"/"+this.clippables.length);for(var C=0;C<E.length;C++){wwd.logger.log("i++");for(var B=0;B<this.clippables.length;B++){F=this.clippables[B].attr("id");wwd.logger.log("id = "+F);if(!F){continue}F=F.substr(F.lastIndexOf("-")+1);wwd.logger.log(C+":"+B+":"+E[C]+":"+F);if(F&&F==E[C]){if(this.clippables[B].hasClass("clippable-link")){this.clippables[B].text("Remove Clipping");this.clippables[B].addClass("removefile");this.clippables[B].attr("href","javascript:wwd.clipping.unclip("+F+")")}else{wwd.logger.log("turning on: "+this.clippables[B].attr("id"));$("#"+this.clippables[B].attr("id")+" ."+clippableModule+" ."+clippedClass).hide();$("#"+this.clippables[B].attr("id")+" ."+clippableModule+" ."+unclippedClass).show()}}}}if($("#content-id").length>0&&this.findClipByContentId($("#content-id").val())){$(".tools-article-note").css("visibility","visible")}},getFolders:function(){wwd.logger.log("getFolders()");ClippingController.getClipFiles(function(A){if(A.length<=0){return }wwd.clipping.setFolders(A);wwd.clipping.setCurrentFolder();if(typeof (wwd.clipping.isExpanded)=="undefined"){wwd.clipping.collapse()}})},setFolders:function(A){if(!A||A.length==0){wwd.logger.error("couldnt get folders for user");return }this.folders=A},getCurrentFolder:function(){return this.folders[this.currentFolderIndex]},setCurrentFolder:function(D){D=(D)?(D):(this.getCurrentFolder());if(!D){return }var E=this.currentFolderIndex;var B=this.getFolderIndex(D.id);this.currentFolderIndex=B;var C=$("#"+clippingInfo);C.empty();C.append($("<li>").text(D.name));C.append($("<li>").addClass(clippingCounts).html("<a href='/clippings/images/?folderid="+(this.getCurrentFolder()).id+"'><span>Images</span></a> ("+D.imageCount+")"));wwd.logger.log("clipped article: "+this.clippedArticleId);C.append($("<li>").addClass(clippingCounts).html("<a href='javascript:wwd.clipping.viewArticle();'><span>Articles</span></a> ("+D.articleCount+")"));$(".clipping-image-counts span").html("("+D.imageCount+")");var A=$(".clipping-article-counts a");if(D.articleCount>0&&A.length==0){A=$("<a></a>").html("Articles <span></span>").attr("href","javascript:wwd.clipping.viewArticle();");$(".clipping-article-counts").html(A)}$(".clipping-article-counts span").html("("+D.articleCount+")");this.getClips(this.getCurrentFolder())},getClips:function(A){wwd.logger.log("getClips("+A+")");wwd.logger.log("getClips("+A.id+")");var B=(typeof (A)=="object")?(A.id):(A);if(B){ClippingController.getClippings(B,function(C){wwd.clipping.setClips(C)})}},setClips:function(B){wwd.logger.log("setClips(), "+B.length+" clip(s) returned");wwd.logger.log(B);this.clippedArticleId=null;this.clippedArticleUrl=null;var F=this.getCurrentFolder();F.clips=B;F.images=[];F.articles=[];var A=[];var E=[];for(var D=0;D<B.length;D++){if(B[D].thumbUrl&&B[D].thumbUrl.length>0){A.push(B[D])}else{E.push(B[D]);if(!this.clippedArticleUrl){this.clippedArticleUrl=B[D].contentUrl}if(!this.clippedArticleId){this.clippedArticleId=B[D].contentId}}}F.images=A;F.articles=E;this.galleryClips=A;$("#"+clippingThumbs+" ul").empty();var C=Math.min(A.length,this.CLIPPING_THUMB_MAX);for(var D=0;D<C;D++){this.createThumb(A[D])}if(A.length>0){$(".clipping-see-more").show()}else{$(".clipping-see-more").hide()}if(this.isGallery){this.resetGallery();this.createGallery()}this.whichAreClipped()},whichAreClipped:function(){if(wwd.user.isLoggedIn()){this.prepareClippables();this.isClipped(this.clippables)}},createThumb:function(D){wwd.logger.log("createThumb("+D.id+")");var E=$("<img>");var F=(D.thumbUrl&&D.thumbUrl.length>0)?(D.thumbUrl):("/images/tmp/thumb-001.jpg");E.attr("src",F);E.addClass(clippingThumb);var C=this.getCurrentFolder();if(C){var B=$("<a></a>");B.attr("href","javascript:wwd.slideshow.start('clipFile','"+C.id+"','"+D.contentId+"');");B.attr("id","clipped-image-"+C.id+"-"+D.id);B.append(E);var A=$("<li></li>");A.append(B);$("#"+clippingThumbs+" ul").append(A)}},viewArticle:function(){if(this.clippedArticleUrl){var B=this.clippedArticleUrl;self.location=B}else{if(this.clippedArticleId){var A="/fashion-news/clipped-"+this.clippedArticleId;var B=A+"?navSection=clippings&navId="+this.getCurrentFolder().id;self.location=B}else{wwd.logger.error("Article ID not set")}}},filterGalleryByNotes:function(E){var B=(this.getCurrentFolder()).images;var C=[];E=E?E:false;var A=($(".clipping-filter-checkbox").attr("checked"))==true;if(!E){if(A){$(".clipping-filter-checkbox").removeAttr("checked")}else{$(".clipping-filter-checkbox").attr("checked","true")}A=!A}for(var D=0;D<B.length;D++){if(A){if(B[D].note){C.push(B[D])}}else{C.push(B[D])}}this.resetGallery();this.galleryClips=C;this.createGallery(this.galleryClips)},setGalleryPage:function(A){wwd.logger.log("setGalleryPage("+A+")");A=parseInt(A);if(A!=this.currentPage){this.currentPage=parseInt(A);this.createGallery()}},resetGallery:function(){this.currentPage=1;var C;var B=$(".paginator-container");if(this.pagers.length==0&&B.length>0){for(var A=0;A<B.length;A++){C=new Paginator(B[A],1,1,"alternate");C.addListener("page-request",function(D){wwd.clipping.setGalleryPage(D)});this.pagers.push(C)}}for(var A=0;A<this.pagers.length;A++){this.pagers[A].setCount(1);this.pagers[A].setCurrent(this.currentPage)}},createGallery:function(C){C=C?C:this.getCurrentFolder().images;this.galleryClips=C;wwd.logger.log("Clipping.createGallery()");wwd.logger.log(" # clips:"+C.length);var D=this.numPerRow*this.numRowsPerPage;var B=Math.ceil(C.length/D);for(var E=0;E<this.pagers.length;E++){this.pagers[E].setCount(B);this.pagers[E].setCurrent(this.currentPage)}wwd.logger.log("pages: "+B);wwd.logger.log("current: "+this.currentPage);this.createGalleryThumbs(C);if(C.length<=0){var A=$("#clipping-gallery");A.empty();A.append($("<p></p>").css({color:"#ffffff","font-size":"120%","text-align":"center","margin-top":"100px"}).html("No images have been clipped to this clipfile<br>See the FAQ for more information on using clipfiles"));$(".clipping-gallery-tools").each(function(){$(this).hide()})}else{$(".clipping-gallery-tools").each(function(){$(this).show()});$(".clipping-gallery-printall").attr("target","_blank").attr("href","/print-images/?type=clipFile&id="+(this.getCurrentFolder()).id)}},createGalleryThumbs:function(D){wwd.logger.log("createGalleryThumbs()");var F=this.numPerRow;var L=0;var I=0;var J=0;var O=[];var A=(this.currentPage-1)*(this.numPerRow*this.numRowsPerPage);var K=Math.min((this.numPerRow*this.numRowsPerPage),(D.length-A));var Q=$("#clipping-gallery");Q.empty();var G=D[A];wwd.logger.verbose(" first: "+A);var P,M,H,E,C,N;while(J<K){P=$("<div></div>");P.addClass("clipping-gallery-row");var B;while(G&&L<F&&J<K){M=$("<div></div>");M.addClass("clipping-gallery-image");M.addClass("clippable");M.attr("id","clippable-"+G.contentId);B=G.thumbUrl;if(B){if(B.indexOf("landscape/06")!=-1){B=B.substr(0,B.indexOf("landscape/06"))+"portrait/03-thumb/"+B.substr(B.lastIndexOf("/")+1)}else{B=B.substr(0,B.indexOf("portrait/06"))+"portrait/03-thumb/"+B.substr(B.lastIndexOf("/")+1)}}H=$("<img>");H.load(function(R){$(this).width($(this).width())});H.attr("src",B);M.append($("<div></div>").height(238).append(H));C=$("<div></div>").attr("id","gallery-image-"+G.id).css("background-color","#000000").css("text-align","left").css("min-height","40px");if(G.note&&G.note.length>0){C.addClass("note")}E=$("<p>");E.addClass("photo-by");E.html("<!-- NEED AUTHOR INFO -->");C.append(E);E=$("<p>");E.addClass("caption");E.html("<!-- NEED CAPTION INFO -->");C.append(E);M.append(C);M.css("opacity",0);P.append(M);O.push(M);L++;J++;G=D[(A+J)]}Q.append(P);L=0}$("#clipping-gallery .clipping-gallery-image").each(function(R){$(this).fadeTo(R*200+10,0).fadeTo(200,1)})},collapse:function(){if(this.isExpanded!=false){$("#"+clippingBar).animate({top:collapsedObj.y+"px"},200);$("#clipping-collapse-expand").removeClass("clipping-collapsed");$("#clipping-collapse-expand").addClass("clipping-expanded");this.isExpanded=false}},expand:function(){if(!this.isExpanded){$("#"+clippingBar).animate({top:expandedObj.y+"px",height:expandedObj.height+"px"},200);$("#clipping-collapse-expand").addClass("clipping-collapsed");$("#clipping-collapse-expand").removeClass("clipping-expanded");this.isExpanded=true}},toggleView:function(){if(this.isExpanded){this.collapse()}else{this.expand()}},clip:function(B){wwd.logger.log("clip("+B+")");var A=this.getCurrentFolder();if(A){this.sendClip(B,A.id)}wwd.logger.verbose(" leaving clip()")},sendClip:function(D,B){wwd.logger.log("sendClip("+D+","+B+")");var C=B;var A={id:D,folder:B};ClippingController.clip(D,B,function(E){if(E.success==true){wwd.logger.log("ClippingController.clip result:");wwd.logger.log(E);wwd.clipping.addClip(A);wwd.clipping.getFolders();wwd.clipping.expand();wwd.events.dispatchEvent("clipped",D);wwd.stats.trackAction("clippeditem",A.id)}})},sendUnclip:function(B){B=(B)?(B):(this.nextUnclipId);wwd.logger.log("Clipping.sendUnclip("+B+")");var A={id:B};if(!B){return }this.nextUnclipId=null;ClippingController.removeClip(B,function(C){wwd.clipping.removeClip(A);wwd.clipping.getFolders();wwd.events.dispatchEvent("unclipped",B)})},removeClip:function(C){wwd.logger.log("removeClip("+C.id+")");var A=[];for(var B=0;B<this.clipped.length;B++){if(this.clipped[B]!=C.id){A.push(this.clipped[B])}}this.setClipped(A)},getFolderIndex:function(B){for(var A=0;A<this.folders.length;A++){if(this.folders[A].id==B){return A}}return -1},addClip:function(A){wwd.logger.log("addClip("+A.id+")");$.merge(this.clipped,[A.id]);this.setClipped(this.clipped)},unclip:function(B){this.nextUnclipId=B;var A=new Dialog("Remove this clipping?",["Yes","No"]);A.addListener("click",function(D,C){if(D=="Yes"){wwd.clipping.sendUnclip()}C.close()})},onUnClipDialog:function(B,A){if(B=="Yes"){wwd.clipping.sendUnclip(clipId)}A.close()},showSlideshowNote:function(C){var A=wwd.slideshow.getCurrentSlide();var B=this.findClipByContentId(A.id);var D=B.note;var E=$("#"+C).offset();this.showNote(E.left,E.top,B.contentId,D)},showArticleNote:function(B){var A=this.findClipByContentId($("#content-id").val());if(A){var C=A.note;var D=$(B).offset();D.top+=$(B).height();this.showNote(D.left,D.top,A.contentId,C)}},showNote:function(A,F,E,D){var C=$("#clipping-note");if(C.length==0){var B;C=$("<div></div>");C.attr("id","clipping-note");C.append($("<input id='note-content-id' type='hidden' name='content' />"));C.append($("<textarea>")).attr("name","clipping-note-text");B=$("<input type='button' class='note-cancel' value='Cancel'>");B.click(function(){wwd.clipping.cancelNote()});C.append(B);B=$("<input type='button' class='note-submit' value='Submit'>");B.click(function(){wwd.clipping.submitNote($(this).parent().find("input").val())});C.append(B);$("#slideshow-container").after(C);C.hide()}C.find("#note-content-id").val(E);D=(D&&D.length>0)?(D):("");$($("#clipping-note textarea")).val(D);C.css("left",A);C.css("top",F);C.show()},submitNote:function(D){var A=$($("#clipping-note textarea")).val();var C=this.getCurrentFolder();var B=this.findClipByContentId(D);ClippingController.setNote(B.contentId,C.id,A,function(E){$("#clipping-note").hide();var F=wwd.clipping.findClipByContentId(B.id);if(F){F.note=A;if(A.length>0){$("#gallery-image-"+F.id).addClass("note")}else{$("#gallery-image-"+F.id).removeClass("note")}}})},cancelNote:function(){$("#clipping-note").hide()},getClipByContentId:function(A){alert("Deprecated: getClipByContentId() - Use findClipByContentId()");return this.findClipByContentId(A)},findClipByContentId:function(C){var B=this.getCurrentFolder();if(B&&B.clips){for(var A=0;A<B.clips.length;A++){if(B.clips[A].contentId==C){return B.clips[A]}}}},findClip:function(C){wwd.logger.log("Clipping.findClip("+C+")");for(var B=0;B<this.folders.length;B++){for(var A=0;A<this.folders[B].clips.length;A++){if(this.folders[B].clips[A].id==C){return this.folders[B].clips[A]}}}}};var slideshowBack="slideshow-back";var slideshowNext="slideshow-next";var slideshowContainer="slideshow-container";var contentContainer="content-container";var outerContainer="outer-container";var slideShowImageContainer="slideshow-image-container";if(typeof (wwd)=="undefined"){wwd={}}wwd.slideshow={type:"",id:null,currentSlideId:null,slides:[],current:0,total:0,showingAd:false,showing:false,initialize:function(){if($("#"+slideshowContainer).length<=0){return }$("#"+slideshowBack).css("opacity",0.4);$("#"+slideshowBack).hover(function(){$(this).css("opacity",0.8)},function(){$(this).css("opacity",0.4)});$("#"+slideshowBack).click(function(){wwd.slideshow.previousSlide()});$("#"+slideshowNext).css("opacity",0.4);$("#"+slideshowNext).hover(function(){$(this).css("opacity",0.8)},function(){$(this).css("opacity",0.4)});$("#"+slideshowNext).click(function(){wwd.slideshow.nextSlide()});wwd.events.addListener("clipped",function(A){if($("#slideshow").css("display")=="block"){wwd.slideshow.updateTools()}});wwd.events.addListener("unclipped",function(A){if($("#slideshow").css("display")=="block"){wwd.slideshow.updateTools()}});wwd.events.addListener("hashChanged",function(A){wwd.slideshow.onHashChange(A)});if((wwd.history.getHash()).length>0){this.onHashChange(wwd.history.getHash())}},onHashChange:function(B){wwd.logger.verbose("Slideshow.onHashChange("+B+")");if(B){var A=B.split("/");if(A[0]=="slideshow"){var C=A[2];if(C&&C.length>0){if(A[1]=="article"){return this.startArticleSlideshow(C,A[3])}else{if(A[1]=="clipfile"){return this.startClippingSlideshow(C,A[3])}else{if(A[1]=="landing"){return this.startLandingSlideshow(C,A[3])}else{if(A[1]=="homepage"){return this.startHomepageSlideshow(A[2])}else{if(A[1]=="image"){return this.startSingleSlideshow(A[2])}}}}}}}}this._hide()},setSlides:function(A,B){wwd.logger.log("Slideshow.setSlides()");if(A.length<=1){$("#slideshow-pagination").hide()}else{$("#slideshow-pagination").show()}if(B&&B.length>0){this.title=B}this.slides=A;this.total=A.length;this.showSlide(this.getCurrentSlide());this.updateThumb()},setArticles:function(E){var D=$("#slideshow-info .slideshow-article-list");D.show();var F;var B=Math.min(E.length,10);var A=["January","February","March","April","May","June","July","August","September","October","November","December"];for(var C=0;C<B;C++){F=new Date(E[C].postDate);F="Posted "+(A[F.getMonth()])+" "+F.getDate()+", "+(1900+F.getYear());li=$("<li></li>").append($("<a></a>").attr("href",E[C].url).html(E[C].headline)).append($("<p></p>").html(F));D.append(li)}},getCurrentSlide:function(){if(this.currentSlideId!=undefined&&this.currentSlideId>0){for(var A=0;A<this.slides.length;A++){wwd.logger.verbose(this.slides[A].id+" =? "+this.currentSlideId);if(this.slides[A].id==this.currentSlideId){this.current=A;break}}this.currentSlideId=null}wwd.logger.log(this.slides[this.current]);return this.slides[this.current]},loadError:function(A){if(A.slides.length==0&&A.loggedIn==false){var B=new Dialog("Please log in to view this slideshow",["Ok"]);wwd.logger.verbose("adding click handler");B.addListener("click",function(D,C){wwd.logger.verbose("clicked");wwd.slideshow.hide();C.close()});B.move("",($(window).height()/3))}},showSlide:function(A){wwd.logger.log("Slideshow.showSlide()");wwd.logger.log(" slide: "+A.title);$("#slideshow-page").html("0/0");if(!A){wwd.logger.error("Slide is undefined");return }$("#slideshow-info h3").text("");$("#slideshow-info h3").html(wwd.slideshow.title);$("#slideshow-byline").html(A.byline);$("#slideshow-caption").html(A.caption);$("#slideshow-page").text((this.current+1)+"/"+this.total);$("#slideshow-other-articles").unbind("click");$("#"+slideShowImageContainer).empty();var C=$("#slideshow-info .slideshow-article-list").empty().hide();this.updateTools();var D=A.id;$("#slideshow-other-articles").unbind("click");$("#slideshow-other-articles").click(function(E){SlideshowController.getArticlesForImage(D,function(F){wwd.slideshow.setArticles(F)})});var B=new Image();B.id="slide-"+(this.current);B.onload=function(){if("slide-"+(wwd.slideshow.current)==this.id){$("#"+slideShowImageContainer).append($(this));$(this).fadeTo(500,1)}else{try{delete this}catch(E){}}};$(B).css("opacity",0).attr("src",A.imagePath);this.updateThumb()},updateTools:function(){if(!this.showing){return }wwd.logger.verbose("Slideshow.updateTools()");$("#slideshow-info").show();if(this.slides.length>1){$("#tools-print-all").show();$("#tools-print-all").attr("href","/print-images/?type="+this.type+"&id="+this.id);$("#tools-print-all").attr("target","_blank")}else{$("#tools-print-all").hide()}$("#tools-print").attr("href","/print-image/?id="+(this.getCurrentSlide()).id);$("#tools-print").attr("target","_blank");var A=this.getCurrentSlide();$("#tools-clip").hide();$("#tools-unclip").hide();$(".tools-note").hide();if(wwd.user.isLoggedIn()){if(wwd.clipping.findClipByContentId(A.id)){$("#tools-unclip").show();$("#tools-unclip").attr("href","javascript:wwd.clipping.unclip("+(this.getCurrentSlide()).id+")");$(".tools-note").show()}else{$("#tools-clip").show();$("#tools-clip").attr("href","javascript:wwd.clipping.clip("+(this.getCurrentSlide()).id+")")}}},updateThumb:function(){if(this.slides.length<=1){$("#slideshow-slider").hide()}else{$("#slideshow-slider").show();var B=Math.round(726/this.total);var A=this.getCurrentSlide();var C=(this.getSlideIndex(A))*B;$("#slideshow-slider-thumb").css("left",C);$("#slideshow-slider-thumb").css("width",B)}},getCurrentSlideHash:function(){var A=this.getCurrentSlide();var B;if(this.type=="homepage"){B="slideshow/"+this.type+"/"+A.id}else{B="slideshow/"+this.type+"/"+this.id+"/"+A.id}return B},previousSlide:function(){wwd.logger.log("SlideShow.previousSlide()");if(this.showingAd){this.hideAd();this.current=this.total-1;this.showSlide(this.getCurrentSlide())}else{if(this.current==0){this.showAd();return }else{this.current--;wwd.history.setHash(this.getCurrentSlideHash())}}},nextSlide:function(){wwd.logger.log("SlideShow.nextSlide()");if(this.showingAd){this.hideAd();this.current=0;this.showSlide(this.getCurrentSlide())}else{if(this.current==this.total-1){this.showAd();return }else{this.current++;wwd.history.setHash(this.getCurrentSlideHash())}}},showAd:function(){this.showingAd=true;$("#"+slideShowImageContainer+" img").fadeOut(400).remove();$("#slideshow-ad").show();$("#slideshow-info").hide();$("#slideshow-image-info").hide();showHiddenAds("slideshow")},hideAd:function(){this.showingAd=false;$("#slideshow-ad").hide();$("#slideshow-info").show();$("#slideshow-image-info").show()},getSlideIndex:function(A){for(var B=0;B<this.slides.length;B++){if(this.slides[B].id==A.id){return B}}return -1},start:function(B,C,A){wwd.logger.log("Slideshow.start("+B+","+C+", "+A+")");wwd.stats.trackAction("slideshow",C);A=(A)?(A):(0);this.current=0;if(C&&C.length>0){if(B=="homepage"){wwd.history.setHash("slideshow/"+B+"/"+C)}else{wwd.history.setHash("slideshow/"+B+"/"+C+"/"+A)}}},startSingleSlideshow:function(A){wwd.logger.log("Slideshow.startSingleSlideshow("+A+")");this.currentSlideId=A;if(this.type!="image"){this.type="image";this.id=A;this.title="Image Search";this.show();SlideshowController.getSlideSlideshow(A,function(B){if(B.success){wwd.slideshow.setSlides(B.slides)}else{wwd.slideshow.loadError(B)}})}else{this.showSlide(this.getCurrentSlide())}},startHomepageSlideshow:function(A){wwd.logger.log("Slideshow.startHomepageSlideshow("+A+")");this.currentSlideId=A;if(this.type!="homepage"){this.type="homepage";this.id=A;this.title="Featured Images";this.show();SlideshowController.getHomepageFeaturedSlideshow(function(B){if(B.success){wwd.slideshow.setSlides(B.slides)}else{wwd.slideshow.loadError(B)}})}else{this.showSlide(this.getCurrentSlide())}},startLandingSlideshow:function(B,A){wwd.logger.log("Slideshow.startFeaturedImagesSlideshow("+B+","+A+")");this.currentSlideId=A;if(this.type!="landing"||this.id!=B){this.type="landing";this.id=B;this.title="Recent Images";this.show();SlideshowController.getFeaturedBySection(B,function(C){wwd.logger.log(C);if(C.success){wwd.slideshow.setSlides(C.slides)}else{wwd.slideshow.loadError(C)}})}else{this.showSlide(this.getCurrentSlide())}},startClippingSlideshow:function(A,C){wwd.logger.log("Slideshow.startClippingSlideshow("+A+","+C+")");A=(A)?(A):((wwd.clipping.getCurrentFolder()).id);this.currentSlideId=C;if(this.type!="clipFile"){this.type="clipFile";this.id=A;var B=(wwd.clipping.getCurrentFolder());this.title=B?B.name:"Clipping";this.show();SlideshowController.getClipFileSlideshow(A,function(D){wwd.logger.log(D);if(D.success){wwd.slideshow.setSlides(D.slides)}else{wwd.slideshow.loadError(D)}})}else{this.showSlide(this.getCurrentSlide())}},startArticleSlideshow:function(B,A){wwd.logger.log("Slideshow.startArticleSlideshow("+B+","+A+")");wwd.logger.log("  "+this.type+", "+this.id);this.currentSlideId=(A)?(A):("");if(this.type!="article"||this.id!=B){this.type="article";this.id=B;this.title="";this.show();SlideshowController.getArticleSlideshow(B,$("body form[name=summing] input[name=currentSection]").val(),function(C){wwd.logger.log(C);if(C.success){wwd.slideshow.setSlides(C.slides,C.title)}else{wwd.slideshow.loadError(C)}})}else{this.showSlide(this.getCurrentSlide())}},end:function(){this.hide()},show:function(){this.showing=true;$("#"+slideShowImageContainer+" img").remove();$("#slideshow-ad").hide();$("#slideshow").hide();$("#"+slideshowContainer).css("left","0px").css("opacity",0).show().height($("body").height()).fadeTo(500,1,function(){this.scrollTop=$("html,body").scrollTop();$("html,body").scrollTop(0);$("#"+outerContainer).hide();$("#slideshow").show()})},hide:function(){wwd.history.clearHash()},_hide:function(){this.showing=false;this.type=null;this.id=null;this.currentSlideId=null;$("#slideshow").hide();$("#"+outerContainer).show();$("#"+slideshowContainer).fadeOut();$("html,body").scrollTop(this.scrollTop)}};wwd.comments={sortOrder:"TimeStampDescending",DEFAULT_BATCH_SIZE:10,batchSize:10,page:1,comments:[],total:0,filterRecommended:false,visible:false,contentId:null,initialize:function(){wwd.logger.log("Comments.initialize()");if($("#comment-container").length==0){wwd.logger.log("Comment module not included, exiting");return }this.contentId=$("#content-id").text();this.contentId=(this.contentId)?(this.contentId):($("#content-id").val());this.contentId=(this.contentId)?(this.contentId):(guid);if(!this.contentId){wwd.logger.error("Content ID not found");return }this.reset();this.getComments();this.restrictCount($("#comment-form-container"),$("#comment-submit-textarea"),2000);$("#comment-report-username").html("Username <span>"+wwd.user.getName()+"</span>");$(".comment-count span").text("0")},restrictCount:function(A,C,B){$(C).keydown(function(){var D=this.value.length;var E=this.value;if(D>B){D=B;E=this.value.substr(0,B);this.value=E}$("#"+$(A).attr("id")+" .comment-counter").html((D+1)+"/"+B)})},reset:function(){this.visible=false;this.page=1;this.comments=[];try{$("#comment-hide-show").html("");$("#comment-submit-textarea").val("");$("#comment-report-textarea").val("");$(".comment-counter").text("");$("#comment-report-thanks").css("display","none");$("#comment-report-body").slideDown()}catch(A){wwd.logger.error("One or more Comment Elements not found")}this.hideCommentForm();this.hideReportForm()},getComments:function(A){wwd.logger.verbose("Comments.getComments("+A+")");wwd.logger.verbose("  content id: "+this.contentId);this.page=(A)?(A):(1);var B=new RequestBatch();B.AddToRequest(new CommentPage(new ArticleKey(this.contentId),this.batchSize,this.page,this.sortOrder));if(wwd.user.isLoggedIn()){B.AddToRequest(new UserKey(wwd.user.getName()))}B.BeginRequest(pluckServerUrl,function(C){wwd.comments.onGetComments(C)})},onGetComments:function(A){wwd.logger.verbose("Comments.onGetComments()");var D=A.Responses;wwd.logger.log(A);var B;if(!this.page||this.page==1){this.comments=[];this.total=0}for(var C=0;C<D.length;C++){B=D[C];if(B.CommentPage){this.setTotal(B.CommentPage.NumberOfComments);$.merge(this.comments,B.CommentPage.Comments)}}if(this.comments.length>=this.total){this.renderComments()}else{this.page++;this.getComments(this.page)}},addComment:function(){if(!this.visible){this.show()}this.showCommentForm()},showCommentForm:function(){this.hideReportForm();$("#comment-form-container").slideDown()},hideCommentForm:function(){$("#comment-form-container").slideUp();$("#error-comment-body").text("")},cancelComment:function(){this.reset()},submitComment:function(B){wwd.logger.log("Comments.submitComment()");if(B.comments.value.length<=0){$("#error-comment-body").html("You must make a comment");return }var A=function(D){D=D.replace(/\</g,"&lt;");D=D.replace(/\>/g,"&gt;");return D};var C=new RequestBatch();C.AddToRequest(new CommentAction(new ArticleKey(this.contentId),B.url.value,B.title.value,A(B.comments.value)));C.AddToRequest(new ArticleKey(this.contentId));C.AddToRequest(new UserKey(wwd.user.getName()));C.BeginRequest(pluckServerUrl,function(D){wwd.stats.trackAction("addcomment","true");wwd.comments.reset();wwd.comments.getComments()})},recommend:function(A){wwd.logger.log("recommend("+A+")");try{var D=this.comments[A].CommentKey.Key}catch(C){wwd.logger.error("Could not get comment ID");return }var B=new RequestBatch();B.AddToRequest(new RecommendAction(new CommentKey(D)));B.BeginRequest(pluckServerUrl,function(E){wwd.comments.onRecommendResult(E)})},onRecommendResult:function(A){wwd.logger.log("Comment.onRecommendResult()");wwd.logger.log(A);var B=A.Messages[0];if(B.Message=="ok"){this.getComments()}else{wwd.logger.error("Recommendation Failed: "+B)}},showReportForm:function(){$("#comment-report-container").slideDown()},hideReportForm:function(){$("#comment-report-container").slideUp();$("#error-abuse-body").text("")},reportAbuse:function(B){wwd.logger.log("reportAbuse("+B+")");this.hideCommentForm();var C=$("#comment-report-container");var A=C.clone();C.remove();var D=$("#comment-block-"+B);D.append(A);$("#abuse-comment-id").value=B;this.restrictCount($("#comment-report-container"),$("#comment-report-textarea"),700);this.showReportForm()},cancelReport:function(){this.reset()},submitReport:function(B){var D=B.abuseCommentId.value;wwd.logger.log("Comments.submitReport("+D+")");if(B.message.value.length<=0){$("#error-abuse-body").html("Please describe the violation");return }for(var A=0;A<this.comments.length;A++){if(A==D){D=this.comments[A].CommentKey.Key;break}}if(!D||D.length<=0){wwd.logger.error("Couldnt get Comment ID");return }var C=new RequestBatch();C.AddToRequest(new UserKey(wwd.user.getName()));C.AddToRequest(new ReportAbuseAction(new CommentKey(D),B.reason.value,B.message.value));C.BeginRequest(pluckServerUrl,function(E){wwd.comments.onSubmitReport(E)})},onSubmitReport:function(A){wwd.logger.log("Comments.onSubmitReport()");wwd.logger.log(A);$("#comment-report-thanks").css("display","block");$("#comment-report-body").slideUp()},setTotal:function(A){this.total=parseInt(A);if(A>0){$("#comment-label").html("<span>"+A+"</span>&nbsp;Comments")}$(".comment-count span").text(A)},renderComments:function(){wwd.logger.verbose("Comments.renderComments()");wwd.logger.verbose("  comments: "+this.comments.length);wwd.logger.verbose("  total: "+this.total);var I=$("<div>");var F,G;var A,J,L;var D,H,B;var M;$("#comment-body div").remove();if(wwd.user.isLoggedIn()){$("#comment-container").addClass("logged-in")}for(var C=0;C<this.comments.length;C++){F=this.comments[C];M=parseInt(F.NumberOfRecommendations);if(this.filterRecommended&&M<=0){continue}A=$("<div>");A.addClass("comment-block");A.attr("id","comment-block-"+C);var J=$("<div>");J.addClass("comment-data");D=$("<div>").html("Posted: "+F.PostedAtTime);D.addClass("comment-posted");H=$("<div>").html(F.CommentBody);H.addClass("comment-body");B=$("<div>").html("by <span>"+F.Author.DisplayName+"</span>");B.addClass("comment-author");J.append(D).append(H).append(B);A.append(J);G=C;var L,K;if(wwd.user.isLoggedIn()){J=$("<ul>").addClass("comment-tools");if(M>0){L=$("<li><span></span></li>");L.addClass("comment-recommended");L.html("Recommended by "+M+" User(s)");J.append(L)}if(F.Author.DisplayName!=wwd.user.getName()){wwd.logger.verbose(F.CurrentUserHasRecommended);if(F.CurrentUserHasReportedAbuse!="True"&&F.CurrentUserHasRecommended!="True"){var L=$("<li></li>");var K=$("<a></a>");K.attr("id","comment-"+C);K.attr("href","javascript:void(0);");K.addClass("comment-report");K.html("Report Abuse");K.click(function(){var N=$(this).attr("id");N=N.substr(N.indexOf("-")+1);wwd.comments.reportAbuse(N)});L.append(K);J.append(L);L=$("<li></li>");K=$("<a></a>");K.attr("id","comment-"+C);K.attr("href","javascript:void(0);");K.addClass("comment-recommend").html("Recommend It");K.click(function(){var N=$(this).attr("id");N=N.substr(N.indexOf("-")+1);wwd.comments.recommend(N)});L.append(K);J.append(L)}else{if(F.CurrentUserHasRecommended=="True"){J.append($("<li></li>").append($("<span></span>").addClass("comment-recommend").html("RECOMMENDED")))}}}A.append(J)}var E=$("<div>");E.css("clear","both");A.append(E);$("#comment-body").append(A)}$(".comment-byline span").html(wwd.user.getName());$("#comment-header").css("display","block");if(this.total>0){$("#comment-hide-show").html("(Show)")}},sort:function(A){if(A=="asc"){this.sortOrder="TimeStampAscending"}else{this.sortOrder="TimeStampDescending"}this.reset();this.getComments()},toggleRecommended:function(){var A=$("#comment-show-recommended");this.filterRecommended=!this.filterRecommended;wwd.logger.log("Filter: "+((this.filterRecommended)?("on"):("off")));if(this.filterRecommended){A.css("background-position","0px -16px")}else{A.css("background-position","0px 0px")}this.renderComments()},show:function(){this.visible=true;$("#comment-hide-show").html("(Hide)");$("#comment-content").slideDown()},hide:function(){this.visible=false;this.reset();$("#comment-hide-show").html("(Show)");$("#comment-content").slideUp()},toggleShowHide:function(){return(this.visible)?(this.hide()):(this.show())}};wwd.components={initialize:function(){wwd.dropdown.initialize();stripe("index-table","#fff","#efefef")}};wwd.dropdown={maxViewable:10,initialize:function(){$(".drop-down").each(function(B){$(this).prepend($("<input>").val("").addClass("drop-down-value").css("display","none"));var A=$("#"+this.id+" li").length;A=Math.min(A,10);var C=$(this).css("width");if(C.indexOf("px")){C=parseInt(C.substr(0,C.indexOf("px")))}C=($(this).width()>C)?($(this).width()):(C);if(C>0){$(this).find(".drop-down-box").width(C)}if(A>=10){$("#"+this.id+" .drop-down-box").height((20*A)+5)}$("#"+this.id+" .drop-down-box").css("overflow-y","auto");var B=this;$("#"+this.id+" .drop-down-title").mousedown(function(){wwd.dropdown.mousedown(B)});$(this).mouseout(function(){wwd.dropdown.mouseout(B)});$(this).mouseover(function(){wwd.dropdown.mouseover(B)})})},mousedown:function(A){if(this.closing&&this.closing!=A){clearTimeout(this.timerId);this.close()}$("#"+A.id+" .drop-down-box").toggle()},mouseout:function(A){if(this.closing&&this.closing!=A){$("#"+this.closing.id+" .drop-down-box").hide()}this.closing=A;this.timerId=setTimeout("wwd.dropdown.close()",800)},mouseover:function(A){if(this.closing==A){clearTimeout(this.timerId)}},close:function(){$("#"+this.closing.id+" .drop-down-box").hide()}};function Paginator(B,C,D,E,A){this.range=4;this.containerClass="pagination";this.pageClass="";this.currentClass="current";if(E){this.containerClass+=" "+E}if(A){this.currentClass+=" "+A}this.parent=(typeof (B)=="string")?($("#"+B)):$(B);if(!this.parent){wwd.logger.error("parent cannot be null")}this.container=$("<div></div>");this.container.addClass(this.containerClass);this.parent.append(this.container);this.setCount(C);D=(D)?(D):(1);this.setCurrent(D);this.update()}Paginator.prototype=new EventBroadcaster();Paginator.prototype.setCount=function(A){this.count=A;this.current=Math.min(this.current,this.count);this.update()};Paginator.prototype.setCurrent=function(A){this.current=Math.min(A,this.count);this.update()};Paginator.prototype.update=function(){this.container.empty();this.list=$("<ul></ul>");this.container.append(this.list);if(this.count<=1){return }var D,A;D=this.current-2;if(D>this.count-this.range){D=this.count-this.range}D=Math.max(1,D);var E=this.range-(this.current-D);A=this.current+E;A=Math.min(this.count,A);if(this.current>1){this.container.prepend(this.createAnchorItem("<< prev",this.current-1))}if(D>1){this.list.append(this.createListItem("1",1,this.pageClass))}if(D>2){this.list.append(this.createListItem("..."))}var B;for(var C=D;C<=A;C++){B=(C==this.current)?(this.currentClass+" "+this.pageClass):(this.pageClass);this.list.append(this.createListItem(C,C,B))}if(A<this.count-1){this.list.append(this.createListItem("..."))}if(this.current<this.count&&A!=this.count){this.list.append(this.createListItem(this.count,this.count,this.pageClass))}if(this.current<this.count){this.container.append(this.createAnchorItem("next >>",this.current+1))}};Paginator.prototype.createListItem=function(C,D,B){var A=$("<li></li>");A.append(this.createAnchorItem(C,D,B));A.addClass(B);return A};Paginator.prototype.createAnchorItem=function(D,E,B){var C=$("<a></a>");var A=this;if(E){C.attr("id","page-"+E);C.attr("href","javascript:void(0);");C.click(function(F){var G=this.id;G=G.substr(G.indexOf("page-")+5);A.dispatchEvent("page-request",G,A)})}C.text(D);return C};function Dialog(D,C,B,A){this.modal=(A==undefined||model==true)?(true):(false);this.buttons=C;this.message=D;this.content=(B)?(B):($("<div></div>"));this.container="";this.create()}Dialog.prototype=new EventBroadcaster();Dialog.prototype.create=function(){this.container=$("<div></div>");this.container.addClass("dialog-container");if(this.modal){var F=$("<div></div>").addClass("dialog-modal").css("opacity",0.75).width($("body").width()).height($("body").height()).click(function(G){G.cancelBubble=true});this.container.append(F)}var D=$("<div></div>");D.addClass("dialog");D.append($("<div></div>").append($("<p class='message'></p>").text(this.message)));D.append(this.content);var C;var E=$("<div></div>").addClass("dialog-buttons");for(var B=0;B<this.buttons.length;B++){var A=this;C=$("<div></div>").addClass("dialog-button").text(this.buttons[B]);C.click(function(G){A.dispatchEvent("click",$(this).text(),A)});E.append(C)}D.append(E);if($(E).find(".dialog-buttons").length==1){$(E).find(".dialog-button").css({margin:"0px auto","float":"none"})}this.container.append(D);$("body").append(this.container);this.move($("body").width()/2-(D.width()/2),($("html").scrollTop()+$(window).height()/3))};Dialog.prototype.setMessage=function(A,B){this.container.find(".message").text(A);if(B){this.container.find(".message").addClass(B)}};Dialog.prototype.close=function(){this.removeAllListeners("click");this.container.remove()};Dialog.prototype.move=function(A,B){if(parseInt(A)>0){this.container.find(".dialog").css("left",A)}if(parseInt(B)>0){this.container.find(".dialog").css("top",B)}};function GraphicalInput(A,C,B){this.obj=$(A);this.id=A.id;this.parent=$(A).parent();this.type=$(A).attr("type");this.name=$(A).attr("name");this.value=$(A).val();this.checked=$(A).attr("checked")?"true":"false";this.chkvalue=(C==undefined?"true":C);this.unchkvalue=(B==undefined?"false":B);this.className=$(A).attr("checked")?"checked":" ";this.imgInput="<input type='image' src='/images/misc/transparent.gif' value='"+this.checked+"'  id='"+this.id+"' class='"+this.className+"' />";this.hiddenVal=this.checked=="true"?this.chkvalue:this.unchkvalue;this.hiddenInput="<input type='hidden' value='"+this.hiddenVal+"' name='"+this.name+"' />";if(this.type=="checkbox"){this.subCheckbox()}else{this.subRadio()}}GraphicalInput.prototype.toggleChk=function(){if(this.obj.val()=="true"){this.obj.val("false");this.obj.next().val(this.unchkvalue);this.obj.removeClass("checked")}else{this.obj.val("true");this.obj.next().val(this.chkvalue);this.obj.addClass("checked")}};GraphicalInput.prototype.attachToggle=function(){var A=this;this.obj.toggle(function(){wwd.logger.log("click");A.toggleChk()},function(){wwd.logger.log("unclick");A.toggleChk()})};GraphicalInput.prototype.subCheckbox=function(){this.obj.after(this.hiddenInput);this.obj.replaceWith(this.imgInput);this.obj=$(this.parent).find(":image:first");this.attachToggle()};GraphicalInput.prototype.subRadio=function(){if(this.value==this.chkvalue){this.parent.after(this.hiddenInput);var A=this.parent.parent();this.parent.replaceWith(this.imgInput);this.parent=A;this.parent.find("label").attr("for",this.id);this.obj=$(this.parent).find(":image:first");this.attachToggle()}else{this.parent.replaceWith()}};function showbox(){$(document).ready(function(){$("#more-fairchild").show();this.timerId=setTimeout("hidebox()",5000)})}function hidebox(){$(document).ready(function(){$("#more-fairchild").hide()})}function showissues(){clearTimeout(this.timerId);$(document).ready(function(){$("#past-issues-container").show()});this.timerId=setTimeout("hideissues()",2000)}function mouseoutissues(){this.timerId=setTimeout("hideissues()",1500)}function mouseoverissues(){clearTimeout(this.timerId)}function hideissues(){$("#past-issues-container").hide()}function hasClass(B){var A=false;if(B.getAttributeNode("class")!=null){A=B.getAttributeNode("class").value}return A}function stripe(C){var F=false;var B=arguments[1]?arguments[1]:"#fff";var A=arguments[2]?arguments[2]:"#eee";var K=document.getElementById(C);if(!K){return }var L=K.getElementsByTagName("tbody");for(var I=0;I<L.length;I++){var J=L[I].getElementsByTagName("tr");for(var H=0;H<J.length;H++){if(!hasClass(J[H])&&!J[H].style.backgroundColor){var G=J[H].getElementsByTagName("td");for(var E=0;E<G.length;E++){var D=G[E];if(!hasClass(D)&&!D.style.backgroundColor){D.style.backgroundColor=F?B:A}}}F=!F}}}var quizpolls={u:"UNLIMITED",o:"ONCE",d:"DAILY",w:"WEEKLY",m:"MONTHLY",id:null,groupname:null,limit:null,date:null,formname:null,formdiv:null,haschoiceimg:false,init:function(K,E,M,O,I,A){quizpolls.id=K;quizpolls.groupname=E;quizpolls.limit=M;quizpolls.date=O;quizpolls.formname=I;quizpolls.formdiv=A;if(quizpolls.haschoiceimg){$(".quizpoll-rightrail div.pollimgbtn").hover(function(){$(this).attr("class","pollimgbtn on")},function(){$(this).attr("class","pollimgbtn off")})}else{if($(".quizpoll-radio")){$(".quizpoll-radio li").hover(function(){$(this).attr("class","on")},function(){$(this).attr("class","off")})}if($(".quizpoll-select")){var B="";$(".quizpoll-select li").hover(function(){B=$(this).attr("class");$(this).attr("class",B+" on")},function(){$(this).attr("class",B+" off")})}}var R=quizpolls.getcookie("quizPoll");var N=new Date(O);if(R){var F=R.split("|");for(var L=0;L<F.length;L++){str=F[L];poll=str.split("=");pollid=poll[0];if(pollid==K){pollstrdate=poll[1];pollstrarr=pollstrdate.split("/");polldate=new Date();polldate.setFullYear(pollstrarr[2],(pollstrarr[0]-1),pollstrarr[1]);var Q=true;switch(M){case quizpolls.u:Q=false;break;case quizpolls.o:Q=true;break;case quizpolls.d:var D=new Date(polldate.getTime()+1*24*60*60*1000);if(N>D){Q=false}break;case quizpolls.w:var H=new Date(polldate.getTime()+7*24*60*60*1000);if(N>H){Q=false}break;case quizpolls.m:var P=new Date(polldate.getTime()+30*24*60*60*1000);if(N>P){Q=false}break}if(Q){var G=$("#"+quizpolls.formname);var J=$("#"+quizpolls.formdiv);var C=G.attr("action");J.load(C+"inline/results/")}}}}$("#pollLoader").hide()},getcookie:function(C){var B=document.cookie;var E=C+"=";var D=B.indexOf("; "+E);if(D==-1){D=B.indexOf(E);if(D!=0){return null}}else{D+=2}var A=document.cookie.indexOf(";",D);if(A==-1){A=B.length}return unescape(B.substring(D+E.length,A))},validate:function(G){var F=true;var A=$(G);var H="";var D=Form.getElements(A);var C=new Array();var B=-1;for(var E=0;E<D.length;E++){if(D[E].hasClassName("isRequired")){if(H!=D[E].name){B++}H=D[E].name;if(D[E].type=="radio"||D[E].type=="checkbox"){if(D[E].checked){C[B]=true}else{if(!C[B]){C[B]=false}}}}}for(var E=0;E<C.length;E++){if(!C[E]){F=false}}if(!F){}return F},setradioval:function(B,A){$("#"+B).attr("value",A);quizpolls.submitform()},setchoiceimg:function(){quizpolls.haschoiceimg=true},submitform:function(){try{$("#pollLoader").show();var D=$("#"+quizpolls.formname);var C=$("#"+quizpolls.formdiv);var B=D.attr("action");var A={complete:function(){C.load(B+"inline/results/",{complete:function(){$("#pollLoader").hide()}})}};D.ajaxSubmit(A)}catch(E){}}};function EventList(A){var A=A;var E=2000;var F=20;var D="/";var B="images/event.gif";var C="/js/event.js";this.eventList=new Array();this.addEvent=function(G){this.eventList.push(G)};this.setBaseUrl=function(G){this.baseUrl=G};this.setImageUrl=function(G){this.imageUrl=G};this.setJsUrl=function(G){this.jsUrl=G};this.writeImageTags=function(){this.clearOldTags();this.writeTags(B,this.writeIndividualImageTag)};this.writeJavaScriptTags=function(){this.clearOldTags();this.writeTags(C,this.writeIndividualJavaScriptTag)};this.clearOldTags=function(){var G=$("#"+A);while(G.firstChild){G.removeChild(G.firstChild)}};this.writeTags=function(I,K){if(this.eventList.length==0){return }var G=this.baseUrl+I+"?"+this.eventList[0].getQueryString("e0_");for(var H=1;H<this.eventList.length;++H){var J=this.eventList[H].getQueryString("e"+H+"_");tmpFullUrl=G+J;if(tmpFullUrl.length+F<E){G=tmpFullUrl}else{K(G);G=this.baseUrl+I+"?"+J}}K(G)};this.writeIndividualImageTag=function(G){if(G.length+F>E){throw ("URL for event is longer than max URL length of "+E)}G=G+"rnd="+Math.random()*10000000000000000;var H=document.createElement("img");H.src=G;$("#"+A).append(H)};this.writeIndividualJavaScriptTag=function(G){if(G.length+F>E){throw ("URL for event is longer than max URL length of "+E)}G=G+"rnd="+Math.random()*10000000000000000;var H=document.createElement("script");H.type="text/javascript";H.src=G;$("#"+A).append(H)}}function EventObject(A,B,C){this.properties=new Object();this.properties.sc=A;this.properties.ec=B;this.properties.id=C;this.setProperty=function(D,E){this.properties[D]=E};this.getProperty=function(D){return this.properties[D]};this.setEnvironment=function(D){this.setProperty("env",D)};this.setActionCode=function(D){this.setProperty("ac",D)};this.setContentType=function(D){this.setProperty("ct",D)};this.setFullUrl=function(D){this.setProperty("url",D)};this.setContentTitle=function(D){this.setProperty("tit",D)};this.setLocation=function(D){this.setProperty("loc",D)};this.setSearchResultCount=function(D){this.setProperty("rc",D)};this.setAssetId=function(D){this.setProperty("asid",D)};this.setApplicationId=function(D){this.setProperty("apid",D)};this.getQueryString=function(D){var F="";for(var E in this.properties){F+=D+E+"="+encodeURIComponent(this.getProperty(E))+"&"}return F}}function fireEventTracker(G,F,C,I,D,H,E){var A=new EventList("eventListHolder");var B=new EventObject("WWD",G,C);B.setEnvironment(F);B.setContentType(I);B.setFullUrl(D);B.setContentTitle(H);A.addEvent(B);A.setBaseUrl(E);A.writeJavaScriptTags()}var emailafriend={REQUIRED_ERROR:"(Cannot be empty)",INVALID_ERROR:"(Must be valid)",ILLEGAL_ERROR:"(Please remove HTML from message)",MAXCHARS_ERROR:"(You have exceeded the character limit)",MESSAGE_MAXCHARS_LIMIT:2000,NAME_MAXCHARS_LIMIT:50,MAXEMAILS_LIMIT:20,MAXEMAILS_ERROR:"(You have exceeded the email limit)",EVENT_CODE:"most_emailed",ENVIRONMENT:null,CONTENT_ID:null,CONTENT_TYPE:null,CONTENT_URL:null,CONTENT_TITLE:null,EVENT_URL:null,isvalid:true,init:function(){$("#sendtofriend-form").bind("submit",function(){emailafriend.submit();return false});this.getValues()},getValues:function(){this.ENVIRONMENT=$("#articleEnvironment").val();this.EVENT_URL=$("#articleEventURL").val();this.CONTENT_TITLE=$("#articleContentTitle").val();this.CONTENT_URL=$("#articleContentUrl").val();this.CONTENT_TYPE=$("#articleContenType").val();this.CONTENT_ID=$("#articleContentId").val()},charcounter:function(){if($("#your-message").val().length>this.MESSAGE_MAXCHARS_LIMIT){$("#your-message").attr("class","alert");$("#your-message-alert").html(this.MAXCHARS_ERROR);$("#your-message-alert").show()}else{$("#your-message").attr("class","");$("#your-message-alert").hide()}var A=$("#your-message").val().length;$("#your-message-count").html("("+A+"/"+this.MESSAGE_MAXCHARS_LIMIT+")")},validate:function(){var D=/(\w+@[a-zA-Z_-]+?\.[a-zA-Z]{2,6})/;var A=/(<([^>]+)>)/ig;var C=$("#your-name").val();var E=$("#your-email").val();var B=$("#your-friends-email").val();var F=$("#your-message").val();if(C==""||C==null){this.isvalid=false;$("#your-name").attr("class","alert");$("#your-name-alert").html(this.REQUIRED_ERROR);$("#your-name-alert").show()}else{if(C.length>this.NAME_MAXCHARS_LIMIT){$("#your-name").attr("class","alert");$("#your-name-alert").html(this.MAXCHARS_ERROR);$("#your-name-alert").show()}else{$("#your-name").attr("class","");$("#your-name-alert").hide()}}if(E==""||E==null){this.isvalid=false;$("#your-email").attr("class","alert");$("#your-email-alert").html(this.REQUIRED_ERROR);$("#your-email-alert").show()}else{if(!D.test(E)){this.isvalid=false;$("#your-email").attr("class","alert");$("#your-email-alert").html(this.INVALID_ERROR);$("#your-email-alert").show()}else{$("#your-email").attr("class","");$("#your-email-alert").hide()}}if(B==""||B==null){this.isvalid=false;$("#your-friends-email").attr("class","alert");$("#your-friends-email-alert").html(this.REQUIRED_ERROR);$("#your-friends-email-alert").show()}else{if(!D.test(B)){this.isvalid=false;$("#your-friends-email").attr("class","alert");$("#your-friends-email-alert").html(this.INVALID_ERROR);$("#your-friends-email-alert").show()}else{$("#your-friends-email").attr("class","");$("#your-friends-email-alert").hide()}}if(this.isvalid){return true}else{return false}},submit:function(){try{if(this.validate()){var A={complete:function(){$("#sendtofriend").hide();fireEventTracker(emailafriend.EVENT_CODE,emailafriend.ENVIRONMENT,emailafriend.CONTENT_ID,emailafriend.CONTENT_TYPE,emailafriend.CONTENT_URL,emailafriend.CONTENT_TITLE,emailafriend.EVENT_URL)},success:function(){$("#success").show();wwd.stats.trackAction("emailaction","sendtofriend")},error:function(){$("#failure").show()}};$("#sendtofriend-form").ajaxSubmit(A)}}catch(B){$("#sendtofriend").hide();$("#failure").show()}return false}};wwd.stats={baseUrl:"http://www.wwd.com/js/stats/zig.js",initialize:function(){wwd.events.broadcaster.addListener("page",wwd.stats.onPage);this.call()},call:function(F){if(!vs||!vs.sensorPath){wwd.logger.error("Error: Stat Tracking is not properly initialized")}var D=self.location.search;var C;if(D.length){var E=D.split("&");for(var B in E){if(E[B].indexOf("module=")>=0){C=E[B];C=C.substr(C.indexOf("module=")+(("module=").length))}}}var A=(F!=null&&F.statusCode)?F.statusCode:"200";vs.setStandardProperty("URL",document.location.href);vs.setCustomProperty("statusCode",A);vs.setCustomProperty("module",C);vs.setCustomProperty("User",wwd.user.getSubscriptionLevel());if(wwd.user.isLoggedIn()){vs.setCustomProperty("username",wwd.user.getUserHash())}vs.StatCall()},onPage:function(){wwd.logger.log("Stats.onPage()")},trackPage:function(){},trackAction:function(B,A){vs.setCustomProperty("statusCode","200");vs.setCustomProperty(B,A);vs.setCustomProperty("User",wwd.user.getSubscriptionLevel());vs.setCustomProperty("module","");vs.StatCall()}};wwd.video={href:"/video/",name:"video",parameters:"height=650,width=988",start:function(A){window.open(this.href+"?vid="+A,this.name,this.parameters).focus()}};var sizeText=new (function(){var A=this;var B=[];A.init=function(E,H,F){var D=document.getElementById(E);if(D!=undefined){var I=D.getElementsByTagName(F);for(var G=0;G<I.length;G++){if(I[G].className.match(H)){var C=I[G];var M=C.style.fontSize;var J=100;if(M!=""){var L=M.replace(/([0-9.]+)/,"$1");var K=M.slice(-1);J=parseInt(K=="m"?L*100:K=="%"?L:L*10)}B.push({domObj:C,initialTextSize:J,currentTextSize:J})}}}};A.change=function(C){for(var E=0;E<B.length;E++){var G=B[E];var D=G.currentTextSize.toString();var F=D.indexOf("%")>-1?D.substring(0,D.indexOf("%")):D;G.domObj.style.fontSize=G.currentTextSize=C==0?G.initialTextSize+"%":parseInt(F)+C+"%"}}})();wwd.content={paginationContainer:"ajax-anchors",responseContainer:"ajax-wrapper",initialize:function(){wwd.events.addListener("hashChanged",function(A){wwd.content.onHashChange(A)});wwd.events.addListener("pageLoad",function(A){wwd.content.updateLinks();wwd.content.eventtracking()});if((wwd.history.getHash()).length>0){this.onHashChange(wwd.history.getHash())}this.updateLinks()},eventtracking:function(){var F="most_viewed";var E=$("#articleEnvironment").val();var D=$("#articleEventURL").val();var B=$("#articleContentTitle").val();var A=$("#articleContentUrl").val();var C=$("#articleContenType").val();var G=$("#articleContentId").val();if($("#articleEnvironment")){fireEventTracker(F,E,G,C,A,B,D)}},updateLinks:function(){var A=this;var B=$("."+this.paginationContainer+" a");B.each(function(D){var C=$(this).attr("href");if(C.indexOf("javascript")==-1){$(this).click(function(){A.paginate($(this).attr("href"));return false})}})},paginate:function(A){wwd.logger.log("Content.paginate("+A+")");if(A&&A.length>0){wwd.history.setHash("article"+A)}},onHashChange:function(A){var B="article";startHash=B.length;if(A!=null&&A.indexOf(B)==0){this.doPage(A.substring(startHash),this.responseContainer)}},doPage:function(E,C){var F=this;var B=E.indexOf("?")>-1?"&":"?";if(E.indexOf("#")>-1){var G=E.split("#");E=G[0];var D="#"+G[1]}C=(C)?(C):(this.responseContainer);$("#ajax-wrapper-hide").css({display:"none"});$("body").append($("<div>").attr("id","load-cover").css("display","none"));$("#load-cover").css($("#content").offset());$("#load-cover").css({opacity:".8",filter:"alpha(opacity=88)","-moz-opacity":".88",position:"absolute","z-index":"100","background-color":"#ffffff"});$("#load-cover").width($("#content").width());$("#load-cover").height($("#content").height());var A=$("<p>loading <blink>...</blink></p>");A.css({margin:"40px","font-size":"2em",color:"#000000"});$("#load-cover").html(A);$("#load-cover").css("display","block");$.ajax({url:E+B+"decorator=zero&confirm=true",success:function(H){var J=$(H);$("#"+F.responseContainer).html(J.find("#render-wrapper"));$("#landing-ad").removeClass("ad-section-landing");$("#ajax-wrapper-xrail").html(J.find("#render-wrapper-xrail"));$("#quizPoll").html(J.find("#render-wrapper-quizpoll"));$("#content-container").css({background:"url(/images/backgrounds/content-container-article.gif) top left repeat-y"});var I=Math.max(0,$(D?D:"#content").offset().top);$("html,body").animate({scrollTop:I},1000);$("#load-cover").remove();wwd.events.dispatchEvent("pageLoad")}})}};$(document).ready(function(){sizeText.init("content","size-text","div");wwd.jsHover()});function getSearchCookieValue(A){userPrefCookieObj.searchResultValue=userPrefCookieObj.getCookieNameValuePair(A)}function setSearchCookieValue(B,A){userPrefCookieObj.searchResultValue=A;userPrefCookieObj.setCookieString(B,A)}function generateCookieInfo(B,A){getSearchCookieValue("time=");setSearchCookieValue("time=",A);location.href=B+A}function generateImageCookieInfo(B,A){getSearchCookieValue("photoType=");setSearchCookieValue("photoType=",A);location.href=B+A}function generateYearSpanCookieInfo(A){if(A==null){this.urlString="/search/results?"}else{this.urlString=A}setSearchCookieValue("time=","YEAR_SPAN");this.valueString=userPrefCookieObj.searchResultValue;getSearchCookieValue("startYear=");this.startYearString=document.getElementById("start-year-title-text").innerHTML;setSearchCookieValue("startYear=",this.startYearString);getSearchCookieValue("endYear=");this.endYearString=document.getElementById("end-year-title-text").innerHTML;setSearchCookieValue("endYear=",this.endYearString);this.resultQuery=urlQueryString;this.pageString="1";this.urlString=this.urlString+"query="+this.resultQuery+"&page="+this.pageString+"&startYear="+this.startYearString+"&endYear="+this.endYearString+"&time="+this.valueString;location.href=this.urlString}function generateSearchCookieInfo(A){if(A==null){this.urlString="/search/results?"}else{this.urlString=A}getSearchCookieValue("time=");this.valueString=userPrefCookieObj.searchResultValue;if(this.valueString==null){setSearchCookieValue("time=","THIS_YEAR");this.valueString="THIS_YEAR"}getSearchCookieValue("startYear=");this.startYearString=userPrefCookieObj.searchResultValue;if(this.startYearString==null){setSearchCookieValue("startYear=","2008");this.startYearString="2008"}getSearchCookieValue("endYear=");this.endYearString=userPrefCookieObj.searchResultValue;if(this.endYearString==null){setSearchCookieValue("endYear=","2008");this.endYearString="2008"}if(A!=null){getSearchCookieValue("photoType=");this.photoTypeString=userPrefCookieObj.searchResultValue;if(this.photoTypeString==null){setSearchCookieValue("photoType=","");this.photoTypeString=""}}if(A!=null){this.resultQuery=document.getElementById("imageSearchTextValue").value}else{this.resultQuery=document.getElementById("searchTextValue").value}this.pageString="1";if(A!=null){this.urlString=this.urlString+"query="+this.resultQuery+"&page="+this.pageString+"&startYear="+this.startYearString+"&endYear="+this.endYearString+"&time="+this.valueString+"&photoType="+this.photoTypeString}else{this.urlString=this.urlString+"query="+this.resultQuery+"&page="+this.pageString+"&startYear="+this.startYearString+"&endYear="+this.endYearString+"&time="+this.valueString}location.href=this.urlString}function changeYearText(C,A,B){document.getElementById(A).innerHTML=C;document.getElementById(B).style.display="none"};

if ( typeof(wwd)=="undefined" ) { wwd = {}; }

wwd.news =
{
    panels:[],
    current:0,
    total:0,
    panelWidth:0,

    initialize:function()
    {
		// check that the markup exists
		if ( $("#news").length <= 0 ) {
			return;
		}

        this.panels = $("#panel-container .panel-wrapper");
        this.total = this.panels.length;

        this.panelWidth = $(this.panels[0]).width();
        $("#panel-container").width(this.panelWidth * this.panels.length);
        $("#panel-container").css("left", -1*$("#panel-container").width());
		/**
		 * set up the panel back button
		 */
		$("#panel-back").css("opacity",.4);
		$("#panel-back").hover( function() { $(this).css("opacity",.80); },
									function() { $(this).css("opacity",.40); } );
		$("#panel-back").click( function() {wwd.news.previousPanel(); } );

		/**
		 * set up the panel next button
		 */
		$("#panel-next").css("opacity",.4);
		$("#panel-next").hover( function() { $(this).css("opacity",.80); },
									function() { $(this).css("opacity",.40); } );
		$("#panel-next").click( function() {wwd.news.nextPanel(); } );

        this.showPanel();
    },

    showPanel:function()
    {
        $("#panel-container").animate({
            left:0-(this.panelWidth*this.current) + "px"
        }, 1200);

		this.updateThumb();
    },

    updateThumb:function()
    {
		if ( this.panels.length <= 1 ) {
			$("#panel-slider").hide();
		}
		else {
			$("#panel-slider").show();
			var width = Math.round( this.panelWidth / this.total );
			var pos = this.current * width;
			$("#panel-slider-thumb").css( {
                "left": pos,
			    "width": width
            } );
		}
    },

    previousPanel:function()
    {
		wwd.logger.log("News.previousPanel()");
		this.current--;
		if ( this.current < 0 ) {
			this.current = 0;
		}
		this.showPanel();
    },

    nextPanel:function()
    {
		wwd.logger.log("News.nextPanel()");
		this.current++;
		if ( this.current > this.total - 1 ) {
			this.current = this.total -1;
		}
		this.showPanel();
    },

    getPanelIndex:function( panel )
    {
		for ( var i=0;i<this.panels.length;i++ ) {
			if ( this.panels[i].id == panel.id ) {
				return i;
			}
		}
		return -1;
    }
}

function ScrollPanels( panels, interval ){

    this.windowWidth = $("#" + panels + " .panel-window").width();
    this.panelContainer = $("#" + panels + " .panel-window .panels");
    this.numPanels = this.panelContainer.children().length;

    var thisptr = this;
    $("#" + panels + " .next").click(function(){
        thisptr.move("next");
        return false;
    });
    $("#" + panels + " .previous").click(function(){
        thisptr.move("previous");
        return false;
    });

    this.interval = interval ? interval : 3000;
    this.timer = new Timer();
    this.start();
}

ScrollPanels.prototype.start = function( direction ) {
    this.timer.setInterval(this, "scroll", this.interval);
}
ScrollPanels.prototype.scroll = function( direction ) {

    if( direction == "next" || direction == null){
        var lastPanel = $(this.panelContainer.children()[this.numPanels - 1]);
        lastPanel.remove();
        this.panelContainer.css( "left","-" + this.windowWidth + "px");
        this.panelContainer.prepend(lastPanel);
    } else {
        var lastPanel = $(this.panelContainer.children()[0]);
        lastPanel.remove();
        this.panelContainer.css( "left", this.windowWidth + "px");
        this.panelContainer.append(lastPanel);
    }
    this.panelContainer.animate(
        {
            "left": 0
        }
    );
}

ScrollPanels.prototype.move = function( direction ) {
    this.timer.kill();
    this.scroll( direction );
    this.timer.setTimeout(this, "start", 7000);
}

$(document).ready(
    function() {
        wwd.news.initialize();
        var ticker = new ScrollPanels("ticker-container", 3000);
    }
);
