(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)}})})();
(function(){var ua=navigator.userAgent.toLowerCase(),S={version:"3.0rc1",adapter:null,cache:[],client:{isIE:ua.indexOf("msie")>-1,isIE6:ua.indexOf("msie 6")>-1,isIE7:ua.indexOf("msie 7")>-1,isGecko:ua.indexOf("gecko")>-1&&ua.indexOf("safari")==-1,isWebkit:ua.indexOf("applewebkit/")>-1,isWindows:ua.indexOf("windows")>-1||ua.indexOf("win32")>-1,isMac:ua.indexOf("macintosh")>-1||ua.indexOf("mac os x")>-1,isLinux:ua.indexOf("linux")>-1},content:null,current:-1,dimensions:null,gallery:[],expando:"shadowboxCacheKey",libraries:{Prototype:"prototype",jQuery:"jquery",MooTools:"mootools",YAHOO:"yui",dojo:"dojo",Ext:"ext"},options:{adapter:null,animate:true,animateFade:true,autoplayMovies:true,continuous:false,ease:function(x){return 1+Math.pow(x-1,3)},enableKeys:true,errors:{fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}},ext:{img:["png","jpg","jpeg","gif","bmp"],swf:["swf"],flv:["flv","m4v"],qt:["dv","mov","moov","movie","mp4"],wmp:["asf","wm","wmv"],qtwmp:["avi","mpg","mpeg"]},flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",language:"en",onChange:null,onClose:null,onFinish:null,onOpen:null,players:["img"],showMovieControls:true,skipSetup:false,slideshowDelay:0,useSizzle:true,viewportPadding:20},path:"",plugins:null,ready:false,regex:{domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/},applyOptions:function(opts){if(opts){default_options=apply({},S.options);apply(S.options,opts)}},revertOptions:function(){apply(S.options,default_options)},change:function(index){if(!S.gallery){return}if(!S.gallery[index]){if(!S.options.continuous){return}else{index=index<0?S.gallery.length-1:0}}S.current=index;if(typeof slide_timer=="number"){clearTimeout(slide_timer);slide_timer=null;slide_delay=slide_start=0}if(S.options.onChange){S.options.onChange()}loadContent()},close:function(){if(!active){return}active=false;listenKeys(false);if(S.content){S.content.remove();S.content=null}if(typeof slide_timer=="number"){clearTimeout(slide_timer)}slide_timer=null;slide_delay=0;if(S.options.onClose){S.options.onClose()}S.skin.onClose();S.revertOptions()},contentId:function(){return content_id},error:function(msg){if(!S.debug){return}if(typeof window.console!="undefined"&&typeof console.log=="function"){console.log(msg)}else{alert(msg)}},getCurrent:function(){return S.current>-1?S.gallery[S.current]:null},hasNext:function(){return S.gallery.length>1&&(S.current!=S.gallery.length-1||S.options.continuous)},init:function(opts){if(initialized){return}initialized=true;opts=opts||{};init_options=opts;if(opts){apply(S.options,opts)}for(var e in S.options.ext){S.regex[e]=new RegExp(".("+S.options.ext[e].join("|")+")s*$","i")}if(!S.path){var pathre=/(.+\/)shadowbox\.js/i,path;each(document.getElementsByTagName("script"),function(s){path=pathre.exec(s.src);if(path){S.path=path[1];return false}})}if(S.options.adapter){S.adapter=S.options.adapter.toLowerCase()}else{for(var lib in S.libraries){if(typeof window[lib]!="undefined"){S.adapter=S.libraries[lib];break}}if(!S.adapter){S.adapter="base"}}if(S.options.useSizzle&&!window.Sizzle){if(window.jQuery){window.Sizzle=jQuery.find}else{U.include(S.path+"libraries/sizzle/sizzle.js")}}if(!S.lang){U.include(S.path+"languages/shadowbox-"+S.options.language+".js")}each(S.options.players,function(p){if((p=="swf"||p=="flv")&&!window.swfobject){U.include(S.path+"libraries/swfobject/swfobject.js")}if(!S[p]){U.include(S.path+"players/shadowbox-"+p+".js")}});if(!S.lib){U.include(S.path+"adapters/shadowbox-"+S.adapter+".js")}waitDom(waitLibs)},isActive:function(){return active},isPaused:function(){return slide_timer=="paused"},load:function(){if(S.ready){return}S.ready=true;if(S.skin.options){apply(S.options,S.skin.options);apply(S.options,init_options)}S.skin.init();if(!S.options.skipSetup){S.setup()}},next:function(){S.change(S.current+1)},open:function(obj){if(U.isLink(obj)){if(S.inCache(obj)){obj=S.cache[obj[S.expando]]}else{obj=S.buildCacheObj(obj)}}if(obj.constructor==Array){S.gallery=obj;S.current=0}else{if(!obj.gallery){S.gallery=[obj];S.current=0}else{S.current=null;S.gallery=[];each(S.cache,function(c){if(c.gallery&&c.gallery==obj.gallery){if(S.current==null&&c.content==obj.content&&c.title==obj.title){S.current=S.gallery.length}S.gallery.push(c)}});if(S.current==null){S.gallery.unshift(obj);S.current=0}}}obj=S.getCurrent();if(obj.options){S.revertOptions();S.applyOptions(obj.options)}var item,remove,m,format,replace,oe=S.options.errors,msg,el;for(var i=0;i<S.gallery.length;++i){item=S.gallery[i]=apply({},S.gallery[i]);remove=false;if(m=S.regex.unsupported.exec(item.player)){if(S.options.handleUnsupported=="link"){item.player="html";switch(m[1]){case"qtwmp":format="either";replace=[oe.qt.url,oe.qt.name,oe.wmp.url,oe.wmp.name];break;case"qtf4m":format="shared";replace=[oe.qt.url,oe.qt.name,oe.f4m.url,oe.f4m.name];break;default:format="single";if(m[1]=="swf"||m[1]=="flv"){m[1]="fla"}replace=[oe[m[1]].url,oe[m[1]].name]}msg=S.lang.errors[format].replace(/\{(\d+)\}/g,function(m,n){return replace[n]});item.content='<div class="sb-message">'+msg+"</div>"}else{remove=true}}else{if(item.player=="inline"){m=S.regex.inline.exec(item.content);if(m){var el=U.get(m[1]);if(el){item.content=el.innerHTML}else{S.error("Cannot find element with id "+m[1])}}else{S.error("Cannot find element id for inline content")}}else{if(item.player=="swf"||item.player=="flv"){var version=(item.options&&item.options.flashVersion)||S.options.flashVersion;if(!swfobject.hasFlashPlayerVersion(version)){item.width=310;item.height=177}}}}if(remove){S.gallery.splice(i,1);if(i<S.current){--S.current}else{if(i==S.current){S.current=i>0?i-1:i}}--i}}if(S.gallery.length){if(!active){if(typeof S.options.onOpen=="function"&&S.options.onOpen(obj)===false){return}S.skin.onOpen(obj,loadContent)}else{loadContent()}active=true}},pause:function(){if(typeof slide_timer!="number"){return}var time=new Date().getTime();slide_delay=Math.max(0,slide_delay-(time-slide_start));if(slide_delay){clearTimeout(slide_timer);slide_timer="paused";if(S.skin.onPause){S.skin.onPause()}}},play:function(){if(!S.hasNext()){return}if(!slide_delay){slide_delay=S.options.slideshowDelay*1000}if(slide_delay){slide_start=new Date().getTime();slide_timer=setTimeout(function(){slide_delay=slide_start=0;S.next()},slide_delay);if(S.skin.onPlay){S.skin.onPlay()}}},previous:function(){S.change(S.current-1)},setDimensions:function(height,width,max_h,max_w,tb,lr,resizable){var h=height=parseInt(height),w=width=parseInt(width),pad=parseInt(S.options.viewportPadding)||0;var extra_h=2*pad+tb;if(h+extra_h>=max_h){h=max_h-extra_h}var extra_w=2*pad+lr;if(w+extra_w>=max_w){w=max_w-extra_w}var resize_h=height,resize_w=width,change_h=(height-h)/height,change_w=(width-w)/width,oversized=(change_h>0||change_w>0);if(resizable&&oversized&&S.options.handleOversize=="resize"){if(change_h>change_w){w=Math.round((width/height)*h)}else{if(change_w>change_h){h=Math.round((height/width)*w)}}resize_w=w;resize_h=h}S.dimensions={height:h+tb,width:w+lr,inner_h:h,inner_w:w,top:(max_h-(h+extra_h))/2+pad,left:(max_w-(w+extra_w))/2+pad,oversized:oversized,resize_h:resize_h,resize_w:resize_w}},setup:function(links,opts){each(S.findLinks(links),function(link){S.addCache(link,opts)})},teardown:function(links){each(S.findLinks(links),S.removeCache)},findLinks:function(links){if(!links){var links=[],rel;each(document.getElementsByTagName("a"),function(a){rel=a.getAttribute("rel");if(rel&&S.regex.rel.test(rel)){links.push(a)}})}else{var len=links.length;if(len){if(window.Sizzle){if(typeof links=="string"){links=Sizzle(links)}else{if(len==2&&links.push&&typeof links[0]=="string"&&links[1].nodeType){links=Sizzle(links[0],links[1])}}}}else{links=[links]}}return links},inCache:function(link){return typeof link[S.expando]=="number"&&S.cache[link[S.expando]]},addCache:function(link,opts){if(!S.inCache(link)){link[S.expando]=S.cache.length;S.lib.addEvent(link,"click",handleClick)}S.cache[link[S.expando]]=S.buildCacheObj(link,opts)},removeCache:function(link){S.lib.removeEvent(link,"click",handleClick);S.cache[link[S.expando]]=null;delete link[S.expando]},clearCache:function(){each(S.cache,function(obj){S.removeCache(obj.link)});S.cache=[]},buildCacheObj:function(link,opts){var obj={link:link,title:link.getAttribute("title"),options:apply({},opts||{}),content:link.href};if(opts){each(["player","title","height","width","gallery"],function(option){if(typeof obj.options[option]!="undefined"){obj[option]=obj.options[option];delete obj.options[option]}})}if(!obj.player){obj.player=S.getPlayer(obj.content)}var rel=link.getAttribute("rel");if(rel){var match=rel.match(S.regex.gallery);if(match){obj.gallery=escape(match[2])}each(rel.split(";"),function(parameter){match=parameter.match(S.regex.param);if(match){if(match[1]=="options"){eval("apply(obj.options,"+match[2]+")")}else{obj[match[1]]=match[2]}}})}return obj},getPlayer:function(content){var r=S.regex,p=S.plugins,m=content.match(r.domain),same_domain=m&&document.domain==m[1];if(content.indexOf("#")>-1&&same_domain){return"inline"}var q=content.indexOf("?");if(q>-1){content=content.substring(0,q)}if(r.img.test(content)){return"img"}if(r.swf.test(content)){return p.fla?"swf":"unsupported-swf"}if(r.flv.test(content)){return p.fla?"flv":"unsupported-flv"}if(r.qt.test(content)){return p.qt?"qt":"unsupported-qt"}if(r.wmp.test(content)){if(p.wmp){return"wmp"}if(p.f4m){return"qt"}if(S.client.isMac){return p.qt?"unsupported-f4m":"unsupported-qtf4m"}return"unsupported-wmp"}if(r.qtwmp.test(content)){if(p.qt){return"qt"}if(p.wmp){return"wmp"}return S.client.isMac?"unsupported-qt":"unsupported-qtwmp"}return"iframe"}},U=S.util={animate:function(el,p,to,d,cb){var from=parseFloat(S.lib.getStyle(el,p));if(isNaN(from)){from=0}var delta=to-from;if(delta==0){if(cb){cb()}return}var op=p=="opacity";function fn(ease){var to=from+ease*delta;if(op){U.setOpacity(el,to)}else{el.style[p]=to+"px"}}if(!d||(!op&&!S.options.animate)||(op&&!S.options.animateFade)){fn(1);if(cb){cb()}return}d*=1000;var begin=new Date().getTime(),ease=S.options.ease,end=begin+d,time,timer=setInterval(function(){time=new Date().getTime();if(time>=end){clearInterval(timer);fn(1);if(cb){cb()}}else{fn(ease((time-begin)/d))}},10)},apply:function(o,e){for(var p in e){o[p]=e[p]}return o},clearOpacity:function(el){var s=el.style;if(window.ActiveXObject){if(typeof s.filter=="string"&&(/alpha/i).test(s.filter)){s.filter=s.filter.replace(/[\w\.]*alpha\(.*?\);?/i,"")}}else{s.opacity=""}},each:function(obj,fn,scope){for(var i=0,len=obj.length;i<len;++i){if(fn.call(scope||obj[i],obj[i],i,obj)===false){return}}},get:function(id){return document.getElementById(id)},include:function(){var includes={};return function(file){if(includes[file]){return}includes[file]=true;var head=document.getElementsByTagName("head")[0],script=document.createElement("script");script.src=file;head.appendChild(script)}}(),isLink:function(obj){if(!obj||!obj.tagName){return false}var up=obj.tagName.toUpperCase();return up=="A"||up=="AREA"},removeChildren:function(el){while(el.firstChild){el.removeChild(el.firstChild)}},setOpacity:function(el,o){var s=el.style;if(window.ActiveXObject){s.zoom=1;s.filter=(s.filter||"").replace(/\s*alpha\([^\)]*\)/gi,"")+(o==1?"":" alpha(opacity="+(o*100)+")")}else{s.opacity=o}}},apply=U.apply,each=U.each,init_options,initialized=false,default_options={},content_id="sb-content",active=false,slide_timer,slide_start,slide_delay=0;if(navigator.plugins&&navigator.plugins.length){var names=[];each(navigator.plugins,function(p){names.push(p.name)});names=names.join();var f4m=names.indexOf("Flip4Mac")>-1;S.plugins={fla:names.indexOf("Shockwave Flash")>-1,qt:names.indexOf("QuickTime")>-1,wmp:!f4m&&names.indexOf("Windows Media")>-1,f4m:f4m}}else{function detectPlugin(n){try{var axo=new ActiveXObject(n)}catch(e){}return!!axo}S.plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}}function waitDom(cb){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);cb()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);cb()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(S.ready){return}try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}cb()})()}}}if(typeof window.onload=="function"){var oldonload=window.onload;window.onload=function(){oldonload();cb()}}else{window.onload=cb}}function waitLibs(){if(S.lib&&S.lang){S.load()}else{setTimeout(waitLibs,0)}}function handleClick(e){var link;if(U.isLink(this)){link=this}else{link=S.lib.getTarget(e);while(!U.isLink(link)&&link.parentNode){link=link.parentNode}}S.lib.preventDefault(e);if(link){S.open(link);if(S.gallery.length){S.lib.preventDefault(e)}}}function listenKeys(on){if(!S.options.enableKeys){return}S.lib[(on?"add":"remove")+"Event"](document,"keydown",handleKey)}function handleKey(e){var code=S.lib.keyCode(e),handler;switch(code){case 81:case 88:case 27:handler=S.close;break;case 37:handler=S.previous;break;case 39:handler=S.next;break;case 32:handler=typeof slide_timer=="number"?S.pause:S.play}if(handler){S.lib.preventDefault(e);handler()}}function loadContent(){var obj=S.getCurrent();if(!obj){return}var p=obj.player=="inline"?"html":obj.player;if(typeof S[p]!="function"){S.error("Unknown player: "+p)}var change=false;if(S.content){S.content.remove();change=true;S.revertOptions();if(obj.options){S.applyOptions(obj.options)}}U.removeChildren(S.skin.bodyEl());S.content=new S[p](obj);listenKeys(false);S.skin.onLoad(S.content,change,function(){if(!S.content){return}if(typeof S.content.ready!="undefined"){var id=setInterval(function(){if(S.content){if(S.content.ready){clearInterval(id);id=null;S.skin.onReady(contentReady)}}else{clearInterval(id);id=null}},100)}else{S.skin.onReady(contentReady)}});if(S.gallery.length>1){var next=S.gallery[S.current+1]||S.gallery[0];if(next.player=="img"){var a=new Image();a.src=next.content}var prev=S.gallery[S.current-1]||S.gallery[S.gallery.length-1];if(prev.player=="img"){var b=new Image();b.src=prev.content}}}function contentReady(){if(!S.content){return}S.content.append(S.skin.bodyEl(),content_id,S.dimensions);S.skin.onFinish(finishContent)}function finishContent(){if(!S.content){return}if(S.content.onLoad){S.content.onLoad()}if(S.options.onFinish){S.options.onFinish()}if(!S.isPaused()){S.play()}listenKeys(true)}window.Shadowbox=S})();(function(){var g=Shadowbox,f=g.util,r=false,b=[],n=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],p={markup:'<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><div id="shadowbox_loading_indicator"></div><a onclick="Shadowbox.close()">{cancel}</a></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div><div style="clear:both"></div></div></div><div id="shadowbox_tl"></div><div id="shadowbox_t"></div><div id="shadowbox_tr"></div><div id="shadowbox_l"></div><div id="shadowbox_r"></div><div id="shadowbox_bl"></div><div id="shadowbox_b"></div><div id="shadowbox_br"></div></div></div>',options:{animSequence:"sync",autoDimensions:false,counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.8,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]},init:function(){var v=p.markup.replace(/\{(\w+)\}/g,function(z,A){return g.lang[A]});g.lib.append(document.body,v);if(g.client.isIE6){f.get("sb-body").style.zoom=1;var x,u,w=/url\("(.*\.png)"\)/;f.each(n,function(z){x=f.get(z);if(x){u=g.lib.getStyle(x,"backgroundImage").match(w);if(u){x.style.backgroundImage="none";x.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+u[1]+",sizingMethod=scale);"}}})}var y;g.lib.addEvent(window,"resize",function(){if(y){clearTimeout(y);y=null}if(g.isActive()){y=setTimeout(function(){p.onWindowResize();var z=g.content;if(z&&z.onWindowResize){z.onWindowResize()}},50)}})},bodyEl:function(){return f.get("sb-body-inner")},onOpen:function(y,u){e(false);var x=g.options.autoDimensions&&"height"in y?y.height:g.options.initialHeight,v=g.options.autoDimensions&&"width"in y?y.width:g.options.initialWidth;f.get("sb-container").style.display="block";var z=q(x,v);d(z.inner_h,z.top,false);i(z.width,z.left,false);j(u)},onLoad:function(v,w,u){l(true);k(w,function(){if(!v){return}if(!w){f.get("sb-wrapper").style.display=""}u()})},onReady:function(u){var w=g.content;if(!w){return}var v=q(w.height,w.width,w.resizable);p.resizeContent(v.inner_h,v.width,v.top,v.left,true,function(){m(u)})},onFinish:function(u){l(false,u)},onClose:function(){j();e(true)},onPlay:function(){c("play",false);c("pause",true)},onPause:function(){c("pause",false);c("play",true)},onWindowResize:function(){var w=g.content;if(!w){return}var v=q(w.height,w.width,w.resizable);i(v.width,v.left,false);d(v.inner_h,v.top,false);var u=f.get(g.contentId());if(u){if(w.resizable&&g.options.handleOversize=="resize"){u.height=v.resize_h;u.width=v.resize_w}}},resizeContent:function(v,w,z,y,x,u){var B=g.content;if(!B){return}var A=q(B.height,B.width,B.resizable);switch(g.options.animSequence){case"hw":d(A.inner_h,A.top,x,function(){i(A.width,A.left,x,u)});break;case"wh":i(A.width,A.left,x,function(){d(A.inner_h,A.top,x,u)});break;default:i(A.width,A.left,x);d(A.inner_h,A.top,x,u)}}};function o(){f.get("sb-container").style.top=document.documentElement.scrollTop+"px"}function e(u){if(u){f.each(b,function(v){v[0].style.visibility=v[1]||""})}else{b=[];f.each(g.options.troubleElements,function(v){f.each(document.getElementsByTagName(v),function(w){b.push([w,w.style.visibility]);w.style.visibility="hidden"})})}}function j(u){var v=f.get("sb-overlay"),w=f.get("sb-container"),y=f.get("sb-wrapper");if(u){if(g.client.isIE6){o();g.lib.addEvent(window,"scroll",o)}if(g.options.showOverlay){r=true;v.style.backgroundColor=g.options.overlayColor;f.setOpacity(v,0);if(!g.options.modal){g.lib.addEvent(v,"click",g.close)}y.style.display="none"}w.style.visibility="visible";if(r){var x=parseFloat(g.options.overlayOpacity);f.animate(v,"opacity",x,g.options.fadeDuration,u)}else{u()}}else{if(g.client.isIE6){g.lib.removeEvent(window,"scroll",o)}g.lib.removeEvent(v,"click",g.close);if(r){y.style.display="none";f.animate(v,"opacity",0,g.options.fadeDuration,function(){w.style.display="";y.style.display="";f.clearOpacity(v)})}else{w.style.visibility="hidden"}}}function c(w,u){var v=f.get("sb-nav-"+w);if(v){v.style.display=u?"":"none"}}function l(v,u){var x=f.get("sb-loading"),z=g.getCurrent().player,y=(z=="img"||z=="html");if(v){function w(){f.clearOpacity(x);if(u){u()}}f.setOpacity(x,0);x.style.display="";if(y){f.animate(x,"opacity",1,g.options.fadeDuration,w)}else{w()}}else{function w(){x.style.display="none";f.clearOpacity(x);if(u){u()}}if(y){f.animate(x,"opacity",0,g.options.fadeDuration,w)}else{w()}}}function a(x){var C=g.getCurrent();f.get("sb-title-inner").innerHTML=C.title||"";var F,w,A,G,v;if(g.options.displayNav){F=true;var E=g.gallery.length;if(E>1){if(g.options.continuous){w=v=true}else{w=(E-1)>g.current;v=g.current>0}}if(g.options.slideshowDelay>0&&g.hasNext()){G=!g.isPaused();A=!G}}else{F=w=A=G=v=false}c("close",F);c("next",w);c("play",A);c("pause",G);c("previous",v);var u="";if(g.options.displayCounter&&g.gallery.length>1){var E=g.gallery.length;if(g.options.counterType=="skip"){var B=0,z=E,y=parseInt(g.options.counterLimit)||0;if(y<E&&y>2){var D=Math.floor(y/2);B=g.current-D;if(B<0){B+=E}z=g.current+(y-D);if(z>E){z-=E}}while(B!=z){if(B==E){B=0}u+='<a onclick="Shadowbox.change('+B+');"';if(B==g.current){u+=' class="sb-counter-current"'}u+=">"+(B++)+"</a>"}}else{var u=(g.current+1)+" "+g.lang.of+" "+E}}f.get("sb-counter").innerHTML=u;x()}function k(w,v){var A=f.get("sb-wrapper"),D=f.get("sb-title"),x=f.get("sb-info"),u=f.get("sb-title-inner"),B=f.get("sb-info-inner"),C=parseInt(g.lib.getStyle(u,"height"))||0,z=parseInt(g.lib.getStyle(B,"height"))||0;var y=function(){u.style.visibility=B.style.visibility="hidden";a(v)};if(w){f.animate(D,"height",0,0.35);f.animate(x,"height",0,0.35);if(D.title!=""){f.animate(A,"paddingTop",C,0.35)}f.animate(A,"paddingBottom",z,0.35,y)}else{D.style.height=x.style.height="0px";if(D.title!=""){A.style.paddingTop=C+"px"}A.style.paddingBottom=z+"px";y()}}function m(w){var v=f.get("sb-wrapper"),y=f.get("sb-title"),x=f.get("sb-info"),B=f.get("sb-title-inner"),A=f.get("sb-info-inner"),z=parseInt(g.lib.getStyle(B,"height"))||0,u=parseInt(g.lib.getStyle(A,"height"))||0;B.style.visibility=A.style.visibility="";if(B.innerHTML!=""){f.animate(y,"height",z,0.35);f.animate(v,"paddingTop",0,0.35)}f.animate(x,"height",u,0.35);f.animate(v,"paddingBottom",0,0.35,w)}function d(v,y,x,u){var z=f.get("sb-body"),w=f.get("shadowbox_l");sb_r=f.get("shadowbox_r");st_i=f.get("sb-title-inner");s=f.get("sb-wrapper"),h=parseInt(v),t=parseInt(y);h_offset=0;if(st_i.innerHTML!=""){h_offset=st_i.offsetHeight}if(x){f.animate(w,"height",h+h_offset,g.options.resizeDuration);f.animate(sb_r,"height",h+h_offset,g.options.resizeDuration);f.animate(z,"height",h,g.options.resizeDuration);f.animate(s,"top",t,g.options.resizeDuration,u)}else{w.style.height=h+h_offset+"px";sb_r.style.height=h+h_offset+"px";z.style.height=h+"px";s.style.top=t+"px";if(u){u()}}}function i(z,B,A,u){var y=f.get("sb-wrapper"),x=parseInt(z),v=parseInt(B);if(A){f.animate(y,"width",x,g.options.resizeDuration);f.animate(y,"left",v,g.options.resizeDuration,u)}else{y.style.width=x+"px";y.style.left=v+"px";if(u){u()}}}function q(u,x,w){var v=f.get("sb-body-inner");sw=f.get("sb-wrapper"),so=f.get("sb-overlay"),tb=sw.offsetHeight-v.offsetHeight,lr=sw.offsetWidth-v.offsetWidth,max_h=so.offsetHeight,max_w=so.offsetWidth;g.setDimensions(u,x,max_h,max_w,tb,lr,w);return g.dimensions}g.skin=p})();if(typeof jQuery=="undefined"){throw"Unable to load Shadowbox adapter, jQuery not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}(function(b,a){a.lib={getStyle:function(d,c){return b(d).css(c)},remove:function(c){b(c).remove()},getTarget:function(c){return c.target},getPageXY:function(c){return[c.pageX,c.pageY]},preventDefault:function(c){c.preventDefault()},keyCode:function(c){return c.keyCode},addEvent:function(e,c,d){b(e).bind(c,d)},removeEvent:function(e,c,d){b(e).unbind(c,d)},append:function(d,c){b(d).append(c)}}})(jQuery,Shadowbox);(function(a){a.fn.shadowbox=function(b){return this.each(function(){var d=a(this);var e=a.extend({},b||{},a.metadata?d.metadata():a.meta?d.data():{});var c=this.className||"";e.width=parseInt((c.match(/w:(\d+)/)||[])[1])||e.width;e.height=parseInt((c.match(/h:(\d+)/)||[])[1])||e.height;Shadowbox.setup(d,e)})}})(jQuery);if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};(function(b){var a=b.util,c=20;b.flv=function(d){this.obj=d;this.resizable=true;this.height=d.height?parseInt(d.height,10):300;if(b.options.showMovieControls==true){this.height+=c}this.width=d.width?parseInt(d.width,10):300};b.flv.prototype={append:function(l,e,n){this.id=e;var j=document.createElement("div");j.id=e;l.appendChild(j);var k=n.resize_h,o=n.resize_w,f=b.path+"libraries/mediaplayer/player.swf",m=b.options.flashVersion,d=b.path+"libraries/swfobject/expressInstall.swf",g=a.apply({file:this.obj.content,height:k,width:o,autostart:(b.options.autoplayMovies?"true":"false"),controlbar:(b.options.showMovieControls?"bottom":"none"),backcolor:"0x000000",frontcolor:"0xCCCCCC",lightcolor:"0x557722"},b.options.flashVars),i=b.options.flashParams;swfobject.embedSWF(f,e,o,k,m,d,g,i)},remove:function(){swfobject.expressInstallCallback();swfobject.removeSWF(this.id)}}})(Shadowbox);(function(a){a.html=function(b){this.obj=b;this.height=b.height?parseInt(b.height,10):300;this.width=b.width?parseInt(b.width,10):500};a.html.prototype={append:function(b,e,c){this.id=e;var d=document.createElement("div");d.id=e;d.className="html";d.innerHTML=this.obj.content;b.appendChild(d)},remove:function(){var b=document.getElementById(this.id);if(b){a.lib.remove(b)}}}})(Shadowbox);(function(a){a.iframe=function(c){this.obj=c;var b=document.getElementById("sb-overlay");this.height=c.height?parseInt(c.height,10):b.offsetHeight;this.width=c.width?parseInt(c.width,10):b.offsetWidth};a.iframe.prototype={append:function(b,e,d){this.id=e;var c='<iframe id="'+e+'" name="'+e+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto"';if(a.client.isIE){c+=' allowtransparency="true"';if(a.client.isIE6){c+=" src=\"javascript:false;document.write('');\""}}c+="></iframe>";b.innerHTML=c},remove:function(){var b=document.getElementById(this.id);if(b){a.lib.remove(b);if(a.client.isGecko){delete window.frames[this.id]}}},onLoad:function(){var b=a.client.isIE?document.getElementById(this.id).contentWindow:window.frames[this.id];b.location.href=this.obj.content}}})(Shadowbox);(function(h){var e=h.util,i,k,j="sb-drag-layer",d;function b(){i={x:0,y:0,start_x:null,start_y:null}}function c(m,o,l){if(m){b();var n=["position:absolute","height:"+o+"px","width:"+l+"px","cursor:"+(h.client.isGecko?"-moz-grab":"move"),"background-color:"+(h.client.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");h.lib.append(h.skin.bodyEl(),'<div id="'+j+'" style="'+n+'"></div>');h.lib.addEvent(e.get(j),"mousedown",g)}else{var p=e.get(j);if(p){h.lib.removeEvent(p,"mousedown",g);h.lib.remove(p)}k=null}}function g(m){h.lib.preventDefault(m);var l=h.lib.getPageXY(m);i.start_x=l[0];i.start_y=l[1];k=e.get(h.contentId());h.lib.addEvent(document,"mousemove",f);h.lib.addEvent(document,"mouseup",a);if(h.client.isGecko){e.get(j).style.cursor="-moz-grabbing"}}function a(){h.lib.removeEvent(document,"mousemove",f);h.lib.removeEvent(document,"mouseup",a);if(h.client.isGecko){e.get(j).style.cursor="-moz-grab"}}function f(o){var q=h.content,p=h.dimensions,n=h.lib.getPageXY(o);var m=n[0]-i.start_x;i.start_x+=m;i.x=Math.max(Math.min(0,i.x+m),p.inner_w-q.width);k.style.left=i.x+"px";var l=n[1]-i.start_y;i.start_y+=l;i.y=Math.max(Math.min(0,i.y+l),p.inner_h-q.height);k.style.top=i.y+"px"}h.img=function(m){this.obj=m;this.resizable=true;this.ready=false;var l=this;d=new Image();d.onload=function(){l.height=m.height?parseInt(m.height,10):d.height;l.width=m.width?parseInt(m.width,10):d.width;l.ready=true;d.onload="";d=null};d.src=m.content};h.img.prototype={append:function(l,o,n){this.id=o;var m=document.createElement("img");m.id=o;m.src=this.obj.content;m.style.position="absolute";m.setAttribute("height",n.resize_h);m.setAttribute("width",n.resize_w);l.appendChild(m)},remove:function(){var l=e.get(this.id);if(l){h.lib.remove(l)}c(false);if(d){d.onload="";d=null}},onLoad:function(){var l=h.dimensions;if(l.oversized&&h.options.handleOversize=="drag"){c(true,l.resize_h,l.resize_w)}},onWindowResize:function(){if(k){var p=h.content,o=h.dimensions,n=parseInt(h.lib.getStyle(k,"top")),m=parseInt(h.lib.getStyle(k,"left"));if(n+p.height<o.inner_h){k.style.top=o.inner_h-p.height+"px"}if(m+p.width<o.inner_w){k.style.left=o.inner_w-p.width+"px"}}}}})(Shadowbox);
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;var requiredMajorVersion=9;var requiredMinorVersion=0;var requiredRevision=28;function ControlVersion(){var a;var b;var c;try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=b.GetVariable("$version")}catch(c){}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a="WIN 6,0,21,0";b.AllowScriptAccess="always";a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a=b.GetVariable("$version")}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");a="WIN 3,0,18,0"}catch(c){}}if(!a){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");a="WIN 2,0,0,11"}catch(c){a=-1}}return a}function GetSwfVer(){var g=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var f=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+f].description;var e=a.split(" ");var c=e[2].split(".");var h=c[0];var b=c[1];var d=e[3];if(d==""){d=e[4]}if(d[0]=="d"){d=d.substring(1)}else{if(d[0]=="r"){d=d.substring(1);if(d.indexOf("d")>0){d=d.substring(0,d.indexOf("d"))}}}var g=h+"."+b+"."+d}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){g=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){g=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){g=2}else{if(isIE&&isWin&&!isOpera){g=ControlVersion()}}}}}return g}function DetectFlashVer(f,d,c){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var e=versionArray[0];var a=versionArray[1];var b=versionArray[2];if(e>parseFloat(f)){return true}else{if(e==parseFloat(f)){if(a>parseFloat(d)){return true}else{if(a==parseFloat(d)){if(b>=parseFloat(c)){return true}}}}}return false}}}function AC_AddExtension(b,a){if(b.indexOf("?")!=-1){return b.replace(/\?/,a+"?")}else{return b+a}}function AC_Generateobj(e,d,a){var c="";if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in e){c+=b+'="'+e[b]+'" '}c+=">";for(var b in d){c+='<param name="'+b+'" value="'+d[b]+'" /> '}c+="</object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '}c+="> </embed>"}document.write(c)}function AC_FL_RunContent(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(a.objAttrs,a.params,a.embedAttrs)}function AC_GetArgs(b,e,g,d,h){var a=new Object();a.embedAttrs=new Object();a.params=new Object();a.objAttrs=new Object();for(var c=0;c<b.length;c=c+2){var f=b[c].toLowerCase();switch(f){case"classid":break;case"pluginspage":a.embedAttrs[b[c]]=b[c+1];break;case"src":case"movie":b[c+1]=AC_AddExtension(b[c+1],e);a.embedAttrs.src=b[c+1];a.params[g]=b[c+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":a.objAttrs[b[c]]=b[c+1];break;case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":a.embedAttrs[b[c]]=a.objAttrs[b[c]]=b[c+1];break;default:a.embedAttrs[b[c]]=a.params[b[c]]=b[c+1]}}a.objAttrs.classid=d;if(h){a.embedAttrs.type=h}return a};
function getAdAkamaiPath(){return AD_AKAMAI_PATH}function initPromoAd(TOA_AD_STYLE,TOA_AD_HEIGHT,TOA_IS_ANIMATED,TOA_MOUSEOVER,TOA_MOUSEOUT,TOA_PROMO_CALLBACK){$("#OAS_RMF_x69_FLASH").attr("style",TOA_AD_STYLE);$("#OAS_RMF_x69_FLASH").bind("mouseover",function(){eval(TOA_MOUSEOVER)});$("#OAS_RMF_x69_FLASH").bind("mouseout",function(){eval(TOA_MOUSEOUT)});$("#tetris_header_mouseover").bind("mouseover",function(){eval(TOA_MOUSEOUT)});if(TOA_PROMO_CALLBACK==undefined||TOA_PROMO_CALLBACK=="undefined"){TOA_PROMO_CALLBACK=function(){}}expandBannerDiv(Number(TOA_AD_HEIGHT),10,TOA_IS_ANIMATED,500,function(){eval(TOA_PROMO_CALLBACK)})}function initRailAds(TOA_LEFT_RAIL,TOA_LEFT_RAIL_POS,TOA_RIGHT_RAIL,TOA_RIGHT_RAIL_POS,TOA_RAIL_CALLBACK){var toa_left_pos_array=TOA_LEFT_RAIL_POS.split(",");var toa_right_pos_array=TOA_RIGHT_RAIL_POS.split(",");if(TOA_RAIL_CALLBACK==undefined||TOA_RAIL_CALLBACK=="undefined"){TOA_RAIL_CALLBACK=function(){}}if(TOA_LEFT_RAIL!=""){loadLeftRail(TOA_LEFT_RAIL,toa_left_pos_array[0],toa_left_pos_array[1],toa_left_pos_array[2],toa_left_pos_array[3])}if(TOA_RIGHT_RAIL!=""){loadRightRail(TOA_RIGHT_RAIL,toa_right_pos_array[0],toa_right_pos_array[1],toa_right_pos_array[2],toa_right_pos_array[3])}eval(TOA_RAIL_CALLBACK)}function onBannerMouseOver(d,b,a,c){$("#tetris_header_mouseover").show();$("#OAS_RMF_x69_FLASH").css("clip","rect("+d+"px  "+b+"px  "+a+"px  "+c+"px)")}function onBannerMouseOut(d,b,a,c){$("#tetris_header_mouseover").hide();$("#OAS_RMF_x69_FLASH").css("clip","rect("+d+"px  "+b+"px  "+a+"px  "+c+"px)")}function loadLeftRail(b,e,d,c,a){$("div#home_ad_left_rail").css({position:"absolute",background:b,"background-repeat":"no-repeat",top:e+"px",left:d+"px",width:c+"px",height:a+"px"});$("div#home_ad_left_rail").show()}function loadRightRail(c,e,b,d,a){$("div#home_ad_right_rail").css({position:"absolute",background:c,"background-repeat":"no-repeat",top:e+"px",right:b+"px",width:d+"px",height:a+"px"});$("div#home_ad_right_rail").show()}function expandBannerDiv(a,d,b,c,e){if(c==""){c=500}$("#home_custom_ad_container").show();if(b){$("#home_custom_ad_container").animate({height:a+d},c,e)}else{$("#home_custom_ad_container").animate({height:a+d},1,e)}}function TOA_INIT(){};
function generateFooter(c,d){var b="";b+="%0D%0A%0D%0A%0D%0A";b+="***********************************";b+="%0D%0A";if(c!=null){b+="Customer ID: "+c+"%0D%0A"}if(d!=undefined&&d!="undefined"){b+="Error Code: "+d+"%0D%0A"}b+="Platform: ";if(navigator.cpuClass!=null){b+=navigator.cpuClass+", "}b+=navigator.platform;b+=" ("+screen.width+" x "+screen.height+", "+screen.colorDepth+" bit)%0D%0A";b+="Flash Detected: ";var a=GetSwfVer();if(a!=-1){a=a.replace(/\,/g,"%2C");a=a.replace(/\./g,"%2C");b+="Yes ("+a+")"}else{b+="No"}b+=", Cookies Enabled: ";if(navigator.cookieEnabled){b+="Yes"}else{b+="No"}b+="%0D%0A";b+="Browser: "+navigator.userAgent;b+="%0D%0A";b+="***********************************";b+="%0D%0A";return b}function updateSupportLinks(c,a,d){if(a==undefined||a=="undefined"){a="footerSupportLink"}var b="mailto:support@tetrisonline.com?subject=TETRISFRIENDS.COM%20SUPPORT&BODY=";b+=generateFooter(c,d);$("#"+a).attr("href",b);$("#"+a).after("<a id='footerSupportLink' href='"+b+"'>support@tetrisonline.com</a>").remove()}function updateFeedbackLinks(c){var a="mailto:support@tetrisonline.com?subject=TETRISFRIENDS.COM%20FEEDBACK&BODY=";a+=generateFooter();var b=document.getElementById("navFeedbackLink");b.href=a;b=document.getElementById("footerFeedbackLink");b.href=a};
var eventQueue=new Array();var xfbmlItems=new Array();var fb_api_id="";var fb_session_id="";var fb_uid="";var fb_user_cached=false;var fb_already_linked=false;var fb_cookie_data=new Array();var fb_logged_in=false;var fb_not_authorized="";var fb_access_token="";var tf_logged_in=false;var tf_auto_login=false;var tf_action_token="";var FB_GENERIC_ERROR="Doh! We seem to be experiencing issues at this time. Please refresh your page and try again.";var FB_NOT_LOGGED_IN="You do not appear to be logged into Tetris Friends. Please <a href='/users/login.php'>Log in</a>.";var FB_NOT_LOGGED_IN_FB="You do not appear to be logged into Facebook. Please <a href='javascript:fb_login()'>Log in</a> to Facebook.";var FB_USER_NOT_FOUND="You do not appear to have a Tetris Friends account yet. Please <a href='/users/login.php'>Log in</a> to link your account or <a href='/users/register.php'>Sign-up</a> for a FREE account!";var FB_SIGNATURE_FAIL="We were unable to log you into Tetris Friends at this time. Please try again.";var FB_ACCOUNT_ALREADY_EXISTS="Your Facebook account already appears to be linked with another account.";var FB_WRONG_ACCOUNT="Oops... you are logged in with the wrong Facebook Account. Please <a href='javascript:fb_login()'>Sign into Facebook again</a>.";var FB_STATUS_CHANGED="Your Facebook Connect status appears to have changed... refreshing";var FB_FEED_PUBLISHED="Your message has been posted to your feed.";var FB_REVOKE_AUTHORIZATION="Unlinking your account with Facebook Connect. Please wait...";var FB_DEBUG;var FB_VERSION="0.42";function initFBConnect(g,f,b,e,d,c,a){fb_log("initFBConnect -> inApiId:"+g+", fbUID:"+f+", fbUserCached:"+b+", tfLoggedIn:"+e+", inAutoLogin:"+d+", fbActionToken:"+c+", inTFRootPath:"+a+", "+FB_VERSION);fb_api_id=g;fb_uid=f;fb_user_cached=b;tf_logged_in=e;tf_auto_login=d;tf_action_token=c;fb_log(a+"/channel.html");FB.init({appId:g,status:false,cookie:true,xfbml:true,authResponse:true,channelUrl:a+"/channel.html",oauth:true});fb_updateConnectStatus(function(){if(fb_getCookieValue("fb_force_refresh")){fb_displayError("STATUS_CHANGED");fb_setCookieValue("fb_force_refresh",-1);setTimeout("fb_connectRefreshPage()",3000)}fb_executeQueue()})}function fb_updateConnectStatus(a){fb_log("fb_updateConnectStatus");if(typeof(FB)!=undefined&&typeof(FB)!="undefined"){fb_log("if (typeof(FB) != undefined)");FB.getLoginStatus(function(b){fb_log("FB.getLoginStatus(function(response)");switch(b.status){case"connected":fb_session_id=b.authResponse.userID;fb_access_token=b.authResponse.accessToken;fb_log("CONNECTED:"+(fb_session_id)+", LOGGED INTO TF:"+tf_logged_in);fb_logged_in=true;fb_not_authorized=false;break;case"not_authorized":fb_log("NOT AUTHORIZED");fb_not_authorized=true;break;default:fb_log("NOT CONNECTED");fb_logged_in=false;break}a(b)})}}function fb_getSessionFBUID(){return fb_session_id}function fb_getLinkedFBUID(){return((fb_uid==""||fb_uid==0)?"":fb_uid)}function fb_setLinkedFBUID(a){fb_uid=a}function fb_isValidUser(){return(fb_getLinkedFBUID()==fb_getSessionFBUID()&&fb_getLinkedFBUID()!="")}function fb_requireSession(a){fb_updateConnectStatus(function(){if(!fb_logged_in){fb_log("REQUIRE SESSION");FB.login(a)}else{fb_log("LOGGED IN");a()}})}function fb_showGuestUpsell(){if(!fb_getCookieValue("hide_upsell")){if((!tf_logged_in&&fb_not_authorized!=""&&fb_not_authorized)||(fb_logged_in&&!tf_logged_in)){var a=40;var c=1000;var b='<p><a href="javascript:fb_login()">Login</a> or <a href="javascript:fb_login()">Sign-Up for FREE</a> using your Facebook account<p><a class=\'fb_close_btn\' href="javascript:fb_hideGuestUpsell()">[X] Close</a>';$("#fb_notice").html(b);$(document).ready(function(){$("#fb_notice").show()})}}}function fb_hideGuestUpsell(){$("#fb_notice").hide();fb_setCookieValue("hide_upsell",1)}function fb_siteLogin(a){if(fb_logged_in){fb_login()}else{displayLoginForm(true)}}function fb_login(a){fb_log("fb_login");if(typeof(a)=="undefined"||typeof(a)==undefined){a=fb_connectRefreshPage}fb_updateConnectStatus(function(){fb_log("fb_updateConnectStatus");var c=function(){FB.login(function(){fb_updateConnectStatus(b)})};var b=function(){fb_linkFacebookAccount(a)};if(!tf_logged_in){fb_log("NOT LOGGED IN TF");c=function(){FB.login(function(){fb_updateConnectStatus(function(){fb_TFLogin(b)})})}}else{if(!fb_logged_in){fb_log("NOT LOGGED IN FB AND LOGGED INTO TF")}else{if(fb_logged_in&&fb_getLinkedFBUID()==""&&!fb_already_linked){fb_log("LOGGED IN AND AND NO FBUID")}else{if(fb_logged_in&&fb_getLinkedFBUID()!=fb_getSessionFBUID()){fb_log("LOGGED IN AND FBUID DO NOT MATCH");c=FB.logout(c)}else{c=b}}}}c()})}function fb_logout(){fb_updateConnectStatus(function(){var a="/users/process.php?logout";if(fb_logged_in){FB.logout(function(){window.location.href=a})}else{window.location.href=a}})}function fb_connectRefreshPage(){setTimeout("window.location.reload();",250)}function fb_obtainRegistrationInfo(){addLoadingAnimation("#form_reg");fb_requireSession(function(){fb_getUserInfo(function(a){$("#fb_uid").val(a[0].uid);$("#name").val(a[0].name);$("#pic").val(a[0].pic);$("#pic_small").val(a[0].pic_small);$("#pic_square").val(a[0].pic_square);removeLoadingAnimation("#form_reg")})})}function fb_linkFacebookAccount(a){if(typeof(a)=="undefined"||typeof(a)==undefined){a=fb_connectRefreshPage}fb_getUserInfo(function(b){$.post("/users/process.php",{link_fb_acct:1,fb_uid:b[0].uid,name:b[0].name,pic:b[0].pic,pic_small:b[0].pic_small,pic_square:b[0].pic_square,action_token:tf_action_token},function(c){switch(c){case"SUCCESS":a();break;default:fb_displayError(c);break}})})}function fb_unlinkFacebookAccount(a){if(typeof(a)=="undefined"||typeof(a)==undefined){a=fb_connectRefreshPage}$.post("/users/process.php",{unlink_fb_acct:1,action_token:tf_action_token},function(b){switch(b){case"SUCCESS":a();break;default:fb_displayError(b);break}})}function fb_TFLogin(a){if(typeof(a)=="undefined"||typeof(a)==undefined){a=fb_login}fb_setCookieValue("fb_tf_login",1);$.post("/users/process.php",{login_with_fbuid:1,fb_uid:fb_getSessionFBUID(),action_token:tf_action_token},function(b){switch(b){case"SUCCESS":fb_setCookieValue("fb_tf_login",-1);a();break;default:fb_displayError(b);break}})}function fb_newFacebookAccount(a){if(typeof(a)=="undefined"||typeof(a)==undefined){a=popUpFBLoginPopup}fb_getFullUserInfo(function(b){a(b,tf_action_token)})}function fb_getLikeUrl(d,c,b,a){if(typeof(c)==undefined||typeof(c)=="undefined"){c="standard"}if(typeof(b)==undefined||typeof(b)=="undefined"){b=90}if(typeof(a)==undefined||typeof(a)=="undefined"){a=21}return"http://www.facebook.com/plugins/like.php?href="+getBaseUrl(d)+"&layout="+c+"&show_faces=false&width="+b+"&action=recommend&font=trebuchet+ms&colorscheme=light&height="+a}function fb_getUserInfo(c){var b=fb_getFQLQueryString("user_info");try{fb_fqlQuery(b,function(d){c(d)})}catch(a){fb_log("getUserInfo Fail:"+a.message);throw a}}function fb_getFullUserInfo(c){var b=fb_getFQLQueryString("full_user_info");try{fb_fqlQuery(b,function(d){c(d)})}catch(a){fb_log("fb_getFullUserInfo Fail:"+a.message);throw a}}function fb_getUserFriendsList(c){if(fb_logged_in){var b=fb_getFQLQueryString("friends_list");try{fb_fqlQuery(b,function(d){c(d)})}catch(a){fb_log("getUserFriendsList Fail:"+a.message);throw a}}else{c("FAILURE")}}function fb_getFQLQueryString(a){var b="";switch(a){case"user_info":b="SELECT uid, name, pic, pic_small, pic_square FROM user WHERE uid = "+fb_session_id;break;case"full_user_info":b="SELECT uid, first_name, last_name, name, locale, timezone, birthday, sex, proxied_email, current_location, pic, pic_small, pic_square FROM user WHERE uid = "+fb_session_id;break;case"friends_list":b="SELECT uid, name, pic, pic_small, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = "+fb_session_id+")";break}return b}function fb_fqlQuery(b,c){fb_log("fb_fqlQuery -> "+b);try{FB.api({method:"fql.query",query:b},c)}catch(a){fb_log("Query Fail:"+a.message);throw a}}function fb_log(a){if(typeof(FB_DEBUG)!="undefined"&&typeof(FB_DEBUG)!=undefined&&FB_DEBUG){console.log(a)}}function fb_displayError(a){if(typeof(FB_DEBUG)=="undefined"||typeof(FB_DEBUG)==undefined){clearNotice()}switch(a){case"USER_NOT_FOUND":addNotice(FB_USER_NOT_FOUND);fb_newFacebookAccount();break;case"NOT_LOGGED_IN":addNotice(FB_USER_NOT_FOUND);fb_newFacebookAccount();break;case"NOT_LOGGED_IN_FB":addNotice(FB_NOT_LOGGED_IN_FB);break;case"SIGNATURE_FAIL":addNotice(FB_SIGNATURE_FAIL);break;case"ACCOUNT_ALREADY_LINKED":addNotice(FB_WRONG_ACCOUNT);break;case"ACCOUNT_ALREADY_EXISTS":addNotice(FB_ACCOUNT_ALREADY_EXISTS);fb_already_linked=true;break;case"WRONG_ACCOUNT":addNotice(FB_WRONG_ACCOUNT);break;case"STATUS_CHANGED":addNotice(FB_STATUS_CHANGED);break;case"REVOKE_AUTHORIZATION":addNotice(FB_REVOKE_AUTHORIZATION);break;default:addNotice(FB_GENERIC_ERROR);if(FB_DEBUG){alert(a)}break}}function fb_setCookieValue(c,b){if(fb_cookie_data.length==0){fb_loadFBCookie()}var d=false;for(var a=0;!d&&a<fb_cookie_data.length;a++){if(fb_cookie_data[a][0]==c){fb_cookie_data[a][1]=b;d=true}}if(!d){fb_cookie_data.push(new Array(c,b))}fb_saveFBCookie()}function fb_getCookieValue(c){var a=false;if(fb_cookie_data.length==0){fb_loadFBCookie()}for(var b=0;!a&&b<fb_cookie_data.length;b++){if(fb_cookie_data[b][0]==c){a=fb_cookie_data[b][1]}}return a}function fb_saveFBCookie(){var b="";for(var a=0;a<fb_cookie_data.length;a++){if(fb_cookie_data[a][1]!=-1&&typeof(fb_cookie_data[a][1])!="undefined"&&typeof(fb_cookie_data[a][1])!=undefined){b+=fb_cookie_data[a][0]+":"+fb_cookie_data[a][1];b+="|"}}if(b.substring(b.length-1)=="|"){b=b.substring(0,b.length-1)}$.cookie("TFFC",escape(b),{path:"/"})}function fb_loadFBCookie(){fb_cookie_data=new Array();var c=$.cookie("TFFC");if(c){var b=unescape(c);b=b.split("|");for(var a=0;a<b.length;a++){data=b[a].split(":");fb_cookie_data.push(new Array(data[0],data[1]))}}}function fb_execute(a){if(typeof(FB)=="undefined"||typeof(FB)==undefined){fb_pushCommand(a)}else{a()}}function fb_executeQueue(b){if(typeof(b)=="undefined"||typeof(b)==undefined){b=function(){}}for(var c=0;c<eventQueue.length;c++){var a=fb_popCommand();a()}b()}function fb_pushCommand(a){eventQueue.push(a)}function fb_popCommand(){return eventQueue.pop()}function fb_refreshXFBML(){FB.XFBML.parse()};
(function($){$.fn.editable=function(target,options){var settings={target:target,name:"value",id:"id",type:"text",width:"auto",height:"auto",maxlength:"500",event:"click",onblur:"cancel",loadtype:"GET",loadtext:"Loading...",placeholder:"Click to edit",loaddata:{},submitdata:{},ajaxoptions:{}};if(options){$.extend(settings,options)}var plugin=$.editable.types[settings.type].plugin||function(){};var submit=$.editable.types[settings.type].submit||function(){};var buttons=$.editable.types[settings.type].buttons||$.editable.types.defaults.buttons;var content=$.editable.types[settings.type].content||$.editable.types.defaults.content;var element=$.editable.types[settings.type].element||$.editable.types.defaults.element;var reset=$.editable.types[settings.type].reset||$.editable.types.defaults.reset;var callback=settings.callback||function(){};var onfocus=settings.onfocus||function(){};var onsubmit=settings.onsubmit||function(){};var onreset=settings.onreset||function(){};var onerror=settings.onerror||reset;if(!$.isFunction($(this)[settings.event])){$.fn[settings.event]=function(fn){return fn?this.bind(settings.event,fn):this.trigger(settings.event)}}$(this).attr("title",settings.tooltip);settings.autowidth="auto"==settings.width;settings.autoheight="auto"==settings.height;return this.each(function(){var self=this;var savedwidth=$(self).width();var savedheight=$(self).height();if(!$.trim($(this).html())){$(this).html(settings.placeholder)}$(this)[settings.event](function(e){if(self.editing){return}$(self).removeAttr("title");if(0==$(self).width()){settings.width=savedwidth;settings.height=savedheight}else{if(settings.width!="none"){settings.width=settings.autowidth?$(self).width():settings.width}if(settings.height!="none"){settings.height=settings.autoheight?$(self).height():settings.height}}if($(this).html().toLowerCase().replace(/;/,"")==settings.placeholder.toLowerCase().replace(/;/,"")){$(this).html("")}self.editing=true;self.revert=$(self).html();$(self).html("");var form=$("<form />");if(settings.cssclass){if("inherit"==settings.cssclass){form.attr("class",$(self).attr("class"))}else{form.attr("class",settings.cssclass)}}if(settings.style){if("inherit"==settings.style){form.attr("style",$(self).attr("style"));form.css("display",$(self).css("display"))}else{form.attr("style",settings.style)}}var input=element.apply(form,[settings,self]);var input_content;if(settings.loadurl){var t=setTimeout(function(){input.disabled=true;content.apply(form,[settings.loadtext,settings,self])},100);var loaddata={};loaddata[settings.id]=self.id;if($.isFunction(settings.loaddata)){$.extend(loaddata,settings.loaddata.apply(self,[self.revert,settings]))}else{$.extend(loaddata,settings.loaddata)}$.ajax({type:settings.loadtype,url:settings.loadurl,data:loaddata,async:false,success:function(result){window.clearTimeout(t);input_content=result;input.disabled=false}})}else{if(settings.data){input_content=settings.data;if($.isFunction(settings.data)){input_content=settings.data.apply(self,[self.revert,settings])}}else{input_content=self.revert}}if(settings.onfocus){input_content=onfocus(input_content)}content.apply(form,[input_content,settings,self]);input.attr("name",settings.name);buttons.apply(form,[settings,self]);$(self).append(form);plugin.apply(form,[settings,self]);$(":input:visible:enabled:first",form).focus();if(settings.select){input.select()}input.keydown(function(e){if(e.keyCode==27){e.preventDefault();reset.apply(form,[settings,self])}});var t;if("cancel"==settings.onblur){input.blur(function(e){t=setTimeout(function(){reset.apply(form,[settings,self])},500)})}else{if("submit"==settings.onblur){input.blur(function(e){t=setTimeout(function(){form.submit()},200)})}else{if($.isFunction(settings.onblur)){input.blur(function(e){settings.onblur.apply(self,[input.val(),settings])})}else{input.blur(function(e){})}}}form.submit(function(e){if(t){clearTimeout(t)}e.preventDefault();if(false!==onsubmit.apply(form,[settings,self])){if(false!==submit.apply(form,[settings,self])){if($.isFunction(settings.target)){var str=settings.target.apply(self,[input.val(),settings]);$(self).html(str);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder)}}else{var submitdata={};submitdata[settings.name]=input.val();submitdata[settings.id]=self.id;if($.isFunction(settings.submitdata)){$.extend(submitdata,settings.submitdata.apply(self,[self.revert,settings]))}else{$.extend(submitdata,settings.submitdata)}if("PUT"==settings.method){submitdata._method="put"}$(self).html(settings.indicator);var ajaxoptions={type:"POST",data:submitdata,url:settings.target,success:function(result,status){$(self).html(result);self.editing=false;callback.apply(self,[self.innerHTML,settings]);if(!$.trim($(self).html())){$(self).html(settings.placeholder)}},error:function(xhr,status,error){onerror.apply(form,[settings,self,xhr])}};$.extend(ajaxoptions,settings.ajaxoptions);$.ajax(ajaxoptions)}}}$(self).attr("title",settings.tooltip);return false})});this.reset=function(form){if(this.editing){if(false!==onreset.apply(form,[settings,self])){$(self).html(self.revert);self.editing=false;if(!$.trim($(self).html())){$(self).html(settings.placeholder)}$(self).attr("title",settings.tooltip)}}}})};$.editable={types:{defaults:{element:function(settings,original){var input=$('<input type="hidden"></input>');$(this).append(input);return(input)},content:function(string,settings,original){$(":input:first",this).val(string)},reset:function(settings,original){original.reset(this)},buttons:function(settings,original){var form=this;if(settings.submit){if(settings.submit.match(/>$/)){var submit=$(settings.submit).click(function(){if(submit.attr("type")!="submit"){form.submit()}})}else{var submit=$('<button type="submit" />');submit.html(settings.submit)}$(this).append(submit)}if(settings.cancel){if(settings.cancel.match(/>$/)){var cancel=$(settings.cancel)}else{var cancel=$('<button type="cancel" />');cancel.html(settings.cancel)}$(this).append(cancel);$(cancel).click(function(event){if($.isFunction($.editable.types[settings.type].reset)){var reset=$.editable.types[settings.type].reset}else{var reset=$.editable.types.defaults.reset}reset.apply(form,[settings,original]);return false})}}},text:{element:function(settings,original){var input=$("<input />");if(settings.width!="none"){input.width(settings.width)}if(settings.height!="none"){input.height(settings.height)}input.attr("autocomplete","off");input.attr("maxlength",settings.maxlength);$(this).append(input);return(input)}},textarea:{element:function(settings,original){var textarea=$("<textarea />");if(settings.rows){textarea.attr("rows",settings.rows)}else{textarea.height(settings.height)}if(settings.cols){textarea.attr("cols",settings.cols)}else{textarea.width(settings.width)}$(this).append(textarea);return(textarea)}},select:{element:function(settings,original){var select=$("<select />");$(this).append(select);return(select)},content:function(string,settings,original){if(String==string.constructor){eval("var json = "+string);for(var key in json){if(!json.hasOwnProperty(key)){continue}if("selected"==key){continue}var option=$("<option />").val(key).append(json[key]);$("select",this).append(option)}}$("select",this).children().each(function(){if($(this).val()==json.selected||$(this).text()==original.revert){$(this).attr("selected","selected")}})}}},addInputType:function(name,input){$.editable.types[name]=input}}})(jQuery);
jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.94 (20-DEC-2010)
 * Dual licensed under the MIT and GPL licenses.
 * http://jquery.malsup.com/license.html
 * Requires: jQuery v1.2.6 or later
 */
