if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a)})},add:function(b){b=$(b);var a=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(a.containment){a._containers=[];var c=a.containment;if(Object.isArray(c)){c.each(function(d){a._containers.push($(d))})}else{a._containers.push($(c))}}if(a.accept){a.accept=[a.accept].flatten()}Element.makePositioned(b);a.element=b;this.drops.push(a)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i){if(Element.isParent(a[i].element,deepest.element)){deepest=a[i]}}return deepest},isContained:function(b,a){var c;if(a.tree){c=b.treeNode}else{c=b.parentNode}return a._containers.detect(function(d){return c==d})},isAffected:function(a,c,b){return((b.element!=c)&&((!b._containers)||this.isContained(c,b))&&((!b.accept)||(Element.classNames(c).detect(function(d){return b.accept.include(d)})))&&Position.within(b.element,a[0],a[1]))},deactivate:function(a){if(a.hoverclass){Element.removeClassName(a.element,a.hoverclass)}this.last_active=null},activate:function(a){if(a.hoverclass){Element.addClassName(a.element,a.hoverclass)}this.last_active=a},show:function(a,c){if(!this.drops.length){return}var b,d=[];this.drops.each(function(e){if(Droppables.isAffected(a,c,e)){d.push(e)}});if(d.length>0){b=Droppables.findDeepestChild(d)}if(this.last_active&&this.last_active!=b){this.deactivate(this.last_active)}if(b){Position.within(b.element,a[0],a[1]);if(b.onHover){b.onHover(c,b.element,Position.overlap(b.overlap,b.element))}if(b!=this.last_active){Droppables.activate(b)}}},fire:function(b,a){if(!this.last_active){return}Position.prepare();if(this.isAffected([Event.pointerX(b),Event.pointerY(b)],a,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(a,this.last_active.element,b);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(a)},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable){return}var b=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect())){return}this._lastPointer=b;this.activeDraggable.updateDrag(a,b)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return}this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable){this.activeDraggable.keyPress(a)}},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a});this._cacheObserverCallbacks()},notify:function(b,a,c){if(this[b+"Count"]>0){this.observers.each(function(d){if(d[b]){d[b](b,a,c)}})}if(a.options[b]){a.options[b](a,c)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a]}).length})}};var Draggable=Class.create({initialize:function(b){var c={handle:false,reverteffect:function(f,e,d){var g=Math.sqrt(Math.abs(e^2)+Math.abs(d^2))*0.02;new Effect.Move(f,{x:-d,y:-e,duration:g,queue:{scope:"_draggable",position:"end"}})},endeffect:function(e){var d=Object.isNumber(e._opacity)?e._opacity:1;new Effect.Opacity(e,{duration:0.2,from:0.7,to:d,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[e]=false}})},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(c,{starteffect:function(d){d._opacity=Element.getOpacity(d);Draggable._dragging[d]=true;new Effect.Opacity(d,{duration:0.2,from:d._opacity,to:0.7})}})}var a=Object.extend(c,arguments[1]||{});this.element=$(b);if(a.handle&&Object.isString(a.handle)){this.handle=this.element.down("."+a.handle,0)}if(!this.handle){this.handle=$(a.handle)}if(!this.handle){this.handle=this.element}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll);this._isScrollChild=Element.childOf(this.element,a.scroll)}Element.makePositioned(this.element);this.options=a;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])},initDrag:function(a){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return}if(Event.isLeftClick(a)){var c=Event.element(a);if((tag_name=c.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return}var b=[Event.pointerX(a),Event.pointerY(a)];var d=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(e){return(b[e]-d[e])});Draggables.activate(this);Event.stop(a)}},startDrag:function(b){this.dragging=true;if(!this.delta){this.delta=this.currentDelta()}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this._originallyAbsolute){Position.absolutize(this.element)}this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var a=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=a.left;this.originalScrollTop=a.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify("onStart",this,b);if(this.options.starteffect){this.options.starteffect(this.element)}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element)}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this)}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)}this.startScrolling(speed)}if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(event)},finishDrag:function(b,f){this.dragging=false;if(this.options.quiet){Position.prepare();var e=[Event.pointerX(b),Event.pointerY(b)];Droppables.show(e,this.element)}if(this.options.ghosting){if(!this._originallyAbsolute){Position.relativize(this.element)}delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}var g=false;if(f){g=Droppables.fire(b,this.element);if(!g){g=false}}if(g&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,b);var a=this.options.revert;if(a&&Object.isFunction(a)){a=a(this.element)}var c=this.currentDelta();if(a&&this.options.reverteffect){if(g==0||a!="failure"){this.options.reverteffect(this.element,c[1]-this.delta[1],c[0]-this.delta[0])}}else{this.delta=c}if(this.options.zindex){this.element.style.zIndex=this.originalZ}if(this.options.endeffect){this.options.endeffect(this.element)}Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC){return}this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging){return}this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(a){var g=Position.cumulativeOffset(this.element);if(this.options.ghosting){var c=Position.realOffset(this.element);g[0]+=c[0]-Position.deltaX;g[1]+=c[1]-Position.deltaY}var f=this.currentDelta();g[0]-=f[0];g[1]-=f[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){g[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;g[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var e=[0,1].map(function(d){return(a[d]-g[d]-this.offset[d])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){e=this.options.snap(e[0],e[1],this)}else{if(Object.isArray(this.options.snap)){e=e.map(function(d,h){return(d/this.options.snap[h]).round()*this.options.snap[h]}.bind(this))}else{e=e.map(function(d){return(d/this.options.snap).round()*this.options.snap}.bind(this))}}}var b=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=e[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=e[1]+"px"}if(b.visibility=="hidden"){b.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1])){return}this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0}this.draw(Draggables._lastScrollPointer)}if(this.options.change){this.options.change(this)}},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(b,a){this.element=$(b);this.observer=a;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id]){return a}a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a){return}return Sortable.sortables[a.id]},destroy:function(a){a=$(a);var b=Sortable.sortables[a.id];if(b){Draggables.removeObserver(b.element);b.droppables.each(function(c){Droppables.remove(c)});b.draggables.invoke("destroy");delete Sortable.sortables[b.element.id]}},create:function(c){c=$(c);var b=Object.extend({element:c,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:c,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(c);var a={revert:true,quiet:b.quiet,scroll:b.scroll,scrollSpeed:b.scrollSpeed,scrollSensitivity:b.scrollSensitivity,delay:b.delay,ghosting:b.ghosting,constraint:b.constraint,handle:b.handle};if(b.starteffect){a.starteffect=b.starteffect}if(b.reverteffect){a.reverteffect=b.reverteffect}else{if(b.ghosting){a.reverteffect=function(f){f.style.top=0;f.style.left=0}}}if(b.endeffect){a.endeffect=b.endeffect}if(b.zindex){a.zindex=b.zindex}var d={overlap:b.overlap,containment:b.containment,tree:b.tree,hoverclass:b.hoverclass,onHover:Sortable.onHover};var e={onHover:Sortable.onEmptyHover,overlap:b.overlap,containment:b.containment,hoverclass:b.hoverclass};Element.cleanWhitespace(c);b.draggables=[];b.droppables=[];if(b.dropOnEmpty||b.tree){Droppables.add(c,e);b.droppables.push(c)}(b.elements||this.findElements(c,b)||[]).each(function(h,f){var g=b.handles?$(b.handles[f]):(b.handle?$(h).select("."+b.handle)[0]:h);b.draggables.push(new Draggable(h,Object.extend(a,{handle:g})));Droppables.add(h,d);if(b.tree){h.treeNode=c}b.droppables.push(h)});if(b.tree){(Sortable.findTreeElements(c,b)||[]).each(function(f){Droppables.add(f,e);f.treeNode=c;b.droppables.push(f)})}this.sortables[c.id]=b;Draggables.addObserver(new SortableObserver(c,b.onUpdate))},findElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.tag)},findTreeElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.treeTag)},onHover:function(e,d,a){if(Element.isParent(d,e)){return}if(a>0.33&&a<0.66&&Sortable.options(d).tree){return}else{if(a>0.5){Sortable.mark(d,"before");if(d.previousSibling!=e){var b=e.parentNode;e.style.visibility="hidden";d.parentNode.insertBefore(e,d);if(d.parentNode!=b){Sortable.options(b).onChange(e)}Sortable.options(d.parentNode).onChange(e)}}else{Sortable.mark(d,"after");var c=d.nextSibling||null;if(c!=e){var b=e.parentNode;e.style.visibility="hidden";d.parentNode.insertBefore(e,c);if(d.parentNode!=b){Sortable.options(b).onChange(e)}Sortable.options(d.parentNode).onChange(e)}}}},onEmptyHover:function(e,g,h){var j=e.parentNode;var a=Sortable.options(g);if(!Element.isParent(g,e)){var f;var c=Sortable.findElements(g,{tag:a.tag,only:a.only});var b=null;if(c){var d=Element.offsetSize(g,a.overlap)*(1-h);for(f=0;f<c.length;f+=1){if(d-Element.offsetSize(c[f],a.overlap)>=0){d-=Element.offsetSize(c[f],a.overlap)}else{if(d-(Element.offsetSize(c[f],a.overlap)/2)>=0){b=f+1<c.length?c[f+1]:null;break}else{b=c[f];break}}}}g.insertBefore(e,b);Sortable.options(j).onChange(e);a.onChange(e)}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()}},mark:function(b,a){var d=Sortable.options(b.parentNode);if(d&&!d.ghosting){return}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var c=Position.cumulativeOffset(b);Sortable._marker.setStyle({left:c[0]+"px",top:c[1]+"px"});if(a=="after"){if(d.overlap=="horizontal"){Sortable._marker.setStyle({left:(c[0]+b.clientWidth)+"px"})}else{Sortable._marker.setStyle({top:(c[1]+b.clientHeight)+"px"})}}Sortable._marker.show()},_tree:function(e,b,f){var d=Sortable.findElements(e,b)||[];for(var c=0;c<d.length;++c){var a=d[c].id.match(b.format);if(!a){continue}var g={id:encodeURIComponent(a?a[1]:null),element:e,parent:f,children:[],position:f.children.length,container:$(d[c]).down(b.treeTag)};if(g.container){this._tree(g.container,b,g)}f.children.push(g)}return f},tree:function(d){d=$(d);var c=this.options(d);var b=Object.extend({tag:c.tag,treeTag:c.treeTag,only:c.only,name:d.id,format:c.format},arguments[1]||{});var a={id:null,parent:null,children:[],container:d,position:0};return Sortable._tree(d,b,a)},_constructIndex:function(b){var a="";do{if(b.id){a="["+b.position+"]"+a}}while((b=b.parent)!=null);return a},sequence:function(b){b=$(b);var a=Object.extend(this.options(b),arguments[1]||{});return $(this.findElements(b,a)||[]).map(function(c){return c.id.match(a.format)?c.id.match(a.format)[1]:""})},setSequence:function(b,c){b=$(b);var a=Object.extend(this.options(b),arguments[2]||{});var d={};this.findElements(b,a).each(function(e){if(e.id.match(a.format)){d[e.id.match(a.format)[1]]=[e,e.parentNode]}e.parentNode.removeChild(e)});c.each(function(e){var f=d[e];if(f){f[1].appendChild(f[0]);delete d[e]}})},serialize:function(c){c=$(c);var b=Object.extend(Sortable.options(c),arguments[1]||{});var a=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:c.id);if(b.tree){return Sortable.tree(c,arguments[1]).children.map(function(d){return[a+Sortable._constructIndex(d)+"[id]="+encodeURIComponent(d.id)].concat(d.children.map(arguments.callee))}).flatten().join("&")}else{return Sortable.sequence(c,arguments[1]).map(function(d){return a+"[]="+encodeURIComponent(d)}).join("&")}}};Element.isParent=function(b,a){if(!b.parentNode||b==a){return false}if(b.parentNode==a){return true}return Element.isParent(b.parentNode,a)};Element.findChildren=function(d,b,a,c){if(!d.hasChildNodes()){return null}c=c.toUpperCase();if(b){b=[b].flatten()}var e=[];$A(d.childNodes).each(function(g){if(g.tagName&&g.tagName.toUpperCase()==c&&(!b||(Element.classNames(g).detect(function(h){return b.include(h)})))){e.push(g)}if(a){var f=Element.findChildren(g,b,a,c);if(f){e.push(f)}}});return(e.length>0?e.flatten():[])};Element.offsetSize=function(a,b){return a["offset"+((b=="vertical"||b=="height")?"Height":"Width")]};function ImageUpload(){this.focusElement=null}ImageUpload.prototype.addNewImage=function(a){var b=document.getElementById("new_images_div");var c=document.createElement("input");c.type="hidden";c.id="new_review_image_"+a+"_id";c.name="new_review_image["+a+"][id]";c.value=a;b.appendChild(c)};ImageUpload.prototype.addDeletion=function(b,a){var c=document.getElementById(a);var d=document.createElement("input");d.type="hidden";d.id="existing_image_deletion_"+b+"_id";d.name="existing_image_deletion["+b+"][id]";d.value=b;c.appendChild(d)};ImageUpload.prototype.removeNewImage=function(a){var b=document.getElementById("new_images_div");var c=document.getElementById("new_review_image_"+a+"_id");b.removeChild(c)};ImageUpload.prototype.clearNewImages=function(){var c=document.getElementById("new_images_div");var b=c.firstChild;if(b){var a;while(a=b.nextSibling){c.removeChild(a)}c.removeChild(b)}};ImageUpload.prototype.setActiveImage=function(b,a){if(b==this.focusElement){this.imageSelected(b,a,false);setActiveImageValues("");this.enableUpload(true)}else{this.imageSelected(b,a,true);setActiveImageValues(a);this.enableUpload(true)}};function setActiveImageValues(c){var b=document.getElementById("image_active_image");var a=document.getElementById("review_active_image");b.value=c;a.value=c}ImageUpload.prototype.enableUpload=function(c){var a=document.getElementById("new_images_div");var b=a.childNodes;var d=document.getElementById("image_uploaded_image");if(c==true){if(b.length==6){if(this.focusElement!=null){d.disabled=false}else{d.disabled=true}}else{d.disabled=false}}else{d.disabled=false}};ImageUpload.prototype.imageSelected=function(c,a,d){var b=c.parentNode.parentNode.parentNode;if(d===true){this._setImageHighlighting(b,true);if(this.focusElement!=null){this._setImageHighlighting(this.focusElement.parentNode.parentNode.parentNode,false)}this.focusElement=c;showElementInline("delete_image_button")}else{this._setImageHighlighting(b,false);if(this.focusElement!=null){this._setImageHighlighting(this.focusElement.parentNode.parentNode.parentNode,false);this.focusElement=null}hideElement("delete_image_button")}};ImageUpload.prototype.setFocusElementById=function(a){var b=document.getElementById(a);this.focusElement=b};ImageUpload.prototype.setEmptyImage=function(b){var a=b.parentNode.parentNode.parentNode;setActiveImageValues("");if(a.className=="small-thumb"){this._setImageHighlighting(a,true);if(this.focusElement!=null){this._setImageHighlighting(this.focusElement.parentNode.parentNode.parentNode,false)}this.focusElement=b}else{this._setImageHighlighting(a,false);this.focusElement=null}document.getElementById("image_preview").src="/images/img/thumb_large_none.gif";document.getElementById("caption").style.display="none";document.getElementById("image_caption").style.display="none";document.getElementById("caption-update").style.display="none";hideElement("delete_image_button")};ImageUpload.prototype._setImageHighlighting=function(a,d){var c="none";var b="small-thumb";if(d===true){b="small-thumb-sel"}a.className=b};function confirmImageUpload(){isImageForUpload=document.getElementById("image_uploaded_image").value!="";if(isImageForUpload&&!confirm("By clicking on OK, you certify that you have the right to distribute this image, and that it does not violate SharedReviews Terms and Conditions")){return false}var b=document.getElementById("image_active_image");if(b.value&&b.value!=""){var a;if(!isImageForUpload){a=confirm("You are about to delete the selected image. Do you wish to proceed?")}else{a=confirm("You are about to replace an existing image thereby deleting it. Do you wish to proceed?")}return a}return true}function confirmMemberImageUpload(){isImageForUpload=document.getElementById("image_uploaded_image").value!="";if(isImageForUpload&&!confirm("By clicking on OK, you certify that you have the right to distribute this image, and that it does not violate SharedReviews Terms and Conditions")){return false}return true}function confirmVideoUpload(){return confirm("By clicking on OK, you certify that you have the right to distribute this video file, and that it does not violate SharedReviews Terms and Conditions")}function confirmImageDelete(){var a=document.getElementById("image_active_image");if(a.value&&a.value!=""){return confirm("Selected image will be deleted! Do you wish to proceed?")}return false}function confirmProfileImageDelete(){return confirm("Avatar image will be deleted! Do you wish to proceed?")}function previewImage(a,c){var d=document.getElementById(a);var e=d.parentNode;var b=document.createElement("img");b.id=d.id;b.name=d.name;e.replaceChild(b,d);b.onload=function(){centerImage(b)};b.src=c}function previewIEImage(c){var b=c.src;var d=c.parentNode;var a=document.createElement("img");a.id=c.id;a.style.visibility="hidden";a.name=c.name;d.replaceChild(a,c);a.onload=function(){waitFor(a)};a.src=b}function previewIEThumbImage(c){var b=c.src;var d=c.parentNode;var a=document.createElement("img");a.id=c.id;a.style.visibility="hidden";a.name=c.name;d.replaceChild(a,c);a.onload=function(){waitForThumb(a)};a.src=b}function centerImage(a,b){if(b==null){b=13}if(BrowserDetect.browser=="Explorer"){b+=-1}a.parentNode.style.marginTop="-"+(a.height/2+b)+"px";a.style.visibility="visible"}var imgWait;function waitFor(a,b){if(a.height==0){imgWait=setTimeout(function(){waitFor(a,b)},250)}else{clearTimeout(imgWait);centerImage(a,b)}}function centerPreviewImage(c,a){if(a==null){a="image_preview"}var b=document.getElementById(a);b.style.visibility="hidden";if(b.height!=0){centerImage(b,c)}if(b.height==0){previewIEImage(b,c)}}function centerThumbImage(a){if(a.height==0){a.style.visibility="hidden";previewIEThumbImage(a)}else{offset=5;if(BrowserDetect.browser=="Explorer"){offset+=0}a.style.visibility="visible";a.parentNode.parentNode.style.marginTop="-"+(a.height/2+offset)+"px"}}function waitForThumb(a){if(a.height==0){imgWait=setTimeout(function(){waitForThumb(a)},250)}else{clearTimeout(imgWait);centerThumbImage(a)}}function centerThumbs(){var c=document.getElementsByTagName("div");for(var b=0;b<c.length;b++){if(c[b].className.match("small-thumb-center")){var a=c[b].getElementsByTagName("img");if(a[0]!=null){centerThumbImage(a[0])}}}}function FormSubmitter(a,c,b){this.formName=a;this.addedFields=b}FormSubmitter.prototype.submitForm=function(){oForm=document.getElementById(this.formName);oTargetDiv=document.getElementById(this.targetDiv);this.copyFields(oTargetDiv);this.copyBodyField(oTargetDiv);this.copyUpdateTextField(oTargetDiv);oForm.submit();this.cleanFields(oTargetDiv)};FormSubmitter.prototype.copyFields=function(c){for(var b=0;b<this.addedFields;b++){var a=document.getElementById(this.addedFields[b]);var d=document.createElement("input");d.type="hidden";d.id=this.addedFields[b];d.name=a.name;d.value=a.value;c.appendChild(d)}};FormSubmitter.prototype.copyBodyField=function(b){var a=document.getElementById("review_body");a.value=tinymce.get("review_body").getContent()};FormSubmitter.prototype.copyUpdateTextField=function(b){var a=document.getElementById("review_update_update_text");a.value=tinymce.get("review_update_update_text").getContent()};FormSubmitter.prototype.cleanFields=function(c){var b=this.oTargetDiv.firstChild;if(b){var a;while(a=b.nextSibling){this.oTargetDiv.removeChild(a)}this.oTargetDiv.removeChild(b)}};function DropMenu(a){this.latestMouseOver=null;this.oSelectedMenuTab=null;this.sCurrentRowCol=null;this.bSelectorInUse=false;this.lastFillerCell=null;this.timer=null;this.name=a;this.canClick=true;this.effect=null;this.targetDiv="category_selection_div"}DropMenu.prototype.simulateClick=function(b){if(this.canClick===true&&this.latestMouseOver!=b){this.latestMouseOver=b;var a=this;setTimeout(function(){_simulateClick(a.latestMouseOver,b)},300)}};function _simulateClick(c,b){if(c==b){if(b.click){b.click()}else{if(document.createEvent){var a=document.createEvent("MouseEvents");a.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null);b.dispatchEvent(a)}else{if(document.createEventObject){b.fireEvent("onmouseclick")}}}}}DropMenu.prototype.clearIntent=function(a){if(a==this.latestMouseOver){this.latestMouseOver=null}};DropMenu.prototype.setCanClick=function(a){this.canClick=a};DropMenu.prototype.setSelectedMenuTab=function(a){this.oSelectedMenuTab=document.getElementById(a);this.oSelectedMenuTab.style.backgroundColor="white"};DropMenu.prototype.setCurrentRowCol=function(a){this.sCurrentRowCol=a};DropMenu.prototype.clearSelectedMenuTab=function(){if(this.oSelectedMenuTab!=null){var d=this.oSelectedMenuTab.firstChild;if(d){var b;while(b=d.nextSibling){this.oSelectedMenuTab.removeChild(b)}this.oSelectedMenuTab.removeChild(d)}this.oSelectedMenuTab.style.backgroundColor="";var e=this.name+"_img_"+this.sCurrentRowCol+"_off";var a=document.getElementById(e);if(a){a.style.display="block"}var c=this.name+"_img_"+this.sCurrentRowCol+"_on";a=document.getElementById(c);if(a){a.style.display="none"}}};DropMenu.prototype.selectorInUse=function(b){if(!b){var b=window.event}var a=b.relatedTarget||b.fromElement;if(a&&a.id==this.targetDiv){if(this.bSelectorInUse===false){this.bSelectorInUse=true}}};DropMenu.prototype.selectorNotInUse=function(b){if(!b){var b=window.event}var a=(b.relatedTarget)?b.relatedTarget:b.toElement;if(a&&a.id==this.targetDiv){clearTimeout(this.timer);this.bSelectorInUse=false;this.setCanClick(true);this.effect=null;this.observeSelector()}};DropMenu.prototype.checkIfSelectorInUse=function(){if(!this.bSelectorInUse&&this.canClick){this.latestMouseOver=null;if(this.lastFillerCell){this.lastFillerCell.style.backgroundColor=""}this.clearSelectedMenuTab();clearTimeout(this.timer)}};DropMenu.prototype.observeSelector=function(){setTimeout(this.name+".checkIfSelectorInUse()",3000);this.timer=setTimeout(this.name+".observeSelector()",3000)};DropMenu.prototype.setFiller=function(a){var d=this.name+"_td_"+a;if(this.lastFillerCell){this.lastFillerCell.style.backgroundColor=""}var c=document.getElementById(d);c.style.backgroundColor="white";this.lastFillerCell=c;var f=this.name+"_img_"+a+"_off";var b=document.getElementById(f);b.style.display="none";var e=this.name+"_img_"+a+"_on";b=document.getElementById(e);b.style.display="block"};DropMenu.prototype.doSlideDown=function(b){var a=document.getElementById(b)};function callBackStart(a){dropMenu.setCanClick(false)}function callBackFinish(a){dropMenu.setCanClick(true)}function closeCategorySelection(){oElement=document.getElementById("category_selection_div");oElement.style.diplay="none"}function setCategoryId(a){document.getElementById("review_category_id").value=a}function showRemoveButton(a,b){var c=document.getElementById(b);c.style.display="block";a.style.display="none"}function removeCustomRating(a){oElemRemove=document.getElementById(a);oElemParent=oElemRemove.parentNode;oElemParent.removeChild(oElemRemove);var c=document.getElementById("hidden_custom_feature");if(c.value!=null&&c.value!=""){var b=document.getElementById(c.value);if(b){b.style.display="block";recalculateSliders()}}}function addSubmittable(c,b,a){var d=document.getElementById(b+"_"+a+"_submittable");d.value="true"}function removeCustomFeature(a){var b=document.getElementById("new_review_features_div");var c=document.createElement("input");c.type="hidden";c.id="remove_custom_feature_"+a;c.name="remove_custom_feature["+a+"]";c.value=a;b.appendChild(c)}function enforceLimit(a,b){if(parseFloat(a.value,10)>b){a.value=b}var c=/(^\d+$)|(^\d+\.\d+$)|(^\d+\.)$/;if(a.value&&!c.test(a.value)){a.value=b}}function checkCustomFeaturesLimit(a){var g=document.getElementById("new_review_features_div");var f=document.getElementById(a);var c=g.getElementsByTagName("span");var e=0;for(var b=0;b<c.length;b++){if(c[b].id.indexOf("review_feature")!=-1){e++}}if(e==7){f.style.display="none";var d=document.getElementById("hidden_custom_feature");d.value=a}else{f.style.display="block"}}function replaceCustomLabelText(b){var a=document.createTextNode("Your Custom Rating:");var c=document.getElementById("title_label_"+b);c.replaceChild(a,c.firstChild)}function submitForms(h,a,l){var k=null;if(h){if(h=="confirm:publish"){k="Are you sure you want to publish? Once published you may add new content through an update, but some content will be locked from editing."}else{if(h=="confirm:update"){k="Are you sure you want to publish this update? Once published you may add new content through more updates, but some previous content will be locked from editing."}}if(k&&!confirm(k)){Element.enable("publish-button");return false}else{Element.show("review-entry-progress")}}var g=document.getElementById(a);for(var c=0;c<l.length;c++){var o=document.getElementById(l[c]);var d=o.elements;for(var b=0;b<d.length;b++){var n=d[b];if(n.nodeName=="INPUT"||n.nodeName=="TEXTAREA"){var m=document.createElement("input");m.type="hidden";m.id=n.id;m.name=n.name;if(n.nodeName=="TEXTAREA"){try{m.value=tinymce.get(n.id).getContent()}catch(f){m.value=n.value}}else{m.value=n.value}g.appendChild(m)}}}g.submit()}function submitFormsForPreview(c,b){var a=document.getElementById(c);var d=document.createElement("input");d.type="hidden";d.id="preview";d.name="preview";d.value="preview";a.appendChild(d);submitForms(null,c,b)}function submitFormsForDraft(c,b){var a=document.getElementById(c);var d=document.createElement("input");d.type="hidden";d.id="draft";d.name="draft";d.value="draft";a.appendChild(d);submitForms(null,c,b)}function switchPreviewToEdit(){var b=document.getElementById("review_entry_page_div");var a=document.getElementById("review_preview_page_div");b.style.display="block";a.style.display="none";recalculateSliders();centerPreviewImage();centerThumbs()}function recalculateSliders(){if(oSliderArray){for(var a in oSliderArray){if(a.indexOf("slider")!=-1){oSliderArray[a].recalculate()}}}}function setVideo(b){var d=document.getElementById("new_video_div");var e=document.createElement("input");e.type="hidden";e.id="review_movie_id";e.name="review[movie_id]";e.value=b;var c=d.firstChild;if(c){var a;while(a=c.nextSibling){d.removeChild(a)}d.removeChild(c)}d.appendChild(e)}function removeVideo(a){var b=document.getElementById("new_video_div");var c=document.getElementById("review_video_"+sImageId+"_id");b.removeChild(c)}function setMemberVideo(a){var b=document.getElementById("member_movie_id");if(b){b.value=a}}function PrivacySwitch(b,a,c){this.oDiv=document.getElementById(b);this.oTarget=document.getElementById(a);this.sInput=c;this.oPosition=0;this.init()}PrivacySwitch.prototype.init=function(){if(this.oTarget.value=="true"){this.oDiv.style.backgroundPosition="-52px 0px";this.oPosition=2}else{if(this.oTarget.value=="false"){this.oDiv.style.backgroundPosition="-26px 0px";this.oPosition=1}else{this.oPosition=0}}};PrivacySwitch.prototype.rotate=function(){if(this.oPosition==0){this.oDiv.style.backgroundPosition="-26px 0px";this.oPosition=1;this.oTarget.value="false";var b=document.getElementById(this.sInput);if(b){b.className="public"}}else{if(this.oPosition==1){this.oDiv.style.backgroundPosition="-52px 0px";this.oPosition=2;this.oTarget.value="true";var b=document.getElementById(this.sInput);if(b){b.className="private"}}else{if(this.oPosition==2){this.oDiv.style.backgroundPosition="-26px 0px";this.oPosition=1;this.oTarget.value="false";var b=document.getElementById(this.sInput);if(b){b.className="public"}}}}if(document.createEvent){var a=document.createEvent("HTMLEvents");a.initEvent("change",true,true);this.oTarget.dispatchEvent(a)}else{if(document.createEventObject){this.oTarget.fireEvent("onchange")}}};var pctMouseInside=false;var pctOpened=false;function openPreview(b,a){$("p-image").src=a;Effect.Appear("preview-image-cont",{duration:1})}function closePreview(){$("preview-image-cont").hide()}function findPos(a){var b=curtop=0;if(a.offsetParent){b=a.offsetLeft;curtop=a.offsetTop;while(a=a.offsetParent){b+=a.offsetLeft;curtop+=a.offsetTop}}return[b,curtop]}function setHttp(a,b){if(b.length==0){oElement=document.getElementById(a);oElement.value="http://"}}function setTempImageIndicator(){oElement=document.getElementById("use_temp_img");oElement.value="true"}function setLabelOne(a){document.getElementById("member_other_profile_one_label").value=a}function setLabelTwo(a){document.getElementById("member_other_profile_two_label").value=a}function PopupPanel(d,b,a,c){this.name=d;this.sObj=b;this.sTrigger=c;this.opened=false;this.inHelp=false;this.top=a;this.timeOut}PopupPanel.prototype.showPopupPanel=function(d){if(this.opened==false){var c=$(this.sTrigger);var f=Position.realOffset(c);Event.stop(d);var a=Event.pointerX(d);var e=Event.pointerY(d);var b=$(this.name);b.style.left=f[1];if(BrowserDetect.browser=="Explorer"){b.style.top=f[0]+210}else{b.style.top=f[0]-210}Effect.Appear(b,{duration:0});this.opened=true}};PopupPanel.prototype.startMonitor=function(){this.timeOut=setTimeout(this.sObj+".hidePopupPanelDelayed()",0)};PopupPanel.prototype.markInsidePanel=function(){this.inHelp=true};PopupPanel.prototype.markOutsidePanel=function(){this.inHelp=false};PopupPanel.prototype.hidePopupPanelDelayed=function(){if(this.inHelp==false){var a=document.getElementById(this.name);Effect.Fade(a,{duration:0});this.opened=false;clearTimeout(this.timeOut)}else{this.startMonitor()}};PopupPanel.prototype.hidePopupPanel=function(b,d){var a=null;if(d.relatedTarget){a=d.relatedTarget}else{a=d.toElement}var c=b.getElementsByTagName("div")[0];if(a&&c&&a!=b&&c!=b){b.style.display="none";this.inHelp=false;this.opened=false}};function PopupHelp(c,b,a){this.name=c;this.sObj=b;this.opened=false;this.inHelp=false;this.top=a;this.timeOut}PopupHelp.prototype.showHelpPopup=function(){if(this.opened==false){var c=document.getElementById("help_img_"+this.name);var e=findPos(c);var a=c.offsetLeft;var d=c.offsetTop;if(this.bottom=="true"){}var b=document.getElementById("help_popup_"+this.name);b.style.width=(300)+"px";b.style.height=(220)+"px";b.style.marginTop="-30px";b.style.marginRight="50px";b.style.border="0px";b.style.background="transparent";b.style.background="url(/images/img/help_popup.gif) 0 10px no-repeat";Effect.Appear(b,{duration:0});this.opened=true}};PopupHelp.prototype.startMonitor=function(){this.timeOut=setTimeout(this.sObj+".hideHelpPopupDelayed()",0)};PopupHelp.prototype.markInsideHelp=function(){this.inHelp=true};PopupHelp.prototype.markOutsideHelp=function(){this.inHelp=false};PopupHelp.prototype.hideHelpPopupDelayed=function(){if(this.inHelp==false){var a=document.getElementById("help_popup_"+this.name);Effect.Fade(a,{duration:0});a.style.display="none";this.opened=false;clearTimeout(this.timeOut)}else{this.startMonitor()}};PopupHelp.prototype.hideHelpPopup=function(b,d){var a=null;if(d.relatedTarget){a=d.relatedTarget}else{a=d.toElement}var c=b.getElementsByTagName("div")[0];if(a&&c&&a!=b&&c!=b){b.style.display="none";this.inHelp=false;this.opened=false}};function toggleElement(a){var b=document.getElementById(a);if(b.style.display=="block"){b.style.display="none"}else{b.style.display="block"}}function showElement(a){var b=document.getElementById(a);b.style.display="inline"}function showElementInline(a){var b=document.getElementById(a);b.style.display="inline"}function hideElement(a){var b=document.getElementById(a);b.style.display="none"}function removeElement(a){var b=document.getElementById(a);var c=b.parentNode;c.removeChild(b)}function switchImages(c,b,a){if(c.src==b){c.src=a}else{c.src=b}}function getMousePosition(b){var a=0;var c=0;if(!b){var b=window.event}if(b.pageX||b.pageY){a=b.pageX;c=b.pageY}else{if(b.clientX||b.clientY){a=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;c=b.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return[a,c]}function Invite(e,d,b,a,c){this.iMaxInvites=e;this.sUpdateArea=d;this.sSubmitButton=c;this.sInputEmail=b+"_email";this.sInputName=b+"_name";this.sInputArea=a;this.iCount=0;this.iRealCount=0}Invite.prototype.addInvitation=function(){if(this.iRealCount==this.iMaxInvites){this.closeTheStore()}else{var a=document.getElementById(this.sUpdateArea);var k=document.getElementById(this.sInputEmail);var g=document.getElementById(this.sInputName);var d=document.getElementById(this.sSubmitButton);this.iRealCount++;this.iCount++;if(k.value!=null&&k.value.length>0){var c=document.createElement("input");c.type="text";c.id="invite_email_"+parseInt(this.iCount)+"_count";c.name="invite_email["+parseInt(this.iCount)+"]["+parseInt(this.iCount)+"]";c.value=k.value;c.className="input-field";var b=document.createElement("input");b.type="text";b.id="invite_name_"+parseInt(this.iCount)+"_count";b.name="invite_name["+parseInt(this.iCount)+"]["+parseInt(this.iCount)+"]";b.value=g.value;b.className="input-field";b.maxLength=30;var e=document.createElement("div");e.id="invite_email_div_"+parseInt(this.iCount);e.className="contain";var f=document.createElement("div");f.className="invite-friend-input";f.appendChild(c);f.appendChild(b);var j=document.createElement("a");j.onclick=function(){deleteInvitationEmail(e.id)};var h=document.createElement("img");j.appendChild(h);h.src="/images/img/btn_delete_friend.gif";h.alt="Delete Friend";f.appendChild(j);e.appendChild(f);a.appendChild(e)}k.value="";g.value="";if(this.iRealCount==this.iMaxInvites){this.closeTheStore()}}};function deleteInvitationEmail(b){var a=document.getElementById(b);var c=a.parentNode;c.removeChild(a);oInvite.iRealCount--;oInvite.openTheStore()}Invite.prototype.closeTheStore=function(){var b=document.getElementById(this.sInputArea);b.style.display="none";var a=document.getElementById(this.sSubmitButton);a.style.display="block"};Invite.prototype.openTheStore=function(){var a=document.getElementById(this.sInputArea);a.style.display="block"};Invite.prototype.preview=function(e,a){var b=document.getElementById(e);var d=document.createElement("input");d.type="hidden";d.id="message";d.name="message";d.value=b.value;var c=document.getElementById(a);c.appendChild(d)};function textLimit(e,c,b){var d=document.getElementById(b);var a=e.value.length;if(a>c){d.style.display="block"}else{d.style.display="none"}if(a>c){e.value=e.value.substring(0,c)}}function Leaderboard(a,c,b){this.iSetNumber=a;this.iMaxSetNumber=c;this.sSetRef=b;this.iTimeoutId=null;this.iExitTimeoutId=null;this.iCurrentSetNum=null;this.bAuto=true;this.sDirection="right";this.bBusy=false}Leaderboard.prototype.fadeCurrent=function(){clearTimeout(this.iTimeoutId);if(this.iCurrentSetNum!=null){var a=this.sSetRef+this.iCurrentSetNum;var b=document.getElementById(a);if(b!=null){new Effect.Fade(a,{duration:0.4})}}this.move()};Leaderboard.prototype.move=function(){if(this.bAuto==true){if(this.sDirection=="right"){this.iTimeoutId=setTimeout(function(){oLeaderboard.moveRight()},1000)}else{this.iTimeoutId=setTimeout(function(){oLeaderboard.moveLeft()},1000)}}else{if(this.sDirection=="right"){this.iTimeoutId=setTimeout(function(){oLeaderboard.moveRight()},1000)}else{this.iTimeoutId=setTimeout(function(){oLeaderboard.moveLeft()},1000)}}};Leaderboard.prototype.moveSet=function(){var a=this.sSetRef+this.iSetNumber;var b=document.getElementById(a);if(b!=null){new Effect.Appear(a,{duration:0.4})}this.iCurrentSetNum=this.iSetNumber;clearTimeout(this.iTimeoutId);if(this.bAuto==true){oLeaderboard.iTimeoutId=setTimeout(function(){oLeaderboard.fadeCurrent()},20000)}else{this.bBusy=false}};Leaderboard.prototype.moveSetLeft=function(){if(this.bAuto==false){if(this.bBusy==false){this.bBusy=true;this.sDirection="left";this.fadeCurrent()}}else{this.stopAuto();setTimeout(function(){oLeaderboard.moveSetLeft()},100)}};Leaderboard.prototype.moveSetRight=function(){if(this.bAuto==false){if(this.bBusy==false){this.bBusy=true;this.sDirection="right";this.fadeCurrent()}}else{this.stopAuto();setTimeout(function(){oLeaderboard.moveSetRight()},100)}};Leaderboard.prototype.moveLeft=function(){this.moveIndexLeft();this.moveSet()};Leaderboard.prototype.moveRight=function(){this.moveIndexRight();this.moveSet()};Leaderboard.prototype.moveIndexLeft=function(){if(this.iSetNumber-1==0){this.iSetNumber=this.iMaxSetNumber}else{this.iSetNumber--}};Leaderboard.prototype.moveIndexRight=function(){if(this.iSetNumber+1>this.iMaxSetNumber){this.iSetNumber=1}else{this.iSetNumber++}};Leaderboard.prototype.stopAuto=function(){this.bAuto=false;clearTimeout(this.iTimeoutId);clearTimeout(this.iExitTimeoutId)};Leaderboard.prototype.startAuto=function(){if(this.bAuto==false){clearTimeout(this.iExitTimeoutId);this.bAuto=true;this.sDirection="right";this.iExitTimeoutId=setTimeout(function(){oLeaderboard.fadeCurrent()},3000)}};function containsDOM(a,c){var b=false;do{if((b=a==c)){break}c=c.parentNode}while(c!=null);return b}function checkMouseEnter(b,a){if(b.contains&&a.fromElement){return !b.contains(a.fromElement)}else{if(a.relatedTarget){return !containsDOM(b,a.relatedTarget)}}}function checkMouseLeave(b,a){if(b.contains&&a.toElement){return !b.contains(a.toElement)}else{if(a.relatedTarget){return !containsDOM(b,a.relatedTarget)}}}function setSearchCategoryId(b,f,a){var e=document.getElementById(b+"_category_id");var g=e.getElementsByTagName("input");var h=g[0];if(h){h.value=a}var d=document.getElementById(b);while(d.hasChildNodes()){d.removeChild(d.firstChild)}var c=document.getElementById(f+"_error_msg_container");if(c){c.style.display="none"}}function submitSearchValidate(a,e){var d=false;var c=document.getElementById(a+"_category_id");var f=c.getElementsByTagName("input");var g=f[0];if(g){if(g.value){d=true}}if(d==false){var b=document.getElementById(e+"_error_msg_container");b.style.display="block"}return d}function submitSimpleSearchValidate(a){var d=false;var c=document.getElementById(a);if(c){if(c.value.length>0){d=true}}if(d==false){var b=document.getElementById("simple_search_error_msg_container");b.style.display="block"}return d}function submitSearchValidate(a,e,d){var f=false;var b=document.getElementById(a);var g=document.getElementById(e);var h=document.getElementById(d);if(b&&b.value&&b.value.length>0){f=true}else{if(g&&g.value&&g.value.length>0&&g.value!="*"){f=true}else{if(h&&h.value&&h.value.length>0&&h.value!="*"){f=true}}}if(f==false){var c=document.getElementById("search_error_msg_container");c.style.display="block"}return f}function setRefinedSearchType(c){return;var b=document.getElementById("st_r");var a=document.getElementById("st_m");if(c=="r"){b.checked=true;b.parentNode.className="radio selected";b.parentNode.style.backgroundPosition="0px -52px";a.checked=false;a.parentNode.className="radio";a.parentNode.style.backgroundPosition="0px 0px"}else{a.checked=true;a.parentNode.className="radio selected";a.parentNode.style.backgroundPosition="0px -52px";b.checked=false;b.parentNode.className="radio";b.parentNode.style.backgroundPosition="0px 0px"}switchRefinedSearchParams(true)}function switchRefinedSearchParams(e){var b=document.getElementById("st_r");var a=document.getElementById("st_m");var g=[];if(b.checked){aFieldsOn=["t","e","b","r"];aFieldsOff=["n","l","pi","i"]}else{if(a.checked){aFieldsOff=["t","e","b","r"];aFieldsOn=["n","l","pi","i"]}}for(var d=0;d<aFieldsOff.length;d++){var c=document.getElementById(aFieldsOff[d]);var f=c.parentNode;c.checked=false;f.className="checkbox";f.style.backgroundPosition="0px 0px"}if(!e){for(var d=0;d<aFieldsOn.length;d++){var c=document.getElementById(aFieldsOn[d]);var f=c.parentNode;c.checked=true;f.className="checkbox selected";f.style.backgroundPosition="0px -52px"}}}function handleCheckboxes(){if(document.getElementsByTagName("form")){var b=document.getElementsByTagName("span");for(var a=0;a<b.length;a++){if(b[a].className.match("checkbox")||b[a].className.match("radio")){b[a].onmousedown=function(){if(this.className=="checkbox"||this.className=="radio"){this.style.backgroundPosition="0px -26px"}else{if(this.className=="checkbox disabled"||this.className=="checkbox selected-disabled"){}else{this.style.backgroundPosition="0px -79px"}}};b[a].onmouseup=function(){selector=this.getElementsByTagName("input")[0];if(this.className=="checkbox"){selector.checked=true;this.className="checkbox selected";this.style.backgroundPosition="0px -52px"}else{if(this.className=="checkbox selected"){selector.checked=false;this.className="checkbox";this.style.backgroundPosition="0px 0px"}else{if(this.className=="checkbox disabled"){}else{if(this.className=="checkbox selected-disabled"){}else{selector.checked=true;this.className="radio selected";this.style.backgroundPosition="0px -52px";inputs=document.getElementsByTagName("input");for(a=0;a<inputs.length;a++){if(inputs[a].getAttribute("name")==selector.getAttribute("name")){if(inputs[a].type!="hidden"&&inputs[a]!=selector){inputs[a].parentNode.className="radio";inputs[a].parentNode.style.backgroundPosition="0px 0px"}}}}}}}};window.onmouseup=function(){b=document.getElementsByTagName("span");for(var c=0;c<b.length;c++){if(b[c].className=="checkbox"||b[c].className=="radio"){b[c].style.backgroundPosition="0px 0px"}else{if(b[c].className=="checkbox disabled"||b[c].className=="checkbox selected-disabled"){}else{if(b[c].className=="checkbox selected"||b[c].className=="radio selected"){b[c].style.backgroundPosition="0px -52px"}}}}}}}}}function hidediv(a){if(document.getElementById){document.getElementById(a).style.display="none"}}function showdiv(a){if(document.getElementById){document.getElementById(a).style.display="block"}}function onABCommComplete(a){hidediv("friend-invite-panel");showdiv("plaxo-page")}function refreshTracker(a){pageTracker._trackPageview(a)};