(function(i){var l="2.94";if(i.support==undefined){i.support={opacity:!(i.browser.msie)}}function a(r){if(i.fn.cycle.debug){f(r)}}function f(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}}i.fn.cycle=function(s,r){var t={s:this.selector,c:this.context};if(this.length===0&&s!="stop"){if(!i.isReady&&t.s){f("DOM not ready, queuing slideshow");i(function(){i(t.s,t.c).cycle(s,r)});return this}f("terminating; zero elements found by selector"+(i.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var x=m(this,s,r);if(x===false){return}x.updateActivePagerLink=x.updateActivePagerLink||i.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var y=i(this);var z=x.slideExpr?i(x.slideExpr,this):y.children();var v=z.get();if(v.length<2){f("terminating; too few slides: "+v.length);return}var u=k(y,z,v,x,t);if(u===false){return}var w=u.continuous?10:h(v[u.currSlide],v[u.nextSlide],u,!u.backwards);if(w){w+=(u.delay||0);if(w<10){w=10}a("first timeout: "+w);this.cycleTimeout=setTimeout(function(){e(v,u,0,!x.backwards)},w)}})};function m(r,u,s){if(r.cycleStop==undefined){r.cycleStop=0}if(u===undefined||u===null){u={}}if(u.constructor==String){switch(u){case"destroy":case"stop":var w=i(r).data("cycle.opts");if(!w){return false}r.cycleStop++;if(r.cycleTimeout){clearTimeout(r.cycleTimeout)}r.cycleTimeout=0;i(r).removeData("cycle.opts");if(u=="destroy"){q(w)}return false;case"toggle":r.cyclePause=(r.cyclePause===1)?0:1;v(r.cyclePause,s,r);return false;case"pause":r.cyclePause=1;return false;case"resume":r.cyclePause=0;v(false,s,r);return false;case"prev":case"next":var w=i(r).data("cycle.opts");if(!w){f('options not found, "prev/next" ignored');return false}i.fn.cycle[u](w);return false;default:u={fx:u}}return u}else{if(u.constructor==Number){var t=u;u=i(r).data("cycle.opts");if(!u){f("options not found, can not advance slide");return false}if(t<0||t>=u.elements.length){f("invalid slide index: "+t);return false}u.nextSlide=t;if(r.cycleTimeout){clearTimeout(r.cycleTimeout);r.cycleTimeout=0}if(typeof s=="string"){u.oneTimeFx=s}e(u.elements,u,1,t>=u.currSlide);return false}}return u;function v(y,z,x){if(!y&&z===true){var A=i(x).data("cycle.opts");if(!A){f("options not found, can not resume");return false}if(x.cycleTimeout){clearTimeout(x.cycleTimeout);x.cycleTimeout=0}e(A.elements,A,1,!A.backwards)}}}function b(r,s){if(!i.support.opacity&&s.cleartype&&r.style.filter){try{r.style.removeAttribute("filter")}catch(t){}}}function q(r){if(r.next){i(r.next).unbind(r.prevNextEvent)}if(r.prev){i(r.prev).unbind(r.prevNextEvent)}if(r.pager||r.pagerAnchorBuilder){i.each(r.pagerAnchors||[],function(){this.unbind().remove()})}r.pagerAnchors=null;if(r.destroy){r.destroy(r)}}function k(z,L,v,u,F){var D=i.extend({},i.fn.cycle.defaults,u||{},i.metadata?z.metadata():i.meta?z.data():{});if(D.autostop){D.countdown=D.autostopCount||v.length}var s=z[0];z.data("cycle.opts",D);D.$cont=z;D.stopCount=s.cycleStop;D.elements=v;D.before=D.before?[D.before]:[];D.after=D.after?[D.after]:[];D.after.unshift(function(){D.busy=0});if(!i.support.opacity&&D.cleartype){D.after.push(function(){b(this,D)})}if(D.continuous){D.after.push(function(){e(v,D,0,!D.backwards)})}n(D);if(!i.support.opacity&&D.cleartype&&!D.cleartypeNoBg){g(L)}if(z.css("position")=="static"){z.css("position","relative")}if(D.width){z.width(D.width)}if(D.height&&D.height!="auto"){z.height(D.height)}if(D.startingSlide){D.startingSlide=parseInt(D.startingSlide)}else{if(D.backwards){D.startingSlide=v.length-1}}if(D.random){D.randomMap=[];for(var J=0;J<v.length;J++){D.randomMap.push(J)}D.randomMap.sort(function(N,w){return Math.random()-0.5});D.randomIndex=1;D.startingSlide=D.randomMap[1]}else{if(D.startingSlide>=v.length){D.startingSlide=0}}D.currSlide=D.startingSlide||0;var y=D.startingSlide;L.css({position:"absolute",top:0,left:0}).hide().each(function(w){var N;if(D.backwards){N=y?w<=y?v.length+(w-y):y-w:v.length-w}else{N=y?w>=y?v.length-(w-y):y-w:v.length-w}i(this).css("z-index",N)});i(v[y]).css("opacity",1).show();b(v[y],D);if(D.fit&&D.width){L.width(D.width)}if(D.fit&&D.height&&D.height!="auto"){L.height(D.height)}var E=D.containerResize&&!z.innerHeight();if(E){var x=0,C=0;for(var H=0;H<v.length;H++){var r=i(v[H]),M=r[0],B=r.outerWidth(),K=r.outerHeight();if(!B){B=M.offsetWidth||M.width||r.attr("width")}if(!K){K=M.offsetHeight||M.height||r.attr("height")}x=B>x?B:x;C=K>C?K:C}if(x>0&&C>0){z.css({width:x+"px",height:C+"px"})}}if(D.pause){z.hover(function(){this.cyclePause++},function(){this.cyclePause--})}if(c(D)===false){return false}var t=false;u.requeueAttempts=u.requeueAttempts||0;L.each(function(){var P=i(this);this.cycleH=(D.fit&&D.height)?D.height:(P.height()||this.offsetHeight||this.height||P.attr("height")||0);this.cycleW=(D.fit&&D.width)?D.width:(P.width()||this.offsetWidth||this.width||P.attr("width")||0);if(P.is("img")){var N=(i.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var Q=(i.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var O=(i.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var w=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(N||Q||O||w){if(F.s&&D.requeueOnImageNotLoaded&&++u.requeueAttempts<100){f(u.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){i(F.s,F.c).cycle(u)},D.requeueTimeout);t=true;return false}else{f("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(t){return false}D.cssBefore=D.cssBefore||{};D.animIn=D.animIn||{};D.animOut=D.animOut||{};L.not(":eq("+y+")").css(D.cssBefore);if(D.cssFirst){i(L[y]).css(D.cssFirst)}if(D.timeout){D.timeout=parseInt(D.timeout);if(D.speed.constructor==String){D.speed=i.fx.speeds[D.speed]||parseInt(D.speed)}if(!D.sync){D.speed=D.speed/2}var G=D.fx=="shuffle"?500:250;while((D.timeout-D.speed)<G){D.timeout+=D.speed}}if(D.easing){D.easeIn=D.easeOut=D.easing}if(!D.speedIn){D.speedIn=D.speed}if(!D.speedOut){D.speedOut=D.speed}D.slideCount=v.length;D.currSlide=D.lastSlide=y;if(D.random){if(++D.randomIndex==v.length){D.randomIndex=0}D.nextSlide=D.randomMap[D.randomIndex]}else{if(D.backwards){D.nextSlide=D.startingSlide==0?(v.length-1):D.startingSlide-1}else{D.nextSlide=D.startingSlide>=(v.length-1)?0:D.startingSlide+1}}if(!D.multiFx){var I=i.fn.cycle.transitions[D.fx];if(i.isFunction(I)){I(z,L,D)}else{if(D.fx!="custom"&&!D.multiFx){f("unknown transition: "+D.fx,"; slideshow terminating");return false}}}var A=L[y];if(D.before.length){D.before[0].apply(A,[A,A,D,true])}if(D.after.length>1){D.after[1].apply(A,[A,A,D,true])}if(D.next){i(D.next).bind(D.prevNextEvent,function(){return o(D,1)})}if(D.prev){i(D.prev).bind(D.prevNextEvent,function(){return o(D,0)})}if(D.pager||D.pagerAnchorBuilder){d(v,D)}j(D,v);return D}function n(r){r.original={before:[],after:[]};r.original.cssBefore=i.extend({},r.cssBefore);r.original.cssAfter=i.extend({},r.cssAfter);r.original.animIn=i.extend({},r.animIn);r.original.animOut=i.extend({},r.animOut);i.each(r.before,function(){r.original.before.push(this)});i.each(r.after,function(){r.original.after.push(this)})}function c(x){var v,t,s=i.fn.cycle.transitions;if(x.fx.indexOf(",")>0){x.multiFx=true;x.fxs=x.fx.replace(/\s*/g,"").split(",");for(v=0;v<x.fxs.length;v++){var w=x.fxs[v];t=s[w];if(!t||!s.hasOwnProperty(w)||!i.isFunction(t)){f("discarding unknown transition: ",w);x.fxs.splice(v,1);v--}}if(!x.fxs.length){f("No valid transitions named; slideshow terminating.");return false}}else{if(x.fx=="all"){x.multiFx=true;x.fxs=[];for(p in s){t=s[p];if(s.hasOwnProperty(p)&&i.isFunction(t)){x.fxs.push(p)}}}}if(x.multiFx&&x.randomizeEffects){var u=Math.floor(Math.random()*20)+30;for(v=0;v<u;v++){var r=Math.floor(Math.random()*x.fxs.length);x.fxs.push(x.fxs.splice(r,1)[0])}a("randomized fx sequence: ",x.fxs)}return true}function j(s,r){s.addSlide=function(u,v){var t=i(u),w=t[0];if(!s.autostopCount){s.countdown++}r[v?"unshift":"push"](w);if(s.els){s.els[v?"unshift":"push"](w)}s.slideCount=r.length;t.css("position","absolute");t[v?"prependTo":"appendTo"](s.$cont);if(v){s.currSlide++;s.nextSlide++}if(!i.support.opacity&&s.cleartype&&!s.cleartypeNoBg){g(t)}if(s.fit&&s.width){t.width(s.width)}if(s.fit&&s.height&&s.height!="auto"){t.height(s.height)}w.cycleH=(s.fit&&s.height)?s.height:t.height();w.cycleW=(s.fit&&s.width)?s.width:t.width();t.css(s.cssBefore);if(s.pager||s.pagerAnchorBuilder){i.fn.cycle.createPagerAnchor(r.length-1,w,i(s.pager),r,s)}if(i.isFunction(s.onAddSlide)){s.onAddSlide(t)}else{t.hide()}}}i.fn.cycle.resetState=function(s,r){r=r||s.fx;s.before=[];s.after=[];s.cssBefore=i.extend({},s.original.cssBefore);s.cssAfter=i.extend({},s.original.cssAfter);s.animIn=i.extend({},s.original.animIn);s.animOut=i.extend({},s.original.animOut);s.fxFn=null;i.each(s.original.before,function(){s.before.push(this)});i.each(s.original.after,function(){s.after.push(this)});var t=i.fn.cycle.transitions[r];if(i.isFunction(t)){t(s.$cont,i(s.elements),s)}};function e(y,r,x,A){if(x&&r.busy&&r.manualTrump){a("manualTrump in go(), stopping active transition");i(y).stop(true,true);r.busy=false}if(r.busy){a("transition active, ignoring new tx request");return}var v=r.$cont[0],C=y[r.currSlide],B=y[r.nextSlide];if(v.cycleStop!=r.stopCount||v.cycleTimeout===0&&!x){return}if(!x&&!v.cyclePause&&!r.bounce&&((r.autostop&&(--r.countdown<=0))||(r.nowrap&&!r.random&&r.nextSlide<r.currSlide))){if(r.end){r.end(r)}return}var z=false;if((x||!v.cyclePause)&&(r.nextSlide!=r.currSlide)){z=true;var w=r.fx;C.cycleH=C.cycleH||i(C).height();C.cycleW=C.cycleW||i(C).width();B.cycleH=B.cycleH||i(B).height();B.cycleW=B.cycleW||i(B).width();if(r.multiFx){if(r.lastFx==undefined||++r.lastFx>=r.fxs.length){r.lastFx=0}w=r.fxs[r.lastFx];r.currFx=w}if(r.oneTimeFx){w=r.oneTimeFx;r.oneTimeFx=null}i.fn.cycle.resetState(r,w);if(r.before.length){i.each(r.before,function(D,E){if(v.cycleStop!=r.stopCount){return}E.apply(B,[C,B,r,A])})}var t=function(){i.each(r.after,function(D,E){if(v.cycleStop!=r.stopCount){return}E.apply(B,[C,B,r,A])})};a("tx firing; currSlide: "+r.currSlide+"; nextSlide: "+r.nextSlide);r.busy=1;if(r.fxFn){r.fxFn(C,B,r,t,A,x&&r.fastOnEvent)}else{if(i.isFunction(i.fn.cycle[r.fx])){i.fn.cycle[r.fx](C,B,r,t,A,x&&r.fastOnEvent)}else{i.fn.cycle.custom(C,B,r,t,A,x&&r.fastOnEvent)}}}if(z||r.nextSlide==r.currSlide){r.lastSlide=r.currSlide;if(r.random){r.currSlide=r.nextSlide;if(++r.randomIndex==y.length){r.randomIndex=0}r.nextSlide=r.randomMap[r.randomIndex];if(r.nextSlide==r.currSlide){r.nextSlide=(r.currSlide==r.slideCount-1)?0:r.currSlide+1}}else{if(r.backwards){var u=(r.nextSlide-1)<0;if(u&&r.bounce){r.backwards=!r.backwards;r.nextSlide=1;r.currSlide=0}else{r.nextSlide=u?(y.length-1):r.nextSlide-1;r.currSlide=u?0:r.nextSlide+1}}else{var u=(r.nextSlide+1)==y.length;if(u&&r.bounce){r.backwards=!r.backwards;r.nextSlide=y.length-2;r.currSlide=y.length-1}else{r.nextSlide=u?0:r.nextSlide+1;r.currSlide=u?y.length-1:r.nextSlide-1}}}}if(z&&r.pager){r.updateActivePagerLink(r.pager,r.currSlide,r.activePagerClass)}var s=0;if(r.timeout&&!r.continuous){s=h(y[r.currSlide],y[r.nextSlide],r,A)}else{if(r.continuous&&v.cyclePause){s=10}}if(s>0){v.cycleTimeout=setTimeout(function(){e(y,r,0,!r.backwards)},s)}}i.fn.cycle.updateActivePagerLink=function(r,t,s){i(r).each(function(){i(this).children().removeClass(s).eq(t).addClass(s)})};function h(w,u,v,s){if(v.timeoutFn){var r=v.timeoutFn.call(w,w,u,v,s);while((r-v.speed)<250){r+=v.speed}a("calculated timeout: "+r+"; speed: "+v.speed);if(r!==false){return r}}return v.timeout}i.fn.cycle.next=function(r){o(r,1)};i.fn.cycle.prev=function(r){o(r,0)};function o(u,t){var x=t?1:-1;var s=u.elements;var w=u.$cont[0],v=w.cycleTimeout;if(v){clearTimeout(v);w.cycleTimeout=0}if(u.random&&x<0){u.randomIndex--;if(--u.randomIndex==-2){u.randomIndex=s.length-2}else{if(u.randomIndex==-1){u.randomIndex=s.length-1}}u.nextSlide=u.randomMap[u.randomIndex]}else{if(u.random){u.nextSlide=u.randomMap[u.randomIndex]}else{u.nextSlide=u.currSlide+x;if(u.nextSlide<0){if(u.nowrap){return false}u.nextSlide=s.length-1}else{if(u.nextSlide>=s.length){if(u.nowrap){return false}u.nextSlide=0}}}}var r=u.onPrevNextEvent||u.prevNextClick;if(i.isFunction(r)){r(x>0,u.nextSlide,s[u.nextSlide])}e(s,u,1,t);return false}function d(s,t){var r=i(t.pager);i.each(s,function(u,v){i.fn.cycle.createPagerAnchor(u,v,r,s,t)});t.updateActivePagerLink(t.pager,t.startingSlide,t.activePagerClass)}i.fn.cycle.createPagerAnchor=function(v,w,t,u,x){var s;if(i.isFunction(x.pagerAnchorBuilder)){s=x.pagerAnchorBuilder(v,w);a("pagerAnchorBuilder("+v+", el) returned: "+s)}else{s='<a href="#">'+(v+1)+"</a>"}if(!s){return}var y=i(s);if(y.parents("body").length===0){var r=[];if(t.length>1){t.each(function(){var z=y.clone(true);i(this).append(z);r.push(z[0])});y=i(r)}else{y.appendTo(t)}}x.pagerAnchors=x.pagerAnchors||[];x.pagerAnchors.push(y);y.bind(x.pagerEvent,function(C){C.preventDefault();x.nextSlide=v;var B=x.$cont[0],A=B.cycleTimeout;if(A){clearTimeout(A);B.cycleTimeout=0}var z=x.onPagerEvent||x.pagerClick;if(i.isFunction(z)){z(x.nextSlide,u[x.nextSlide])}e(u,x,1,x.currSlide<v)});if(!/^click/.test(x.pagerEvent)&&!x.allowPagerClickBubble){y.bind("click.cycle",function(){return false})}if(x.pauseOnPagerHover){y.hover(function(){x.$cont[0].cyclePause++},function(){x.$cont[0].cyclePause--})}};i.fn.cycle.hopsFromLast=function(u,t){var s,r=u.lastSlide,v=u.currSlide;if(t){s=v>r?v-r:u.slideCount-r}else{s=v<r?r-v:r+u.slideCount-v}return s};function g(t){a("applying clearType background-color hack");function s(u){u=parseInt(u).toString(16);return u.length<2?"0"+u:u}function r(x){for(;x&&x.nodeName.toLowerCase()!="html";x=x.parentNode){var u=i.css(x,"background-color");if(u.indexOf("rgb")>=0){var w=u.match(/\d+/g);return"#"+s(w[0])+s(w[1])+s(w[2])}if(u&&u!="transparent"){return u}}return"#ffffff"}t.each(function(){i(this).css("background-color",r(this))})}i.fn.cycle.commonReset=function(x,u,v,s,t,r){i(v.elements).not(x).hide();v.cssBefore.opacity=1;v.cssBefore.display="block";if(v.slideResize&&s!==false&&u.cycleW>0){v.cssBefore.width=u.cycleW}if(v.slideResize&&t!==false&&u.cycleH>0){v.cssBefore.height=u.cycleH}v.cssAfter=v.cssAfter||{};v.cssAfter.display="none";i(x).css("zIndex",v.slideCount+(r===true?1:0));i(u).css("zIndex",v.slideCount+(r===true?0:1))};i.fn.cycle.custom=function(D,x,r,u,w,s){var C=i(D),y=i(x);var t=r.speedIn,B=r.speedOut,v=r.easeIn,A=r.easeOut;y.css(r.cssBefore);if(s){if(typeof s=="number"){t=B=s}else{t=B=1}v=A=null}var z=function(){y.animate(r.animIn,t,v,u)};C.animate(r.animOut,B,A,function(){if(r.cssAfter){C.css(r.cssAfter)}if(!r.sync){z()}});if(r.sync){z()}};i.fn.cycle.transitions={fade:function(s,t,r){t.not(":eq("+r.currSlide+")").css("opacity",0);r.before.push(function(w,u,v){i.fn.cycle.commonReset(w,u,v);v.cssBefore.opacity=0});r.animIn={opacity:1};r.animOut={opacity:0};r.cssBefore={top:0,left:0}}};i.fn.cycle.ver=function(){return l};i.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,slideResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!i.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null,backwards:false}})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version:	 2.73
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(a){a.fn.cycle.transitions.none=function(c,d,b){b.fxFn=function(g,e,f,h){a(e).show();a(g).hide();h()}};a.fn.cycle.transitions.fadeout=function(c,d,b){d.not(":eq("+b.currSlide+")").css({display:"block",opacity:1});b.before.push(function(k,i,j,f,g,e){a(k).css("zIndex",j.slideCount+(!e===true?1:0));a(i).css("zIndex",j.slideCount+(!e===true?0:1))});b.animIn={opacity:1};b.animOut={opacity:0};b.cssBefore={opacity:1,display:"block"};b.cssAfter={zIndex:0}};a.fn.cycle.transitions.scrollUp=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssBefore={top:b,left:0};c.cssFirst={top:0};c.animIn={top:0};c.animOut={top:-b}};a.fn.cycle.transitions.scrollDown=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssFirst={top:0};c.cssBefore={top:-b,left:0};c.animIn={top:0};c.animOut={top:b}};a.fn.cycle.transitions.scrollLeft=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.width();c.cssFirst={left:0};c.cssBefore={left:b,top:0};c.animIn={left:0};c.animOut={left:0-b}};a.fn.cycle.transitions.scrollRight=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.width();c.cssFirst={left:0};c.cssBefore={left:-b,top:0};c.animIn={left:0};c.animOut={left:b}};a.fn.cycle.transitions.scrollHorz=function(c,d,b){c.css("overflow","hidden").width();b.before.push(function(h,f,g,e){if(g.rev){e=!e}a.fn.cycle.commonReset(h,f,g);g.cssBefore.left=e?(f.cycleW-1):(1-f.cycleW);g.animOut.left=e?-h.cycleW:h.cycleW});b.cssFirst={left:0};b.cssBefore={top:0};b.animIn={left:0};b.animOut={top:0}};a.fn.cycle.transitions.scrollVert=function(c,d,b){c.css("overflow","hidden");b.before.push(function(h,f,g,e){if(g.rev){e=!e}a.fn.cycle.commonReset(h,f,g);g.cssBefore.top=e?(1-f.cycleH):(f.cycleH-1);g.animOut.top=e?h.cycleH:-h.cycleH});b.cssFirst={top:0};b.cssBefore={left:0};b.animIn={top:0};b.animOut={left:0}};a.fn.cycle.transitions.slideX=function(c,d,b){b.before.push(function(g,e,f){a(f.elements).not(g).hide();a.fn.cycle.commonReset(g,e,f,false,true);f.animIn.width=e.cycleW});b.cssBefore={left:0,top:0,width:0};b.animIn={width:"show"};b.animOut={width:0}};a.fn.cycle.transitions.slideY=function(c,d,b){b.before.push(function(g,e,f){a(f.elements).not(g).hide();a.fn.cycle.commonReset(g,e,f,true,false);f.animIn.height=e.cycleH});b.cssBefore={left:0,top:0,height:0};b.animIn={height:"show"};b.animOut={height:0}};a.fn.cycle.transitions.shuffle=function(e,f,d){var c,b=e.css("overflow","visible").width();f.css({left:0,top:0});d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h,true,true,true)});if(!d.speedAdjusted){d.speed=d.speed/2;d.speedAdjusted=true}d.random=0;d.shuffle=d.shuffle||{left:-b,top:15};d.els=[];for(c=0;c<f.length;c++){d.els.push(f[c])}for(c=0;c<d.currSlide;c++){d.els.push(d.els.shift())}d.fxFn=function(m,j,l,g,i){if(l.rev){i=!i}var h=i?a(m):a(j);a(j).css(l.cssBefore);var k=l.slideCount;h.animate(l.shuffle,l.speedIn,l.easeIn,function(){var o=a.fn.cycle.hopsFromLast(l,i);for(var q=0;q<o;q++){i?l.els.push(l.els.shift()):l.els.unshift(l.els.pop())}if(i){for(var r=0,n=l.els.length;r<n;r++){a(l.els[r]).css("z-index",n-r+k)}}else{var s=a(m).css("z-index");h.css("z-index",parseInt(s)+1+k)}h.animate({left:0,top:0},l.speedOut,l.easeOut,function(){a(i?this:m).hide();if(g){g()}})})};d.cssBefore={display:"block",opacity:1,top:0,left:0}};a.fn.cycle.transitions.turnUp=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.cssBefore.top=e.cycleH;f.animIn.height=e.cycleH;f.animOut.width=e.cycleW});b.cssFirst={top:0};b.cssBefore={left:0,height:0};b.animIn={top:0};b.animOut={height:0}};a.fn.cycle.transitions.turnDown=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.animIn.height=e.cycleH;f.animOut.top=g.cycleH});b.cssFirst={top:0};b.cssBefore={left:0,top:0,height:0};b.animOut={height:0}};a.fn.cycle.transitions.turnLeft=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.cssBefore.left=e.cycleW;f.animIn.width=e.cycleW});b.cssBefore={top:0,width:0};b.animIn={left:0};b.animOut={width:0}};a.fn.cycle.transitions.turnRight=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.animIn.width=e.cycleW;f.animOut.left=g.cycleW});b.cssBefore={top:0,left:0,width:0};b.animIn={left:0};b.animOut={width:0}};a.fn.cycle.transitions.zoom=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,false,true);f.cssBefore.top=e.cycleH/2;f.cssBefore.left=e.cycleW/2;f.animIn={top:0,left:0,width:e.cycleW,height:e.cycleH};f.animOut={width:0,height:0,top:g.cycleH/2,left:g.cycleW/2}});b.cssFirst={top:0,left:0};b.cssBefore={width:0,height:0}};a.fn.cycle.transitions.fadeZoom=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,false);f.cssBefore.left=e.cycleW/2;f.cssBefore.top=e.cycleH/2;f.animIn={top:0,left:0,width:e.cycleW,height:e.cycleH}});b.cssBefore={width:0,height:0};b.animOut={opacity:0}};a.fn.cycle.transitions.blindX=function(d,e,c){var b=d.css("overflow","hidden").width();c.before.push(function(h,f,g){a.fn.cycle.commonReset(h,f,g);g.animIn.width=f.cycleW;g.animOut.left=h.cycleW});c.cssBefore={left:b,top:0};c.animIn={left:0};c.animOut={left:b}};a.fn.cycle.transitions.blindY=function(d,e,c){var b=d.css("overflow","hidden").height();c.before.push(function(h,f,g){a.fn.cycle.commonReset(h,f,g);g.animIn.height=f.cycleH;g.animOut.top=h.cycleH});c.cssBefore={top:b,left:0};c.animIn={top:0};c.animOut={top:b}};a.fn.cycle.transitions.blindZ=function(e,f,d){var c=e.css("overflow","hidden").height();var b=e.width();d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h);h.animIn.height=g.cycleH;h.animOut.top=i.cycleH});d.cssBefore={top:c,left:b};d.animIn={top:0,left:0};d.animOut={top:c,left:b}};a.fn.cycle.transitions.growX=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.cssBefore.left=this.cycleW/2;f.animIn={left:0,width:this.cycleW};f.animOut={left:0}});b.cssBefore={width:0,top:0}};a.fn.cycle.transitions.growY=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.cssBefore.top=this.cycleH/2;f.animIn={top:0,height:this.cycleH};f.animOut={top:0}});b.cssBefore={height:0,left:0}};a.fn.cycle.transitions.curtainX=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true,true);f.cssBefore.left=e.cycleW/2;f.animIn={left:0,width:this.cycleW};f.animOut={left:g.cycleW/2,width:0}});b.cssBefore={top:0,width:0}};a.fn.cycle.transitions.curtainY=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false,true);f.cssBefore.top=e.cycleH/2;f.animIn={top:0,height:e.cycleH};f.animOut={top:g.cycleH/2,height:0}});b.cssBefore={left:0,height:0}};a.fn.cycle.transitions.cover=function(f,g,e){var i=e.direction||"left";var b=f.css("overflow","hidden").width();var c=f.height();e.before.push(function(j,d,h){a.fn.cycle.commonReset(j,d,h);if(i=="right"){h.cssBefore.left=-b}else{if(i=="up"){h.cssBefore.top=c}else{if(i=="down"){h.cssBefore.top=-c}else{h.cssBefore.left=b}}}});e.animIn={left:0,top:0};e.animOut={opacity:1};e.cssBefore={top:0,left:0}};a.fn.cycle.transitions.uncover=function(f,g,e){var i=e.direction||"left";var b=f.css("overflow","hidden").width();var c=f.height();e.before.push(function(j,d,h){a.fn.cycle.commonReset(j,d,h,true,true,true);if(i=="right"){h.animOut.left=b}else{if(i=="up"){h.animOut.top=-c}else{if(i=="down"){h.animOut.top=c}else{h.animOut.left=-b}}}});e.animIn={left:0,top:0};e.animOut={opacity:1};e.cssBefore={top:0,left:0}};a.fn.cycle.transitions.toss=function(e,f,d){var b=e.css("overflow","visible").width();var c=e.height();d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h,true,true,true);if(!h.animOut.left&&!h.animOut.top){h.animOut={left:b*2,top:-c/2,opacity:0}}else{h.animOut.opacity=0}});d.cssBefore={left:0,top:0};d.animIn={left:0}};a.fn.cycle.transitions.wipe=function(s,m,e){var q=s.css("overflow","hidden").width();var j=s.height();e.cssBefore=e.cssBefore||{};var g;if(e.clip){if(/l2r/.test(e.clip)){g="rect(0px 0px "+j+"px 0px)"}else{if(/r2l/.test(e.clip)){g="rect(0px "+q+"px "+j+"px "+q+"px)"}else{if(/t2b/.test(e.clip)){g="rect(0px "+q+"px 0px 0px)"}else{if(/b2t/.test(e.clip)){g="rect("+j+"px "+q+"px "+j+"px 0px)"}else{if(/zoom/.test(e.clip)){var o=parseInt(j/2);var f=parseInt(q/2);g="rect("+o+"px "+f+"px "+o+"px "+f+"px)"}}}}}}e.cssBefore.clip=e.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var k=e.cssBefore.clip.match(/(\d+)/g);var u=parseInt(k[0]),c=parseInt(k[1]),n=parseInt(k[2]),i=parseInt(k[3]);e.before.push(function(w,h,t){if(w==h){return}var d=a(w),b=a(h);a.fn.cycle.commonReset(w,h,t,true,true,false);t.cssAfter.display="block";var r=1,l=parseInt((t.speedIn/13))-1;(function v(){var y=u?u-parseInt(r*(u/l)):0;var z=i?i-parseInt(r*(i/l)):0;var A=n<j?n+parseInt(r*((j-n)/l||1)):j;var x=c<q?c+parseInt(r*((q-c)/l||1)):q;b.css({clip:"rect("+y+"px "+x+"px "+A+"px "+z+"px)"});(r++<=l)?setTimeout(v,13):d.css("display","none")})()});e.cssBefore={display:"block",opacity:1,top:0,left:0};e.animIn={left:0};e.animOut={left:0}}})(jQuery);
(function(a){a.fn.jpager=function(b,d){var c={navClass:"pager_page_nav ",navSelectedClass:"pager_page_selected",startPage:1,pageUpdateHook:function(){}};if(d){a.extend(c,d)}return this.each(function(){var n=a(b);var m=0;for(var k=0;k<n.length;k++){if(n.eq(k).height()>m){m=n.eq(k).height()}}n.css("min-height",m);n.parent().append("<div class='"+c.navClass+"'>"+l(b,n.length)+"</div>");var f=a(b+" ~ ."+c.navClass).children();for(var h=0;h<f.length;h++){if(h==0){a(f[h]).bind("click",{elementId:b,pageNum:h,navClass:c.navClass,navSelectedClass:c.navSelectedClass,pageUpdateHook:c.pageUpdateHook},function(i){e(i.data.elementId,"Prev",i.data.navClass,i.data.navSelectedClass,i.data.pageUpdateHook)})}else{if(h==f.length-1){a(f[h]).bind("click",{elementId:b,pageNum:h,navClass:c.navClass,navSelectedClass:c.navSelectedClass,pageUpdateHook:c.pageUpdateHook},function(i){e(i.data.elementId,"Next",i.data.navClass,i.data.navSelectedClass,i.data.pageUpdateHook)})}else{a(f[h]).bind("click",{elementId:b,pageNum:h,navClass:c.navClass,navSelectedClass:c.navSelectedClass,pageUpdateHook:c.pageUpdateHook},function(i){e(i.data.elementId,i.data.pageNum,i.data.navClass,i.data.navSelectedClass,i.data.pageUpdateHook)})}}}e(b,parseInt(c.startPage),c.navClass,c.navSelectedClass,c.pageUpdateHook);function l(o,p){var j="";j+=g(o,"Prev");for(var q=0;q<p;q++){j+=g(o,q+1)}j+=g(o,"Next");return j}function g(i,j){return"<a href='javascript:void(0)' rel='"+j+"'>"+j+"</a>"}function e(r,j,t,v,w){var q=a(r+" ~ ."+t).children();var o=j;if(j=="Prev"||j=="Next"){var p=a(r).parent().children();var u=0;for(var s=0;s<p.length;s++){if(a(p[s]).css("display")!="none"){u=s;break}}if(j=="Prev"){o=(u<1)?1:u}else{if(j=="Next"){o=(u+2>=p.length)?u+1:u+2}}}a(r).hide();a(r).eq(o-1).show();a(q).removeClass(v);if(o==1){a(q).eq(0).addClass(v)}else{if(o>=q.length-2){a(q).eq(o+1).addClass(v)}}a(q).eq(o).addClass(v);if(q.length==3){a(q).eq(0).hide();a(q).eq(2).hide()}w(o)}})}})(jQuery);
/*
 * jquery.qtip. The jQuery tooltip plugin
 *
 * Copyright (c) 2009 Craig Thompson
 * http://craigsworks.com
 *
 * Licensed under MIT
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Launch  : February 2009
 * Version : 1.0.0-rc3
 * Released: Tuesday 12th May, 2009 - 00:00
 * Debug: jquery.qtip.debug.js
 */
(function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")=="object"){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';">  <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;">    <div class="qtip-contentWrapper" style="overflow:hidden;">       <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);
/*
 * jQuery xmlDOM Plugin v1.0
 * http://outwestmedia.com/jquery-plugins/xmldom/
 *
 * Released: 2009-04-06
 * Version: 1.0
 *
 * Copyright (c) 2009 Jonathan Sharp, Out West Media LLC.
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 */
(function(a){if(window.DOMParser==undefined&&window.ActiveXObject){DOMParser=function(){};DOMParser.prototype.parseFromString=function(c){var b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(c);return b}}a.xmlDOM=function(b,h){try{var d=(new DOMParser()).parseFromString(b,"text/xml");if(a.isXMLDoc(d)){var c=a("parsererror",d);if(c.length==1){throw ("Error: "+a(d).text())}}else{throw ("Unable to parse XML")}}catch(f){var g=(f.name==undefined?f:f.name+": "+f.message);if(a.isFunction(h)){h(g)}else{a(document).trigger("xmlParseError",[g])}return a([])}return a(d)}})(jQuery);
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}AD+='<param name="AllowScriptAccess" value="always" />';v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();
(function(b){b.tools=b.tools||{version:{}};b.tools.version.scrollable="1.0.5";var c=null;function a(p,m){var s=this;if(!c){c=s}function n(t,u){b(s).bind(t,function(w,v){if(u&&u.call(this,v.index)===false&&v){v.proceed=false}});return s}b.each(m,function(t,u){if(b.isFunction(u)){n(t,u)}});var d=!m.vertical;var f=b(m.items,p);var j=0;function l(u,t){return u.indexOf("#")!=-1?b(u).eq(0):t.siblings(u).eq(0)}var q=l(m.navi,p);var g=l(m.prev,p);var i=l(m.next,p);var h=l(m.prevPage,p);var o=l(m.nextPage,p);b.extend(s,{getIndex:function(){return j},getConf:function(){return m},getSize:function(){return s.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(j/m.size)},getRoot:function(){return p},getItemWrap:function(){return f},getItems:function(){return f.children()},getVisibleItems:function(){return s.getItems().slice(j,j+m.size)},seekTo:function(w,u,A){if(u===undefined){u=m.speed}if(b.isFunction(u)){A=u;u=m.speed}if(w<0){w=0}if(w>s.getSize()-m.size){return s}var B=s.getItems().eq(w);if(!B.length){return s}var t={index:w,proceed:true};b(s).trigger("onBeforeSeek",t);if(!t.proceed){return s}if(d){var v=-B.position().left;f.animate({left:v},u,m.easing,A?function(){A.call(s)}:null)}else{var z=-B.position().top;f.animate({top:z},u,m.easing,A?function(){A.call(s)}:null)}if(q.length){var x=m.activeClass;var y=Math.ceil(w/m.size);y=Math.min(y,q.children().length-1);q.children().removeClass(x).eq(y).addClass(x)}if(w===0){g.add(h).addClass(m.disabledClass)}else{g.add(h).removeClass(m.disabledClass)}if(w>=s.getSize()-m.size){i.add(o).addClass(m.disabledClass)}else{i.add(o).removeClass(m.disabledClass)}c=s;j=w;b(s).trigger("onSeek",{index:w});return s},move:function(v,u,t){var w=j+v;if(m.loop&&w>(s.getSize()-m.size)){w=0}return this.seekTo(w,u,t)},next:function(u,t){return this.move(1,u,t)},prev:function(u,t){return this.move(-1,u,t)},movePage:function(v,u,t){return this.move(m.size*v,u,t)},setPage:function(x,y,v){var u=m.size;var t=u*x;var w=t+u>=this.getSize();if(w){t=this.getSize()-m.size}return this.seekTo(t,y,v)},prevPage:function(u,t){return this.setPage(this.getPageIndex()-1,u,t)},nextPage:function(u,t){return this.setPage(this.getPageIndex()+1,u,t)},begin:function(u,t){return this.seekTo(0,u,t)},end:function(u,t){return this.seekTo(this.getSize()-m.size,u,t)},reload:function(){return r()},click:function(u,x,v){var w=s.getItems().eq(u);var t=m.activeClass;if(u<0||u>=this.getSize()){return s}if(m.size==2){if(u==s.getIndex()){u--}s.getItems().removeClass(t);w.addClass(t);return this.seekTo(u,x,v)}if(!w.hasClass(t)){s.getItems().removeClass(t);w.addClass(t);var z=Math.floor(m.size/2);var y=u-z;if(y>s.getSize()-m.size){y=s.getSize()-m.size}if(y!==u){return this.seekTo(y,x,v)}}return s},onBeforeSeek:function(t){return n("onBeforeSeek",t)},onSeek:function(t){return n("onSeek",t)}});if(b.isFunction(b.fn.mousewheel)){p.bind("mousewheel.scrollable",function(u,v){var t=b.browser.opera?1:-1;s.move(v>0?t:-t,50);return false})}g.addClass(m.disabledClass).click(function(){s.prev()});i.click(function(){s.next()});if(s.getSize()<=m.size){o.addClass(m.disabledClass).click(function(){s.nextPage()})}else{o.click(function(){s.nextPage()})}h.addClass(m.disabledClass).click(function(){s.prevPage()});if(m.keyboard){b(document).unbind("keydown.scrollable").bind("keydown.scrollable",function(t){var u=c;if(!u||t.altKey||t.ctrlKey){return}if(d&&(t.keyCode==37||t.keyCode==39)){u.move(t.keyCode==37?-1:1);return t.preventDefault()}if(!d&&(t.keyCode==38||t.keyCode==40)){u.move(t.keyCode==38?-1:1);return t.preventDefault()}return true})}function r(){if(q.is(":empty")||q.data("me")==s){q.empty();q.data("me",s);for(var u=0;u<s.getPageAmount();u++){var v=b("<"+m.naviItem+"/>").attr("href",u).click(function(x){var w=b(this);w.parent().children().removeClass(m.activeClass);w.addClass(m.activeClass);s.setPage(w.attr("href"));return x.preventDefault()});if(u===0){v.addClass(m.activeClass)}q.append(v)}}else{var t=q.children();t.each(function(w){var x=b(this);x.attr("href",w);if(w===0){x.addClass(m.activeClass)}x.click(function(){q.find("."+m.activeClass).removeClass(m.activeClass);x.addClass(m.activeClass);s.setPage(x.attr("href"))})})}if(m.clickable){s.getItems().each(function(x,w){var y=b(this);if(!y.data("set")){y.bind("click.scrollable",function(){s.click(x)});y.data("set",true)}})}if(m.hoverClass){s.getItems().hover(function(){b(this).addClass(m.hoverClass)},function(){b(this).removeClass(m.hoverClass)})}return s}r();var e=null;function k(){if(e){return}e=setInterval(function(){if(m.interval===0){clearInterval(e);e=0;return}s.next()},m.interval)}if(m.interval>0){p.hover(function(){clearInterval(e);e=0},function(){k()});k()}}b.fn.scrollable=function(d){var e=this.eq(typeof d=="number"?d:0).data("scrollable");if(e){return e}var f={size:5,vertical:false,clickable:true,loop:false,interval:0,speed:400,keyboard:true,activeClass:"active",disabledClass:"disabled",hoverClass:null,easing:"swing",items:".items",prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",navi:".navi",naviItem:"a",api:false,onBeforeSeek:null,onSeek:null};b.extend(f,d);this.each(function(){e=new a(b(this),f);b(this).data("scrollable",e)});return f.api?e:this}})(jQuery);
var gAutomaticReloadForwardObject=null;function automaticReloadForward(){if(gAutomaticReloadForwardObject!=null){gAutomaticReloadForwardObject.automaticReload()}}if(typeof ut=="undefined"){var ut=new Object()}ut.UnityObject=function(e,f,c,g,j,b){if(!document.getElementById){return}this.attributes=new Array();this.params=new Object();if(e){this.setAttribute("src",e)}if(f){this.setAttribute("id",f)}if(c){this.setAttribute("width",c)}if(g){this.setAttribute("height",g)}if(j){this.setAttribute("div",j)}if(b){this.setAttribute("anchor",b)}};ut.UnityObject.prototype={addParam:function(b,a){this.params[b]=a},automaticReload:function(){gAutomaticReloadForwardObject=null;navigator.plugins.refresh();if(this.detectUnityWebPlayer()){window.location.reload()}else{gAutomaticReloadForwardObject=this;setTimeout("automaticReloadForward()",500)}},detectUnityWebPlayer:function(){var a=false;if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.toLowerCase().indexOf("win")!=-1){a=DetectUnityWebPlayerActiveX()}else{if(navigator.mimeTypes&&navigator.mimeTypes["application/vnd.unity"]&&navigator.mimeTypes["application/vnd.unity"].enabledPlugin){if(navigator.plugins&&navigator.plugins["Unity Player"]){a=true}}}return a},findEar:function(){this.unityEar="";if(navigator.appVersion.indexOf("Chrome")){this.unityEar=document.getElementById(this.getAttribute("id")+"Embed")}else{if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.toLowerCase().indexOf("win")!=-1){this.unityEar=document.getElementById(this.getAttribute("id")+"Object")}else{if(navigator.appVersion.toLowerCase().indexOf("safari")!=-1){this.unityEar=document.getElementById(this.getAttribute("id")+"Object")}else{this.unityEar=document.getElementById(this.getAttribute("id")+"Embed")}}}document.Unity=this.unityEar},getAttribute:function(a){return this.attributes[a]},getParams:function(){return this.params},getInstallerPath:function(){var a="";if(navigator.platform=="MacIntel"){a="http://webplayer.unity3d.com/download_webplayer-2.x/webplayer-i386.dmg"}else{if(navigator.platform=="MacPPC"){a="http://webplayer.unity3d.com/download_webplayer-2.x/webplayer-ppc.dmg"}else{if(navigator.platform.toLowerCase().indexOf("win")!=-1){a="http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayer.exe"}}}return a},msg:function(c,a,b){this.unityEar.SendMessage(c,a,b)},setAttribute:function(b,a){this.attributes[b]=a},write:function(a){if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.toLowerCase().indexOf("win")!=-1){document.write(" \n");document.write("<script language='VBscript'> \n");document.write("function DetectUnityWebPlayerActiveX \n");document.write("on error resume next \n");document.write("dim tControl \n");document.write("dim res \n");document.write("res = 0 \n");if(this.playerVersion==1){document.write('set tControl = CreateObject("UnityWebPlayer.UnityWebPlayerAXCtrl.1") \n')}else{if(this.playerVersion>=2){document.write('set tControl = CreateObject("UnityWebPlayer.UnityWebPlayer.1") \n')}}document.write("if IsObject(tControl) then \n");document.write("res = 1 \n");document.write("end if \n");document.write("DetectUnityWebPlayerActiveX = res\n");document.write("end function\n");document.write("<\/script>\n")}if(this.detectUnityWebPlayer()){if(this.getAttribute("div")){this.getAttribute("div").html(this.writeEmbedDOM())}else{document.write(this.writeEmbedDOM())}this.findEar();return true}else{var b=this.getInstallerPath();if(b==""){b="http://www.unity3d.com/unity-web-player-2.x"}if(this.getAttribute("div")&&this.getAttribute("anchor")){this.getAttribute("anchor").attr({href:b})}this.automaticReload();return false}},writeEmbedDOM:function(){var a="";a+="<object classid='clsid:444785F1-DE89-4295-863A-D46C3A781394' codebase='http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayer.cab#version=2,0,0,0";a+="id='"+this.getAttribute("id")+"Object' width='"+this.getAttribute("width")+"' height='"+this.getAttribute("height")+"'><param name='src' value='"+this.getAttribute("src")+"' />";var c=this.getParams();for(var b in c){a+="<param name='"+b+"' value='"+c[b]+"' />"}a+="<embed type='application/vnd.unity' pluginspage='http://www.unity3d.com/unity-web-player-2.x' ";a+="id='"+this.getAttribute("id")+"Embed' width='"+this.getAttribute("width")+"' height='"+this.getAttribute("height")+"' src='"+this.getAttribute("src")+"' ";var c=this.getParams();for(var b in c){a+=[b]+"='"+c[b]+"' "}a+=" /></object>";return a}};if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a]}}var UnityObject=ut.UnityObject;
jQuery.extend({getScript:function(c,e){var d=document.getElementsByTagName("head")[0];var b=document.createElement("script");b.src=c;var a=false;b.onload=b.onreadystatechange=function(){if(!a&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){a=true;if(e){e()}b.onload=b.onreadystatechange=null}};d.appendChild(b);return undefined}});var tmpLoginId;var g_isInterstitial=false;var g_flvPlayer;var s_flvTimeout;var OAS_url="http://oasc11009.247realmedia.com/RealMedia/ads/";var OAS_site="www.tetrisfriends.com/openweb/";var OAS_sitepage="home";var OAS_listpos="";var OAS_query="XE&amp;status=active&amp;XE";var OAS_target="_top";var OAS_version=10;var OAS_rn=new String(Math.random());var OAS_rns=OAS_rn.substring(2,11);function OAS_NORMAL(a){document.write('<a href="'+OAS_url+"click_nx.ads/"+OAS_site+OAS_sitepage+"/1"+OAS_rns+"@"+OAS_listpos+"!"+a+"?"+OAS_query+'" target='+OAS_target+">");document.write('<img src="'+OAS_url+"adstream_nx.ads/"+OAS_site+OAS_sitepage+"/1"+OAS_rns+"@"+OAS_listpos+"!"+a+"?"+OAS_query+'" border="0" alt="Loading..."></img></a>')}function OAS_INIT(b,d,c,a){OAS_listpos=b;OAS_query=d;OAS_sitepage=c;OAS_version=a;if(b!=""){if(OAS_version==11){if((navigator.userAgent.indexOf("Mozilla/3")!=-1)||(navigator.userAgent.indexOf("Mozilla/4.0 webTV")!=-1)){OAS_version=10}}if(OAS_version>=11){document.write('<script language="javascript1.1" src="'+OAS_url+"adstream_mjx.ads/"+OAS_site+OAS_sitepage+"/1"+OAS_rns+"@"+OAS_listpos+"?"+OAS_query+'"><\/script>')}}document.write("")}function OAS_GET_URL(b,c){var a=OAS_url+"adstream_"+b+".ads/"+OAS_site+OAS_sitepage+"/1"+OAS_rns+"@"+c+"?"+decodeHtmlSpecialChars(OAS_query);return a}function OAS_AD(a){if(OAS_version>=11){OAS_RICH(a)}else{OAS_NORMAL(a)}}function shadowboxInit(d,b,a){var c={animate:false,animSequence:"sync",displayNav:false,overlayColor:"#000000",overlayOpacity:0.4,continuous:false,displayCounter:true,counterType:"default",viewportPadding:5,handleOversize:"resize",enableKeys:b,handleUnsupported:"remove",modal:d,language:"en"};Shadowbox.init(c)}function popUpBoxByUrl(b,a,c,e,d){Shadowbox.open({player:"iframe",title:e,content:b,height:c,width:a});Shadowbox.applyOptions({onClose:d})}function popUpBoxByUrlExt(b,a,c,f,d,e,g){Shadowbox.open({player:"iframe",title:f,content:b,height:c,width:a});Shadowbox.applyOptions({onClose:d,onFinish:e,onOpen:g})}function popUpBoxByHtml(b,a,c,f,d,e){Shadowbox.open({player:"html",title:f,content:b,height:c,width:a});Shadowbox.applyOptions({onClose:d,onFinish:e})}function popUpBoxByFlv(e,a,c,f,b,g,d){Shadowbox.open({player:"flv",title:f,caption:b,content:e,height:c,width:a});Shadowbox.applyOptions({onClose:d});Shadowbox.applyOptions({onFinish:g})}function closePopup(){var a=window.parent.Shadowbox;a.close()}var homepageHasLoadedMiniLbd;function homeRenderFlash(c,b,a){var d=DetectFlashVer(9,0,0);if(d){swfobject.embedSWF(c,"game_feature_swf",b,a,"9.0.0",{},{},{wmode:"opaque"},{allowscriptaccess:"always"},{id:"gameFeatureSwf",name:"gameFeatureSwf"})}else{$("#errorMessage").html('<br /><br /><p><a href="http://get.adobe.com/flashplayer/">Please upgrade your version of Adobe Flash Player</a></p>')}}function homeResetButtons(){$(".games_scrollable > div.items > div").removeClass("selected");$("#game_info").removeClass();$("#game_info").addClass("home_game_info")}function homeSelectButton(a){homeResetButtons();$("#gameButton"+a).addClass("selected");if($("#gameButton"+a).hasClass("locked")){$("#game_info").addClass("locked")}else{$("#game_info").addClass("unlocked")}}function toggleHomeGameStats(b,a){if($("#game_info").css("display")=="none"){$("#game_mini_lbd").fadeOut("slow",function(){$("#game_info").fadeIn("slow")})}else{$("#game_info").fadeOut("slow",function(){homeLoadMiniLbd(b);$("#game_mini_lbd").fadeIn("slow")})}if(!a&&intervalTimer!=-1){clearInterval(intervalTimer);intervalTimer=-1}}function homeLoadMiniLbd(a){if(!homepageHasLoadedMiniLbd){$("#game_mini_lbd_content").load("/users/ajax/user_mini_leaderboard.php?productId="+a,{},function(){homepageHasLoadedMiniLbd=true;$("#game_info").fadeOut("fast",function(){$("#game_mini_lbd").fadeIn()})})}else{$("#game_info").fadeOut("fast",function(){$("#game_mini_lbd").fadeIn()})}}function homeShowBestGame(){$("#game_mini_lbd").fadeOut("fast",function(){$("#game_info").fadeIn()})}function homeChangeProduct(f,d,g,b,c,a,e){homepageHasLoadedMiniLbd=false;if(!$("#gameButton"+g).hasClass("selected")){homeSelectButton(g);homeRenderFlash(f,630,242);$("#game_desc").html("<h2>"+b+"</h2>"+c+"<div class='games_played'>"+((a!="")?a+" plays":"")+"</div>");$("#game_info").show();$("#game_mini_lbd").hide();if(e){$("#game_play_btn").show();$("#game_register_btn").hide();$("#game_play_btn").attr({href:"/games/"+g+"/game.php"});$("#game_stats").hide();if(TOA_IS_LOGGED_IN){$("#game_stats").load("/users/ajax/user_best_score.php?productId="+d)}$(".home_info_footer_link").attr("href","javascript:toggleHomeGameStats("+d+", false)");$("#game_mini_lbd_link").attr("href","javascript:toggleHomeGameStats("+d+", false)");$("#game_mini_lbd_link").show();if(g=="NBlox"){$("a.home_game_disclaimer_link").attr("href","http://www.neave.com");$("a.home_game_disclaimer_link").show()}else{$("a.home_game_disclaimer_link").hide()}$("#game_desc").css("borderWidth","0 0 1px")}else{$("#game_play_btn").hide();$("#game_register_btn").attr({href:"/users/register.php?saveGame=true&linkTag=guest_view&game_id="+d});$("#game_register_btn").show();$("#game_disclaimer").hide();$("#game_mini_lbd_link").hide();$("#game_desc").css("borderWidth",0)}}}function js_enableGameSideButtons(a){if(a){$("#game_side_buttons > a.game_tutorial_button").removeClass("button_round_tutorial_disabled");$("#game_side_buttons > a.game_options_button").removeClass("button_round_options_disabled");$("#game_side_buttons > a.button_round_side_feedback").removeClass("button_round_side_feedback_disabled");$("#game_side_buttons > a.game_tutorial_button").attr("href","javascript:tetrisGameInstructions()");$("#game_side_buttons > a.game_options_button").attr("href","javascript:tetrisGameOptions()")}else{$("#game_side_buttons > a.game_tutorial_button").addClass("button_round_tutorial_disabled");$("#game_side_buttons > a.game_options_button").addClass("button_round_options_disabled");$("#game_side_buttons > a.button_round_side_feedback").addClass("button_round_side_feedback_disabled");$("#game_side_buttons > a.game_tutorial_button").attr("href","javascript:void(0);");$("#game_side_buttons > a.game_options_button").attr("href","javascript:void(0);")}$("#game_side_buttons > div > a").show()}function js_analyticsTrackGameUrl(c,a){try{pageTracker._trackPageview("/games/"+c+"/"+a+"/")}catch(b){}}function js_analyticsTrackGameEvent(a,d,b){try{pageTracker._trackEvent("Game",a,d,parseInt(b))}catch(c){}}var sShop;function js_gameOpenShop(b,a){var c="";if(b!=-1){c="accessoryId="+b+"&"}if(a!=-1){c+="accessoryType="+a}window.name="game";sShop=window.open("/shop/index.php?"+c,"sShop")}function tetrisGameUpdateAccessories(){document.getElementById("contentFlash").as3_updateAccessories()}function tetrisGameTutorial(){document.getElementById("contentFlash").as3_tetrisGameTutorial()}function tetrisGameInstructions(){document.getElementById("contentFlash").as3_tetrisGameInstructions()}function tetrisGameOptions(){document.getElementById("contentFlash").as3_tetrisGameOptions()}function gameShowResults(e,d,b,k,p,h,g,t,m,l,a,o,r,c,q,f){$("#game_tutorial_button").attr({href:b+"?showInstructions=true"});$("#game_options_button").attr({href:b+"?showOptions=true"});gameResult=new GameResult(e,d,k,p,h,g);var n="/games/ajax/game_results.php?points="+gameResult.points+"&gameUrl="+b+"&productId="+gameResult.productId+"&value="+(k?0:gameResult.value[0]);$("#game_container").load(n,{},function(){gameResultsUpdateResults(gameResult,t,m,l,a,o,r,c,q,f)})}function js_sendArenaRoomInvite(a,b){switch(b){case 1:fb_sendArenaInvite(a);break;case 2:sendTwitterRoomInvite(a);break}}function sendTwitterRoomInvite(a){var b="Come play real-time TETRIS with me at TetrisFriends.com! I'm waiting at: "+a;var c="http://twitter.com/home?status="+encodeURIComponent(b);sendTwitterMsg(c)}function sendTwitterMsg(a){window.open(a)}function popUpFBLinkedPopup(a){popUpBoxByUrl("/users/ajax/fb_account_linked.php?isFirstLink="+a,500,230,"",function(){setTimeout("popUpFBFriends(true)",500)})}function popUpFBLoginPopup(c,b){var a="fb_uid="+c[0].uid+"&first_name="+c[0].first_name+"&last_name="+c[0].last_name+"&locale="+c[0].locale+"&sex="+c[0].sex+"&pic="+c[0].pic+"&pic_small="+c[0].pic_small+"&pic_square="+c[0].pic_square+"&action_token="+b;popUpBoxByUrl("/users/ajax/fb_account_login.php?"+a,650,300,"")}function popUpFBFriends(a,b){popUpBoxByUrl("/friends/ajax/fb_friends_popup.php?isAuto="+a,625,540,"",b)}function popUpFBMoreInfo(a){var b="<h3 class='textcenter'>Tell me more about yourself!</h3><br />";b+="<table style='width: 75%;'><tr>";b+="<td style='width: 50%; text-align: right; font-weight: bold;'>Email:</td>";b+="<td style='width: 50%; text-align: left;'><input id='popup_email' type='text' /></td>";b+="</tr></table><br />";b+="<p id='popup_notice_msg' style='color: #24be52; text-align: center;'>We will be using this email address to contact you<br />in case you win prizes on our site.</p><br />";b+="<a href= 'javascript:void(0)' onclick='var email = $(\"input#popup_email\").val(); changeEmail(email, \""+a+"\");' class='button button_small_grey button_small_grey_savechanges floatleft' style='margin-left: 120px;'>Save</a>";b+="<a href= 'javascript:closePopup()' class='button button_small_grey button_small_grey_notnow floatleft marginleft_5px'>Not Now</a>";popUpBoxByHtml(b,400,180,"",function(){},function(){})}function changeEmail(b,a){$.post("/users/process.php",{change_email:1,email:b,action_token:a},function(c){if(c=="SUCCESS"){closePopup();addNotice("Your e-mail address has been set. Thank you!")}else{$("#popup_notice_msg").css("color","#ff0000");$("#popup_notice_msg").html(c)}})}var gameResultMissions;function GameResultMission(d){var a;var b;var c;this.amountCompleted=$(d).find("AmountCompleted").text();this.deltaCompleted=$(d).find("DeltaCompleted").text();this.dateCompleted=$(d).find("DateCompleted").text();this.dateStarted=$(d).find("DateStarted").text();this.id=$(d).find("Id:first").text();this.missionId=$(d).find("MissionId").text();this.status=$(d).find("Status").text();this.userId=$(d).find("UserId").text();this.amountToComplete=$(d).find("Mission > AmountToComplete").text();this.daysToComplete=$(d).find("Mission > DaysToComplete").text();this.description=$(d).find("Mission > Description").text();this.missionType=$(d).find("Mission > MissionType").text();this.pointsCost=$(d).find("Mission > PointsCost").text();this.missionName=$(d).find("Mission > Name").text();this.pointsEarned=$(d).find("Mission > PointsEarned").text();this.productId=$(d).find("Mission > ProductId").text();this.missionClass=$(d).find("Mission > MissionClass").text();this.collectionName=$(d).find("Mission > MissionCollection > Name").text();this.collectionId=$(d).find("Mission > MissionCollection > Id").text();this.collectionPointsEarned=$(d).find("Mission > MissionCollection > PointsEarned").text();a=$(d).find("Mission > MissionCollection > Completed").text();if(a=="true"){a=true}else{if(a=="false"){a=false}}this.collectionIsCompleted=a;b=$(d).find("MissionGridRowComplete").text();if(b=="true"){b=true}else{if(b=="false"){b=false}}this.gridRowIsCompleted=b;c=$(d).find("MissionTetriminoComplete").text();if(c=="true"){c=true}else{if(c=="false"){c=false}}this.gridTetriminoIsCompleted=c}var gameResult;function GameResult(p,b,n,e,k,g){var r;var f;var a;this.username=k;this.userAvatar=g;var o;var q=new Array();this.awardLabel=new Array();this.awardValue=new Array();this.points=0;this.guestTokens=-1;gameResultMissions=new Array();if(b){var d=p.indexOf("<UserMissions>");var l=p.indexOf("</UserMissions>")+15;if(d!=-1){a=p.substring(d,l);var m=p.substring(0,d-14)+p.substring(l+1);p=m}$.xmlDOM(a).find("UserMission").each(function(t){gameResultMissions.push(new GameResultMission(this))})}o=p.split("<awards>");if(!b&&o[1].substr("<GuestAwardTotal>")!=0){r=o[1].split("<GuestAwardTotal>");o[1]=r[0];this.guestTokens=r[1];if(this.guestTokens!="undefined"&&this.guestTokens!=undefined){if(this.guestTokens>500){this.guestTokens=500}$.get("/users/ajax/guest_token.php?guestTokens="+this.guestTokens)}}if(o[1]&&o[1].length>1){q=o[1].split(",");for(var h=0;h<q.length;h++){r=q[h].split("&");if(r[0]&&r[1]){this.awardLabel[h]=r[0];this.awardValue[h]=r[1];this.points+=parseInt(r[1])}}}if(n){f=o[0].split("<mp_results>");o[0]=f[0];f=f[1]}o=o[0].split(",");this.isDev=e;this.isMultiplayer=Boolean(n);this.isLoggedIn=b;this.productId=o[0];this.advanceRank=0;if(this.isMultiplayer){r=o[1].split("&");if(r.length==1){this.rank=Number(r[0]);this.advanceRank=0}else{this.rank=Number(r[0]);this.advanceRank=Number(r[1])}o[2]=o[2].split("&");if(o[2].length==1){this.halfStars=Number(o[2]);this.prevHalfStars=this.halfStars}else{this.halfStars=Number(o[2][0]);this.prevHalfStars=Number(o[2][1])}this.starMessage=String(o[3]).replace("\n","<br />");if(this.starMessage.toLowerCase().indexOf("you lost")!=-1){this.starType="down"}else{if(this.starMessage.toLowerCase().indexOf("you won")!=-1||this.starMessage.toLowerCase().indexOf("you earned")!=-1){this.starType="up"}else{this.starType="same"}}if(this.starMessage.toLowerCase().indexOf("ranked up")!=-1){this.prevRank=this.rank-1;this.halfStars=10;this.starType="up"}else{if(this.starMessage.toLowerCase().indexOf("ranked down")!=-1){this.prevRank=this.rank+1;this.starType="down"}else{this.prevRank=this.rank}}}else{this.percentile=Number(o[1]);this.rankAlltime=Number(o[2]);this.rankDaily=Number(o[3]);if(this.rankAlltime>0){this.points+=100}if(this.rankDaily>0){this.points+=10}}this.headingId=o[4];this.label=new Array();this.value=new Array();if(this.isMultiplayer){this.gameData=new Array();this.playerIds=new Array();this.playerNames=new Array();this.playerAvatars=new Array();var c;if(this.productId==101){this.gameData[0]=o[o.length-17];for(h=0;h<4;h++){this.playerIds[h]=o[o.length-((4-h)*4)];this.playerNames[h]=o[o.length-(((4-h)*4)-1)];this.playerAvatars[h]=o[o.length-(((4-h)*4)-2)];this.gameData[h+1]=o[o.length-(((4-h)*4)-3)]}c=17;f=f.split(",");this.mpCustomResultsNames=new Array(f.length);this.mpCustomResultsTimes=new Array(f.length);this.mpCustomResultsIds=new Array(f.length);for(h=0;h<f.length;h++){r=f[h].split("&");this.mpCustomResultsNames[h]=r[0];this.mpCustomResultsTimes[h]=r[1]}this.mpCustomResultsAvatars=new Array(this.mpCustomResultsNames.length);for(h=0;h<this.mpCustomResultsNames.length;h++){if(this.mpCustomResultsNames[h]!=0){this.mpCustomResultsAvatars[h]=this.playerAvatars[this.mpCustomResultsNames[h]-1];this.mpCustomResultsIds[h]=this.playerIds[this.mpCustomResultsNames[h]-1];this.mpCustomResultsNames[h]=this.playerNames[this.mpCustomResultsNames[h]-1]}else{this.mpCustomResultsNames[h]=k;this.mpCustomResultsIds[h]=-1;this.mpCustomResultsAvatars[h]=g;if(h!=0&&this.mpCustomResultsTimes[h]<this.mpCustomResultsTimes[h-1]){this.mpCustomResultsTimes[h]="-1"}}}}else{if(this.productId==100||this.productId==2){this.gameData[0]=o[o.length-5];this.playerIds[0]=o[o.length-4];this.playerNames[0]=o[o.length-3];this.playerAvatars[0]=o[o.length-2];this.gameData[1]=o[o.length-1];c=5;f=f.split(",");this.mpCustomResultsNames=new Array(f.length);this.mpCustomResultsKOs=new Array(f.length);this.mpCustomResultsLines=new Array(f.length);this.mpCustomResultsHeight=new Array(f.length);this.mpCustomResultsIds=new Array(f.length);for(h=0;h<f.length;h++){r=f[h].split("&");this.mpCustomResultsNames[h]=r[0];this.mpCustomResultsKOs[h]=r[1];this.mpCustomResultsLines[h]=r[2];this.mpCustomResultsHeight[h]=r[3]}this.mpCustomResultsAvatars=new Array(this.mpCustomResultsNames.length);this.mpCustomResultsNames[0]=k;this.mpCustomResultsAvatars[0]=g;this.mpCustomResultsIds[0]=-1;this.mpCustomResultsAvatars[1]=this.playerAvatars[0];this.mpCustomResultsNames[1]=this.playerNames[0];this.mpCustomResultsIds[1]=this.playerIds[0]}else{if(this.productId==4){this.gameData[0]=o[o.length-21];for(h=0;h<7;h++){this.playerIds[h]=o[o.length-((7-h)*4)];this.playerNames[h]=o[o.length-(((7-h)*4)-1)];this.playerAvatars[h]=o[o.length-(((7-h)*4)-2)];this.gameData[h+1]=o[o.length-(((7-h)*4)-3)]}c=7*4+1;f=f.split(",");this.mpCustomResultsNames=new Array(f.length);this.mpCustomResultsPlaces=new Array(f.length);this.mpCustomResultsTimes=new Array(f.length);this.mpCustomResultsIds=new Array(f.length);for(h=0;h<f.length;h++){r=f[h].split("&");this.mpCustomResultsNames[h]=r[0];this.mpCustomResultsPlaces[h]=r[1];this.mpCustomResultsTimes[h]=r[2]}this.mpCustomResultsAvatars=new Array(this.mpCustomResultsNames.length);for(h=0;h<this.mpCustomResultsNames.length;h++){if(this.mpCustomResultsNames[h]!=0){this.mpCustomResultsAvatars[h]=this.playerAvatars[this.mpCustomResultsNames[h]-1];this.mpCustomResultsIds[h]=this.playerIds[this.mpCustomResultsNames[h]-1];this.mpCustomResultsNames[h]=this.playerNames[this.mpCustomResultsNames[h]-1]}else{this.mpCustomResultsNames[h]=k;this.mpCustomResultsIds[h]=-1;this.mpCustomResultsAvatars[h]=g}}}else{if(this.productId==86){this.gameData[0]=o[o.length-21];for(h=0;h<5;h++){this.playerIds[h]=o[o.length-((5-h)*4)];this.playerNames[h]=o[o.length-(((5-h)*4)-1)];this.playerAvatars[h]=o[o.length-(((5-h)*4)-2)];this.gameData[h+1]=o[o.length-(((5-h)*4)-3)]}c=21;f=f.split(",");this.mpCustomResultsNames=new Array(f.length);this.mpCustomResultsPlaces=new Array(f.length);this.mpCustomResultsKOs=new Array(f.length);this.mpCustomResultsLines=new Array(f.length);this.mpCustomResultsHeight=new Array(f.length);this.mpCustomResultsIds=new Array(f.length);for(h=0;h<f.length;h++){r=f[h].split("&");this.mpCustomResultsNames[h]=r[0];this.mpCustomResultsPlaces[h]=r[1];this.mpCustomResultsKOs[h]=r[2];this.mpCustomResultsLines[h]=r[3];this.mpCustomResultsHeight[h]=r[4]}this.mpCustomResultsAvatars=new Array(this.mpCustomResultsNames.length);for(h=0;h<this.mpCustomResultsNames.length;h++){if(this.mpCustomResultsNames[h]!=0){this.mpCustomResultsAvatars[h]=this.playerAvatars[this.mpCustomResultsNames[h]-1];this.mpCustomResultsIds[h]=this.playerIds[this.mpCustomResultsNames[h]-1];this.mpCustomResultsNames[h]=this.playerNames[this.mpCustomResultsNames[h]-1]}else{this.mpCustomResultsNames[h]=k;this.mpCustomResultsIds[h]=-1;this.mpCustomResultsAvatars[h]=g}}}}}}for(var h=5;h<o.length-c;h++){r=o[h].split("&");this.label[h-5]=r[0];this.value[h-5]=r[1]}this.gameData[0]=this.gameData[0]+"&"+k+"&"+g+"&"+this.rank+"&"+this.halfStars}else{this.gameData=o[o.length-1];for(var h=5;h<o.length-1;h++){r=o[h].split("&");this.label[h-5]=r[0];this.value[h-5]=r[1]}}}var rankNames=Array("Newbie","Novice","Trainee","Rookie","Apprentice","Journeyman","Hobbyist","Practitioner","Achiever","Specialist","Professional","Veteran","Expert","Elite","Champion","Genius","Prodigy","Guru","Master","Grand Master");var replayProductId;var gameResultsGameData;var gameResultsNames;var gameResultsAvatars;var gameResultsIsMultiplayer;var isAdPlaying=false;var isEmailVerified=false;var isReplayReady=false;var isReplayStarted=false;var gameResultsMissionAchievements=false;var gameResultsAdvanceRank=false;var gameResultsLeaderboardRank=false;var gameResultsMissions=false;var gameResultsRankChangeType=null;var gameResultsCurrentRank=-1;var gameResultsPromotionRank=-1;var gameResultsAchievementPopup=false;var gameResultsGuestNotice=true;var gameResultsHeaderInterval;var gameResultsBgLoaded;var gameResultsNeedsStartWinAnim;var gameResultWinAnimId;var windowHasFocus=true;var intervalTimer=-1;var gameResultNotices=new Array();var currGameResultNotice;function gameResultsUpdateResults(h,u,e,f,y,a,H,w,p,t){var q;var E;var d;gameResultsBgLoaded=false;gameResultsNeedsStartWinAnim=false;gameResultsAdvanceRank=false;gameResultsAchievementPopup=false;isEmailVerified=(f=="true"||f==true);if(h.headingId==0){d="game_results_alltime_header"}else{if(h.headingId==1){d="game_results_goodgame_header"}else{if(h.headingId==2){d="game_results_nicetry_header"}else{if(h.headingId==3){d="game_results_first_place_header"}else{if(h.headingId==4){d="game_results_second_place_header"}else{if(h.headingId==5){d="game_results_third_place_header"}else{if(h.headingId==6){d="game_results_fourth_place_header"}else{if(h.headingId==7){d="game_results_fifth_place_header"}else{if(h.headingId==8){d="game_results_winby3ko_header"}else{if(h.headingId==9){d="game_results_win_header"}else{if(h.headingId==10){d="game_results_lose_header"}else{if(h.headingId==11){d="game_results_draw_header"}else{if(h.headingId==12){d="game_results_sixth_place_header"}}}}}}}}}}}}}if(h.isLoggedIn){q=$("#profile_tokens_value").html();var b=Number(q);b+=h.points;$("#profile_tokens_value").html(b)}$("#game_results_header").addClass(d);if(h.headingId==0){$("b.game_results_best_game_header").html("New Best Game!");$("b.game_results_best_game_header").css("color","#FF0000")}else{$("b.game_results_best_game_header").html("Your Best Game")}if(h.isMultiplayer){for(E=0;E<h.mpCustomResultsNames.length;E++){var A=function(){};var c=h.mpCustomResultsNames[E];var C="th";var n=E;if(h.productId==86||h.productId==4){n=h.mpCustomResultsPlaces[E]-1}switch(n+1){case 1:C="st";break;case 2:C="nd";break;case 3:C="rd";break}if(h.productId==100){c="<b>"+h.mpCustomResultsNames[E]+"</b><div"+(p==h.mpCustomResultsNames[E]?" class='results_winner_frame'":"")+"><img class='game_results_avatar_image' src='"+u+"/images/avatars/"+h.mpCustomResultsAvatars[E]+"' alt='' /></div>"}else{c="<img class='game_results_avatar_image' src='"+u+"/images/avatars/"+h.mpCustomResultsAvatars[E]+"' alt='' /><b>"+h.mpCustomResultsNames[E]+"</b>"}if((h.mpCustomResultsNames[E].toLowerCase().replace(/^\s+|\s+$/g,"")!="guest")&&(h.mpCustomResultsNames[E].toLowerCase().replace(/^\s+|\s+$/g,"")!="anonymous")&&h.mpCustomResultsNames[E].toLowerCase().replace(/^\s+|\s+$/g,"")!="ai"){var r=h.mpCustomResultsIds[E];if(r==-1){r=""}else{r="?id="+r}c="<a href='/users/profile.php"+r+"' target='_blank' onclick='clearInterval(intervalTimer); intervalTimer = -1;'>"+c+"</a>"}if(h.productId==101){q="<p>"+(n+1)+C+c+"<font>"+formatSprintTime(h.mpCustomResultsTimes[E])+"</font></p>"}else{if(h.productId==100||h.productId==2){q="<p>"+c+"<span id='game_results_contestant_message"+E+"' class='game_results_contestant_message'></span><span>KO<font>"+h.mpCustomResultsKOs[E]+"</font></span><span>Lines Sent<font>"+h.mpCustomResultsLines[E]+"</font></span><span>Height<font>"+h.mpCustomResultsHeight[E]+"</font></span></span>";if(E==0){A=function(){$("#game_results_contestant_message0").load("/users/ajax/player_info.php",function(){$("#game_results_contestant_message0 > p").fadeIn("slow")})}}else{if(E==1){A=function(){$("#game_results_contestant_message1").load("/users/ajax/player_info.php?id="+h.playerIds[0],function(){$("#game_results_contestant_message1 > p").fadeIn("slow")})}}}}else{if(h.productId==86){if(E==0){q="<span class='game_results_ko_label'>KO</span><span class='game_results_lines_label'>Lines Sent</span><span class='game_results_lines_height'>Height</span>"}else{q=""}q+="<p>"+(n+1)+C+c+"<span class='game_results_contestant_kos'>"+h.mpCustomResultsKOs[E]+"</span><span class='game_results_contestant_lines'>"+h.mpCustomResultsLines[E]+"</span><span class='game_results_contestant_height'>"+h.mpCustomResultsHeight[E]+"</span></p>"}else{if(h.productId==4){if(E==0){q="<span class='game_results_time_label'>TIME</span>"}else{q=""}q+="<p>"+(n+1)+C+c+"<span class='game_results_contestant_time'>"+h.mpCustomResultsTimes[E]+"</span></p>"}}}}$("#game_results_contestant"+E).html(q);A()}q="<p>"+h.username+"</p><img src='"+u+"/images/avatars/"+h.userAvatar+"' alt='' />";$("#game_results_player").html(q);displayRank("game_results_rank",h.rank,1,true,null,u);displayRank("game_results_prev_rank",h.prevRank,1,true,null,u);displayHalfStars("game_results_stars",h.halfStars,null,u);displayHalfStars("game_results_prev_stars",h.prevHalfStars,null,u);if(h.starMessage&&h.starMessage!="null"){$("#game_results_star_message").html("<p>"+h.starMessage+"</p>");if((h.starMessage).toLowerCase().indexOf("ranked down")!=-1){$("#game_results_rank_change_arrow").addClass("game_results_rank_down_arrow");gameResultsRankChangeType="down"}else{if((h.starMessage).toLowerCase().indexOf("ranked up")!=-1){$("#game_results_rank_change_arrow").addClass("game_results_rank_up_arrow");gameResultsRankChangeType="up"}else{var m=h.halfStars-h.prevHalfStars;if(m==1||m==-1){m=m+"/"+2}else{m=m/2}if((h.halfStars-h.prevHalfStars)>0){m="+"+m}$("#game_results_rank_change_arrow").html("<p>"+m+"</p")}}}else{displayRank("game_results_rank",h.rank,1,true,null,u)}if(replayProductId==4){$("#game_results_rank").hide();$("#game_results_prev_rank").show();$("#game_results_prev_stars").show();$("div.game_results_main_info2").fadeIn("slow",function(){gameResultsAnimateStars(3)});$("div.game_results_main_info").hide();$("a.game_results_main_prev_page").show();$("a.game_results_main_next_page").hide()}}else{$("#game_results_main_stat").html(h.label[0]+": "+h.value[0]);if(h.productId==11){$("#game_results_secondary_stat").html(h.label[1]+": "+h.value[1])}if(h.productId==84&&h.headingId==2){$("#percent_arrow").css("left","43px");$("#percent_txt").html("Percentile Rank<font>--</font></p>")}else{$("#percent_txt").html("Percentile Rank<font>"+$("#percent_txt").html()+"</font></p>")}}q="<table>";for(E=0;E<h.awardLabel.length;E++){q+="<tr><th>";q+=h.awardLabel[E];q+="</td><td>";q+=h.awardValue[E];q+="</td></tr>"}if(h.rankAlltime>0){q+="<tr><th>";q+="Ranked in the Top 100 of All Time";q+="</td><td>";q+=100;q+="</td></tr>"}if(h.rankDaily>0){q+="<tr><th>";q+="Ranked in the Top 100 of Today";q+="</td><td>";q+=10;q+="</td></tr>"}q+="<tr class='game_total_tokens_row'><th>";q+="<p>Total Bonus:</p>";q+="</th><td>";q+=h.points;q+="</td></tr>";q+="</table>";$("#mini_profile_token_msg").html(q);var k;var D;var F;var g;var G=false;D=h.label.length;F=Math.round(D/2);g=F;if(h.productId!=86&&h.productId!=4){for(E=0;E<D;E++){if(h.label[E]=="Singles"){g=E;if(g>(D-g)){F=g}else{F=D-g}}}}else{for(E=0;E<D;E++){if(h.label[E]=="Map"){if(h.value[E]!="None"){G=true}}}}k=0;q="<table class='game_stat_left_column'>";for(E=0;E<D;E++){q+="<tr>";if((k+1)%2==0){q+="<th class='game_stat_even_row'>";if(E<h.label.length){q+=h.label[E]}q+="&nbsp;</th><td class='game_stat_even_row'>&nbsp;";if(E<h.value.length){q+=h.value[E]}}else{q+="<th>";if(E<h.label.length){q+=h.label[E]}q+="&nbsp;</th><td>&nbsp;";if(E<h.value.length){q+=h.value[E]}}q+="</td></tr>";if(E+1==g&&E<F){for(var B=0;B<(F-(E+1));B++){k+=1;if((k+1)%2==0){q+="<tr><th class='game_stat_even_row'>&nbsp;</th><td class='game_stat_even_row'>&nbsp;</td></tr>"}else{q+="<tr><th>&nbsp;</th><td>&nbsp;</td></tr>"}}q+="</table><table class='game_stat_right_column'>";k=0}else{if(E+1>g&&D-(E+1)==0){for(var B=k;B+1<F;B++){k+=1;if((k+1)%2==0){q+="<tr><th class='game_stat_even_row'>&nbsp;</th><td class='game_stat_even_row'>&nbsp;</td></tr>"}else{q+="<tr><th>&nbsp;</th><td>&nbsp;</td></tr>"}}q+="</table>"}else{k+=1}}}q+="</table>";q+="<div class='clear'></div>";$("#game_results_details").html(q);replayProductId=h.productId;gameResultsIsMultiplayer=h.isMultiplayer;gameResultsGameData=h.gameData;gameResultsNames=h.playerNames;gameResultsAvatars=h.playerAvatars;if(gameResultsAvatars!=undefined&&gameResultsAvatars!="undefined"){for(var z=0;z<gameResultsAvatars.length;z++){gameResultsAvatars[z]=u+"/images/avatars/40X40/"+gameResultsAvatars[z]}}if(!h.isLoggedIn){gameResultsGuestNotice=true;gameResultNotices.push("#game_results_guest_notice","auto")}if(h.rankAlltime>0||h.rankDaily>0){if(h.rankAlltime>0){points=$("#mini_profile_points").html();$("#mini_profile_points").html(parseInt(points)+100)}if(h.rankDaily>0){points=$("#mini_profile_points").html();$("#mini_profile_points").html(parseInt(points)+10)}gameResultsPopUpLeaderboard(h.rankAlltime,h.rankDaily,h.productId)}if(h.advanceRank!=0){var x="promote";if(h.rank>h.advanceRank){x="demote"}if(h.headingId!=10&&!(h.productId==86&&x=="promote"&&h.headingId!=3)&&!(h.productId==101&&x=="promote"&&h.headingId!=3)&&!(h.productId==86&&x=="demote"&&h.headingId!=12)&&!(h.productId==101&&x=="demote"&&h.headingId!=7)&&!G){gameResultsPopUpAdvanceQuestion(h.advanceRank,h.rank,h.productId);$("div.game_results_footer > table.game_buttons").hide()}}if(h.isLoggedIn&&gameResultMissions!=undefined&&gameResultMissions.length>0){var o=false;var v;for(v=0;v<gameResultMissions.length;v++){if(gameResultMissions[v].status==1){o=true;break}}if(o){gameResultsPopUpMissions()}}if(e){isAdPlaying=true}gameResultsMissionAchievements=gameResultsHasMissionAchivements();if(gameResultsMissionAchievements){gameResultsDisplayAchievementPopups(u)}else{if(e&&h.isLoggedIn&&(gameResultMissions==undefined||gameResultMissions.length==0)){showMissionPromoPopup(true,u,h.productId)}else{gameResultsLoadOASIAB();gameResultsShowNotices()}}if(h.isMultiplayer){gameResultWinAnimId=y;if(gameResultWinAnimId>6000){$("#game_results_header").hide()}gameResultsLoadWinAnimBg(h.productId,h.headingId,h.userAvatar,h.username,y,a,H,w,p,t,u);if(!e&&!gameResultsMissionAchievements){intervalTimer=setInterval("toggleMainInfoPage(true)",7000);gameResultsPlayWinAnim()}}else{gameResultsLoadBg(h.productId,h.headingId,u)}}function js_gameResultBgLoaded(){gameResultsBgLoaded=true;if(gameResultsNeedsStartWinAnim){gameResultsStartWinAnim()}}function js_gameResultBgTextColor(a){$("div.game_results_player > p, div.game_results_rank_change_arrow > p, div.game_results_rank > p, div.game_results_contestant > p > span, div.game_results_star_message > p").css("color",a)}function gameResultsStartWinAnim(){gameResultsNeedsStartWinAnim=false;document.getElementById("game_results_bg_content").as3_startResultsAnimation();clearInterval(gameResultsHeaderInterval);if(gameResultWinAnimId>6000){$("#game_results_header").hide();gameResultsHeaderInterval=setInterval("gameResultsShowHeader()",6500)}else{$("#game_results_header").show()}}function gameResultsWinAnimShowPage2(){document.getElementById("game_results_bg_content").as3_showResultsAnimationPage2()}function gameResultsPlayWinAnim(){if(gameResultsIsMultiplayer&&gameResultsBgLoaded){gameResultsStartWinAnim()}else{gameResultsNeedsStartWinAnim=true}}function gameResultsPauseWinAnim(){if(gameResultsIsMultiplayer&&gameResultsBgLoaded){clearInterval(intervalTimer);document.getElementById("game_results_bg_content").as3_pauseResultsAnimation()}}function gameResultsShowHeader(){if(gameResultsHeaderInterval!=-1){clearInterval(gameResultsHeaderInterval);gameResultsHeaderInterval=-1}$("#game_results_header").fadeIn("slow")}function gameResultsLoadWinAnimBg(c,r,f,n,a,m,t,d,q,e,p){var g;var k;var o;var h;var b;if(gameResult.starType=="up"){b=1}else{if(gameResult.starType=="down"){b=-1}else{b=0}}switch(Number(c)){default:case 100:if(r==10){h=-1;$("div#game_results_content").addClass("game_results_lose")}else{h=1}break;case 101:if(r==3){h=1}else{h=-1;$("div#game_results_content").addClass("game_results_lose")}break;case 86:if(r==3){h=1}else{h=-1;$("div#game_results_content").addClass("game_results_lose")}break;case 4:if(r==3){h=1}else{h=-1;$("div#game_results_content").addClass("game_results_lose")}break}if(m<=0&&a<=0){$("#game_results_wineffects_no_tone").hide();$("#game_results_wineffects_all").hide();$("#game_results_wineffects_no_grafix").hide();if(h>=0){$("#game_results_effect_get_one").hide()}else{$("#game_results_win_anim_msg").hide()}}else{if(m<=0){$("#game_results_wineffects_none").hide();$("#game_results_wineffects_all").hide();$("#game_results_wineffects_no_grafix").hide();$("#game_results_win_grafix_name").html(t);$("#game_results_win_grafix_name").attr("href","/shop/index.php?accessoryType=6&accessoryId="+a);if(h>=0){$("#game_results_effect_get_one").hide()}else{$("#game_results_effect_shop").hide();$("#game_results_you_use").html(q+" is using")}}else{if(a<=0){$("#game_results_wineffects_none").hide();$("#game_results_wineffects_all").hide();$("#game_results_wineffects_no_tone").hide();$("#game_results_win_tone_name").html(d);$("#game_results_win_tone_name").attr("href","/shop/index.php?accessoryType=5&accessoryId="+m);if(h>=0){$("#game_results_effect_get_one").hide()}else{$("#game_results_effect_shop").hide();$("#game_results_you_use1").html(q+" is using")}}else{$("#game_results_wineffects_none").hide();$("#game_results_wineffects_no_tone").hide();$("#game_results_wineffects_no_grafix").hide();$("#game_results_win_grafix_name1").html(t);$("#game_results_win_grafix_name1").attr("href","/shop/index.php?accessoryType=6&accessoryId="+a);$("#game_results_win_tone_name1").html(d);$("#game_results_win_tone_name1").attr("href","/shop/index.php?accessoryType=5&accessoryId="+m);if(h>=0){$("#game_results_effect_get_one").hide()}else{$("#game_results_effect_shop").hide();$("#game_results_you_use2").html(q+" is using")}}}}g=p+"/images/winGrafix/OWResultsAnimation.swf";var l;if(c==100){if(q==n){k=n;k+=","+gameResultsNames[0];o=p+"/images/avatars/40X40/"+f;l=gameResultsAvatars[0];if(l.lastIndexOf("/")!=-1){l=l.slice(l.lastIndexOf("/")+1,l.length)}l=p+"/images/avatars/40X40/"+l;o+=","+l}else{k=gameResultsNames[0];k+=","+n;l=gameResultsAvatars[0];if(l.lastIndexOf("/")!=-1){l=l.slice(l.lastIndexOf("/")+1,l.length)}l=p+"/images/avatars/40X40/"+l;o=l;o+=","+p+"/images/avatars/40X40/"+f}}else{if(q==n){k=n;k+=","+gameResult.mpCustomResultsNames[1];o=p+"/images/avatars/40X40/"+f;l=gameResult.mpCustomResultsAvatars[1];if(l.lastIndexOf("/")!=-1){l=l.slice(l.lastIndexOf("/")+1,l.length)}l=p+"/images/avatars/40X40/"+l;o+=","+l}else{k=gameResult.mpCustomResultsNames[0];k+=","+n;l=gameResult.mpCustomResultsAvatars[0];if(l.lastIndexOf("/")!=-1){l=l.slice(l.lastIndexOf("/")+1,l.length)}l=p+"/images/avatars/40X40/"+l;o=l;o+=","+p+"/images/avatars/40X40/"+f}}c=Number(c);a=Number(a);m=Number(m);flashVars={productId:c,winAnimId:a==6000?0:a,winToneId:m==5000?0:m,names:k,avatars:o,resultType:h,starType:b,volume:e};swfobject.embedSWF(g,"game_results_bg_content",616,355,"9.0.0",{},flashVars,{wmode:"opaque"},{allowscriptaccess:"always"},{id:"gameBGSwf",name:"gameBGSwf"})}function gameResultsLoadBg(b,d,c){var a;switch(Number(b)){case 10:a=c+"/images/results/AnimatedBackgroundMarathon.swf";break;case 11:a=c+"/images/results/AnimatedBackgroundIceAge.swf";break;case 12:a=c+"/images/results/AnimatedBackgroundSurvival.swf";break;case 23:a=c+"/images/results/AnimatedBackgroundUltra.swf";break;case 84:a=c+"/images/results/AnimatedBackgroundSprint.swf";break;case 102:a=c+"/images/results/AnimatedBackgroundMono.swf";break;default:a=c+"/images/results/AnimatedBackgroundMarathon.swf";break}if(a!=null){swfobject.embedSWF(a,"game_results_bg_content",616,355,"9.0.0",{},{},{wmode:"opaque"},{allowscriptaccess:"always"},{id:"gameBGSwf",name:"gameBGSwf"})}}var numOfStarAnimations=3;function toggleMainInfoPage(a){if($("div.game_results_main_info2").css("display")=="none"){$("#game_results_rank").hide();$("#game_results_prev_rank").show();$("#game_results_prev_stars").show();$("div.game_results_main_info2").fadeIn("slow",function(){gameResultsAnimateStars(numOfStarAnimations)});$("div.game_results_main_info").fadeOut("slow");$("a.game_results_main_prev_page").show();$("a.game_results_main_next_page").hide();gameResultsWinAnimShowPage2()}else{$("div.game_results_main_info").fadeIn("slow");$("div.game_results_main_info2").fadeOut("slow");$("#game_results_prev_stars").hide();$("a.game_results_main_prev_page").hide();$("a.game_results_main_next_page").show();gameResultsPlayWinAnim()}if(!a&&intervalTimer!=-1){clearInterval(intervalTimer);intervalTimer=-1}}function gameResultsAnimateStars(numberOfFades){var fadeFunc=function(){};if(numberOfFades>=0){$("#game_results_stars").show();fadeFunc="$('#game_results_prev_stars').fadeIn('fast',  function() { $('#game_results_prev_stars').fadeOut('fast', function() { gameResultsAnimateStars(numberOfFades - 1); }) });";if(numberOfFades==0){fadeFunc+="$('#game_results_stars').fadeIn('slow');";if(gameResultsRankChangeType!=null){fadeFunc+="$('#game_results_prev_rank').fadeOut('slow', function () { ";if(gameResultsRankChangeType.indexOf("promote")==-1&&gameResultsRankChangeType.indexOf("demote")==-1&&gameResultsRankChangeType.indexOf("down")==-1){fadeFunc+="$('#game_results_rank').fadeOut('fast', function () {displayHalfStars('game_results_stars', 4, true, AD_AKAMAI_PATH); $('#game_results_rank').fadeIn('fast'); });";numOfStarAnimations=0}else{if(gameResultsRankChangeType.indexOf("down")!=-1){numOfStarAnimations=0}}fadeFunc+="$('#game_results_rank').fadeIn('fast'); } );"}}}eval(fadeFunc)}function gameResultsShowNotices(){var d=function(){};var a=function(){};var c;var b;if(gameResultNotices.length!=0){c=gameResultNotices.pop();b=gameResultNotices.pop();if(c=="auto"){a=function(){setTimeout("gameResultsShowNotices()",5000)}}d=function(){$(b).fadeIn("slow",a)};if(currGameResultNotice!=null){funcFadeOut=function(){$(currGameResultNotice).fadeOut("slow",d)}}else{funcFadeOut=d}funcFadeOut();currGameResultNotice=b}else{if(currGameResultNotice!=null){$(currGameResultNotice).fadeOut("slow");currGameResultNotice=null}}}function gameResultsPopUpAdvanceQuestion(a,c,b){gameResultsAdvanceRank=true;gameResultsCurrentRank=c;gameResultsPromotionRank=a;gameResultNotices.push("#game_results_advance_popup","manual");$("div#game_results_advance_popup").load("/games/ajax/game_results_advance_popup.php?advanceRank="+a+"&rank="+c+"&productId="+b)}function gameResultsPopUpLeaderboard(c,a,b){gameResultsLeaderboardRank=true;gameResultNotices.push("#game_results_rank_popup","auto");$("div#game_results_rank_popup").load("/games/ajax/game_results_rank_popup.php?rankAlltime="+c+"&rankDaily="+a+"&productId="+b)}function gameResultsPopUpMissions(){gameResultsMissions=true;gameResultNotices.push("#game_results_missions_popup","auto");$("div#game_results_missions_popup").load("/games/ajax/game_results_missions_popup.php")}function gameResultsRankUp(g,d,f,a,b,c){if(g){url="/users/ajax/rank_up.php";$.post(url,{rank:f,productId:b},function(h){})}else{flashVars={productID:b,rank:f,halfStars:4};swfobject.embedSWF(c+"/games/OWGuestCookieUpdate.swf","results_hidden_swf_content",1,1,"9.0.0",{},flashVars,{wmode:"opaque"},{allowscriptaccess:"always"},{id:"results_hidden_swf_content",name:"results_hidden_swf_content"})}var e=c;displayRank("game_results_rank",f,1,true,true,(e=="")?null:e);displayHalfStars("game_results_stars",4,true,(e=="")?null:e);$("#game_results_rank_change_arrow").html("");if(a=="promote"){$("#game_results_rank_change_arrow").addClass("game_results_rank_up_arrow");$("#game_results_star_message").html("You've been promoted.<br />Your Star Meter has been reset.");gameResultsRankChangeType="promote"}else{if(a=="demote"){$("#game_results_rank_change_arrow").addClass("game_results_rank_down_arrow");$("#game_results_star_message").html("You've been demoted.<br />Your Star Meter has been reset.");gameResultsRankChangeType="demote"}}gameResultsClosePopupLb()}function gameResultsShowMissions(f,g,a){var e=gameResultsShowActiveMissions(1,g);var b="";var h;var d=Math.floor(e.length/2);for(var c=0;c<d*2;c+=2){b+=e[c]}$("#game_results_missions_content_active").html(b);for(var c=0;c<d*2;c+=2){h=e[c+1];$(document).ready(function(){$("#result_mission_icon_"+(c/2)).qtip({show:{delay:0},content:"<span class='tooltip_content'>"+h+"</span>",position:{corner:{tooltip:"bottomLeft",target:"topMiddle"}},style:{width:"310",border:{width:1,radius:3,color:"#969696"},tip:{corner:"bottomLeft",color:"#969696",size:{x:20,y:10}}}})})}$("#game_results_missions_content_active").css("height",(d*60)+"px");if(d<=0){$("#game_results_missions_content_active_header").html("")}gameResultsShowOtherMissions(f,(d<4?4-d:0),a)}function gameResultsShowActiveMissions(g,k){var w;var c=new Array();var x=0;var h=0;var l="";var u=0;var f=0;var e="";var n=0;var t="";var r;var v="";var b=gameResultMissions.length;var q=0;if(b>0){for(r=0;r<b;r++){if(gameResultMissions[r].status==g&&q<4){w="";u=gameResultMissions[r].amountCompleted;f=gameResultMissions[r].amountToComplete;h=(u/f)*100;x=gameResultMissions[r].missionId;var m="";if(x<10){m="000"}else{if(x<100){m="00"}else{if(x<1000){m="0"}}}e=gameResultMissions[r].dateStarted;n=gameResultMissions[r].daysToComplete;if(x>=5000){v="/missions/premium_mission_list.php?tabId=available&missionId="+x}else{v="/missions/personal_mission_list.php?tabId=available&collectionId="+gameResultMissions[r].collectionId+"&missionId="+x}var a=k+"/images/missions/78x78/"+m+x+".png";j=0;var o="<div class='mission_text'><div class='mission_collection_name'>"+gameResultMissions[r].collectionName+"</div><div class='mission_name'>"+gameResultMissions[r].missionName+"</div><div class='mission_desc'>"+gameResultMissions[r].description+"</div><div class='mission_difficulty' style={height=0}></div></div>";w+="<div class='mission_item'>";w+="<a href='"+v+"'>";w+="<img class='mission_icon' id='result_mission_icon_"+q+"' src='"+a+"' border='0' alt='' />";w+="</a>";w+="<div class='mission_name'>"+gameResultMissions[r].missionName+"</div>";w+="<div class='mission_progress_bar'><div class='mission_progress_bar_content' style='width:"+h+"%'/></div>";t=getMissionProgressType(gameResultMissions[r].productId,gameResultMissions[r].missionType);w+="<div class='mission_progress_text'>"+u+"/"+f+" "+t+" </div>";w+="<div class='mission_delta'>";if(gameResultMissions[r].deltaCompleted>=0){w+="+"}w+=gameResultMissions[r].deltaCompleted;w+="</div>";var d=calculateTimeLeft(e,n);var p="#FF0000";if(d/60/60/24>1){p="#000000"}w+="<div class='mission_time' style='color:"+p+"'>"+convertSecondsToWords(d)+" left</div>";w+="</div>";c.push(w);c.push(o);q++}}}return c}var gameResultsAvailableMissions="";function gameResultsShowOtherMissions(c,e,a){var d="";var b;if(e>0){for(b=0;b<gameResultMissions.length;b++){if(b!=0){d+=","}d+=gameResultMissions[b].missionId}$.get("/missions/ajax/available_by_product.php?productId="+c+"&omitIds="+d+"&maxMissions="+e,function(f){if(f==""&&gameResultsAvailableMissions!=""){f=gameResultsAvailableMissions}else{if(f!=""&&gameResultsAvailableMissions==""){gameResultsAvailableMissions=f}}$("#game_results_missions_content_available").html(f);if(f==""&&a){gameResultsShowCompletedAll()}else{$(".game_results_nav_item_missions").removeClass("game_results_nav_item_missions").addClass("game_results_nav_item_missions_gold")}})}else{gameResultsShowCompletedAll()}}function gameResultsShowCompletedAll(){if($("#game_results_missions_content_active_header").html()==""&&$("#game_results_missions_content_available_header").html()==""){$("#game_results_missions_content_active").html("<div class='results_missions_all_complete'>You've completed all available Missions for this game.<br>Check out other available <a href='/missions/index.php?tabId=available'>Missions</a>.</div>")}}function gameResultsHasMissionAchivements(){var a=false;var b=0;while(!a&&b<gameResultMissions.length){if(gameResultMissions[b].status==0||gameResultMissions[b].status==2){a=true}b++}return a}function gameResultsDisplayAchievementPopups(C,q,J){var m=0;var o=0;var r=0;var l=0;var K='<div id="mission_list_box" class="mission_list_box mission_achievement_popup">';var F="";var t="";var p="";var v="";var u=(isEmailVerified=="true"||isEmailVerified==true);var A=new Array();var h=function(){};var k=false;var c="";for(var N=0;N<gameResultMissions.length;N++){var L=gameResultMissions[N].status;if(L==0||L==2){var n="";var x=gameResultMissions[N].collectionId;var g=gameResultMissions[N].collectionName;var O=gameResultMissions[N].collectionPointsEarned;var M=gameResultMissions[N].collectionIsCompleted;var H=gameResultMissions[N].gridTetriminoIsCompleted;var z=gameResultMissions[N].missionId;var P=gameResultMissions[N].missionName;var y=gameResultMissions[N].description;var I=gameResultMissions[N].pointsEarned;var G=gameResultMissions[N].missionClass;var B=gameResultMissions[N].productId;if(!k&&L==2&&G.indexOf("premium")!=-1){k=true}var w=C+"/images/OWSoundPlayer.swf";var e=C+"/images/missions/150x150/"+padNumber(z,4)+".swf";if(L==2&&o!=0){w=e}var E="filePath="+e+"&"+((L==0)?"swfState=1":"swfState=2")+"&height=150&width=150&soundName=badge0001&useControls=false";n+='<div class="mission_item mission_detailed_item">';n+='   <div class="mission_icon">';n+=getEmbedFlashHtml(w,"Badge"+z,150,150,E);n+="   </div>";n+='   <div class="mission_info">';n+='      <p class="name">'+g+" Collection</p>";n+='      <p class="mission_name">'+P+"</p>";n+='      <p class="mission_desc">'+y+"</p>";if(L!=0){n+='      <p class="textcenter mission_completion_text margintop_5px marginbottom_5px"><b>You earned this Badge';if(I!=0){n+=" and "+I+" Tokens!"}else{n+="."}l+=parseInt(I)}n+="   </b></p></div>";n+='   <div id="mission_star_rating'+z+'" class="mission_star_rating" onmouseout="updateRatingStarsState(\'#mission_star_rating'+z+"', "+0+", 'Click to rate difficulty', '"+C+"')\">";var f=new Array("Piece of cake!","Easy enough","So-so","Kinda hard","Crazy hard!");for(var D=1;D<=5;D++){n+='<img border=0 src="'+C+'/images/missions/circle_empty.png" onmouseover="updateRatingStarsState(\'#mission_star_rating'+z+"', "+D+", '"+f[D-1]+"', '"+C+'\')" onclick="submitRating('+z+","+D+');" />'}n+='<br /><p id="mission_star_rating'+z+'_text" class="textright">Click to rate difficulty</p>';n+="   </div>";n+="</div>";n+="<div class='clear'></div>";n+="<a id='mission_comment_link"+z+"' class='floatright margin_5px mission_comment_link' href='javascript:void(0)' onclick='showCommentBox(\"mission_comment_box"+z+"\")'>Write a Comment</a>";n+="<div class='clear'></div>";n+="<div id='mission_comment_box"+z+"' class='mission_comment_box'>";n+="  <div class='clear'></div>";if(!u){n+="<div class='no_mission_comment_box'><a class='email_verify' href='/users/email_verify.php' target='_parent'><img src='"+C+"/images/alertbad_icon.gif' border=0/>&nbsp;Verify your email to enable commenting feature</a></div>"}n+="  <textarea class='floatleft"+(u?" enabled":" disabled")+"'"+(u?"":" disabled='disabled'")+" cols=100 rows=2 onclick='selectComment(\"mission_comment_box"+z+"\")' oninput='commentCharCheck(\"mission_comment_box"+z+"\")' onpaste='commentCharCheck(\"mission_comment_box"+z+"\")' onkeyup='commentCharCheck(\"mission_comment_box"+z+"\")'>";if(u){n+="Enter comment here"}else{n+="This feature has been disabled"}n+="  </textarea>";n+="	 <a class='floatleft button button_small_grey button_small_grey_post mission_comment_post_btn "+(u?"":"button_small_grey_post_disabled")+"' href='javascript:void(0)'"+(u?" onclick='submitComment("+z+', 0, 0,"mission_comment_box'+z+"\", true)'":"")+">Confirm</a>";n+="  <div class='clear'></div>";n+="  <p class='mission_comment_error'></p>";n+="</div>";n+="<div class='line_divider'></div>";if(L==0){p+=n;r++}else{if(L==2){t+=n;o++;if(c.length>0){c+=","}c+=z;if(M){A.push(x,O);m++;l+=parseInt(O)}if(H){l+=100}}}m++}}if(t!=""){if(F==""){F="Congratulations! You&rsquo;ve Completed the Following "+((o==1)?"Mission":"Missions")+"!"}else{K+='<div class="mission_divider_item"><h3 class="textcenter">Congratulations! You&rsquo;ve Completed the Following '+((o==1)?"Mission":"Missions")+"!</h3></div>"}K+=t}if(A.length!=0){v+='<div class="mission_divider_item" style="margin: 0;"><h3 class="textcenter">Congratulations! You&rsquo;ve Completed the Following '+((o==1)?"Pak":"Paks")+"!</h3></div>";for(var N=0;N<A.length;N=N+2){v+='<div class="mission_collection_item">';v+='   <div style="position: relative; margin: 0 auto; width: 442px;">';v+=getEmbedFlashHtml(C+"/images/missions/Collection_"+padNumber(x,3)+".swf","Collection"+x,442,98,"");v+='      <p class="textcenter mission_completion_text margincenter margintop_5px marginbottom_5px"><b>You earned '+O+" Tokens!</b></p>";v+="   </div>";v+="</div>"}K+=v}if(p!=""){if(F==""){F="The Following "+((r==1)?"Mission":"Missions")+" have Expired..."}else{K+='<div class="mission_divider_item"><h3 class="textcenter">The Following '+((r==1)?"Mission":"Missions")+" have Expired...</h3></div>"}K+=p}if(!q){K+="<div id='mission_premium_upsell' style='position: relative; height: 80px'><div id='tetris_loading_spinner'></div></div>";K+="</div>"}var a=750;var b=635;if(m==1){if(u){b=475}else{b=550}}var d="";for(N=0;N<gameResultMissions.length;N++){if(N!=0){d+=","}d+=gameResultMissions[N].missionId}h=function(){if(m==1){$(".mission_comment_link").remove();$(".mission_comment_box").show()}$.get("/missions/ajax/available_by_product.php?productId=-1&omitIds="+d+"&maxMissions=1&isPopup=1",function(Q){if(Q!=""){upsellHtml='<div class="mission_divider_item"><h3 class="textcenter">Want to play more Missions now? Check out Premium Missions!</h3></div>';upsellHtml+='<div class="results_mission_update game_results_missions_content_available">';upsellHtml+=Q;upsellHtml+="</div>";$("#mission_premium_upsell").html(upsellHtml)}else{removeLoadingAnimation()}})};if(K!='<div class="mission_list_box"></div>'){gameResultsAchievementPopup=true;K="<div class='box_header'><h2 class='textcenter'>"+F+"</h2><a id='mission_close_btn' class='floatright button button_small_grey button_small_grey_close user_stats_close_btn' href='javascript: void(0)' onclick='"+(q?"window.close()":"closePopup()")+"'"+(k?" style='display:none;'":"")+"></a></div><br />"+K;K+="<table style='table-layout:fixed; width:100%;'><tr>";if(!k){K+="  <td class='textcenter'><a href='/missions/premium_mission_list.php?tabId=my_grid' target='_parent'>Check out My Grid</a></td>";K+="  <td class='textcenter'><a href='/users/profile.php?tabId=my_badges' target='_parent'>Show Me My Badges</a></td>"}else{K+="  <td></td><td class='textcenter' style='width:66px;'><a id='mission_continue_btn' class='button button_small_grey button_small_grey_continue' href='javascript: void(0)' onclick='showMissionGridPopup(\""+c+'","'+C+'",'+B+")'></a></td><td></td>"}K+="</tr></table>";if(q){newWindow=window.open("","mission_complete","height="+b+", width="+a+",toolbar=no,scrollbars="+scroll+",menubar=no");newWindow.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'><head>"+J+"</head><body style='background:none'>"+K+"</body></html>")}else{popUpBoxByHtml(K,a,b,"",function(){gameResultsClosePopupLb(C);gameResultsAchievementPopup=false},h)}}}function showMissionGridPopup(a,c,b){$("#mission_list_box").load("/missions/_inc/_mission_premium_list.php?tabId=my_grid&recentCompleted="+a,function(){$(".box_header > h2").html("Your Mission Grid Results");$("#mission_continue_btn").removeAttr("onclick");$("#mission_continue_btn").click(function(){closePopup()});$("#mission_list_box").css("overflow","hidden")})}function showMissionPromoPopup(b,e,c){if(!b){closePopup()}var d="";var a;for(i=0;i<gameResultMissions.length;i++){if(i!=0){d+=","}d+=gameResultMissions[i].missionId}$.get("/missions/ajax/available_by_product.php?productId="+c+"&omitIds="+d+"&maxMissions=1",function(f){if(f!=""){gameResultsAvailableMissions=f;a=f.slice(f.indexOf("missionId=")+10,f.indexOf("missionId=")+14);a=a.replace("'>","");popUpMissionStore(a,function(){gameResultsClosePopupLb(e)},true)}else{$.get("/missions/ajax/available_by_product.php?productId=-1&omitIds="+d+"&maxMissions=1&isPopup=1",function(g){if(g!=""){a=g.slice(g.indexOf("missionId=")+10,g.indexOf("missionId=")+14);popUpMissionStore(a,function(){gameResultsClosePopupLb(e)},true)}})}})}function submitRating(a,b){$.get("/missions/ajax/save_rating.php?missionId="+a+"&rating="+b,function(c){if(c=="SUCCESS"){$("#mission_star_rating"+a).html("Rating submitted. Thank you!")}else{$("#mission_star_rating"+a).html("Unable to submit rating, please try again later.")}})}function updateRatingStarsState(b,f,e,d){var a=$(b).children();for(var c=0;c<a.length;c++){$(a[c]).attr("src",d+"/images/missions/circle_empty.png")}for(var c=0;c<f;c++){$(a[c]).attr("src",d+"/images/missions/circle_full"+(c+1)+".png")}$(b+"_text").html(e)}function getMissionProgressType(c,g){var f="";var a=["b2b_tetris","tetris","tspin","garbage_lines","lines_cleared","finish1"];var d=["Back-to-Back Tetrises","Tetrises","T-Spins","Garbage Lines","Lines","Rank 1st","Wins"];var e=a.length;for(var b=0;b<e;b++){if(g==a[b]){if(c==100&&g=="finish1"){f=d[b+1]}else{f=d[b]}break}}return f}function replayLoad(b,c){var a;switch(Number(b)){case 10:a=c+"/games/Marathon/marathonWebsiteReplay.swf";document.getElementById("contentReplayFlash").as3_loadReplayer(b,a);break;case 12:a=c+"/games/Survival/survivalWebsiteReplay.swf";document.getElementById("contentReplayFlash").as3_loadReplayer(b,a);break;case 23:a=c+"/games/Ultra/ultraWebsiteReplay.swf";document.getElementById("contentReplayFlash").as3_loadReplayer(b,a);break;case 84:a=c+"/games/Sprint/sprintWebsiteReplay.swf";document.getElementById("contentReplayFlash").as3_loadReplayer(b,a);break;case 86:a=c+"/games/Battle6P/battle6PWebsiteReplay.swf";document.getElementById("contentReplayFlash").as3_loadReplayer(b,a,5);break;case 100:a=c+"/games/Battle2P/battleWebsiteReplay.swf";document.getElementById("contentReplayFlash").as3_loadReplayer(b,a,1);break;case 101:a=c+"/games/Sprint5P/sprint_5PWebsiteReplay.swf";document.getElementById("contentReplayFlash").as3_loadReplayer(b,a,4);break;case 102:a=c+"/games/Mono/colorblindWebsiteReplay.swf";document.getElementById("contentReplayFlash").as3_loadReplayer(b,a);break}}function replayStart(a){isReplayStarted=true;document.getElementById("contentReplayFlash").as3_startReplay(a)}function replayStartMP(a,b){isReplayStarted=true;tmpGameData=a[0].split("&");myGameData=tmpGameData[0];myName=tmpGameData[1];myAvatar=b+"/images/avatars/40X40/"+tmpGameData[2];myRank=tmpGameData[3];myStars=tmpGameData[4];opponentGameData=a.slice(1);document.getElementById("contentReplayFlash").as3_startReplay(myGameData,myName,myAvatar,myRank,myStars,opponentGameData.toString(),gameResultsNames,gameResultsAvatars)}function replayPause(a){document.getElementById("contentReplayFlash").as3_pauseReplay(a)}function gameResultsClosePopupLb(b){var a=false;if(gameResultsMissionAchievements){gameResultsMissionAchievements=false;a=true;if(gameResultsIsMultiplayer){intervalTimer=setInterval("toggleMainInfoPage(true)",7000);gameResultsPlayWinAnim()}}else{if(isAdPlaying){isAdPlaying=false;a=true;if(gameResultsIsMultiplayer){intervalTimer=setInterval("toggleMainInfoPage(true)",7000);gameResultsPlayWinAnim()}}else{if(gameResultsAdvanceRank){gameResultsAdvanceRank=false;gameResultsCurrentRank=-1;gameResultsPromotionRank=-1;$("div.game_results_footer > table.game_buttons").attr("style","");gameResultsShowNotices()}else{if(gameResultsLeaderboardRank){gameResultsLeaderboardRank=false}else{if(gameResultsMissions){gameResultsMissions=false}}}}}if(a){gameResultsLoadOASIAB();gameResultsShowNotices()}}function gameResultsLoadOASIAB(){oas_php_url=OAS_GET_URL("sx","x62");$("#game_advertisement_iframe").attr("src",oas_php_url);$(".game_ad_container").css("visibility","visible");$("#containerAds").show()}function gameResultsLoadOASVideo(a){oas_php_url=OAS_GET_URL("sx","x63");$.getScript(oas_php_url,function(){try{OAS_VIDEO()}catch(b){gameResultsClosePopupLb(a)}})}function gameLoadOASPrerollVideo(){oas_php_url=OAS_GET_URL("sx","x74");$.getScript(oas_php_url,function(){try{OAS_VIDEO()}catch(a){gamePrerollComplete()}});intervalTimer=setTimeout("gamePrerollComplete()",15000)}function gameLoadOASPrerollTest(){var a="tremor780x385_Preroll.html";$(".game_loading").css("height","574px");$(".game_preroll_container").attr("width",video_iframe_width+"px");$(".game_preroll_container").attr("height",video_iframe_height+"px");setTimeout("gamePrerollStart('"+a+"')",30000)}var videoProvider="Unknown";function gamePrerollStart(a){if(a.indexOf("spotx")!=-1){videoProvider="SpotX"}else{if(a.indexOf("tremor")!=-1){videoProvider="Tremor"}}$(".game_preroll_container").attr("src","/marketing/"+a);$(".game_preroll_container").css("display","block");gamePrerollTrackEvent("Start",window.productName)}function gamePrerollLoaded(){if(intervalTimer!=-1){clearTimeout(intervalTimer);intervalTimer=-1;gamePrerollTrackEvent("Loaded",window.productName)}}var prerollDone=false;function gamePrerollComplete(){$(".game_loading").hide();$("#game_container").css("height","auto");$("#contentFlash").css("visibility","visible");if(!prerollDone){prerollDone=true;$.get("/games/ajax/preroll_done.php?sk="+sk);gamePrerollTrackEvent("Complete",window.productName)}document.getElementById("contentFlash").as3_prerollDone()}function gamePrerollTrackEvent(c,a){try{if(videoProvider!="Unknown"){pageTracker=_gat._getTracker("UA-886022-5");pageTracker._trackEvent("Video",c+" - "+videoProvider,a)}}catch(b){}}function gameResultsInterstitialAdCB(b,c,a){g_isInterstitial=true;if(c!=""){popUpBoxByFlv(c,800,400,"This game is brought to you by","",function(){gameResultsInterstitialAdOpened(b,a,true)},function(){gameResultsClosePopupLb(AD_AKAMAI_PATH)})}}function gameResultsInterstitialAdOpened(c,b,a){if(typeof(a)=="undefined"||a==""){a=false}if(c!=null||c!=""){$("#shadowbox_learn_more_btn > a").attr("href",c)}if(b!=-1){s_flvTimeout=setTimeout("gameResultsDisplayCloseButton()",b)}if(a){$("#shadowbox_body_more_info").height($("#shadowbox_content").css("height"));$("#shadowbox_body_more_info").width($("#shadowbox_body_inner").width())}}function gameResultsInterstitialAdState(a){if(a.newstate=="COMPLETED"){gameResultsInterstitialAdCompleted()}}function gameResultsInterstitialAdCompleted(){$("#shadowbox_body_inner").css("left","-9999px");$("#shadowbox_body_more_info").show();$("#shadowbox_container").show();gameResultsDisplayCloseButton()}function gameResultsDisplayCloseButton(){var a="<a class='button button_small_grey button_small_grey_close' href='javascript: void(0)' onclick='gameResultsInterstitialAdClose();'></a>";$("#sb-title-sidecontent").html(a);clearTimeout(s_flvTimeout)}function gameResultsInterstitialAdClose(){g_isInterstitial=false;$("#shadowbox_body_inner").css("left","0");$("#shadowbox_body_more_info").hide();window.parent.Shadowbox.close()}function gameResultsInterstitialTremorMediaAdCB(a,b){if(typeof(b)=="undefined"||b==""){b=7000}popUpBoxByUrlExt("/marketing/"+a,806,390,"This game is brought to you by <div id='sb-title-sidecontent'></div>",function(){gameResultsClosePopupLb()},function(){gameResultsInterstitialTremorMediaAdLoaded(b)},function(){})}function gameResultsInterstitialTremorMediaAdLoaded(a){gameResultsInterstitialAdOpened(null,a)}function gameResultsInterstitialSpotXChangeAdCB(a){spotx_channel_id="71727";if(typeof(spotx_content_category)=="undefined"||spotx_content_category==""){spotx_content_category="Casual Games"}if(typeof(spotx_content_tags)=="undefined"||spotx_content_tags==""){spotx_content_tags="free,games"}if(typeof(spotx_ad_max_duration)=="undefined"||spotx_ad_max_duration==""){spotx_ad_max_duration="35"}if(typeof(spotx_ad_click_target)=="undefined"||spotx_ad_click_target==""){spotx_ad_click_target="_blank"}if(typeof(spotx_ad_volume)=="undefined"||spotx_ad_volume==""){spotx_ad_volume="80"}if(typeof(spotx_ad_is_ready_interval_MSEC)=="undefined"||spotx_ad_is_ready_interval_MSEC==""){spotx_ad_is_ready_interval_MSEC=250}if(typeof(spotx_ad_is_ready_interval_limit_MSEC)=="undefined"||spotx_ad_is_ready_interval_limit_MSEC==""){spotx_ad_is_ready_interval_limit_MSEC=3000}spotx_content_url="http://www.tetrisfriends.com";spotx_content_title="Casual Games";spotx_content_desc="Free Web Games";spotx_content_page_url="http://www.tetrisfriends.com";spotx_content_duration="60";spotx_content_format="FlashVideo";spotx_content_width="500";spotx_content_height="375";spotx_ad_type="preroll";spotx_banner_size="300x250";spotx_content_container_id="shadowbox_video";spotx_banner_container_id="shadowbox_companion";spotx_ad_done_function=function(){if(typeof(isPromoAdCheckboxEnabled)=="function"&&isPromoAdCheckboxEnabled()){promoAdInterstitialLoadUpsell()}else{gameResultsInterstitialAdClose()}};spotx_ad_is_ready=false;spotx_ad_is_ready_interval_id=-1;spotx_ad_is_ready_interval_count=0;$.getScript(AD_AKAMAI_PATH+"/javascripts/extra/spotx.js",function(){spotx_ad_is_ready_interval_id=setInterval("gameResultsInterstitalSpotXIsReadyCB("+a+")",spotx_ad_is_ready_interval_MSEC)})}function gameResultsInterstitalSpotXIsReadyCB(a){if(spotx_ad_is_ready){clearInterval(spotx_ad_is_ready_interval_id);gameResultsInterstitialSpotXChangeAdLoaded(a)}else{if(spotx_ad_is_ready_interval_count>(spotx_ad_is_ready_interval_limit_MSEC/spotx_ad_is_ready_interval_MSEC)){clearInterval(spotx_ad_is_ready_interval_id);gameResultsInterstitialAdClose();gameResultsClosePopupLb()}else{spotx_ad_is_ready_interval_count++}}}function gameResultsInterstitialSpotXChangeAdLoaded(a){if(typeof(spotx_ad_found)=="undefined"||spotx_ad_found==false){gameResultsInterstitialAdClose();gameResultsClosePopupLb()}else{var b='<div id="interstitial_body">   <div id="shadowbox_video" style="position: absolute; top: 0; left: 0;"></div>   <div id="shadowbox_companion" style="position: absolute; top: 0; left: 505px;"></div>   <div id="promo_ad_small" style="position: absolute; top: 255px; left: 505px; z-index: 100;"></div></div><div id="promo_ad_large_container" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none;"></div>';g_isInterstitial=true;popUpBoxByHtml(b,806,375,"This game is brought to you by <div id='sb-title-sidecontent'></div>",function(){gameResultsClosePopupLb()},function(){gameResultsInterstitialAdOpened(null,a);$("#promo_ad_small").load("/marketing/promoAd300x110.html")})}}var leaderboardCurrentProductId=-1;var leaderboardCurrentlbType=-1;var leaderboardCurrentStartIndex=-1;var leaderboardCurrentRegion=-1;var leaderboardMpFilter=-1;var leaderboardRallyMapFilter=-1;function leaderboardPageNext(a,b){a=Number(leaderboardCurrentStartIndex);a+=10;leaderboardChange(3,-1,-1,-1,a,b)}function leaderboardPagePrev(a,b){a=Number(leaderboardCurrentStartIndex);a-=10;leaderboardChange(3,-1,-1,-1,a,b)}function leaderboardResetButtons(){$("#game_list > ul > li").removeClass("selected")}function leaderboardSelectButton(a){leaderboardResetButtons();$("#gameButton"+a).addClass("selected")}function leaderboardChange(l,c,e,g,k,b,a,h){var f;if(a==null){a=-1}if(h==null){h=-1}if(leaderboardCurrentProductId==c&&e==leaderboardCurrentlbType&&k==leaderboardCurrentStartIndex&&leaderboardCurrentRegion==g&&leaderboardMpFilter==a&&leaderboardRallyMapFilter==h){return}if(b!=null){leaderboardSelectButton(b);f="/leaderboard/ajax/leaderboard_tips.php?gameName="+b;$("#tetris_tip").load(f)}if(c!=-1){var d=leaderboardCurrentProductId;leaderboardCurrentProductId=c}if(e!=-1){leaderboardCurrentlbType=e}if(g!=-1){leaderboardCurrentRegion=g}if(a!=-1){leaderboardMpFilter=a}else{if(leaderboardMpFilter=="kos_rank"&&leaderboardCurrentProductId==101){leaderboardMpFilter="best_time_rank"}else{if(leaderboardMpFilter=="best_time_rank"&&leaderboardCurrentProductId==100){leaderboardMpFilter="kos_rank"}else{if(leaderboardMpFilter=="most_played_rank"&&leaderboardCurrentProductId==3){leaderboardMpFilter="most_won"}else{if(leaderboardMpFilter=="most_won"&&leaderboardCurrentProductId!=3){leaderboardMpFilter="most_played_rank"}}}}}if(h==-2){leaderboardRallyMapFilter=-1}else{if(h!=-1){leaderboardRallyMapFilter=h}}if(k!=-1){leaderboardCurrentStartIndex=Number(k)}f="/leaderboard/ajax/leaderboard_page.php?platformId="+l+"&productId="+leaderboardCurrentProductId+"&leaderboardType="+leaderboardCurrentlbType+"&startIndex="+leaderboardCurrentStartIndex;if(b!=null){f+="&gameName="+b}if(leaderboardCurrentRegion!=-1){f+="&lbRegion="+leaderboardCurrentRegion}if(leaderboardMpFilter!=-1){f+="&lbMpFilter="+leaderboardMpFilter}if(leaderboardRallyMapFilter!=-1){f+="&mapId="+leaderboardRallyMapFilter}$("#leaderboard_page").load(f)}function leaderboardChangeRegion(a,b){leaderboardChange(3,-1,-1,a,0,b)}function leaderboardChangeMpFilter(a,b){leaderboardChange(3,-1,-1,-1,0,b,a,-2)}function leaderboardChangeRallyMapFilter(a,b){leaderboardChange(3,-1,-1,0,0,b,"best_time_rank",a)}function leaderboardViewDetails(g,e,b,f,a,d,c,k,l,h){popUpBoxByUrl("/leaderboard/ajax/leaderboard_details.php?gameRecordId="+e+"&userId="+g+"&productId="+b+"&leaderboardType="+f+"&name="+a+"&stat0="+d+"&stat1="+c+"&avatar="+k+"&isBetaUser="+h+"&message="+l,760,550,"")}function leaderboardMPViewDetails(d,f,b,e,c,a,g,h){popUpBoxByUrl("/leaderboard/ajax/leaderboard_mp_details.php?userId="+d+"&productId="+f+"&name="+b+"&stat0="+e+"&stat1="+c+"&avatar="+a+"&isBetaUser="+h+"&message="+g,760,550,"")}function leaderboardRegionOnSelection(a,b){leaderboardChangeRegion(a,b)}function profileViewDetails(d,b,a,c){popUpBoxByUrl("/leaderboard/ajax/user_stats.php?username="+d+"&value="+c+"&productId="+b+"&userId="+a,760,508,"")}function profileViewMPDetails(c,b,a){popUpBoxByUrl("/leaderboard/ajax/mp_user_stats.php?username="+c+"&productId="+b+"&userId="+a,800,525,"")}function profileViewConnectDetails(c,b,a){popUpBoxByUrl("/leaderboard/ajax/connect_user_stats.php?username="+c+"&productId="+b+"&userId="+a,760,508,"")}function profileReportUser(b,d,c,a){popUpBoxByUrl("/users/ajax/report_user_popup.php?&userId="+b+"&username="+d+"&userAvatar="+c+"&room_name"+a,584,300,"")}function submitReportUser(e,g,d,f,b,a,c){d=$("#"+f+" > textarea").val();if(trim(d)==""||(trim(d)=="Enter comment here")){commentErrorMsg(f,"You must enter a reason why you are reporting this user!","#f00")}else{if(d.length<200){d=encodeURIComponent(d);$("#friend_report_popup_btns").html("<img src='"+c+"/images/spinner.gif' style='vertical-align:middle; margin:5 auto;'/>");$("#friend_report_popup_btns").removeClass();$.post("/users/ajax/report_user.php",{userId:e,username:g,reportComment:d,chat:b,roomName:a},function(k){if(k=="SUCCESS"){var h="<br /><br />The User Report has been sent to our Support Team for review.<br />Thank you.<br /><br />Did you know you can also add users to your <a href='/users/block_list.php?block_user=1&id="+e+"' target='_parent'>User Block List</a> to minimize interactions?<br />You can manage the User Block List by visiting the Privacy Settings inside your Profile.";$(".box_header").html("<h3>Report has been sent</h3>");$("#friend_report_popup").html("<div class='friends_popup_response'>"+h+"</div>");$("#friend_report_popup").css("height","210px");$("#friend_report_popup_btns").addClass("buttons_area");$("#friend_report_popup_btns").html("<a class='button button_small_grey button_small_grey_ok okbtn' href='javascript:void(0)' onclick='closePopup()' style='left:45%;'>Ok</a>")}else{commentErrorMsg(f,"There was an error while submitting. Please try again later.","#f00")}})}}}function profileBlockUser(a,d,b,c){popUpBoxByUrl("/users/ajax/block_user_popup.php?&userId="+a+"&username="+d+"&userAvatar="+b,584,320,"",c)}function submitBlockUser(a){$.get("/users/ajax/block_user.php?userId="+a,function(c){if(c=="SUCCESS"){closePopup()}else{var b="There was a problem in submitting your request.<br />Please try again later.";$(".box_header").html("<h3>There was a problem...</h3>");$("#friend_report_popup").html("<div class='friends_popup_response'>"+b+"</div>");$("#friend_report_popup").css("height","210px");$("#friend_report_popup_btns").html("<a class='button button_small_grey button_small_grey_ok okbtn' href='javascript:void(0)' onclick='closePopup()' style='left:45%;'>Ok</a>")}})}function submitUnblockUser(a){$.get("/users/ajax/block_user.php?userId="+a+"&unblock=1",function(c){if(c=="SUCCESS"){reloadBlockList(true)}else{var b="There was a problem in submitting your request.<br />Please try again later.";$(".box_header").html("<h3>There was a problem...</h3>");$("#friend_report_popup").html("<div class='friends_popup_response'>"+b+"</div>");$("#friend_report_popup").css("height","210px");$("#friend_report_popup_btns").html("<a class='button button_small_grey button_small_grey_ok okbtn' href='javascript:void(0)' onclick='closePopup()' style='left:45%;'>Ok</a>")}})}function popUpFriendStore(b,a){popUpBoxByUrl("/friends/ajax/friend_browser.php?id="+b,584,300,"",a)}function popUpRemoveFriend(b,a){popUpBoxByUrl("/friends/ajax/friend_remove_popup.php?id="+b,584,300,"",a)}function removeFriend(b,a){$("a.sendbtn").attr("onclick","javascript:void(0);");$("a.cancelbtn").attr("onclick","javascript:void(0);");url="/users/ajax/purchase_friend.php?toId="+a+"&remove_friend=1";$.get(url,function(d){var c="";if(d=="SUCCESS"){c="Friend has been removed..."}else{c="Failed to remove friend from list."}$("#friend_befriend_popup").html("<div class='friends_popup_response'>"+c+"</div>");$("#friend_button_area").css("width",64);$("#friend_button_area").html("<a class='button button_small_grey button_small_grey_ok okbtn' href='javascript:void(0)' onclick='closePopup()'>Ok</a>")})}function popUpFriendList(b,a){popUpBoxByUrl("/friends/_inc/_friends_list.php?id="+b+"&isPopup=true",584,500,"",a)}function popUpMessagesConfirmed(b,l,h,e,f,g,m){var c;c="<div class='friend_popup'>\n<div class='box_header' style='text-align:center;'><h3>";if(f!="SUCCESS"){c+=h+" could not be added as a Friend"}else{c+=h+" has been added as a Friend"}c+="</h3></div><br/>\n<div id='friend_confirm_popup' class='friend_confirm_popup'>\n";if(f=="SUCCESS"){var a=l+"/images/OWSoundPlayer.swf";var k=l+"/images/friends/friend_confirmed.swf";var d="sessionId="+b+"&filePath="+k+"&height=100&width=100&soundName=friendConfirmed&useControls=false";c+="<div class='friend_confirmed_animation'>"+getEmbedFlashHtml(a,"FriendConfirmed",100,100,d)+"</div>"}c+="<img class='friend_avatar' src='"+e+"' "+((f=="failed"||f=="blocked")?"style='left:40px;'":"")+"/><div class='friend_desc' "+((f!="SUCCESS")?"style='width:330px;'":"")+">";if(f=="SUCCESS"){c+="You are now Friends with "+h+"!"}else{if(f=="BLOCKED"){c+="<p>You have blocked "+h+". Please visit<br>your <a href='/users/block_list.php'>User Block List</a> and remove this<br>user first before adding as a Friend."}else{c+="<p>"+h+" could not be added as a Friend</p>";if(f!="FAILURE"){c+="<br/>"+f}}}c+="</div></div>\n</div>\n<div id='friend_button_area' class='buttons_area'>\n<a class='floatleft button button_small_grey button_small_grey_ok okbtn' href='javascript:void(0)' onclick='messageFriendConfirmed("+(f=="SUCCESS"?true:false)+")' style='left:45%;'>Ok</a></div>\n";popUpBoxByHtml(c,584,300,"",m,null)}function messageFriendConfirmed(a){if(a){$("#messageFriendConfirmed > .acceptbtn").hide();$("#messageFriendConfirmed > .deletebtn").css("left","45%")}closePopup()}function popUpReportMessage(b,h,f,g,e,a,c,k){var d="";d="<div id='report_message_popup'><div class='box_header' style='text-align:center;'><h3>Are you sure you want to report this message?</h3></div><br/><div class='report_message_info'><img src='"+f+"'/><a class='report_user_name' href=''>"+h+"</a><div class='report_subject'>"+e+"</div><div class='report_time'>"+a+"</div></div><br/><div id='report_message_comment_box' class='report_message_comment_area'><div class='report_comment_title'>Comment:<br/>(Required)</div><textarea id='report_message_comment' onclick='selectComment(\"report_message_comment_box\")' 'rows='3' cols='60' oninput='commentCharCheck(\"report_message_comment_box\",\"button_small_grey_sendreport\")' onpaste='commentCharCheck(\"report_message_comment_box\",\"button_small_grey_sendreport\")' onkeyup='commentCharCheck(\"report_message_comment_box\",\"button_small_grey_sendreport\")'>Enter comment here</textarea><p class='mission_comment_error'></p></div><div class='buttons_area'><a class='button button_small_grey button_small_grey_sendreport' href='javascript:void(0)' onclick='submitReportMessage("+g+","+b+',"'+h+'","'+encodeURIComponent(c)+"\",\"report_message_comment_box\",\"report_message_popup\")' style='left:38%;'>Report</a><a class='button button_small_grey button_small_grey_cancel' href='javascript:void(0)' onclick='closePopup()' style='left:55%;'>Cancel</a></div></div>";popUpBoxByHtml(d,584,250,"",k,null)}function submitReportMessage(b,f,e,a,d,c){reportComment=$("#"+d+" > textarea").val();if((trim(reportComment)=="Enter comment here")||(trim(reportComment).length==0)){commentErrorMsg(d,"Please enter a comment before submitting.","#f00")}else{if(reportComment.length<200){$.get("/messages/ajax/report_message.php?messageId="+b+"&userId="+f+"&username="+e+"&comment="+encodeURIComponent(a)+"&reportComment="+encodeURIComponent(reportComment),function(g){if(g=="SUCCESS"){reportConfirmedMessage(c,f)}else{commentErrorMsg(d,"There was an error while submitting. Please try again later.","#f00")}})}}}function reportConfirmedMessage(b,c){var a="";a="<div class='box_header' style='text-align:center;'><h3>Report has been sent</h3></div><br/><div class='report_message_confirmed'><div class='report_confirmed'><p>The Spam/Abuse Report has been sent to our Support Team for review.<br/>Thank you.</p><br/><p>Did you know you can also add users to your <a href='/users/block_list.php?block_user=1&id="+c+"' target='_parent'>User Block List</a> to minimize interactions?<br/>You can manage the User Block List by visiting the Privacy Settings inside your Profile.</p></div></div><div class='buttons_area'><a class='button button_small_grey button_small_grey_ok' href='javascript:void(0)' onclick='closePopup()' style='left:45%;'>Cancel</a></div>";$("#"+b).html(a)}function popUpMissionStore(b,a,c){popUpBoxByUrl("/shop/shop_popup.php?rdir=/shop/index.php&missionId="+b+"&isPromo="+c,620,540,"",a)}function submitComment(a,d,e,c,b){comment=$("#"+c+" > textarea").val();if((trim(comment)=="Enter comment here")||(trim(comment).length==0)){commentErrorMsg(c,"Please enter a comment before submitting.","#f00")}else{if(comment.length<200){comment=decodeHtmlSpecialChars(comment);addLoadingAnimation("#"+c);$.get("/missions/ajax/save_comment.php?missionId="+a+"&comment="+comment+"&parentId="+e,function(f){if(f=="SUCCESS"){if(b){$("#"+c).html("<p class='textright'><i>Comment Submitted!</i></p>");$("#mission_comment_link"+a).remove()}else{$("#"+c).hide();showMissionDetails(a,d)}}else{if(f=="SPAM"){$("#"+c+" > div#tetris_loading_spinner").remove();$("#"+c+" > div#tetris_loading_mask").remove();commentErrorMsg(c,"Please wait 5 minutes to regain commenting feature.","#f00")}else{$("#"+c+" > div#tetris_loading_spinner").remove();$("#"+c+" > div#tetris_loading_mask").remove();commentErrorMsg(c,"Please review your message and try again.","#f00")}}})}}}function submitGalleryComment(a,c,b){comment=$("#"+b+" > textarea").val();if((trim(comment)=="Enter comment here")||(trim(comment).length==0)){commentErrorMsg(b,"Please enter a comment before submitting.","#f00")}else{if(comment.length<200){comment=decodeHtmlSpecialChars(comment);addLoadingAnimation("#"+b);$.get("/gallery/ajax/save_comment.php?galleryId="+a+"&comment="+comment+"&parentId="+c,function(d){if(d=="SUCCESS"){$("#"+b).hide();refreshComments()}else{if(d=="SPAM"){$("#"+b+" > div#tetris_loading_spinner").remove();$("#"+b+" > div#tetris_loading_mask").remove();commentErrorMsg(b,"Please wait 5 minutes to regain commenting feature.","#f00")}else{$("#"+b+" > div#tetris_loading_spinner").remove();$("#"+b+" > div#tetris_loading_mask").remove();commentErrorMsg(b,"Please review your message and try again.","#f00")}}})}}}function selectComment(a){comment=$("#"+a+" > textarea").val();if(trim(comment)=="Enter comment here"){$("#"+a+" > textarea").css("font-style","normal");$("#"+a+" > textarea").css("color","#666");$("#"+a+" > textarea").val("")}}function commentCharCheck(a,b){comment=$("#"+a+" > textarea").val();if(htmlspecialchars(comment).length>=200){if(b){$("."+b).addClass(b+"_disabled")}commentErrorMsg(a,"Message too long!","#f00")}else{if(b){$("."+b).removeClass(b+"_disabled")}commentErrorMsg(a,"","#c0c0c0")}}function commentErrorMsg(b,a,c){$("#"+b+" > p.mission_comment_error").html(a);$("#"+b+" > textarea").css("border-color",c)}function discardComment(a){comment=$("#"+a).hide();comment=$("#"+a+"> textarea").val("Enter comment here");$("#"+a).css("font-style","italic");$("#"+a).css("color","#c0c0c0")}function removeMissionComment(a){$.get("/missions/ajax/remove_comment.php?commentId="+a,function(b){if(b=="SUCCESS"){refreshMissionsPage()}else{alert("There was a problem while removing your comment. Please try again later.")}})}function removeGalleryComment(a){$.get("/gallery/ajax/remove_comment.php?commentId="+a,function(b){if(b=="SUCCESS"){refreshComments()}else{alert("There was a problem while removing your comment. Please try again later.")}})}function missionReportComment(b,a,f,d,c,e){popUpBoxByUrl("/missions/ajax/report_comment_popup.php?commentId="+b+"&userId="+a+"&username="+f+"&userAvatar="+d+"&timeElapsed="+c+"&comment="+e,600,325,"")}function submitReportComment(b,a,e,d,c){reportComment=$("#"+c+" > textarea").val();$.get("/missions/ajax/report_comment.php?commentId="+b+"&userId="+a+"&username="+e+"&comment="+d+"&reportComment="+reportComment,function(f){if(f=="SUCCESS"){closePopup()}else{commentErrorMsg(c,"There was an error while submitting. Please try again later.","#f00")}})}function galleryReportComment(b,a,f,d,c,e){popUpBoxByUrl("/gallery/ajax/report_comment_popup.php?commentId="+b+"&userId="+a+"&username="+f+"&userAvatar="+d+"&timeElapsed="+c+"&comment="+e,600,325,"")}function submitGalleryReportComment(b,a,e,d,c){reportComment=$("#"+c+" > textarea").val();$.get("/gallery/ajax/report_comment.php?commentId="+b+"&userId="+a+"&username="+e+"&comment="+d+"&reportComment="+reportComment,function(f){if(f=="SUCCESS"){closePopup()}else{commentErrorMsg(c,"There was an error while submitting. Please try again later.","#f00")}})}function setFavoriteUserMission(a){$.get("/users/ajax/set_favorite_mission.php?userMissionId="+a,function(b){if(b=="SUCCESS"){refreshMissionsPage()}else{alert("There was a problem while setting this as your favorite. Please try again later.")}})}function displayRank(f,b,a,e,g,d){var c="";if(d!=null){imageGamePath=d+"/images/games/"}else{imageGamePath="/images/games/"}if(e){imageGamePath+="rankIcons40x40/"}imageGamePath+="rankIcon_";if(b>9){imageGamePath=imageGamePath+(b)}else{imageGamePath=imageGamePath+"0"+(b)}imageGamePath=imageGamePath+".png";if(a==0&&a!=3){c+="<p>Rank "+b+"</p>"}if(a!=2){c+="<img class = 'rank_icon' src = '"+imageGamePath+"' alt='' />"}if(a==1){c+="<p>Rank "+b+" ("+rankNames[b-1]+")</p>"}else{if(a==2){c+="<p>Your Rank: "+b+" ("+rankNames[b-1]+")</p>"}}if(g!=null){window.parent.$("#"+f).html(c)}else{$("#"+f).html(c)}}function displayHalfStars(d,b,e,c){var a="";if(c!=null){imageGamePath=c+"/images/games/"}else{imageGamePath="/images/games/"}fullStars=Math.floor(b/2);remainderStars=b%2;for(i=0;i<fullStars;i++){a+="<img src = '"+imageGamePath+"star_full.png' alt='' />"}if(remainderStars>0){a+="<img src = '"+imageGamePath+"star_half.png' alt='' />"}for(i=0;i<5-(fullStars+remainderStars);i++){a+="<img src = '"+imageGamePath+"star_empty.png' alt='' />"}if(e!=null){window.parent.$("#"+d).html(a)}else{$("#"+d).html(a)}}function displayLiveBar(h,c,p,a,g,m){var l=Math.floor(p/1000);var k=p%1000;var f=p-(l*1000);var b=(k>0&&f>0)?1:0;var o=0;var n=0;if(b==1){o=(f/1000)*100;n=f}else{if(p==""){n=500;o=50;c=1}else{o=100;n=1000}}var e=(a==0)?"Rank "+c+" ("+rankNames[c-1]+")":"";var d="<p style='text-align: "+((a==1)?"center":"left")+";'>"+e+"<span style='position: absolute; "+((a==1)?"top: 10px; left: 0; width: 100%;":"right: 0;")+"; font-weight: bold; color: #000;'>"+n+"/1000</span></p>";d+="<div class='tetris_progress_bar'>";d+="   <div class='tetris_progress_bar_content tetris_progress_green_bar_content' style='width:"+(o)+"%;'></div>";d+="</div>";$("#"+h).html(d)}function displayLoginForm(a){var b=window.location.href;if(b.match("game.php")==null&&b.match("login.php")==null){if(a){$("div.tetris_login_form").css("left","auto");$("div.tetris_login_form").css("right","65px")}else{$("div.tetris_login_form").css("left","-9999px");$("div.tetris_login_form").css("right","auto")}}else{window.location.href="/users/login.php"}}function displayShareThisPopup(){if($("#game_swf").length){if($("#game_side_buttons").length&&!$("#game_side_buttons > a").hasClass("disabled_game_button")){tetrisGameOptions()}}var a="/users/ajax/sharethis.php";a=a+"?pageUrl="+window.location.href;a=a+"&pageTitle="+window.document.title;popUpBoxByUrl(a,400,200)}function popUpGameErrorNotice(a,f,c,e,b,d){popUpBoxByUrlExt("/games/ajax/game_results_error_popup.php?userId="+a+"&errorCode="+f,616,375,"",null,function(){if(d){$.post("/games/ajax/process_error_msg.php",{userId:a,errorCode:f,errorMsg:c,errorRQ:e,errorRS:b})}},null)}function popUpHolidayNotice(){$("#tetris_token_notice").css("background-color","#fff");$(document).ready(function(){addNotice("<a parent='_top' href='/shop/index.php'><img style='height: 100px; width: 872px; display: block; margin: 0 auto;' src='"+AD_AKAMAI_PATH+"/images/promo_ads/holidays/christmasRubies.png' /></a>")})}function popUpHolidayPopup(){$("#tetris_token_notice").css({height:"0",overflow:"hidden"});var a="";a="<div id='holiday_popup'><div class='box_header'><a class='floatright button button_small_grey button_small_grey_close user_stats_close_btn' href='javascript: void(0)' onclick='closePopup();'></a></div><br /><div style='border: 1px solid #c0c0c0; border-width: 1px 0 0 0;'>"+getEmbedFlashHtml(AD_AKAMAI_PATH+"/images/promo_ads/holidays/RubyPresent.swf","HolidayNotice",650,350,{})+"</div><a class='button button_large_blue button_go_shopping margincenter' parent='_top' href='/shop/index.php'>Go Shopping</a></div>";$(document).ready(function(){popUpBoxByHtml(a,650,435,"",function(){},function(){})})}function popUpPromoNotice(a){if(typeof(a)=="undefined"||a==false){a="http://videoads2.tetrisfriends.com/inHouse_ads/html/primary_promo_notice.html"}$.getScript(a,function(){try{}catch(b){}})}function popUpPromoPopup(a){if(typeof(a)=="undefined"||a==false){a="http://videoads2.tetrisfriends.com/inHouse_ads/html/primary_promo_popup.html"}$.getScript(a,function(){try{}catch(b){}})}function popUpRegisterPopup(a){if(typeof(a)=="undefined"||a==""){a=function(){}}popUpBoxByUrlExt("/users/_inc/_registerForm.php?isPopup=true&$saveGame=true",650,480,"",a,function(){})}function popUpRegisterPromoPopup(a,b){if(typeof(a)=="undefined"||a==""){a=function(){}}if(b){popUpBoxByUrlExt("/users/_inc/_arenaGuestInvite.php",650,400,"",a,function(){})}else{popUpBoxByUrlExt("/users/_inc/_registerPromo.php?isPopup=true",650,400,"",a,function(){})}}function popUpDailySpin(a){popUpBoxByUrl("/users/ajax/daily_spin_popup.php?action_token="+a,640,510,"",function(){setTimeout("refreshMiniProfile()",0)})}function refreshMiniProfile(){addLoadingAnimation("#home_mini_profile_container");$("#home_mini_profile_container").load("/users/_inc/mini_profile.php",function(){removeLoadingAnimation("#home_mini_profile_container")})}function popUpArenaTimeUpPopup(){var a="<div id='arena_timeup_popup'><div class='box_header'><h2 class='textcenter'>Viewing Time Ended</h2><a class='floatright button button_small_grey button_small_grey_close user_stats_close_btn' href='javascript: void(0)' onclick='closePopup(); window.location.href = \"/index.php\";'></a></div><br /><div style='text-align:center; font-size:18px; margin:40px 10px;'>You have reached the max viewing time for the day.<br />Come back tomorrow or <a href='/users/register.php'>sign-up</a> for a Free Account to get an unlimited access.</div></div>";popUpBoxByHtml(a,550,300,"",function(){},function(){})}function resetTabStates(a){$("ul#"+a+" > li > a").removeClass("selected")}function selectTab(b,a){resetTabStates(b);$("ul#"+b+" > li."+a+" > a").addClass("selected")}function resetButtonStates(d){var c=$("div#"+d+" > a");for(var b=0;b<c.length;b++){var e=$(c[b]).attr("class");e=e.split(" ");for(var a=0;a<e.length;a++){if(e[a].search(/\w_selected/)!=-1){$(c).removeClass(e[a])}}}}function selectButton(b,a){resetButtonStates(b);$("div#"+b+" > a."+a).addClass(a+"_selected")}function showCommentBox(a){$(".mission_comment_box").hide();$("#"+a).show()}function addLoadingAnimation(a){$(a).html('<div id="tetris_loading_spinner" ></div><div id="tetris_loading_mask"></div>'+$(a).html())}function removeLoadingAnimation(b){var a="";if(typeof(b)!=undefined&&typeof(b)!="undefined"){a=b+" > "}$(a+" #tetris_loading_spinner").remove();$(a+" #tetris_loading_mask").remove()}function generatePages(d,b,f,k,h){var g=$(d).children();var a=0;var l=((typeof(k)=="undefined")?false:k);var f=((typeof(f)=="undefined")?1:f);var h=((typeof(h)=="undefined")?function(){}:h);for(var c=0;c<g.length;c=c+b){var e=c+b;if(e>g.length){e=g.length}$(g).slice(c,e).wrapAll("<div class='"+d.substring(1)+"_page'></div>")}initPager(d,l,f,h)}function initPager(a,b,c,d){if(b==undefined||b=="undefined"){b=false}if(c==undefined||c=="undefined"){c=1}if(d==undefined||d=="undefined"){d=function(){}}$(document).ready(function(){$(a).jpager("."+a.substring(1)+"_page",{navClass:"pager_page_nav ",highlightClass:"pager_page_selected",prevText:"Prev",nextText:"Next",autoHeight:b,startPage:c,pageUpdateHook:d})})}function addNotice(d,e,c){if(c==undefined||c=="undefined"){c=function(){}}var b=$("#tetris_token_notice").html();var a=function(){};if(b.length!=0){b=b+"<br />"}if(typeof(e)=="undefined"||e==""){e=false}if(e){a=function(){intervalTimer=setTimeout("$('#tetris_token_notice').hide('slow');",3000)}}else{if(intervalTimer!=-1){clearTimeout(intervalTimer);intervalTimer=-1}}$("#tetris_token_notice").html(b+d);$("#tetris_token_notice").show("fast",function(){a();c()})}function clearNotice(){$("#tetris_token_notice").hide();$("#tetris_token_notice").html("")}function clearSessionNotifications(){$.get("/users/ajax/clear_notifications.php")}var activateSent=false;function activatePromoItem(a){if(!activateSent){activateSent=true;$.get("/users/ajax/activate_promo_item.php?accessoryId="+a,function(b){if(b=="SUCCESS"){showItemDetails(a,accessoryType);addNotice('<p style="color: #000;">This <i>limited-time</i> promotional item has now been added to your account. Have fun!</p>')}else{}})}}function activatePromoMission(a){if(!activateSent){activateSent=true;$.get("/users/ajax/activate_promo_item.php?missionId="+a,function(b){if(b=="SUCCESS"){addNotice('<p style="color: #000;">This promotional item has now been added to your account. Have fun!</p>');setTimeout("refreshMissionsPage(); popUpMissionStore("+a+");",0)}else{}})}}function activateRewards(b){if(!activateSent){activateSent=true;try{if(typeof(spinCount)==undefined||typeof(spinCount)=="undefined"){spinCount=1}var e=prizeTags.split("&");pageTracker=_gat._getTracker("UA-886022-5");pageTracker._trackPageview("/daily_spin_popup/spin"+spinCount);for(var a=0;a<e.length;a++){var d=e[a].split(":");pageTracker._trackEvent("DailySpin",d[0],d[1])}}catch(c){}$.get("/users/ajax/activate_promo_item.php?rewardSpin=1",function(f){})}}function toggleTroubleElements(b){var a=["select","object","embed","canvas"];for(var d=0;d<a.length;d++){var e=document.getElementsByTagName(a[d]);for(var c=0;c<e.length;c++){if(b){$(e[c]).css("visibility","visible")}else{$(e[c]).css("visibility","hidden")}}}}function getNowPlusMinutes(b){var a=new Date();return new Date().setTime(a.getUTCSeconds+(b*60*1000))}function formatLoginId(b){var a=b.getHours();var c=b.getMinutes();if(c<10){c="0"+c.toString()}return a.toString()+c.toString()}function isMainPage(a){if(a.search(/index.php/)!=-1||a=="/"||a.search(/users\/profile.php/)!=-1||a.search(/leaderboard\/index.php/)!=-1||a.search(/help\/tips.php/)!=-1||a.search(/help\/help.php/)!=-1||a.search(/game.php/)!=-1){return true}return false}function getExternalId(b){if(b==0){var a=unescape($.cookie("guest_cookie"));a=a.split(":");return a[0]}return"u7tpFP8R0Cg="}function getLoginId(b){if(b==0){var a=unescape($.cookie("guest_cookie"));a=a.split(":");if(a[2]==-1){return tmpLoginId}else{return a[2]}}return b}function encodeHtmlSpecialChars(a){a=a.replace(/\"/g,"&quot;");a=a.replace(/'/g,"&#039;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");a=a.replace(/&/g,"&amp;");return a}function decodeHtmlSpecialChars(a){a=a.replace(/&quot;/g,'"');a=a.replace(/&#039;/g,"'");a=a.replace(/&lt;/g,"<");a=a.replace(/&gt;/g,">");a=a.replace(/&amp;/g,"&");return a}function convertToLocalTimezone(a){tmpDateObj=new Date();localOffset=tmpDateObj.getTimezoneOffset();localOffset=localOffset*60*1000;a=a-localOffset;return a}function formatDateTime(a){date=a.getDate();month=a.getMonth()+1;year=a.getFullYear();time=a.toLocaleTimeString();return year+"-"+month+"-"+date+" <br /> "+time}function formatSprintTime(b){var a;if(b==-1){a="---"}else{minutes=Math.floor((b/1000)/60);seconds=(b/1000)-(minutes*60);decimal=Math.floor(new Number(seconds%1).toPrecision(2)*100);seconds=Math.floor(seconds);if(seconds<10){seconds="0"+seconds}if(decimal<10){decimal="0"+decimal}a=""+minutes+":"+seconds+"."+decimal}return a}function htmlspecialchars(a){if(typeof(a)=="string"){a=a.replace(/&/g,"&amp;");a=a.replace(/"/g,"&quot;");a=a.replace(/'/g,"&#039;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;")}return a}function trim(a){s=a.replace(/^(\s)*/,"");s=s.replace(/(\s)*$/,"");return s}function getEmbedFlashHtml(e,b,c,d,f){if(f==undefined||f=="undefined"){f="swfState = 1"}var a='<object id="'+b+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+c+'" height="'+d+'" data="'+e+'">';a+='<param name="movie" value="'+e+'">';a+='<param name="quality" value="high">';a+='<param name="wmode" value="transparent">';a+='<param name="scale" value="noscale">';a+='<param name="salign" value="tl">';a+='<param name="allowScriptAccess" value="always">';a+='<param name="FlashVars" value="'+f+'">';a+='<embed name="'+b+'" src="'+e+'" width="'+c+'" FlashVars="'+f+'" allowScriptAccess="always" quality="high" wmode="transparent" scale="noscale" salign="tl" height="'+d+'"></embed>';a+="</object>";return a}function calculateTimeLeft(e,b){var c=new Date();var g;var d;var f;var h;d=e.split(" ");f=d[0].split("/");h=d[1].split(":");g=new Date(f[2],f[1]-1,f[0],h[0],h[1],h[2]);var a=Math.floor((c-g)/1000);a=(b*24*60*60)-a;return a}function convertSecondsToWords(c){var b="";var a="";if(c<60){b=(c==1)?" second":" seconds"}else{if(c/60<60){c=Math.floor(c/60);b=(c==1)?" minute":" minutes"}else{if(c/60/60<=24){c=Math.floor(c/60/60);b=(c==1)?" hour":" hours"}else{if(c/60/60/24<=14){c=Math.ceil(Math.round(c/60/60/24,2));b=(c==1)?" day":" days"}else{if(c/60/60/24/7<4){c=Math.ceil(c/60/60/24/7);b=(c==1)?" week":" weeks"}else{if(c/60/60/24/7/4<12){c=Math.floor(c/60/60/24/7/4);b=(c==1)?" month":" months"}else{c=Math.floor(c/60/60/24/7/12);b=(c==1)?" year":" years"}}}}}}return c+b}function padNumber(c,b){var e=c.length;var a=c;for(var d=e;d<b;d++){a="0"+a}return a}function validateEmailAddress(b){var a=/[\w\d_\-\.]+@[\w\d_\-\.]+\.[\w\W\d]+/;return a.test(b)}function getIndex(d,c){var a=-1;for(var b=0;b<d.length&&a==-1;b++){if(d[b]==c){a=b}}return a}function getBaseUrl(g){var d=new Array("id","newsId","itemName","accessoryId","accessoryType","missionId","collectionId");if(typeof(g)==undefined||typeof(g)=="undefined"){g=document.location.href}var b="";if(g.indexOf("?")==-1){b=encodeURIComponent(g)}else{var c=g.split("?");var f=c[1].split("&");b=c[0];for(var e=0;e<f.length;e++){var a=getIndex(d,f[e].split("=")[0]);if(a!=-1){b+=(e==0?"?":"&")+f[e]}}b=encodeURIComponent(b)}return b}function checkGuest(f,a,e,c){if(isMainPage(e)){var d=$.cookie("guest_cookie");if(d&&d.length>4){var b=unescape(d);b=b.split(":");if(!guestHasAccount(b[2])&&!guestSavedThisHour(b[2])){saveDailyGuestActivity(b[0],b[1],formatLoginId(new Date()),a,c)}}else{if(canSaveCookie()){saveGuestCookie(f,-1,-1,c)}}}}function canSaveCookie(){$.cookie("chk_cookie","true",{expires:getNowPlusMinutes(5)});if($.cookie("chk_cookie")){return true}return false}function guestHasAccount(a){return(a=="true"?true:false)}function guestSavedThisHour(a){if(a.toString().length==4){hours=a.toString().substr(0,2);min=a.toString().substr(2,2)}else{hours=a.toString().substr(0,1);min=a.toString().substr(2,2)}date=new Date();date.setHours(hours);date.setMinutes(min);return(Math.abs((date.getTime()-new Date().getTime()))<3600000)}function saveGuestCookie(e,d,b,c){var a=new Date();if(b==-1){b=c}$.cookie("guest_cookie",escape(b.toString()+":"+e+":"+d),{expires:30,path:"/"})}function saveDailyGuestActivity(b,e,d,a,c){tmpLoginId=d;$.post("http://"+a+"/adm/metrics.php",{external_id:b,ip:e,login_id:d},function(g,f){if(g.toString().search(/Success/)!=-1){saveGuestCookie(e,d,b,c)}})}$(document).ready(function(){$("div#game_menu div#game_list li").click(function(){pageTracker._trackPageview("/home_screen/game_selector/")});$("h2#mini_profile_message").click(function(){pageTracker._trackPageview("/home_screen/change_status_msg")});$(".game_side_buttons .game_tutorial_button a").click(function(){pageTracker._trackPageview("/game_screen/how_to_play/"+replayProductId)});$(".game_side_buttons .game_options_button a").click(function(){pageTracker._trackPageview("/game_screen/options/"+replayProductId)});$("#profile_edit_button").click(function(){pageTracker._trackPageview("/profile/edit/")})});

