/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
 * $Rev: 5685 $
 */
 window.initCarousel=function(instance){if(instance.picture!=null){if(instance.picture.complete){clearInterval(instance.loadTimer);instance.liWidth=instance.picture.width;instance.liHeight=instance.picture.height;instance.sizeInit()}}};function Carousel(id,varname){var Carou=new Object();Carou.id=id;Carou.varname=varname;Carou.obj=document.getElementById(Carou.id);Carou.prevBtn="&lt;&lt;";Carou.prevText="Précédente";Carou.nextBtn="&gt;&gt;";Carou.nextText="Suivante";Carou.pageText="<span class=\'black\'>News : <\/span>";Carou.div=null;Carou.liWidth=0;Carou.liHeight=0;Carou.liStyle=null;Carou.liList=new Array();Carou.navigator=null;Carou.maxLvl=1;Carou.instance=Carou;Carou.idPage=0;Carou.idPrevPage=0;Carou.pas=50;Carou.timerSep=50;Carou.moveTime=500;Carou.Timer=null;Carou.defaultTime=5000;Carou.defaultTimer=null;Carou.configured=false;Carou.play=false;Carou.picture=null;Carou.loadTimer=null;Carou.pageOnLeft=true;Carou.toString=function(){return this.varname};Carou.init=function(){this.navigatorContent="<div class='prevpage'><a title='Page précédente' href='javascript:void(0);' onclick='"+Carou.varname+".prevPage();'><span class='prevpagebtn'>"+Carou.prevBtn+"<\/span><span class='prevpagetxt'>Précédente<\/span><\/a><\/div><div id='carouselPage"+Carou.id+"' class='pages'>"+Carou.pageText+"<\/div><div class='nextpage'><a title='Page suivante' href='javascript:void(0);' onclick='"+Carou.varname+".nextPage();'><span class='nextpagetxt'>Suivante<\/span><span class='nextpagebtn'>"+Carou.nextBtn+"<\/span><\/a><\/div>";var childList=this.obj.childNodes;for(var i=0;i<childList.length;i++){var curItm=childList.item(i);if(curItm&&curItm.nodeName=="LI"){if(curItm.offsetWidth>this.liWidth)this.liWidth=curItm.offsetWidth;if(curItm.offsetHeight>this.liHeight)this.liHeight=curItm.offsetHeight;this.liStyle=curItm.style;this.liList.push(curItm)}}try{this.picture=new Image;this.picture.src=$("#"+this.id+" img")[0].src;this.loadTimer=setInterval("initCarousel("+varname+")",100)}catch(e){}var i=0;while(this.div==null){if(i>this.maxLvl)break;this.maxLvl++;if(this.obj.parentNode.nodeName=="DIV")this.div=this.obj.parentNode}topPadding=sidePadding=0;this.div.style.height=(this.liHeight-topPadding)+"px";this.div.style.width=(this.liWidth-sidePadding)+"px";this.div.style.overflow="hidden";this.div.style.position="relative";this.div.style.border=this.liStyle.border;this.obj.style.width=this.liWidth*this.liList.length+"px";this.obj.style.position="absolute";this.navigator=document.createElement("DIV");this.navigator.className="navigator";this.navigator.innerHTML=this.navigatorContent;this.div.parentNode.appendChild(this.navigator);var pageList=document.getElementById("carouselPage"+this.id);if(this.pageOnLeft){for(var i=0;i<this.liList.length;i++){pageList.innerHTML+='<a id="'+this+'_'+i+'" class="carouselUnselected" href="javascript:void(0);" onClick="'+this+'.openPage('+i+')">'+(i+1)+'<\/a>'}}else{for(var i=this.liList.length-1;i>=0;i--){pageList.innerHTML+='<a id="'+this+'_'+i+'" class="carouselUnselected" href="javascript:void(0);" onClick="'+this+'.openPage('+i+')">'+(i+1)+'<\/a>'}}this.openPage(0)};Carou.sizeInit=function(){topPadding=sidePadding=0;this.div.style.height=(this.liHeight-topPadding)+"px";this.div.style.width=(this.liWidth-sidePadding)+"px";this.obj.style.width=this.liWidth*this.liList.length+"px"};Carou.canMove=function(){if(mouseX<this.div.offsetLeft)return true;if(mouseX>this.div.offsetLeft+this.div.offsetWidth)return true;if(mouseY<this.div.offsetTop)return true;if(mouseY>this.div.offsetTop+this.div.offsetHeight)return true;return false};Carou.openPage=function(id){if(!this.canMove())return;this.idPrevPage=this.idPage;if(id<this.liList.length&&id>0)this.idPage=id;else this.idPage=0;for(var i=0;i<this.liList.length;i++){document.getElementById(this+"_"+i).className="carouselUnselected"}var sens=0;if(this.idPrevPage>this.idPage)sens=1;else if(this.idPrevPage<this.idPage)sens=-1;var px=this.obj.style.left.split("px");var curpx=Math.round(px[0]);this.pas=Math.abs((((this.idPage*this.liWidth)+curpx)*this.timerSep)/this.moveTime);this.slowMotion(sens);document.getElementById(this+"_"+this.idPage).className="carouselSelected"};Carou.slowMotion=function(sens){if(!this.play)return;var px=this.obj.style.left.split("px");var curpx=Math.round(px[0]);var gotopx=(curpx+sens*this.pas);var pagegotopx=-(this.idPage*this.liWidth);this.obj.style.left=gotopx+"px";if(sens<0){if(gotopx<=pagegotopx){this.obj.style.left=pagegotopx+"px";clearTimeout(this.Timer);clearTimeout(this.defaultTimer);this.defaultTimer=window.setTimeout(this.varname+".start()",this.defaultTime)}else{this.Timer=window.setTimeout(this+".slowMotion("+sens+")",this.timerSep)}}else if(sens>0){if(gotopx>=pagegotopx){this.obj.style.left=pagegotopx+"px";clearTimeout(this.Timer);clearTimeout(this.defaultTimer);this.defaultTimer=window.setTimeout(this.varname+".start()",this.defaultTime)}else this.Timer=window.setTimeout(this+".slowMotion("+sens+")",this.timerSep)}else clearTimeout(this.Timer)};Carou.prevPage=function(){clearTimeout(this.defaultTimer);var newpage=0;if(this.idPage==0)newpage=this.liList.length-1;else if(this.idPage==this.liList.length-1)newpage=this.liList.length-2;else newpage=this.idPage-1;this.openPage(newpage)};Carou.nextPage=function(){clearTimeout(this.defaultTimer);var newpage=0;if(this.idPage==this.liList.length-1)newpage=0;else newpage=this.idPage+1;this.openPage(newpage)};Carou.start=function(){document.getElementById(this+"_"+this.idPage).className="carouselSelected";this.play=true;if(this.defaultTimer!=null)this.nextPage();this.defaultTimer=window.setTimeout(this.varname+".start()",this.defaultTime)};Carou.stop=function(){this.play=false;clearTimeout(this.Timer);clearTimeout(this.defaultTimer)};return Carou};var currentCarousel=null;function stopCarousel(){if(currentCarousel!=null)currentCarousel.stop()}function startCarousel(){if(currentCarousel!=null)currentCarousel.start()}try{document.onmousemove=sourisxy;document.onclick=browserHider}catch(e){}var idCat=new Array();var parentCat=new Array();var htmlCat=new Array();var categories=new Array();var categoriesBack=new Array();var currentCat=-1;var lastCat=0;function catAlreadyLoaded(id){for(i=0;i<idCat.length;++i){if(idCat[i]==id)return true}return false}function subCat(id){if(currentCat!=-1){setTimeout("subCat("+id+");",10);return}if(id==-1){for(i=0;i<categories.length;++i){if(categories[i]==lastCat){id=categoriesBack[i]}}if(id==0)return}else{categories[categories.length]=id;categoriesBack[categoriesBack.length]=lastCat}lastCat=id;setCat(id);if(catAlreadyLoaded(id)){do_subCat(htmlCat[id])}else{loading();currentCat=id;idCat[idCat.length]=id;x_drawCat(id,do_subCat)}}function do_subCat(z){getObj("categoryBrowser").innerHTML=z;{htmlCat[currentCat]=z}loaded();currentCat=-1}function Categorie(parent,id,titre,instance){var Cat=new Object();Cat.categories=new Array();Cat.parent=null;Cat.instance=instance;Cat.level=0;Cat.idParent=parent;Cat.titre=titre;Cat.id=id;Cat.nbCat=0;Cat.state="";Cat.checked=false;Cat.addCat=function(categorie){this.categories.push(categorie)};Cat.genLevel=function(){var max=this.level;for(var i=0;i<this.categories.length;i++){if(this.categories[i].parent!=null){this.categories[i].level=this.categories[i].parent.level+1;if(this.categories[i].level>max)max=this.categories[i].level}max2=this.categories[i].genLevel();if(max2>max)max=max2}return max};Cat.genMaxNbCat=function(){this.nbCat=this.categories.length;for(var i=0;i<this.categories.length;i++){var max2=this.categories[i].categories.length;if(max2>this.nbCat)this.nbCat=max2;max2=this.categories[i].genMaxNbCat();if(max2>this.nbCat)this.nbCat=max2}return this.nbCat};Cat.get=function(id){for(var i=0;i<this.categories.length;++i){if(this.categories[i].id==id)return this.categories[i]}return null};Cat.getSubCat=function(id){for(var i=0;i<this.categories.length;++i){if(this.categories[i].id==id)return this.categories[i];var tmp=this.categories[i].getSubCat(id);if(tmp!=null)return tmp}return null};Cat.getCat=function(id){if(this.id==id)return this;return this.getSubCat(id)};Cat.unselect=function(){el=document.getElementById("finder_cat_"+this.instance+"_"+this.id);if(el!=null)el.className="finder_cat";this.state=""};Cat.check=function(checkbox){this.checked=true;for(var i=0;i<this.categories.length;++i){this.categories[i].check(checkbox);checkbox+=";"+this.categories[i].id+";"}return checkbox};Cat.uncheck=function(checkbox){this.checked=false;for(var i=0;i<this.categories.length;++i){checkbox+=this.categories[i].id+";";this.categories[i].uncheck(checkbox)}return checkbox};Cat.selectCat=function(){if(this.parent!=null){var parent=this.parent;el=document.getElementById("finder_cat_"+this.instance+"_"+parent.id);if(el!=null)el.className="finder_cat_parent_selected";parent.state="_parent_selected";var parentC=parent.categories;var taille=parentC.length;for(var i=0;i<taille;++i){parentC[i].unselect()}}for(var i=0;i<this.categories.length;++i){this.categories[i].unselect()}el=document.getElementById("finder_cat_"+this.instance+"_"+this.id);if(el!=null)el.className="finder_cat_selected";this.state="_selected"};Cat.toString=function(){return this.idParent+" - "+this.titre+" - "+this.id+" - "+this.level};Cat.toUrl=function(){newtitle=this.titre.replace(/\ /g,"-");newtitle=newtitle.replace(/,|&/g,"");newtitle=newtitle.replace(/--/g,"-");return remAcc(newtitle)};Cat.toLink=function(callback){var linkClass="finder_cat"+this.state+"";var parent="";if(this.parent!=null){parent=this.parent.toUrl()+"/"}if(this.categories.length==0){linkClass="finder_cat_nochild";callback="/recherche/categorie/"+parent+""+this.id+"-"+this.toUrl()+""}return"<li class='"+linkClass+"' id='finder_cat_"+this.instance+"_"+this.id+"'><a title='Chercher dans la catégorie "+this.titre+"' href='"+callback+"' class='catLinkSearch'>+<\/a><a class='finderCatLink' title='Ouvrir la catégorie "+this.titre+"'  href='/recherche/categorie/"+parent+""+this.id+"-"+this.toUrl()+"'>"+this.titre+"<\/a><\/li>"};Cat.toSelect=function(level,callback){++level;var cur=this.categories;display="";if(level>1)display="style='display:none;'";var txt="<div "+display+" id='selector_cat"+this.id+"'>";var lol="";if(cur.length>0){nextLevel=level+1;txt+="<select onChange='javascript:"+this.instance+".openOptionCat(this.options[this.selectedIndex].value);'>";txt+=this.toOption(this.id,"Toutes les catégories");for(var i=0;i<cur.length;i++){txt+=cur[i].toOption("javascript:void(0);",cur[i].titre);lol+=cur[i].toSelect(level,"javascript:void(0);")}txt+="<\/select>"}else{if(level<=eval(this.instance).maxLevel){txt+="<select disabled='disabled' >";txt+="<option>Pas de sous catégorie<\/option>";txt+="<\/select>"}}txt+="<\/div>";return txt+lol};Cat.toOption=function(current,titre){var linkClass="finder_cat"+this.state+"";if(this.categories.length==0){linkClass="finder_cat_nochild"}selected="";if(current==this.id)selected=" selected = 'selected' ";value=this.id;if(value==0)value=this.categories[0].id;return"<option class='"+linkClass+"' "+selected+" id='finder_cat_"+this.instance+"_"+this.id+"' value='"+value+"' >"+titre+"</option>"};Cat.toCheckbox=function(callback,checkcallback){var checked="";if(this.checked)checked=" checked='checked' ";return"<li class='finder_cat"+this.state+"' id='finder_cat_"+this.instance+"_"+this.id+"'><a href='"+callback+"' title='Affiche les sous-catégories'><input "+checked+" type='checkbox' id='checkCat_"+this.instance+"_"+this.id+"' name='checkCat' title='Chercher des produits dans cette catégorie' onClick='"+checkcallback+"' />"+this.titre+"<\/a><\/li>"};return Cat};var Colors=new function(){this.ColorFromHSV=function(hue,sat,val){var color=new Color();color.SetHSV(hue,sat,val);return color};this.ColorFromHex=function(hexStr){var color=new Color();color.SetHexString(hexStr);return color};function Color(){var red=0;var green=0;var blue=0;var hue=0;var saturation=0;var value=0;this.SetRGB=function(r,g,b){if(isNaN(r)||isNaN(g)||isNaN(b))return false;r=r/255.0;red=r>1?1:r<0?0:r;g=g/255.0;green=g>1?1:g<0?0:g;b=b/255.0;blue=b>1?1:b<0?0:b;calculateHSV();return true};this.Red=function(){return Math.round(red*255)};this.Green=function(){return Math.round(green*255)};this.Blue=function(){return Math.round(blue*255)};this.SetHSV=function(h,s,v){if(isNaN(h)||isNaN(s)||isNaN(v))return false;hue=(h>=360)?359.99:(h<0)?0:h;saturation=(s>1)?1:(s<0)?0:s;value=(v>1)?1:(v<0)?0:v;calculateRGB();return true};this.Hue=function(){return hue};this.Saturation=function(){return saturation};this.Value=function(){return value};this.SetHexString=function(hexString){if(hexString==null||typeof(hexString)!="string")return false;if(hexString.substr(0,1)=='#')hexString=hexString.substr(1);if(hexString.length!=6)return false;var r=parseInt(hexString.substr(0,2),16);var g=parseInt(hexString.substr(2,2),16);var b=parseInt(hexString.substr(4,2),16);return this.SetRGB(r,g,b)};this.HexString=function(){var rStr=this.Red().toString(16);if(rStr.length==1)rStr='0'+rStr;var gStr=this.Green().toString(16);if(gStr.length==1)gStr='0'+gStr;var bStr=this.Blue().toString(16);if(bStr.length==1)bStr='0'+bStr;return('#'+rStr+gStr+bStr).toUpperCase()};this.Complement=function(){var newHue=(hue>=180)?hue-180:hue+180;var newVal=(value*(saturation-1)+1);var newSat=(value*saturation)/newVal;var newColor=new Color();newColor.SetHSV(newHue,newSat,newVal);return newColor};function calculateHSV(){var max=Math.max(Math.max(red,green),blue);var min=Math.min(Math.min(red,green),blue);value=max;saturation=0;if(max!=0)saturation=1-min/max;hue=0;if(min==max)return;var delta=(max-min);if(red==max)hue=(green-blue)/delta;else if(green==max)hue=2+((blue-red)/delta);else hue=4+((red-green)/delta);hue=hue*60;if(hue<0)hue+=360};function calculateRGB(){red=value;green=value;blue=value;if(value==0||saturation==0)return;var tHue=(hue/60);var i=Math.floor(tHue);var f=tHue-i;var p=value*(1-saturation);var q=value*(1-saturation*f);var t=value*(1-saturation*(1-f));switch(i){case 0:red=value;green=t;blue=p;break;case 1:red=q;green=value;blue=p;break;case 2:red=p;green=value;blue=t;break;case 3:red=p;green=q;blue=value;break;case 4:red=t;green=p;blue=value;break;default:red=value;green=p;blue=q;break}}}};function Position(x,y){this.X=x;this.Y=y;this.Add=function(val){var newPos=new Position(this.X,this.Y);if(val!=null){if(!isNaN(val.X))newPos.X+=val.X;if(!isNaN(val.Y))newPos.Y+=val.Y}return newPos};this.Subtract=function(val){var newPos=new Position(this.X,this.Y);if(val!=null){if(!isNaN(val.X))newPos.X-=val.X;if(!isNaN(val.Y))newPos.Y-=val.Y}return newPos};this.Min=function(val){var newPos=new Position(this.X,this.Y);if(val==null)return newPos;if(!isNaN(val.X)&&this.X>val.X)newPos.X=val.X;if(!isNaN(val.Y)&&this.Y>val.Y)newPos.Y=val.Y;return newPos};this.Max=function(val){var newPos=new Position(this.X,this.Y);if(val==null)return newPos;if(!isNaN(val.X)&&this.X<val.X)newPos.X=val.X;if(!isNaN(val.Y)&&this.Y<val.Y)newPos.Y=val.Y;return newPos};this.Bound=function(lower,upper){var newPos=this.Max(lower);return newPos.Min(upper)};this.Check=function(){var newPos=new Position(this.X,this.Y);if(isNaN(newPos.X))newPos.X=0;if(isNaN(newPos.Y))newPos.Y=0;return newPos};this.Apply=function(element){if(typeof(element)=="string")element=document.getElementById(element);if(element==null)return;if(!isNaN(this.X))element.style.left=this.X+'px';if(!isNaN(this.Y))element.style.top=this.Y+'px'}};var pointerOffset=new Position(0,navigator.userAgent.indexOf("Firefox")>=0?1:0);var circleOffset=new Position(5,5);var arrowsOffset=new Position(0,4);var arrowsLowBounds=new Position(0,-4);var arrowsUpBounds=new Position(0,124);var circleLowBounds=new Position(-5,-5);var circleUpBounds=new Position(123,123);function correctOffset(pos,offset,neg){if(neg)return pos.Subtract(offset);return pos.Add(offset)}function hookEvent(element,eventName,callback){if(typeof(element)=="string")element=document.getElementById(element);if(element==null)return;if(element.addEventListener){element.addEventListener(eventName,callback,false)}else if(element.attachEvent)element.attachEvent("on"+eventName,callback)}function unhookEvent(element,eventName,callback){if(typeof(element)=="string")element=document.getElementById(element);if(element==null)return;if(element.removeEventListener)element.removeEventListener(eventName,callback,false);else if(element.detachEvent)element.detachEvent("on"+eventName,callback)}function cancelEvent(e){e=e?e:window.event;if(e.stopPropagation)e.stopPropagation();if(e.preventDefault)e.preventDefault();e.cancelBubble=true;e.cancel=true;e.returnValue=false;return false}function getMousePos(eventObj){eventObj=eventObj?eventObj:window.event;var pos;if(isNaN(eventObj.layerX))pos=new Position(eventObj.offsetX,eventObj.offsetY);else pos=new Position(eventObj.layerX,eventObj.layerY);return correctOffset(pos,pointerOffset,true)}function getEventTarget(e){e=e?e:window.event;return e.target?e.target:e.srcElement}function absoluteCursorPosition(eventObj){eventObj=eventObj?eventObj:window.event;if(isNaN(window.scrollX))return new Position(eventObj.clientX+document.documentElement.scrollLeft+document.body.scrollLeft,eventObj.clientY+document.documentElement.scrollTop+document.body.scrollTop);else return new Position(eventObj.clientX+window.scrollX,eventObj.clientY+window.scrollY)}function dragObject(element,attachElement,lowerBound,upperBound,startCallback,moveCallback,endCallback,attachLater){if(typeof(element)=="string")element=document.getElementById(element);if(element==null)return;if(lowerBound!=null&&upperBound!=null){var temp=lowerBound.Min(upperBound);upperBound=lowerBound.Max(upperBound);lowerBound=temp}var cursorStartPos=null;var elementStartPos=null;var dragging=false;var listening=false;var disposed=false;function dragStart(eventObj){if(dragging||!listening||disposed)return;dragging=true;if(startCallback!=null)startCallback(eventObj,element);cursorStartPos=absoluteCursorPosition(eventObj);elementStartPos=new Position(parseInt(element.style.left),parseInt(element.style.top));elementStartPos=elementStartPos.Check();hookEvent(document,"mousemove",dragGo);hookEvent(document,"mouseup",dragStopHook);return cancelEvent(eventObj)}function dragGo(eventObj){if(!dragging||disposed)return;var newPos=absoluteCursorPosition(eventObj);newPos=newPos.Add(elementStartPos).Subtract(cursorStartPos);newPos=newPos.Bound(lowerBound,upperBound);newPos.Apply(element);if(moveCallback!=null)moveCallback(newPos,element);return cancelEvent(eventObj)}function dragStopHook(eventObj){dragStop();return cancelEvent(eventObj)}function dragStop(){if(!dragging||disposed)return;unhookEvent(document,"mousemove",dragGo);unhookEvent(document,"mouseup",dragStopHook);cursorStartPos=null;elementStartPos=null;if(endCallback!=null)endCallback(element);dragging=false}this.Dispose=function(){if(disposed)return;this.StopListening(true);element=null;attachElement=null;lowerBound=null;upperBound=null;startCallback=null;moveCallback=null;endCallback=null;disposed=true};this.StartListening=function(){if(listening||disposed)return;listening=true;hookEvent(attachElement,"mousedown",dragStart)};this.StopListening=function(stopCurrentDragging){if(!listening||disposed)return;unhookEvent(attachElement,"mousedown",dragStart);listening=false;if(stopCurrentDragging&&dragging)dragStop()};this.IsDragging=function(){return dragging};this.IsListening=function(){return listening};this.IsDisposed=function(){return disposed};if(typeof(attachElement)=="string")attachElement=document.getElementById(attachElement);if(attachElement==null)attachElement=element;if(!attachLater)this.StartListening()};function fixPNG(myImage){if(!document.body.filters)return;var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if(version<5.5||version>=7)return;var imgID=(myImage.id)?"id='"+myImage.id+"' ":"";var imgStyle="display:inline-block;"+myImage.style.cssText;var strNewHTML="<span "+imgID+" style=\""+"width:"+myImage.width+"px; height:"+myImage.height+"px;"+imgStyle+";"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"+"(src=\'"+myImage.src+"\', sizingMethod='scale');\"></span>";myImage.outerHTML=strNewHTML}function fixGradientImg(gradientImg){fixPNG(document.getElementById(gradientImg))}var X=0;var Y=0;var MOVER=null;var ORIGIN=null;var STARTER=null;var CURRENT=null;var PASTER=null;var LASTCREATED=null;var COLUMN=null;var zindex=100;if(ie)document.onselectstart=new Function("return false");else{}function disableselect(e){return false}function reEnable(){return true}function mover(e,obj){PASTER=null;COLUMN=null;ORIGIN=document.getElementById(obj);MOVER=ORIGIN.cloneNode(true);STARTER=ORIGIN.cloneNode(true);ORIGIN.innerHTML=STARTER.innerHTML;ORIGIN.style.opacity=0.6;document.body.appendChild(MOVER);MOVER.style.position="absolute";if(zindex<MOVER.style.zIndex)zindex=zindex;zindex=zindex+1;MOVER.style.zIndex=zindex;X=mouseX;Y=mouseY;if(ie){document.onmousemove=drag;document.onmouseup=drop}else if(ns6){window.onmousemove=drag;window.onmouseup=drop}}function drag(e){if(MOVER==null||MOVER=="")return;MOVER.style.opacity=0.6;e=e||window.event;mouseX=(e.pageX)?e.pageX:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mouseY=(e.pageY)?e.pageY:e.clientY+document.body.scrollTop+document.documentElement.scrollTop;X=mouseX-X;Y=mouseY-Y;if(ie){var newX1=mouseX+8;var newY1=mouseY+8;MOVER.style.top=newY1+"px";MOVER.style.left=newX1+"px"}else if(ns6){var newX1=mouseX+8;var newY1=mouseY+8;MOVER.style.top=newY1+"px";MOVER.style.left=newX1+"px"}X=mouseX;Y=mouseY}function drop(e){if(MOVER!=null){if(PASTER==null)ORIGIN.innerHTML=MOVER.innerHTML;ORIGIN.innerHTML=STARTER.innerHTML;ORIGIN.style.opacity=1.0;document.body.removeChild(MOVER);MOVER=null}if(ie)document.onmousemove=sourisxy;else if(ns6)window.onmousemove=sourisxy}function paster(e,obj){if(PASTER!=null){PASTER.className=classSupportName}if(MOVER!=null){CURRENT=document.getElementById(obj);if(CURRENT.id==ORIGIN.id){return}CURRENT.className=classSupportName+"Hover"}}function backer(e,obj){if(PASTER!=null&&PASTER.id!=CURRENT.id){PASTER.className=classSupportName}PASTER=CURRENT}function validate(e,obj){if(CURRENT!=null&&CURRENT.id!=null){CURRENT.className=classSupportName;if(MOVER!=null)obj=MOVER.id;var cat=obj.split("-")[1];var toCat=0;var toGenre=0;var st=CURRENT.id.split("-");if(st.length>1){toCat=st[1];toGenre=st[2]}else{toCat=MOVER.id}move(cat,toCat,toGenre)}CURRENT=null;PASTER=null}var classMoverName="mover";var classSupportName="support";function addEvent(tmp1,tmp2){if(tmp1!=null)classMoverName=tmp1;if(tmp2!=null)classSupportName=tmp2;var objs=document.getElementsByTagName("div");for(i=0;i<objs.length;++i){if(objs[i].className==classMoverName){if(!ie){objs[i].setAttribute('onMouseDown',"mover(event,'"+objs[i].id+"');")}else{function moverclassie1(idoo){var deplace=new Object;deplace.id=idoo;deplace.init=function(idObj){document.getElementById(idObj).onmousedown=function(){mover(event,idObj)}};return deplace}var u=new moverclassie1(objs[i].id);u.init(objs[i].id)}}else if(objs[i].className==classSupportName){if(!ie){objs[i].setAttribute('onMouseOver',"paster(event, '"+objs[i].id+"');");objs[i].setAttribute('onMouseOut',"backer(event, '"+objs[i].id+"');");objs[i].setAttribute('onMouseUp',"validate(event,'"+objs[i].id+"');")}else{function moverclassie(idoo){var deplace=new Object;deplace.id=idoo;deplace.init=function(idObj){document.getElementById(idObj).onmouseover=function(){paster(event,idObj)};document.getElementById(idObj).onmouseout=function(){backer(event,idObj)};document.getElementById(idObj).onmouseup=function(){validate(event,idObj)}};return deplace}var t=new moverclassie(objs[i].id);t.init(objs[i].id)}}}}function Finder(id,div,btnDiv,instance){var Fin=new Object();Fin.categorie=null;Fin.idCat=id;Fin.nbCol=3;Fin.nbSubCat=0;Fin.cats=new Array();if(Fin.idCat==0){Fin.cats.push(new Categorie(-1,0,"Accueil",instance))}Fin.divWidth=0;Fin.pas=100;Fin.idCur=0;Fin.last=null;Fin.timerSep=100;Fin.multicat=true;Fin.navigate=true;Fin.showEmpty=false;Fin.ariane=true;Fin.changeMode=false;Fin.instanceName=instance;Fin.displayMode="checkbox";Fin.div=document.getElementById(div);Fin.scrollDiv=Fin.div;Fin.btn=document.getElementById(btnDiv);Fin.loaded=false;Fin.addCat=function(parent,id,titre){this.cats.push(new Categorie(parent,id,titre,this.instanceName));return this.cats[this.cats.length-1]};Fin.getCategorie=function(id){return this.categorie.getCat(id)};Fin.generate=function(){for(var i=0;i<this.cats.length;++i){if(this.cats[i].id==this.idCat){this.categorie=this.cats[i];break}}if(this.categorie==null)this.categorie=this.cats[0];this.current=this.categorie;for(var i=0;i<this.cats.length;i++){for(var j=0;j<this.cats.length;j++){if(this.cats[i].idParent==this.cats[j].id){this.cats[i].parent=this.cats[j];this.cats[j].addCat(this.cats[i])}}}this.div.innerHTML="";if(this.btn!=null)this.btn.innerHTML="";if(this.ariane&&this.btn!=null)this.btn.innerHTML+="<div id='finderAriane"+this.instanceName+"' class='finderAriane'>&nbsp;<\/div>";if(this.navigate&&this.btn!=null)this.btn.innerHTML+="<div class='finderBackDiv'><a id='finderBack"+this.instanceName+"' class='finderBackTop' title='Remonter une catégorie' href='javascript:"+this.instanceName+".prev();'><img src='/sharedFiles/icons/empty.gif' alt='Retour' />Retour<\/a><\/div>";this.maxLevel=this.categorie.genLevel();if(this.displayMode=="select")max=0;else max=this.maxLevel;for(var i=0;i<=max;++i){this.div.innerHTML+="<div class='finder_div' id='finder_level_"+this.instanceName+"_"+i+"'><\/div>"}this.nbSubCat=this.categorie.genMaxNbCat()};Fin.openOptionCat=function(categorie){var nbShowed=0;for(var i=0;i<this.cats.length;++i){hide("selector_cat"+this.cats[i].id)}var parent=this.getCategorie(categorie);while(parent!=null){if(parent.categories.length==1&&parent.parent!=null&&parent.parent.id==0){}else{show("selector_cat"+parent.id);nbShowed++}parent=parent.parent}var selectDiv=getObj("emptySelect"+this.instanceName);if(selectDiv!=null){hide("emptySelect"+this.instanceName);selectDiv.innerHTML="";max=this.maxLevel;if(this.nbCol<max)max=this.nbCol;while(nbShowed<max){nbShowed++;show("emptySelect"+this.instanceName);selectDiv.innerHTML+="<select disabled='disabled' ><option>Sélectionnez une catégorie<\/option><\/select>"}}try{if(this.loaded)openFullCat(categorie)}catch(er){}};Fin.openCat=function(id){if(!this.multicat){var input=document.getElementById("inputCat");if(input!=null)input.value=id}this.last=this.getCategorie(id);if(this.last==null)this.last=this.categorie;if(this.last!=null){this.last.selectCat();this.draw(this.last)}};Fin.selectCat=function(id){if(!this.multicat)return;var tmp=this.getCategorie(id);if(tmp==null)return;var input=document.getElementById("inputCat");if(input!=null){var check=document.getElementById("checkCat_"+this.instanceName+"_"+id);if(tmp.parent!=null){tmp.parent.checked=false;var iid=tmp.parent.id;var pa=document.getElementById("checkCat_"+this.instanceName+"_"+iid);if(pa!=null){pa.checked=false}var val=input.value;var ll=val.split(";");vals="";for(var i=0;i<ll.length;++i){if(ll[i]!=""&&ll[i]!=iid)vals+=";"+ll[i]+";"}input.value=vals}if(check.checked){input.value+=";"+id+";";input.value+=tmp.check("")}else{var toUncheck=tmp.uncheck("");var val=input.value;var ll=toUncheck.split(";");for(var i=0;i<ll.length;++i){var jj=val.split(";");val="";for(var j=0;j<jj.length;++j){if(jj[j]!=""&&jj[j]!=ll[i])val+=";"+jj[j]+";"}}var vals=val.replace(";"+id+";",";;");var ll=vals.split(";");vals="";for(var i=0;i<ll.length;++i){if(ll[i]!="")vals+=";"+ll[i]+";"}input.value=vals}}};Fin.startCat=function(cur){var parents=new Array();parents.push(cur);var tmp=cur;while(tmp!=null){if(tmp.parent!=null){parents.push(tmp.parent);if(cur!=tmp)tmp.state="_parent_selected";else tmp.state="_selected";tmp=tmp.parent}else{tmp=null}}parents.reverse();for(var i=0;i<parents.length;++i){this.draw(parents[i])}this.last=cur};Fin.prev=function(){if(this.last!=null&&this.last.parent!=null)this.openCat(this.last.parent.id)};Fin.updateAriane=function(cate){var objAriane=getObj("finderAriane"+this.instanceName);if(objAriane==null)return;var ariane="";var pp=cate;while(pp!=null){ariane="<a href='javascript:"+this.instanceName+".openCat("+pp.id+");'>"+pp.titre+"<\/a> / "+ariane;pp=pp.parent}objAriane.innerHTML=ariane};Fin.drawToSelect=function(cate){txt="";txt+=cate.toSelect(0,"javascript:;");return txt};Fin.draw=function(cate){var cur=cate.categories;if(cur==null)return;var div=document.getElementById("finder_level_"+this.instanceName+"_"+cate.level);var content="";var prev=cate.parent;if(this.ariane)this.updateAriane(cate);if(this.navigate){if(cate.id!=this.idCat){document.getElementById("finderBack"+this.instanceName).className="finderBack"}else{document.getElementById("finderBack"+this.instanceName).className="finderBackTop"}}if(this.showEmpty&&cur.length==0){content+="<li><span>Pas de sous-catégories<\/span><\/li>"}if(this.displayMode=="select")content+=this.drawToSelect(cate);else{content+="<ul>";for(var i=0;i<cur.length;i++){if(this.displayMode=="checkbox")content+=cur[i].toCheckbox("javascript:"+this.instanceName+".openCat("+cur[i].id+");","javascript:"+this.instanceName+".selectCat("+cur[i].id+");");else if(this.displayMode=="link")content+=cur[i].toLink("javascript:"+this.instanceName+".openCat("+cur[i].id+");");else content+=cur[i].toString()}content+="<\/ul>"}div.innerHTML=content;if(this.displayMode=="select")max=0;else max=this.maxLevel;for(var i=cate.level+1;i<=max;++i)document.getElementById("finder_level_"+this.instanceName+"_"+i).innerHTML="";this.divWidth=document.getElementById("finder_level_"+this.instanceName+"_0").offsetWidth;if(this.idCur.level>cate.level)sens=1;else sens=-1;this.idCur=cate;if(this.changeMode){if(cate.level>=this.nbCol){if(!this.showEmpty&&cur.length==0)return;this.scrollDiv.style.left=-(this.divWidth*(cate.level-this.nbCol+1))+"px"}else{if(!this.showEmpty&&cur.length==0)return;this.scrollDiv.style.left="0px"}}else{if(cate.level>=this.nbCol){if(!this.showEmpty&&cur.length==0)return;this.slowMotion(sens)}else if(cur.length>0){this.idCur=this.categorie;if(!this.showEmpty&&cur.length==0)return;this.slowMotion(sens)}if(!this.showEmpty&&cur.length==0){this.slowMotion(sens)}}if(this.displayMode=="select"){this.openOptionCat(this.categorie.categories[0].id)}};Fin.slowMotion=function(sens){var px=this.scrollDiv.style.left.split("px");var curpx=Math.round(px[0]);var gotopx=(curpx+sens*this.pas);tp=this.idCur.level-this.nbCol+1;if(tp<0)tp=0;var pagegotopx=-(tp*this.divWidth);this.scrollDiv.style.left=gotopx+"px";if(sens<0){if(gotopx<=pagegotopx){this.scrollDiv.style.left=pagegotopx+"px";clearTimeout(this.Timer)}else this.Timer=window.setTimeout(""+this.instanceName+".slowMotion("+sens+")",this.timerSep)}else if(sens>0){if(gotopx>=pagegotopx){this.scrollDiv.style.left=pagegotopx+"px";clearTimeout(this.Timer)}else this.Timer=window.setTimeout(""+this.instanceName+".slowMotion("+sens+")",this.timerSep)}else clearTimeout(this.Timer)};return Fin};(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($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s)}else{alert(s)}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug=""}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter)}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter)}if(!p){p=detectParserForColumn(table,cells[i])}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(table.config.debug){log(parsersDebug)}return list};function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i]}}return parsers[0]}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i]}}return false}function buildCache(table){if(table.config.debug){var cacheTime=new Date()}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]))}cols.push(i);cache.normalized.push(cols);cols=null};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime)}return cache};function getElementText(config,node){if(!node)return"";var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML}else{t=node.innerHTML}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node)}else{t=$(node).text()}}return t}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j])}}}if(table.config.appender){table.config.appender(table,rows)}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)};function buildHeaders(table){if(table.config.debug){var time=new Date()}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0};$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(!this.sortDisabled){$(this).addClass(table.config.cssHeader)}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders};function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++))}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell)}}}return arr};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true};return false}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true};return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table)}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i]}}};function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0}else{i=(v==(0||1))?v:0}return i}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true}}return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this)}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]])}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date()}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime)}return cache};function sortText(a,b){return((a<b)?-1:((a>b)?1:0))};function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0))};function sortNumeric(a,b){return a-b};function sortNumericDesc(a,b){return b-a};function getCachedSortType(parsers,i){return parsers[i].type};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j])}}}config.sortList.push([i,this.order])}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}}else{config.sortList.push([i,this.order])}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this)}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false}}if(a){parsers.push(parser)}};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i};this.isDigit=function(s,config){var DECIMAL='\\'+config.decimal;var exp='/(^[+]?0('+DECIMAL+'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)'+DECIMAL+'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*'+DECIMAL+'0+$)/';return RegExp(exp).test($.trim(s))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild)}empty.apply(table.tBodies[0])}else{table.tBodies[0].innerHTML=""}}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[Â£$â‚¬?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s)},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s)},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''))},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s)},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01"+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}$("tr:visible",table.tBodies[0]).filter(':even').removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(':odd').removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);(function($){$.dimensions={version:'@VERSION'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr)};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0)}});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name]}});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'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)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent)}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0}})(jQuery);;(function($){var _remove=$.fn.remove;$.fn.remove=function(){$("*",this).add(this).triggerHandler("remove");return _remove.apply(this,arguments)};function isVisible(element){function checkStyles(element){var style=element.style;return(style.display!='none'&&style.visibility!='hidden')}var visible=checkStyles(element);(visible&&$.each($.dir(element,'parentNode'),function(){return(visible=checkStyles(this))}));return visible}$.extend($.expr[':'],{data:function(a,i,m){return $.data(a,m[3])},tabbable:function(a,i,m){var nodeName=a.nodeName.toLowerCase();return(a.tabIndex>=0&&(('a'==nodeName&&a.href)||(/input|select|textarea|button/.test(nodeName)&&'hidden'!=a.type&&!a.disabled))&&isVisible(a))}});$.keyCode={BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38};function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods)}var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'))}return($.inArray(method,methods)!=-1)}$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this}if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined)}return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options)));(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args))})};$[namespace][name]=function(element,options){var self=this;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(e,key,value){return self._setData(key,value)}).bind('getData.'+name,function(e,key){return self._getData(key)}).bind('remove',function(){return self.destroy()});this._init()};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option'};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName)},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key)}options={};options[key]=value}$.each(options,function(key,value){self._setData(key,value)})},_getData:function(key){return this.options[key]},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled')}},enable:function(){this._setData('disabled',false)},disable:function(){this._setData('disabled',true)},_trigger:function(type,e,data){var eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);e=e||$.event.fix({type:eventName,target:this.element[0]});return this.element.triggerHandler(eventName,[e,data],this.options[type])}};$.widget.defaults={disabled:false};$.ui={plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]])}},call:function(instance,name,args){var set=instance.plugins[name];if(!set){return}for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args)}}}},cssCache:{},css:function(name){if($.ui.cssCache[name]){return $.ui.cssCache[name]}var tmp=$('<div class="ui-gen">').addClass(name).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!((!(/auto|default/).test(tmp.css('cursor'))||(/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0))}catch(e){}return $.ui.cssCache[name]},disableSelection:function(el){return $(el).attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false})},enableSelection:function(el){return $(el).attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui')},hasScroll:function(e,a){if($(e).css('overflow')=='hidden'){return false}var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(e[scroll]>0){return true}e[scroll]=1;has=(e[scroll]>0);e[scroll]=0;return has}};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(e){return self._mouseDown(e)});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on')}this.started=false},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable))},_mouseDown:function(e){(this._mouseStarted&&this._mouseUp(e));this._mouseDownEvent=e;var self=this,btnIsLeft=(e.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(e.target).parents().add(e.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(e)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(e)!==false);if(!this._mouseStarted){e.preventDefault();return true}}this._mouseMoveDelegate=function(e){return self._mouseMove(e)};this._mouseUpDelegate=function(e){return self._mouseUp(e)};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);return false},_mouseMove:function(e){if($.browser.msie&&!e.button){return this._mouseUp(e)}if(this._mouseStarted){this._mouseDrag(e);return false}if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,e)!==false);(this._mouseStarted?this._mouseDrag(e):this._mouseUp(e))}return!this._mouseStarted},_mouseUp:function(e){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._mouseStop(e)}return false},_mouseDistanceMet:function(e){return(Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance)},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return true}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function($){$.widget("ui.draggable",$.extend({},$.ui.mouse,{getHandle:function(e){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==e.target)handle=true});return handle},createHelper:function(){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[e])):(o.helper=='clone'?this.element.clone():this.element);if(!helper.parents('body').length)helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position")))helper.css("position","absolute");return helper},_init:function(){if(this.options.helper=='original'&&!(/^(?:r|a|f)/).test(this.element.css("position")))this.element[0].style.position='relative';(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass('ui-draggable-disabled'));this._mouseInit()},_mouseCapture:function(e){var o=this.options;if(this.helper||o.disabled||$(e.target).is('.ui-resizable-handle'))return false;this.handle=this.getHandle(e);if(!this.handle)return false;return true},_mouseStart:function(e){var o=this.options;this.helper=this.createHelper();if($.ui.ddmanager)$.ui.ddmanager.current=this;this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top};this.cacheScrollParents();this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&$.browser.mozilla)po={top:0,left:0};this.offset.parent={top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};if(this.cssPosition=="relative"){var p=this.element.position();this.offset.relative={top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollTopParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollLeftParent.scrollLeft()}}else{this.offset.relative={top:0,left:0}}this.originalPosition=this._generatePosition(e);this.cacheHelperProportions();if(o.cursorAt)this.adjustOffsetFromHelper(o.cursorAt);$.extend(this,{PAGEY_INCLUDES_SCROLL:(this.cssPosition=="absolute"&&(!this.scrollTopParent[0].tagName||(/(html|body)/i).test(this.scrollTopParent[0].tagName))),PAGEX_INCLUDES_SCROLL:(this.cssPosition=="absolute"&&(!this.scrollLeftParent[0].tagName||(/(html|body)/i).test(this.scrollLeftParent[0].tagName))),OFFSET_PARENT_NOT_SCROLL_PARENT_Y:this.scrollTopParent[0]!=this.offsetParent[0]&&!(this.scrollTopParent[0]==document&&(/(body|html)/i).test(this.offsetParent[0].tagName)),OFFSET_PARENT_NOT_SCROLL_PARENT_X:this.scrollLeftParent[0]!=this.offsetParent[0]&&!(this.scrollLeftParent[0]==document&&(/(body|html)/i).test(this.offsetParent[0].tagName))});if(o.containment)this.setContainment();this._propagate("start",e);this.cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(this,e);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(e);return true},cacheScrollParents:function(){this.scrollTopParent=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(this.helper);this.scrollLeftParent=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(this.helper)},adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top},cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];if(!(/^(document|window|parent)$/).test(o.containment)){var ce=$(o.containment)[0];var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;return{top:(pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-(this.cssPosition=="fixed"||this.PAGEY_INCLUDES_SCROLL||this.OFFSET_PARENT_NOT_SCROLL_PARENT_Y?0:this.scrollTopParent.scrollTop())*mod+(this.cssPosition=="fixed"?$(document).scrollTop():0)*mod+this.margins.top*mod),left:(pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-(this.cssPosition=="fixed"||this.PAGEX_INCLUDES_SCROLL||this.OFFSET_PARENT_NOT_SCROLL_PARENT_X?0:this.scrollLeftParent.scrollLeft())*mod+(this.cssPosition=="fixed"?$(document).scrollLeft():0)*mod+this.margins.left*mod)}},_generatePosition:function(e){var o=this.options;var position={top:(e.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||this.PAGEY_INCLUDES_SCROLL||this.OFFSET_PARENT_NOT_SCROLL_PARENT_Y?0:this.scrollTopParent.scrollTop())-(this.cssPosition=="fixed"?$(document).scrollTop():0)),left:(e.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||this.PAGEX_INCLUDES_SCROLL||this.OFFSET_PARENT_NOT_SCROLL_PARENT_X?0:this.scrollLeftParent.scrollLeft())-(this.cssPosition=="fixed"?$(document).scrollLeft():0))};if(!this.originalPosition)return position;if(this.containment){if(position.left<this.containment[0])position.left=this.containment[0];if(position.top<this.containment[1])position.top=this.containment[1];if(position.left>this.containment[2])position.left=this.containment[2];if(position.top>this.containment[3])position.top=this.containment[3]}if(o.grid){var top=this.originalPosition.top+Math.round((position.top-this.originalPosition.top)/o.grid[1])*o.grid[1];position.top=this.containment?(!(top<this.containment[1]||top>this.containment[3])?top:(!(top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPosition.left+Math.round((position.left-this.originalPosition.left)/o.grid[0])*o.grid[0];position.left=this.containment?(!(left<this.containment[0]||left>this.containment[2])?left:(!(left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left}return position},_mouseDrag:function(e){this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");this.position=this._propagate("drag",e)||this.position;if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+'px';if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+'px';if($.ui.ddmanager)$.ui.ddmanager.drag(this,e);return false},_mouseStop:function(e){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour)var dropped=$.ui.ddmanager.drop(this,e);if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10)||500,function(){self._propagate("stop",e);self._clear()})}else{this._propagate("stop",e);this._clear()}return false},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.options.helper!='original'&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},plugins:{},uiHash:function(e){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}},_propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.uiHash()]);if(n=="drag")this.positionAbs=this._convertPositionTo("absolute");return this.element.triggerHandler(n=="drag"?n:"drag"+n,[e,this.uiHash()],this.options[n])},destroy:function(){if(!this.element.data('draggable'))return;this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable ui-draggable-dragging ui-draggable-disabled');this._mouseDestroy()}}));$.extend($.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original",scope:"default",cssNamespace:"ui"}});$.ui.plugin.add("draggable","cursor",{start:function(e,ui){var t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.options.cursor)},stop:function(e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor)}});$.ui.plugin.add("draggable","zIndex",{start:function(e,ui){var t=$(ui.helper);if(t.css("zIndex"))ui.options._zIndex=t.css("zIndex");t.css('zIndex',ui.options.zIndex)},stop:function(e,ui){if(ui.options._zIndex)$(ui.helper).css('zIndex',ui.options._zIndex)}});$.ui.plugin.add("draggable","opacity",{start:function(e,ui){var t=$(ui.helper);if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity',ui.options.opacity)},stop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('opacity',ui.options._opacity)}});$.ui.plugin.add("draggable","iframeFix",{start:function(e,ui){$(ui.options.iframeFix===true?"iframe":ui.options.iframeFix).each(function(){$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body")})},stop:function(e,ui){$("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});$.ui.plugin.add("draggable","scroll",{start:function(e,ui){var o=ui.options;var i=$(this).data("draggable");o.scrollSensitivity=o.scrollSensitivity||20;o.scrollSpeed=o.scrollSpeed||20;i.overflowY=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(this);i.overflowX=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(this);if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML')i.overflowYOffset=i.overflowY.offset();if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML')i.overflowXOffset=i.overflowX.offset()},drag:function(e,ui){var o=ui.options,scrolled=false;var i=$(this).data("draggable");if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if((i.overflowYOffset.top+i.overflowY[0].offsetHeight)-e.pageY<o.scrollSensitivity)i.overflowY[0].scrollTop=scrolled=i.overflowY[0].scrollTop+o.scrollSpeed;if(e.pageY-i.overflowYOffset.top<o.scrollSensitivity)i.overflowY[0].scrollTop=scrolled=i.overflowY[0].scrollTop-o.scrollSpeed}else{if(e.pageY-$(document).scrollTop()<o.scrollSensitivity)scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);if($(window).height()-(e.pageY-$(document).scrollTop())<o.scrollSensitivity)scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)}if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML'){if((i.overflowXOffset.left+i.overflowX[0].offsetWidth)-e.pageX<o.scrollSensitivity)i.overflowX[0].scrollLeft=scrolled=i.overflowX[0].scrollLeft+o.scrollSpeed;if(e.pageX-i.overflowXOffset.left<o.scrollSensitivity)i.overflowX[0].scrollLeft=scrolled=i.overflowX[0].scrollLeft-o.scrollSpeed}else{if(e.pageX-$(document).scrollLeft()<o.scrollSensitivity)scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);if($(window).width()-(e.pageX-$(document).scrollLeft())<o.scrollSensitivity)scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}if(scrolled!==false)$.ui.ddmanager.prepareOffsets(i,e)}});$.ui.plugin.add("draggable","snap",{start:function(e,ui){var inst=$(this).data("draggable");inst.snapElements=[];$(ui.options.snap.constructor!=String?(ui.options.snap.items||':data(draggable)'):ui.options.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=inst.element[0])inst.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left})})},drag:function(e,ui){var inst=$(this).data("draggable");var d=ui.options.snapTolerance||20;var x1=ui.absolutePosition.left,x2=x1+inst.helperProportions.width,y1=ui.absolutePosition.top,y2=y1+inst.helperProportions.height;for(var i=inst.snapElements.length-1;i>=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){if(inst.snapElements[i].snapping)(inst.options.snap.release&&inst.options.snap.release.call(inst.element,null,$.extend(inst.uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=false;continue}if(ui.options.snapMode!='inner'){var ts=Math.abs(t-y2)<=d;var bs=Math.abs(b-y1)<=d;var ls=Math.abs(l-x2)<=d;var rs=Math.abs(r-x1)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left}var first=(ts||bs||ls||rs);if(ui.options.snapMode!='outer'){var ts=Math.abs(t-y1)<=d;var bs=Math.abs(b-y2)<=d;var ls=Math.abs(l-x1)<=d;var rs=Math.abs(r-x2)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left}if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first))(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,null,$.extend(inst.uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=(ts||bs||ls||rs||first)}}});$.ui.plugin.add("draggable","connectToSortable",{start:function(e,ui){var inst=$(this).data("draggable");inst.sortables=[];$(ui.options.connectToSortable).each(function(){if($.data(this,'sortable')){var sortable=$.data(this,'sortable');inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._propagate("activate",e,inst)}})},stop:function(e,ui){var inst=$(this).data("draggable");$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(e);this.instance.element.triggerHandler("sortreceive",[e,$.extend(this.instance.ui(),{sender:inst.element})],this.instance.options["receive"]);this.instance.options.helper=this.instance.options._helper}else{this.instance._propagate("deactivate",e,inst)}})},drag:function(e,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var l=o.left,r=l+o.width,t=o.top,b=t+o.height;return(l<(this.positionAbs.left+this.offset.click.left)&&(this.positionAbs.left+this.offset.click.left)<r&&t<(this.positionAbs.top+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<b)};$.each(inst.sortables,function(i){if(checkPos.call(inst,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0]};e.target=this.instance.currentItem[0];this.instance._mouseCapture(e,true);this.instance._mouseStart(e,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._propagate("toSortable",e)}if(this.instance.currentItem)this.instance._mouseDrag(e)}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._mouseStop(e,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();inst._propagate("fromSortable",e)}}})}});$.ui.plugin.add("draggable","stack",{start:function(e,ui){var group=$.makeArray($(ui.options.stack.group)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||ui.options.stack.min)-(parseInt($(b).css("zIndex"),10)||ui.options.stack.min)});$(group).each(function(i){this.style.zIndex=ui.options.stack.min+i});this[0].style.zIndex=ui.options.stack.min+group.length}})})(jQuery);(function($){$.widget("ui.droppable",{_setData:function(key,value){if(key=='accept'){this.options.accept=value&&$.isFunction(value)?value:function(d){return d.is(accept)}}else{$.widget.prototype._setData.apply(this,arguments)}},_init:function(){var o=this.options,accept=o.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&$.isFunction(this.options.accept)?this.options.accept:function(d){return d.is(accept)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};$.ui.ddmanager.droppables[this.options.scope]=$.ui.ddmanager.droppables[this.options.scope]||[];$.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-droppable"))},plugins:{},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,absolutePosition:c.positionAbs,options:this.options,element:this.element}},destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];for(var i=0;i<drop.length;i++)if(drop[i]==this)drop.splice(i,1);this.element.removeClass("ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_over:function(e){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element,(draggable.currentItem||draggable.element))){$.ui.plugin.call(this,'over',[e,this.ui(draggable)]);this.element.triggerHandler("dropover",[e,this.ui(draggable)],this.options.over)}},_out:function(e){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return;if(this.options.accept.call(this.element,(draggable.currentItem||draggable.element))){$.ui.plugin.call(this,'out',[e,this.ui(draggable)]);this.element.triggerHandler("dropout",[e,this.ui(draggable)],this.options.out)}},_drop:function(e,custom){var draggable=custom||$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]==this.element[0])return false;var childrenIntersection=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var inst=$.data(this,'droppable');if(inst.options.greedy&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance)){childrenIntersection=true;return false}});if(childrenIntersection)return false;if(this.options.accept.call(this.element,(draggable.currentItem||draggable.element))){$.ui.plugin.call(this,'drop',[e,this.ui(draggable)]);this.element.triggerHandler("drop",[e,this.ui(draggable)],this.options.drop);return this.element}return false},_activate:function(e){var draggable=$.ui.ddmanager.current;$.ui.plugin.call(this,'activate',[e,this.ui(draggable)]);if(draggable)this.element.triggerHandler("dropactivate",[e,this.ui(draggable)],this.options.activate)},_deactivate:function(e){var draggable=$.ui.ddmanager.current;$.ui.plugin.call(this,'deactivate',[e,this.ui(draggable)]);if(draggable)this.element.triggerHandler("dropdeactivate",[e,this.ui(draggable)],this.options.deactivate)}});$.extend($.ui.droppable,{defaults:{disabled:false,tolerance:'intersect',scope:'default',cssNamespace:'ui'}});$.ui.intersect=function(draggable,droppable,toleranceMode){if(!droppable.offset)return false;var x1=(draggable.positionAbs||draggable.position.absolute).left,x2=x1+draggable.helperProportions.width,y1=(draggable.positionAbs||draggable.position.absolute).top,y2=y1+draggable.helperProportions.height;var l=droppable.offset.left,r=l+droppable.proportions.width,t=droppable.offset.top,b=t+droppable.proportions.height;switch(toleranceMode){case'fit':return(l<x1&&x2<r&&t<y1&&y2<b);break;case'intersect':return(l<x1+(draggable.helperProportions.width/2) &&x2-(draggable.helperProportions.width/2)<r &&t<y1+(draggable.helperProportions.height/2) &&y2-(draggable.helperProportions.height/2)<b); break;case'pointer':return(l<((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left)&&((draggable.positionAbs||draggable.position.absolute).left+(draggable.clickOffset||draggable.offset.click).left)<r&&t<((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top)&&((draggable.positionAbs||draggable.position.absolute).top+(draggable.clickOffset||draggable.offset.click).top)<b);break;case'touch':return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));break;default:return false;break}};$.ui.ddmanager={current:null,droppables:{'default':[]},prepareOffsets:function(t,e){var m=$.ui.ddmanager.droppables[t.options.scope];var type=e?e.type:null;var list=(t.currentItem||t.element).find(":data(droppable)").andSelf();droppablesLoop:for(var i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].options.accept.call(m[i].element,(t.currentItem||t.element))))continue;for(var j=0;j<list.length;j++){if(list[j]==m[i].element[0]){m[i].proportions.height=0;continue droppablesLoop}};m[i].visible=m[i].element.css("display")!="none";if(!m[i].visible)continue;m[i].offset=m[i].element.offset();m[i].proportions={width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight};if(type=="dragstart"||type=="sortactivate")m[i]._activate.call(m[i],e)}},drop:function(draggable,e){var dropped=false;$.each($.ui.ddmanager.droppables[draggable.options.scope],function(){if(!this.options)return;if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance))dropped=this._drop.call(this,e);if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element,(draggable.currentItem||draggable.element))){this.isout=1;this.isover=0;this._deactivate.call(this,e)}});return dropped},drag:function(draggable,e){if(draggable.options.refreshPositions)$.ui.ddmanager.prepareOffsets(draggable,e);$.each($.ui.ddmanager.droppables[draggable.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var intersects=$.ui.intersect(draggable,this,this.options.tolerance);var c=!intersects&&this.isover==1?'isout':(intersects&&this.isover==0?'isover':null);if(!c)return;var parentInstance;if(this.options.greedy){var parent=this.element.parents(':data(droppable):eq(0)');if(parent.length){parentInstance=$.data(parent[0],'droppable');parentInstance.greedyChild=(c=='isover'?1:0)}}if(parentInstance&&c=='isover'){parentInstance['isover']=0;parentInstance['isout']=1;parentInstance._out.call(parentInstance,e)}this[c]=1;this[c=='isout'?'isover':'isout']=0;this[c=="isover"?"_over":"_out"].call(this,e);if(parentInstance&&c=='isout'){parentInstance['isout']=0;parentInstance['isover']=1;parentInstance._over.call(parentInstance,e)}})}};$.ui.plugin.add("droppable","activeClass",{activate:function(e,ui){$(this).addClass(ui.options.activeClass)},deactivate:function(e,ui){$(this).removeClass(ui.options.activeClass)},drop:function(e,ui){$(this).removeClass(ui.options.activeClass)}});$.ui.plugin.add("droppable","hoverClass",{over:function(e,ui){$(this).addClass(ui.options.hoverClass)},out:function(e,ui){$(this).removeClass(ui.options.hoverClass)},drop:function(e,ui){$(this).removeClass(ui.options.hoverClass)}})})(jQuery);(function($){$.widget("ui.resizable",$.extend({},$.ui.mouse,{_init:function(){var self=this,o=this.options;var elpos=this.element.css('position');this.originalElement=this.element;this.element.addClass("ui-resizable").css({position:/static/.test(elpos)?'relative':elpos});$.extend(o,{_aspectRatio:!!(o.aspectRatio),helper:o.helper||o.ghost||o.animate?o.helper||'proxy':null,knobHandles:o.knobHandles===true?'ui-resizable-knob-handle':o.knobHandles});var aBorder='1px solid #DEDEDE';o.defaultTheme={'ui-resizable':{display:'block'},'ui-resizable-handle':{position:'absolute',background:'#F2F2F2',fontSize:'0.1px'},'ui-resizable-n':{cursor:'n-resize',height:'4px',left:'0px',right:'0px',borderTop:aBorder},'ui-resizable-s':{cursor:'s-resize',height:'4px',left:'0px',right:'0px',borderBottom:aBorder},'ui-resizable-e':{cursor:'e-resize',width:'4px',top:'0px',bottom:'0px',borderRight:aBorder},'ui-resizable-w':{cursor:'w-resize',width:'4px',top:'0px',bottom:'0px',borderLeft:aBorder},'ui-resizable-se':{cursor:'se-resize',width:'4px',height:'4px',borderRight:aBorder,borderBottom:aBorder},'ui-resizable-sw':{cursor:'sw-resize',width:'4px',height:'4px',borderBottom:aBorder,borderLeft:aBorder},'ui-resizable-ne':{cursor:'ne-resize',width:'4px',height:'4px',borderRight:aBorder,borderTop:aBorder},'ui-resizable-nw':{cursor:'nw-resize',width:'4px',height:'4px',borderLeft:aBorder,borderTop:aBorder}};o.knobTheme={'ui-resizable-handle':{background:'#F2F2F2',border:'1px solid #808080',height:'8px',width:'8px'},'ui-resizable-n':{cursor:'n-resize',top:'0px',left:'45%'},'ui-resizable-s':{cursor:'s-resize',bottom:'0px',left:'45%'},'ui-resizable-e':{cursor:'e-resize',right:'0px',top:'45%'},'ui-resizable-w':{cursor:'w-resize',left:'0px',top:'45%'},'ui-resizable-se':{cursor:'se-resize',right:'0px',bottom:'0px'},'ui-resizable-sw':{cursor:'sw-resize',left:'0px',bottom:'0px'},'ui-resizable-nw':{cursor:'nw-resize',left:'0px',top:'0px'},'ui-resizable-ne':{cursor:'ne-resize',right:'0px',top:'0px'}};o._nodeName=this.element[0].nodeName;if(o._nodeName.match(/canvas|textarea|input|select|button|img/i)){var el=this.element;if(/relative/.test(el.css('position'))&&$.browser.opera)el.css({position:'relative',top:'auto',left:'auto'});el.wrap($('<div class="ui-wrapper"	style="overflow: hidden;"></div>').css({position:el.css('position'),width:el.outerWidth(),height:el.outerHeight(),top:el.css('top'),left:el.css('left')}));var oel=this.element;this.element=this.element.parent();this.element.data('resizable',this);this.element.css({marginLeft:oel.css("marginLeft"),marginTop:oel.css("marginTop"),marginRight:oel.css("marginRight"),marginBottom:oel.css("marginBottom")});oel.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});if($.browser.safari&&o.preventDefault)oel.css('resize','none');o.proportionallyResize=oel.css({position:'static',zoom:1,display:'block'});this.element.css({margin:oel.css('margin')});this._proportionallyResize()}if(!o.handles)o.handles=!$('.ui-resizable-handle',this.element).length?"e,s,se":{n:'.ui-resizable-n',e:'.ui-resizable-e',s:'.ui-resizable-s',w:'.ui-resizable-w',se:'.ui-resizable-se',sw:'.ui-resizable-sw',ne:'.ui-resizable-ne',nw:'.ui-resizable-nw'};if(o.handles.constructor==String){o.zIndex=o.zIndex||1000;if(o.handles=='all')o.handles='n,e,s,w,se,sw,ne,nw';var n=o.handles.split(",");o.handles={};var insertionsDefault={handle:'position: absolute; display: none; overflow:hidden;',n:'top: 0pt; width:100%;',e:'right: 0pt; height:100%;',s:'bottom: 0pt; width:100%;',w:'left: 0pt; height:100%;',se:'bottom: 0pt; right: 0px;',sw:'bottom: 0pt; left: 0px;',ne:'top: 0pt; right: 0px;',nw:'top: 0pt; left: 0px;'};for(var i=0;i<n.length;i++){var handle=$.trim(n[i]),dt=o.defaultTheme,hname='ui-resizable-'+handle,loadDefault=!$.ui.css(hname)&&!o.knobHandles,userKnobClass=$.ui.css('ui-resizable-knob-handle'),allDefTheme=$.extend(dt[hname],dt['ui-resizable-handle']),allKnobTheme=$.extend(o.knobTheme[hname],!userKnobClass?o.knobTheme['ui-resizable-handle']:{});var applyZIndex=/sw|se|ne|nw/.test(handle)?{zIndex:++o.zIndex}:{};var defCss=(loadDefault?insertionsDefault[handle]:''),axis=$(['<div class="ui-resizable-handle ',hname,'" style="',defCss,insertionsDefault.handle,'"></div>'].join('')).css(applyZIndex);o.handles[handle]='.ui-resizable-'+handle;this.element.append(axis.css(loadDefault?allDefTheme:{}).css(o.knobHandles?allKnobTheme:{}).addClass(o.knobHandles?'ui-resizable-knob-handle':'').addClass(o.knobHandles))}if(o.knobHandles)this.element.addClass('ui-resizable-knob').css(!$.ui.css('ui-resizable-knob')?{}:{})}this._renderAxis=function(target){target=target||this.element;for(var i in o.handles){if(o.handles[i].constructor==String)o.handles[i]=$(o.handles[i],this.element).show();if(o.transparent)o.handles[i].css({opacity:0});if(this.element.is('.ui-wrapper')&&o._nodeName.match(/textarea|input|select|button/i)){var axis=$(o.handles[i],this.element),padWrapper=0;padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();var padPos=['padding',/ne|nw|n/.test(i)?'Top':/se|sw|s/.test(i)?'Bottom':/^e$/.test(i)?'Right':'Left'].join("");if(!o.transparent)target.css(padPos,padWrapper);this._proportionallyResize()}if(!$(o.handles[i]).length)continue}};this._renderAxis(this.element);o._handles=$('.ui-resizable-handle',self.element);if(o.disableSelection)o._handles.each(function(i,e){$.ui.disableSelection(e)});o._handles.mouseover(function(){if(!o.resizing){if(this.className)var axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);self.axis=o.axis=axis&&axis[1]?axis[1]:'se'}});if(o.autoHide){o._handles.hide();$(self.element).addClass("ui-resizable-autohide").hover(function(){$(this).removeClass("ui-resizable-autohide");o._handles.show()},function(){if(!o.resizing){$(this).addClass("ui-resizable-autohide");o._handles.hide()}})}this._mouseInit()},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,options:this.options,originalSize:this.originalSize,originalPosition:this.originalPosition}},_propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);if(n!="resize")this.element.triggerHandler(["resize",n].join(""),[e,this.ui()],this.options[n])},destroy:function(){var el=this.element,wrapped=el.children(".ui-resizable").get(0);this._mouseDestroy();var _destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled").removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove()};_destroy(el);if(el.is('.ui-wrapper')&&wrapped){el.parent().append($(wrapped).css({position:el.css('position'),width:el.outerWidth(),height:el.outerHeight(),top:el.css('top'),left:el.css('left')})).end().remove();_destroy(wrapped)}},_mouseCapture:function(e){if(this.options.disabled)return false;var handle=false;for(var i in this.options.handles){if($(this.options.handles[i])[0]==e.target)handle=true}if(!handle)return false;return true},_mouseStart:function(e){var o=this.options,iniPos=this.element.position(),el=this.element,num=function(v){return parseInt(v,10)||0},ie6=$.browser.msie&&$.browser.version<7;o.resizing=true;o.documentScroll={top:$(document).scrollTop(),left:$(document).scrollLeft()};if(el.is('.ui-draggable')||(/absolute/).test(el.css('position'))){var sOffset=$.browser.msie&&!o.containment&&(/absolute/).test(el.css('position'))&&!(/relative/).test(el.parent().css('position'));var dscrollt=sOffset?o.documentScroll.top:0,dscrolll=sOffset?o.documentScroll.left:0;el.css({position:'absolute',top:(iniPos.top+dscrollt),left:(iniPos.left+dscrolll)})}if($.browser.opera&&/relative/.test(el.css('position')))el.css({position:'relative',top:'auto',left:'auto'});this._renderProxy();var curleft=num(this.helper.css('left')),curtop=num(this.helper.css('top'));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=o.helper||ie6?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalSize=o.helper||ie6?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.originalPosition={left:curleft,top:curtop};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};o.aspectRatio=(typeof o.aspectRatio=='number')?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);if(o.preserveCursor)$('body').css('cursor',this.axis+'-resize');this._propagate("start",e);return true},_mouseDrag:function(e){var el=this.helper,o=this.options,props={},self=this,smp=this.originalMousePosition,a=this.axis;var dx=(e.pageX-smp.left)||0,dy=(e.pageY-smp.top)||0;var trigger=this._change[a];if(!trigger)return false;var data=trigger.apply(this,[e,dx,dy]),ie6=$.browser.msie&&$.browser.version<7,csdif=this.sizeDiff;if(o._aspectRatio||e.shiftKey)data=this._updateRatio(data,e);data=this._respectSize(data,e);this._propagate("resize",e);el.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!o.helper&&o.proportionallyResize)this._proportionallyResize();this._updateCache(data);this.element.triggerHandler("resize",[e,this.ui()],this.options["resize"]);return false},_mouseStop:function(e){this.options.resizing=false;var o=this.options,num=function(v){return parseInt(v,10)||0},self=this;if(o.helper){var pr=o.proportionallyResize,ista=pr&&(/textarea/i).test(pr.get(0).nodeName),soffseth=ista&&$.ui.hasScroll(pr.get(0),'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var s={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;if(!o.animate)this.element.css($.extend(s,{top:top,left:left}));if(o.helper&&!o.animate)this._proportionallyResize()}if(o.preserveCursor)$('body').css('cursor','auto');this._propagate("stop",e);if(o.helper)this.helper.remove();return false},_updateCache:function(data){var o=this.options;this.offset=this.helper.offset();if(data.left)this.position.left=data.left;if(data.top)this.position.top=data.top;if(data.height)this.size.height=data.height;if(data.width)this.size.width=data.width},_updateRatio:function(data,e){var o=this.options,cpos=this.position,csize=this.size,a=this.axis;if(data.height)data.width=(csize.height*o.aspectRatio);else if(data.width)data.height=(csize.width/o.aspectRatio);if(a=='sw'){data.left=cpos.left+(csize.width-data.width);data.top=null}if(a=='nw'){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width)}return data},_respectSize:function(data,e){var el=this.helper,o=this.options,pRatio=o._aspectRatio||e.shiftKey,a=this.axis,ismaxw=data.width&&o.maxWidth&&o.maxWidth<data.width,ismaxh=data.height&&o.maxHeight&&o.maxHeight<data.height,isminw=data.width&&o.minWidth&&o.minWidth>data.width,isminh=data.height&&o.minHeight&&o.minHeight>data.height;if(isminw)data.width=o.minWidth;if(isminh)data.height=o.minHeight;if(ismaxw)data.width=o.maxWidth;if(ismaxh)data.height=o.maxHeight;var dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height;var cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw&&cw)data.left=dw-o.minWidth;if(ismaxw&&cw)data.left=dw-o.maxWidth;if(isminh&&ch)data.top=dh-o.minHeight;if(ismaxh&&ch)data.top=dh-o.maxHeight;var isNotwh=!data.width&&!data.height;if(isNotwh&&!data.left&&data.top)data.top=null;else if(isNotwh&&!data.top&&data.left)data.left=null;return data},_proportionallyResize:function(){var o=this.options;if(!o.proportionallyResize)return;var prel=o.proportionallyResize,el=this.helper||this.element;if(!o.borderDif){var b=[prel.css('borderTopWidth'),prel.css('borderRightWidth'),prel.css('borderBottomWidth'),prel.css('borderLeftWidth')],p=[prel.css('paddingTop'),prel.css('paddingRight'),prel.css('paddingBottom'),prel.css('paddingLeft')];o.borderDif=$.map(b,function(v,i){var border=parseInt(v,10)||0,padding=parseInt(p[i],10)||0;return border+padding})}prel.css({height:(el.height()-o.borderDif[0]-o.borderDif[2])+"px",width:(el.width()-o.borderDif[1]-o.borderDif[3])+"px"})},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(o.helper){this.helper=this.helper||$('<div style="overflow:hidden;"></div>');var ie6=$.browser.msie&&$.browser.version<7,ie6offset=(ie6?1:0),pxyoffset=(ie6?2:-1);this.helper.addClass(o.helper).css({width:el.outerWidth()+pxyoffset,height:el.outerHeight()+pxyoffset,position:'absolute',left:this.elementOffset.left-ie6offset+'px',top:this.elementOffset.top-ie6offset+'px',zIndex:++o.zIndex});this.helper.appendTo("body");if(o.disableSelection)$.ui.disableSelection(this.helper.get(0))}else{this.helper=el}},_change:{e:function(e,dx,dy){return{width:this.originalSize.width+dx}},w:function(e,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(e,dx,dy){var o=this.options,cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},s:function(e,dx,dy){return{height:this.originalSize.height+dy}},se:function(e,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,dx,dy]))},sw:function(e,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,dx,dy]))},ne:function(e,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,dx,dy]))},nw:function(e,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,dx,dy]))}}}));$.extend($.ui.resizable,{defaults:{cancel:":input",distance:1,delay:0,preventDefault:true,transparent:false,minWidth:10,minHeight:10,aspectRatio:false,disableSelection:true,preserveCursor:true,autoHide:false,knobHandles:false}});$.ui.plugin.add("resizable","containment",{start:function(e,ui){var o=ui.options,self=$(this).data("resizable"),el=self.element;var oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce)return;self.containerElement=$(ce);if(/document/.test(oc)||oc==document){self.containerOffset={left:0,top:0};self.containerPosition={left:0,top:0};self.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}}else{self.containerOffset=$(ce).offset();self.containerPosition=$(ce).position();self.containerSize={height:$(ce).innerHeight(),width:$(ce).innerWidth()};var co=self.containerOffset,ch=self.containerSize.height,cw=self.containerSize.width,width=($.ui.hasScroll(ce,"left")?ce.scrollWidth:cw),height=($.ui.hasScroll(ce)?ce.scrollHeight:ch);self.parentData={element:ce,left:co.left,top:co.top,width:width,height:height}}},resize:function(e,ui){var o=ui.options,self=$(this).data("resizable"),ps=self.containerSize,co=self.containerOffset,cs=self.size,cp=self.position,pRatio=o._aspectRatio||e.shiftKey,cop={top:0,left:0},ce=self.containerElement;if(ce[0]!=document&&/static/.test(ce.css('position')))cop=self.containerPosition;if(cp.left<(o.helper?co.left:cop.left)){self.size.width=self.size.width+(o.helper?(self.position.left-co.left):(self.position.left-cop.left));if(pRatio)self.size.height=self.size.width/o.aspectRatio;self.position.left=o.helper?co.left:cop.left}if(cp.top<(o.helper?co.top:0)){self.size.height=self.size.height+(o.helper?(self.position.top-co.top):self.position.top);if(pRatio)self.size.width=self.size.height*o.aspectRatio;self.position.top=o.helper?co.top:0}var woset=(o.helper?self.offset.left-co.left:(self.position.left-cop.left))+self.sizeDiff.width,hoset=(o.helper?self.offset.top-co.top:self.position.top)+self.sizeDiff.height;if(woset+self.size.width>=self.parentData.width){self.size.width=self.parentData.width-woset;if(pRatio)self.size.height=self.size.width/o.aspectRatio}if(hoset+self.size.height>=self.parentData.height){self.size.height=self.parentData.height-hoset;if(pRatio)self.size.width=self.size.height*o.aspectRatio}},stop:function(e,ui){var o=ui.options,self=$(this).data("resizable"),cp=self.position,co=self.containerOffset,cop=self.containerPosition,ce=self.containerElement;var helper=$(self.helper),ho=helper.offset(),w=helper.innerWidth(),h=helper.innerHeight();if(o.helper&&!o.animate&&/relative/.test(ce.css('position')))$(this).css({left:(ho.left-co.left),top:(ho.top-co.top),width:w,height:h});if(o.helper&&!o.animate&&/static/.test(ce.css('position')))$(this).css({left:cop.left+(ho.left-co.left),top:cop.top+(ho.top-co.top),width:w,height:h})}});$.ui.plugin.add("resizable","grid",{resize:function(e,ui){var o=ui.options,self=$(this).data("resizable"),cs=self.size,os=self.originalSize,op=self.originalPosition,a=self.axis,ratio=o._aspectRatio||e.shiftKey;o.grid=typeof o.grid=="number"?[o.grid,o.grid]:o.grid;var ox=Math.round((cs.width-os.width)/(o.grid[0]||1))*(o.grid[0]||1),oy=Math.round((cs.height-os.height)/(o.grid[1]||1))*(o.grid[1]||1);if(/^(se|s|e)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy}else if(/^(ne)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy}else if(/^(sw)$/.test(a)){self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.left=op.left-ox}else{self.size.width=os.width+ox;self.size.height=os.height+oy;self.position.top=op.top-oy;self.position.left=op.left-ox}}});$.ui.plugin.add("resizable","animate",{stop:function(e,ui){var o=ui.options,self=$(this).data("resizable");var pr=o.proportionallyResize,ista=pr&&(/textarea/i).test(pr.get(0).nodeName),soffseth=ista&&$.ui.hasScroll(pr.get(0),'left')?0:self.sizeDiff.height,soffsetw=ista?0:self.sizeDiff.width;var style={width:(self.size.width-soffsetw),height:(self.size.height-soffseth)},left=(parseInt(self.element.css('left'),10)+(self.position.left-self.originalPosition.left))||null,top=(parseInt(self.element.css('top'),10)+(self.position.top-self.originalPosition.top))||null;self.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration||"slow",easing:o.animateEasing||"swing",step:function(){var data={width:parseInt(self.element.css('width'),10),height:parseInt(self.element.css('height'),10),top:parseInt(self.element.css('top'),10),left:parseInt(self.element.css('left'),10)};if(pr)pr.css({width:data.width,height:data.height});self._updateCache(data);self._propagate("animate",e)}})}});$.ui.plugin.add("resizable","ghost",{start:function(e,ui){var o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize,cs=self.size;if(!pr)self.ghost=self.element.clone();else self.ghost=pr.clone();self.ghost.css({opacity:.25,display:'block',position:'relative',height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass('ui-resizable-ghost').addClass(typeof o.ghost=='string'?o.ghost:'');self.ghost.appendTo(self.helper)},resize:function(e,ui){var o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize;if(self.ghost)self.ghost.css({position:'relative',height:self.size.height,width:self.size.width})},stop:function(e,ui){var o=ui.options,self=$(this).data("resizable"),pr=o.proportionallyResize;if(self.ghost&&self.helper)self.helper.get(0).removeChild(self.ghost.get(0))}});$.ui.plugin.add("resizable","alsoResize",{start:function(e,ui){var o=ui.options,self=$(this).data("resizable"),_store=function(exp){$(exp).each(function(){$(this).data("resizable-alsoresize",{width:parseInt($(this).width(),10),height:parseInt($(this).height(),10),left:parseInt($(this).css('left'),10),top:parseInt($(this).css('top'),10)})})};if(typeof(o.alsoResize)=='object'){if(o.alsoResize.length){o.alsoResize=o.alsoResize[0];_store(o.alsoResize)}else{$.each(o.alsoResize,function(exp,c){_store(exp)})}}else{_store(o.alsoResize)}},resize:function(e,ui){var o=ui.options,self=$(this).data("resizable"),os=self.originalSize,op=self.originalPosition;var delta={height:(self.size.height-os.height)||0,width:(self.size.width-os.width)||0,top:(self.position.top-op.top)||0,left:(self.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var start=$(this).data("resizable-alsoresize"),style={},css=c&&c.length?c:['width','height','top','left'];$.each(css||['width','height','top','left'],function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0)style[prop]=sum||null});$(this).css(style)})};if(typeof(o.alsoResize)=='object'){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c)})}else{_alsoResize(o.alsoResize)}},stop:function(e,ui){$(this).removeData("resizable-alsoresize-start")}})})(jQuery);(function($){$.widget("ui.selectable",$.extend({},$.ui.mouse,{_init:function(){var self=this;this.element.addClass("ui-selectable");this.dragged=false;var selectees;this.refresh=function(){selectees=$(self.options.filter,self.element[0]);selectees.each(function(){var $this=$(this);var pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.width(),bottom:pos.top+$this.height(),startselected:false,selected:$this.hasClass('ui-selected'),selecting:$this.hasClass('ui-selecting'),unselecting:$this.hasClass('ui-unselecting')})})};this.refresh();this.selectees=selectees.addClass("ui-selectee");this._mouseInit();this.helper=$(document.createElement('div')).css({border:'1px dotted black'}).addClass("ui-selectable-helper")},toggle:function(){if(this.options.disabled){this.enable()}else{this.disable()}},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(e){var self=this;this.opos=[e.pageX,e.pageY];if(this.options.disabled)return;var options=this.options;this.selectees=$(options.filter,this.element[0]);this.element.triggerHandler("selectablestart",[e,{"selectable":this.element[0],"options":options}],options.start);$('body').append(this.helper);this.helper.css({"z-index":100,"position":"absolute","left":e.clientX,"top":e.clientY,"width":0,"height":0});if(options.autoRefresh){this.refresh()}this.selectees.filter('.ui-selected').each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!e.metaKey){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;self.element.triggerHandler("selectableunselecting",[e,{selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting)}});var isSelectee=false;$(e.target).parents().andSelf().each(function(){if($.data(this,"selectable-item"))isSelectee=true});return this.options.keyboard?!isSelectee:true},_mouseDrag:function(e){var self=this;this.dragged=true;if(this.options.disabled)return;var options=this.options;var x1=this.opos[0],y1=this.opos[1],x2=e.pageX,y2=e.pageY;if(x1>x2){var tmp=x2;x2=x1;x1=tmp}if(y1>y2){var tmp=y2;y2=y1;y1=tmp}this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item");if(!selectee||selectee.element==self.element[0])return;var hit=false;if(options.tolerance=='touch'){hit=(!(selectee.left>x2||selectee.right<x1||selectee.top>y2||selectee.bottom<y1))}else if(options.tolerance=='fit'){hit=(selectee.left>x1&&selectee.right<x2&&selectee.top>y1&&selectee.bottom<y2)}if(hit){if(selectee.selected){selectee.$element.removeClass('ui-selected');selectee.selected=false}if(selectee.unselecting){selectee.$element.removeClass('ui-unselecting');selectee.unselecting=false}if(!selectee.selecting){selectee.$element.addClass('ui-selecting');selectee.selecting=true;self.element.triggerHandler("selectableselecting",[e,{selectable:self.element[0],selecting:selectee.element,options:options}],options.selecting)}}else{if(selectee.selecting){if(e.metaKey&&selectee.startselected){selectee.$element.removeClass('ui-selecting');selectee.selecting=false;selectee.$element.addClass('ui-selected');selectee.selected=true}else{selectee.$element.removeClass('ui-selecting');selectee.selecting=false;if(selectee.startselected){selectee.$element.addClass('ui-unselecting');selectee.unselecting=true}self.element.triggerHandler("selectableunselecting",[e,{selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting)}}if(selectee.selected){if(!e.metaKey&&!selectee.startselected){selectee.$element.removeClass('ui-selected');selectee.selected=false;selectee.$element.addClass('ui-unselecting');selectee.unselecting=true;self.element.triggerHandler("selectableunselecting",[e,{selectable:self.element[0],unselecting:selectee.element,options:options}],options.unselecting)}}}});return false},_mouseStop:function(e){var self=this;this.dragged=false;var options=this.options;$('.ui-unselecting',this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass('ui-unselecting');selectee.unselecting=false;selectee.startselected=false;self.element.triggerHandler("selectableunselected",[e,{selectable:self.element[0],unselected:selectee.element,options:options}],options.unselected)});$('.ui-selecting',this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass('ui-selecting').addClass('ui-selected');selectee.selecting=false;selectee.selected=true;selectee.startselected=true;self.element.triggerHandler("selectableselected",[e,{selectable:self.element[0],selected:selectee.element,options:options}],options.selected)});this.element.triggerHandler("selectablestop",[e,{selectable:self.element[0],options:this.options}],this.options.stop);this.helper.remove();return false}}));$.extend($.ui.selectable,{defaults:{distance:1,delay:0,cancel:":input",appendTo:'body',autoRefresh:true,filter:'*',tolerance:'touch'}})})(jQuery);(function($){function contains(a,b){var safari2=$.browser.safari&&$.browser.version<522;if(a.contains&&!safari2){return a.contains(b)}if(a.compareDocumentPosition)return!!(a.compareDocumentPosition(b)&16);while(b=b.parentNode)if(b==a)return true;return false};$.widget("ui.sortable",$.extend({},$.ui.mouse,{_init:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css('float')):false;this.offset=this.element.offset();this._mouseInit()},plugins:{},ui:function(inst){return{helper:(inst||this)["helper"],placeholder:(inst||this)["placeholder"]||$([]),position:(inst||this)["position"],absolutePosition:(inst||this)["positionAbs"],options:this.options,element:this.element,item:(inst||this)["currentItem"],sender:inst?inst.element:null}},_propagate:function(n,e,inst,noPropagation){$.ui.plugin.call(this,n,[e,this.ui(inst)]);if(!noPropagation)this.element.triggerHandler(n=="sort"?n:"sort"+n,[e,this.ui(inst)],this.options[n])},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var str=[];o=o||{};$(items).each(function(){var res=($(this.item||this).attr(o.attribute||'id')||'').match(o.expression||(/(.+)[-=_](.+)/));if(res)str.push((o.key||res[1]+'[]')+'='+(o.key&&o.expression?res[1]:res[2]))});return str.join('&')},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected);var ret=[];items.each(function(){ret.push($(this).attr(o.attr||'id'))});return ret},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var l=item.left,r=l+item.width,t=item.top,b=t+item.height;var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var isOverElement=(y1+dyClick)>t&&(y1+dyClick)<b&&(x1+dxClick)>l&&(x1+dxClick)<r;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance=="guess"&&this.helperProportions[this.floating?'width':'height']>item[this.floating?'width':'height'])){return isOverElement}else{return(l<x1+(this.helperProportions.width/2) &&x2-(this.helperProportions.width/2)<r &&t<y1+(this.helperProportions.height/2) &&y2-(this.helperProportions.height/2)<b); }},_intersectsWithEdge:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height;var l=item.left,r=l+item.width,t=item.top,b=t+item.height;var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var isOverElement=(y1+dyClick)>t&&(y1+dyClick)<b&&(x1+dxClick)>l&&(x1+dxClick)<r;if(this.options.tolerance=="pointer"||(this.options.tolerance=="guess"&&this.helperProportions[this.floating?'width':'height']>item[this.floating?'width':'height'])){if(!isOverElement)return false;if(this.floating){if((x1+dxClick)>l&&(x1+dxClick)<l+item.width/2)return 2;if((x1+dxClick)>l+item.width/2&&(x1+dxClick)<r)return 1}else{var height=item.height;var direction=y1-this.updateOriginalPosition.top<0?2:1;if(direction==1&&(y1+dyClick)<t+height/2){return 2}else if(direction==2&&(y1+dyClick)>t+height/2){return 1}}}else{if(!(l<x1+(this.helperProportions.width/2) &&x2-(this.helperProportions.width/2)<r &&t<y1+(this.helperProportions.height/2) &&y2-(this.helperProportions.height/2)<b))return false; if(this.floating){if(x2>l&&x1<l)return 2;if(x1<r&&x2>r)return 1}else{if(y2>t&&y1<t)return 1;if(y1<b&&y2>b)return 2}}return false},refresh:function(){this._refreshItems();this.refreshPositions()},_getItemsAsjQuery:function(connected){var self=this;var items=[];var queries=[];if(this.options.connectWith&&connected){for(var i=this.options.connectWith.length-1;i>=0;i--){var cur=$(this.options.connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper"),inst])}}}}queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var i=queries.length-1;i>=0;i--){queries[i][0].each(function(){items.push(this)})};return $(items)},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data(sortable-item)");for(var i=0;i<this.items.length;i++){for(var j=0;j<list.length;j++){if(list[j]==this.items[i].item[0])this.items.splice(i,1)}}},_refreshItems:function(){this.items=[];this.containers=[this];var items=this.items;var self=this;var queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element),this]];if(this.options.connectWith){for(var i=this.options.connectWith.length-1;i>=0;i--){var cur=$(this.options.connectWith[i]);for(var j=cur.length-1;j>=0;j--){var inst=$.data(cur[j],'sortable');if(inst&&inst!=this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element),inst]);this.containers.push(inst)}}}}for(var i=queries.length-1;i>=0;i--){queries[i][0].each(function(){$.data(this,'sortable-item',queries[i][1]);items.push({item:$(this),instance:queries[i][1],width:0,height:0,left:0,top:0})})}},refreshPositions:function(fast){if(this.offsetParent){var po=this.offsetParent.offset();this.offset.parent={top:po.top+this.offsetParentBorders.top,left:po.left+this.offsetParentBorders.left}}for(var i=this.items.length-1;i>=0;i--){if(this.items[i].instance!=this.currentContainer&&this.currentContainer&&this.items[i].item[0]!=this.currentItem[0])continue;var t=this.options.toleranceElement?$(this.options.toleranceElement,this.items[i].item):this.items[i].item;if(!fast){this.items[i].width=t[0].offsetWidth;this.items[i].height=t[0].offsetHeight}var p=t.offset();this.items[i].left=p.left;this.items[i].top=p.top};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var i=this.containers.length-1;i>=0;i--){var p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}}},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--)this.items[i].item.removeData("sortable-item")},_createPlaceholder:function(that){var self=that||this,o=self.options;if(!o.placeholder||o.placeholder.constructor==String){var className=o.placeholder;o.placeholder={element:function(){var el=$(document.createElement(self.currentItem[0].nodeName)).addClass(className||"ui-sortable-placeholder")[0];if(!className){el.style.visibility="hidden";document.body.appendChild(el);el.innerHTML=self.currentItem[0].innerHTML;document.body.removeChild(el)};return el},update:function(container,p){if(className&&!o.forcePlaceholderSize)return;if(!p.height()){p.height(self.currentItem.innerHeight()-parseInt(self.currentItem.css('paddingTop')||0,10)-parseInt(self.currentItem.css('paddingBottom')||0,10))};if(!p.width()){p.width(self.currentItem.innerWidth()-parseInt(self.currentItem.css('paddingLeft')||0,10)-parseInt(self.currentItem.css('paddingRight')||0,10))}}}}self.placeholder=$(o.placeholder.element.call(self.element,self.currentItem));self.currentItem.parent()[0].appendChild(self.placeholder[0]);self.placeholder[0].parentNode.insertBefore(self.placeholder[0],self.currentItem[0]);o.placeholder.update(self,self.placeholder)},_contactContainers:function(e){for(var i=this.containers.length-1;i>=0;i--){if(this._intersectsWith(this.containers[i].containerCache)){if(!this.containers[i].containerCache.over){if(this.currentContainer!=this.containers[i]){var dist=10000;var itemWithLeastDistance=null;var base=this.positionAbs[this.containers[i].floating?'left':'top'];for(var j=this.items.length-1;j>=0;j--){if(!contains(this.containers[i].element[0],this.items[j].item[0]))continue;var cur=this.items[j][this.containers[i].floating?'left':'top'];if(Math.abs(cur-base)<dist){dist=Math.abs(cur-base);itemWithLeastDistance=this.items[j]}}if(!itemWithLeastDistance&&!this.options.dropOnEmpty)continue;this.currentContainer=this.containers[i];itemWithLeastDistance?this.options.sortIndicator.call(this,e,itemWithLeastDistance,null,true):this.options.sortIndicator.call(this,e,null,this.containers[i].element,true);this._propagate("change",e);this.containers[i]._propagate("change",e,this);this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[i]._propagate("over",e,this);this.containers[i].containerCache.over=1}}else{if(this.containers[i].containerCache.over){this.containers[i]._propagate("out",e,this);this.containers[i].containerCache.over=0}}}},_mouseCapture:function(e,overrideHandle){if(this.options.disabled||this.options.type=='static')return false;this._refreshItems();var currentItem=null,self=this,nodes=$(e.target).parents().each(function(){if($.data(this,'sortable-item')==self){currentItem=$(this);return false}});if($.data(e.target,'sortable-item')==self)currentItem=$(e.target);if(!currentItem)return false;if(this.options.handle&&!overrideHandle){var validHandle=false;$(this.options.handle,currentItem).find("*").andSelf().each(function(){if(this==e.target)validHandle=true});if(!validHandle)return false}this.currentItem=currentItem;this._removeCurrentsFromItems();return true},createHelper:function(e){var o=this.options;var helper=typeof o.helper=='function'?$(o.helper.apply(this.element[0],[e,this.currentItem])):(o.helper=="original"?this.currentItem:this.currentItem.clone());if(!helper.parents('body').length)$(o.appendTo!='parent'?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);return helper},_mouseStart:function(e,overrideHandle,noActivation){var o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this.createHelper(e);this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();this.offsetParentBorders={top:(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};this.offset.parent={top:po.top+this.offsetParentBorders.top,left:po.left+this.offsetParentBorders.left};this.updateOriginalPosition=this.originalPosition=this._generatePosition(e);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(o.helper=="original"){this._storedCSS={position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left"),clear:this.currentItem.css("clear")}}else{this.currentItem.hide()}this.helper.css({position:'absolute',clear:'both'}).addClass('ui-sortable-helper');this._createPlaceholder();this._propagate("start",e);if(!this._preserveHelperProportions)this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(o.cursorAt){if(o.cursorAt.left!=undefined)this.offset.click.left=o.cursorAt.left;if(o.cursorAt.right!=undefined)this.offset.click.left=this.helperProportions.width-o.cursorAt.right;if(o.cursorAt.top!=undefined)this.offset.click.top=o.cursorAt.top;if(o.cursorAt.bottom!=undefined)this.offset.click.top=this.helperProportions.height-o.cursorAt.bottom}if(o.containment){if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.parent.left,0-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];if(!(/^(document|window|parent)$/).test(o.containment)){var ce=$(o.containment)[0];var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.parent.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.parent.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.currentItem.css("marginRight"),10)||0),co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.currentItem.css("marginBottom"),10)||0)]}}if(!noActivation){for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._propagate("activate",e,this)}}if($.ui.ddmanager)$.ui.ddmanager.current=this;if($.ui.ddmanager&&!o.dropBehaviour)$.ui.ddmanager.prepareOffsets(this,e);this.dragging=true;this._mouseDrag(e);return true},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;return{top:(pos.top+this.offset.parent.top*mod-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)*mod+this.margins.top*mod),left:(pos.left+this.offset.parent.left*mod-(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)*mod+this.margins.left*mod)}},_generatePosition:function(e){var o=this.options;var position={top:(e.pageY-this.offset.click.top-this.offset.parent.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)),left:(e.pageX-this.offset.click.left-this.offset.parent.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft))};if(!this.originalPosition)return position;if(this.containment){if(position.left<this.containment[0])position.left=this.containment[0];if(position.top<this.containment[1])position.top=this.containment[1];if(position.left>this.containment[2])position.left=this.containment[2];if(position.top>this.containment[3])position.top=this.containment[3]}if(o.grid){var top=this.originalPosition.top+Math.round((position.top-this.originalPosition.top)/o.grid[1])*o.grid[1];position.top=this.containment?(!(top<this.containment[1]||top>this.containment[3])?top:(!(top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPosition.left+Math.round((position.left-this.originalPosition.left)/o.grid[0])*o.grid[0];position.left=this.containment?(!(left<this.containment[0]||left>this.containment[2])?left:(!(left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left}return position},_mouseDrag:function(e){this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");$.ui.plugin.call(this,"sort",[e,this.ui()]);this.positionAbs=this._convertPositionTo("absolute");this.helper[0].style.left=this.position.left+'px';this.helper[0].style.top=this.position.top+'px';for(var i=this.items.length-1;i>=0;i--){var intersection=this._intersectsWithEdge(this.items[i]);if(!intersection)continue;if(this.items[i].item[0]!=this.currentItem[0]&&this.placeholder[intersection==1?"next":"prev"]()[0]!=this.items[i].item[0]&&!contains(this.placeholder[0],this.items[i].item[0])&&(this.options.type=='semi-dynamic'?!contains(this.element[0],this.items[i].item[0]):true)){this.updateOriginalPosition=this._generatePosition(e);this.direction=intersection==1?"down":"up";this.options.sortIndicator.call(this,e,this.items[i]);this._propagate("change",e);break}}this._contactContainers(e);if($.ui.ddmanager)$.ui.ddmanager.drag(this,e);this.element.triggerHandler("sort",[e,this.ui()],this.options["sort"]);return false},_rearrange:function(e,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=='down'?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var self=this,counter=this.counter;window.setTimeout(function(){if(counter==self.counter)self.refreshPositions(!hardRefresh)},0)},_mouseStop:function(e,noPropagation){if($.ui.ddmanager&&!this.options.dropBehaviour)$.ui.ddmanager.drop(this,e);if(this.options.revert){var self=this;var cur=self.placeholder.offset();$(this.helper).animate({left:cur.left-this.offset.parent.left-self.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:cur.top-this.offset.parent.top-self.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){self._clear(e)})}else{this._clear(e,noPropagation)}return false},_clear:function(e,noPropagation){if(!this._noFinalSort)this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.options.helper=="original")this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");else this.currentItem.show();if(this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])this._propagate("update",e,null,noPropagation);if(!contains(this.element[0],this.currentItem[0])){this._propagate("remove",e,null,noPropagation);for(var i=this.containers.length-1;i>=0;i--){if(contains(this.containers[i].element[0],this.currentItem[0])){this.containers[i]._propagate("update",e,this,noPropagation);this.containers[i]._propagate("receive",e,this,noPropagation)}}};for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._propagate("deactivate",e,this,noPropagation);if(this.containers[i].containerCache.over){this.containers[i]._propagate("out",e,this);this.containers[i].containerCache.over=0}}this.dragging=false;if(this.cancelHelperRemoval){this._propagate("beforeStop",e,null,noPropagation);this._propagate("stop",e,null,noPropagation);return false}this._propagate("beforeStop",e,null,noPropagation);this.placeholder.remove();if(this.options.helper!="original")this.helper.remove();this.helper=null;this._propagate("stop",e,null,noPropagation);return true}}));$.extend($.ui.sortable,{getter:"serialize toArray",defaults:{helper:"original",tolerance:"guess",distance:1,delay:0,scroll:true,scrollSensitivity:20,scrollSpeed:20,cancel:":input",items:'> *',zIndex:1000,dropOnEmpty:true,appendTo:"parent",sortIndicator:$.ui.sortable.prototype._rearrange,scope:"default",forcePlaceholderSize:false}});$.ui.plugin.add("sortable","cursor",{start:function(e,ui){var t=$('body');if(t.css("cursor"))ui.options._cursor=t.css("cursor");t.css("cursor",ui.options.cursor)},beforeStop:function(e,ui){if(ui.options._cursor)$('body').css("cursor",ui.options._cursor)}});$.ui.plugin.add("sortable","zIndex",{start:function(e,ui){var t=ui.helper;if(t.css("zIndex"))ui.options._zIndex=t.css("zIndex");t.css('zIndex',ui.options.zIndex)},beforeStop:function(e,ui){if(ui.options._zIndex)$(ui.helper).css('zIndex',ui.options._zIndex)}});$.ui.plugin.add("sortable","opacity",{start:function(e,ui){var t=ui.helper;if(t.css("opacity"))ui.options._opacity=t.css("opacity");t.css('opacity',ui.options.opacity)},beforeStop:function(e,ui){if(ui.options._opacity)$(ui.helper).css('opacity',ui.options._opacity)}});$.ui.plugin.add("sortable","scroll",{start:function(e,ui){var o=ui.options;var i=$(this).data("sortable");i.overflowY=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-y')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(i.currentItem);i.overflowX=function(el){do{if(/auto|scroll/.test(el.css('overflow'))||(/auto|scroll/).test(el.css('overflow-x')))return el;el=el.parent()}while(el[0].parentNode);return $(document)}(i.currentItem);if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML')i.overflowYOffset=i.overflowY.offset();if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML')i.overflowXOffset=i.overflowX.offset()},sort:function(e,ui){var o=ui.options;var i=$(this).data("sortable");if(i.overflowY[0]!=document&&i.overflowY[0].tagName!='HTML'){if((i.overflowYOffset.top+i.overflowY[0].offsetHeight)-e.pageY<o.scrollSensitivity)i.overflowY[0].scrollTop=i.overflowY[0].scrollTop+o.scrollSpeed;if(e.pageY-i.overflowYOffset.top<o.scrollSensitivity)i.overflowY[0].scrollTop=i.overflowY[0].scrollTop-o.scrollSpeed}else{if(e.pageY-$(document).scrollTop()<o.scrollSensitivity)$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);if($(window).height()-(e.pageY-$(document).scrollTop())<o.scrollSensitivity)$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)}if(i.overflowX[0]!=document&&i.overflowX[0].tagName!='HTML'){if((i.overflowXOffset.left+i.overflowX[0].offsetWidth)-e.pageX<o.scrollSensitivity)i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft+o.scrollSpeed;if(e.pageX-i.overflowXOffset.left<o.scrollSensitivity)i.overflowX[0].scrollLeft=i.overflowX[0].scrollLeft-o.scrollSpeed}else{if(e.pageX-$(document).scrollLeft()<o.scrollSensitivity)$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);if($(window).width()-(e.pageX-$(document).scrollLeft())<o.scrollSensitivity)$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}}});$.ui.plugin.add("sortable","axis",{sort:function(e,ui){var i=$(this).data("sortable");if(ui.options.axis=="y")i.position.left=i.originalPosition.left;if(ui.options.axis=="x")i.position.top=i.originalPosition.top}})})(jQuery);(function($){$.widget("ui.accordion",{_init:function(){var options=this.options;if(options.navigation){var current=this.element.find("a").filter(options.navigationFilter);if(current.length){if(current.filter(options.header).length){options.active=current}else{options.active=current.parent().parent().prev();current.addClass("current")}}}options.headers=this.element.find(options.header);options.active=findActive(options.headers,options.active);if($.browser.msie){this.element.find('a').css('zoom','1')}if(!this.element.hasClass("ui-accordion")){this.element.addClass("ui-accordion");$('<span class="ui-accordion-left"/>').insertBefore(options.headers);$('<span class="ui-accordion-right"/>').appendTo(options.headers);options.headers.addClass("ui-accordion-header").attr("tabindex","0")}var maxHeight;if(options.fillSpace){maxHeight=this.element.parent().height();options.headers.each(function(){maxHeight-=$(this).outerHeight()});var maxPadding=0;options.headers.next().each(function(){maxPadding=Math.max(maxPadding,$(this).innerHeight()-$(this).height())}).height(maxHeight-maxPadding)}else if(options.autoHeight){maxHeight=0;options.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight())}).height(maxHeight)}options.headers.not(options.active||"").next().hide();options.active.parent().andSelf().addClass(options.selectedClass);if(options.event){this.element.bind((options.event)+".accordion",clickHandler)}},activate:function(index){clickHandler.call(this.element[0],{target:findActive(this.options.headers,index)[0]})},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","")}$.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion")}});function scopeCallback(callback,scope){return function(){return callback.apply(scope,arguments)}};function completed(cancel){if(!$.data(this,"accordion")){return}var instance=$.data(this,"accordion");var options=instance.options;options.running=cancel?0:--options.running;if(options.running){return}if(options.clearStyle){options.toShow.add(options.toHide).css({height:"",overflow:""})}instance._trigger('change',null,options.data)}function toggle(toShow,toHide,data,clickedActive,down){var options=$.data(this,"accordion").options;options.toShow=toShow;options.toHide=toHide;options.data=data;var complete=scopeCallback(completed,this);$.data(this,"accordion")._trigger("changestart",null,options.data);options.running=toHide.size()===0?toShow.size():toHide.size();if(options.animated){if(!options.alwaysOpen&&clickedActive){$.ui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight})}else{$.ui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight})}}else{if(!options.alwaysOpen&&clickedActive){toShow.toggle()}else{toHide.hide();toShow.show()}complete(true)}}function clickHandler(event){var options=$.data(this,"accordion").options;if(options.disabled){return false}if(!event.target&&!options.alwaysOpen){options.active.parent().andSelf().toggleClass(options.selectedClass);var toHide=options.active.next(),data={options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=(options.active=$([]));toggle.call(this,toShow,toHide,data);return false}var clicked=$(event.target);clicked=$(clicked.parents(options.header)[0]||clicked);var clickedActive=clicked[0]==options.active[0];if(options.running||(options.alwaysOpen&&clickedActive)){return false}if(!clicked.is(options.header)){return}options.active.parent().andSelf().toggleClass(options.selectedClass);if(!clickedActive){clicked.parent().andSelf().addClass(options.selectedClass)}var toShow=clicked.next(),toHide=options.active.next(),data={options:options,newHeader:clickedActive&&!options.alwaysOpen?$([]):clicked,oldHeader:options.active,newContent:clickedActive&&!options.alwaysOpen?$([]):toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);options.active=clickedActive?$([]):clicked;toggle.call(this,toShow,toHide,data,clickedActive,down);return false};function findActive(headers,selector){return selector?typeof selector=="number"?headers.filter(":eq("+selector+")"):headers.not(headers.not(selector)):selector===false?$([]):headers.filter(":eq(0)")}$.extend($.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:'slide',event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return}var hideHeight=options.toHide.height(),showHeight=options.toShow.height(),difference=showHeight/hideHeight;options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(now){var current=(hideHeight-now)*difference;if($.browser.msie||$.browser.opera){current=Math.ceil(current)}options.toShow.height(current)},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","auto")}options.complete()}})},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?1000:200})},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:700})}}})})(jQuery);(function($){var setDataSwitch={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};$.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr('title');this.options.title=this.options.title||this.originalTitle;var self=this,options=this.options,uiDialogContent=this.element.removeAttr('title').addClass('ui-dialog-content').wrap('<div/>').wrap('<div/>'),uiDialogContainer=(this.uiDialogContainer=uiDialogContent.parent()).addClass('ui-dialog-container').css({position:'relative',width:'100%',height:'100%'}),uiDialogTitlebar=(this.uiDialogTitlebar=$('<div/>')).addClass('ui-dialog-titlebar').append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>').prependTo(uiDialogContainer),title=options.title||'&nbsp;',titleId=$.ui.dialog.getTitleId(this.element),uiDialogTitle=$('<span/>').addClass('ui-dialog-title').attr('id',titleId).html(title).prependTo(uiDialogTitlebar),uiDialog=(this.uiDialog=uiDialogContainer.parent()).appendTo(document.body).hide().addClass('ui-dialog').addClass(options.dialogClass).addClass(uiDialogContent.attr('className')).removeClass('ui-dialog-content').css({position:'absolute',width:options.width,height:options.height,overflow:'hidden',zIndex:options.zIndex}).attr('tabIndex',-1).css('outline',0).keydown(function(ev){(options.closeOnEscape&&ev.keyCode&&ev.keyCode==$.keyCode.ESCAPE&&self.close())}).mousedown(function(){self._moveToTop()}),uiDialogButtonPane=(this.uiDialogButtonPane=$('<div/>')).addClass('ui-dialog-buttonpane').css({position:'absolute',bottom:0}).appendTo(uiDialog);this.uiDialogTitlebarClose=$('.ui-dialog-titlebar-close',uiDialogTitlebar).hover(function(){$(this).addClass('ui-dialog-titlebar-close-hover')},function(){$(this).removeClass('ui-dialog-titlebar-close-hover')}).mousedown(function(ev){ev.stopPropagation()}).click(function(){self.close();return false});uiDialogTitlebar.find("*").add(uiDialogTitlebar).each(function(){$.ui.disableSelection(this)});(options.draggable&&$.fn.draggable&&this._makeDraggable());(options.resizable&&$.fn.resizable&&this._makeResizable());this._createButtons(options.buttons);this._isOpen=false;(options.bgiframe&&$.fn.bgiframe&&uiDialog.bgiframe());(options.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind('.dialog').removeData('dialog').removeClass('ui-dialog-content').hide().appendTo('body');this.uiDialog.remove();(this.originalTitle&&this.element.attr('title',this.originalTitle))},close:function(){if(false===this._trigger('beforeclose',null,{options:this.options})){return}(this.overlay&&this.overlay.destroy());this.uiDialog.hide(this.options.hide).unbind('keypress.ui-dialog');this._trigger('close',null,{options:this.options});$.ui.dialog.overlay.resize();this._isOpen=false},isOpen:function(){return this._isOpen},open:function(){if(this._isOpen){return}this.overlay=this.options.modal?new $.ui.dialog.overlay(this):null;(this.uiDialog.next().length&&this.uiDialog.appendTo('body'));this._position(this.options.position);this.uiDialog.show(this.options.show);(this.options.autoResize&&this._size());this._moveToTop(true);(this.options.modal&&this.uiDialog.bind('keypress.ui-dialog',function(e){if(e.keyCode!=$.keyCode.TAB){return}var tabbables=$(':tabbable',this),first=tabbables.filter(':first')[0],last=tabbables.filter(':last')[0];if(e.target==last&&!e.shiftKey){setTimeout(function(){first.focus()},1)}else if(e.target==first&&e.shiftKey){setTimeout(function(){last.focus()},1)}}));this.uiDialog.find(':tabbable:first').focus();this._trigger('open',null,{options:this.options});this._isOpen=true},_createButtons:function(buttons){var self=this,hasButtons=false,uiDialogButtonPane=this.uiDialogButtonPane;uiDialogButtonPane.empty().hide();$.each(buttons,function(){return!(hasButtons=true)});if(hasButtons){uiDialogButtonPane.show();$.each(buttons,function(name,fn){$('<button type="button"></button>').text(name).click(function(){fn.apply(self.element[0],arguments)}).appendTo(uiDialogButtonPane)})}},_makeDraggable:function(){var self=this,options=this.options;this.uiDialog.draggable({cancel:'.ui-dialog-content',helper:options.dragHelper,handle:'.ui-dialog-titlebar',start:function(){self._moveToTop();(options.dragStart&&options.dragStart.apply(self.element[0],arguments))},drag:function(){(options.drag&&options.drag.apply(self.element[0],arguments))},stop:function(){(options.dragStop&&options.dragStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize()}})},_makeResizable:function(handles){handles=(handles===undefined?this.options.resizable:handles);var self=this,options=this.options,resizeHandles=typeof handles=='string'?handles:'n,e,s,w,se,sw,ne,nw';this.uiDialog.resizable({cancel:'.ui-dialog-content',helper:options.resizeHelper,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:options.minHeight,start:function(){(options.resizeStart&&options.resizeStart.apply(self.element[0],arguments))},resize:function(){(options.autoResize&&self._size.apply(self));(options.resize&&options.resize.apply(self.element[0],arguments))},handles:resizeHandles,stop:function(){(options.autoResize&&self._size.apply(self));(options.resizeStop&&options.resizeStop.apply(self.element[0],arguments));$.ui.dialog.overlay.resize()}})},_moveToTop:function(force){if((this.options.modal&&!force)||(!this.options.stack&&!this.options.modal)){return this._trigger('focus',null,{options:this.options})}var maxZ=this.options.zIndex,options=this.options;$('.ui-dialog:visible').each(function(){maxZ=Math.max(maxZ,parseInt($(this).css('z-index'),10)||options.zIndex)});(this.overlay&&this.overlay.$el.css('z-index',++maxZ));this.uiDialog.css('z-index',++maxZ);this._trigger('focus',null,{options:this.options})},_position:function(pos){var wnd=$(window),doc=$(document),pTop=doc.scrollTop(),pLeft=doc.scrollLeft(),minTop=pTop;if($.inArray(pos,['center','top','right','bottom','left'])>=0){pos=[pos=='right'||pos=='left'?pos:'center',pos=='top'||pos=='bottom'?pos:'middle']}if(pos.constructor!=Array){pos=['center','middle']}if(pos[0].constructor==Number){pLeft+=pos[0]}else{switch(pos[0]){case'left':pLeft+=0;break;case'right':pLeft+=wnd.width()-this.uiDialog.width();break;default:case'center':pLeft+=(wnd.width()-this.uiDialog.width())/2}}if(pos[1].constructor==Number){pTop+=pos[1]}else{switch(pos[1]){case'top':pTop+=0;break;case'bottom':pTop+=wnd.height()-this.uiDialog.height();break;default:case'middle':pTop+=(wnd.height()-this.uiDialog.height())/2}}pTop=Math.max(pTop,minTop);this.uiDialog.css({top:pTop,left:pLeft})},_setData:function(key,value){(setDataSwitch[key]&&this.uiDialog.data(setDataSwitch[key],value));switch(key){case"buttons":this._createButtons(value);break;case"draggable":(value?this._makeDraggable():this.uiDialog.draggable('destroy'));break;case"height":this.uiDialog.height(value);break;case"position":this._position(value);break;case"resizable":var uiDialog=this.uiDialog,isResizable=this.uiDialog.is(':data(resizable)');(isResizable&&!value&&uiDialog.resizable('destroy'));(isResizable&&typeof value=='string'&&uiDialog.resizable('option','handles',value));(isResizable||this._makeResizable(value));break;case"title":$(".ui-dialog-title",this.uiDialogTitlebar).html(value||'&nbsp;');break;case"width":this.uiDialog.width(value);break}$.widget.prototype._setData.apply(this,arguments)},_size:function(){var container=this.uiDialogContainer,titlebar=this.uiDialogTitlebar,content=this.element,tbMargin=(parseInt(content.css('margin-top'),10)||0)+(parseInt(content.css('margin-bottom'),10)||0),lrMargin=(parseInt(content.css('margin-left'),10)||0)+(parseInt(content.css('margin-right'),10)||0);content.height(container.height()-titlebar.outerHeight()-tbMargin);content.width(container.width()-lrMargin)}});$.extend($.ui.dialog,{defaults:{autoOpen:true,autoResize:true,bgiframe:false,buttons:{},closeOnEscape:true,draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:'center',resizable:true,stack:true,width:300,zIndex:1000},getter:'isOpen',uuid:0,getTitleId:function($el){return'ui-dialog-title-'+($el.attr('id')||++this.uuid)},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog)}});$.extend($.ui.dialog.overlay,{instances:[],events:$.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),function(e){return e+'.dialog-overlay'}).join(' '),create:function(dialog){if(this.instances.length===0){setTimeout(function(){$('a, :input').bind($.ui.dialog.overlay.events,function(){var allow=false;var $dialog=$(this).parents('.ui-dialog');if($dialog.length){var $overlays=$('.ui-dialog-overlay');if($overlays.length){var maxZ=parseInt($overlays.css('z-index'),10);$overlays.each(function(){maxZ=Math.max(maxZ,parseInt($(this).css('z-index'),10))});allow=parseInt($dialog.css('z-index'),10)>maxZ}else{allow=true}}return allow})},1);$(document).bind('keydown.dialog-overlay',function(e){(dialog.options.closeOnEscape&&e.keyCode&&e.keyCode==$.keyCode.ESCAPE&&dialog.close())});$(window).bind('resize.dialog-overlay',$.ui.dialog.overlay.resize)}var $el=$('<div/>').appendTo(document.body).addClass('ui-dialog-overlay').css($.extend({borderWidth:0,margin:0,padding:0,position:'absolute',top:0,left:0,width:this.width(),height:this.height()},dialog.options.overlay));(dialog.options.bgiframe&&$.fn.bgiframe&&$el.bgiframe());this.instances.push($el);return $el},destroy:function($el){this.instances.splice($.inArray(this.instances,$el),1);if(this.instances.length===0){$('a, :input').add([document,window]).unbind('.dialog-overlay')}$el.remove()},height:function(){if($.browser.msie&&$.browser.version<7){var scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight<offsetHeight){return $(window).height()+'px'}else{return scrollHeight+'px'}}else if($.browser.opera){return Math.max(window.innerHeight,$(document).height())+'px'}else{return $(document).height()+'px'}},width:function(){if($.browser.msie&&$.browser.version<7){var scrollWidth=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var offsetWidth=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(scrollWidth<offsetWidth){return $(window).width()+'px'}else{return scrollWidth+'px'}}else if($.browser.opera){return Math.max(window.innerWidth,$(document).width())+'px'}else{return $(document).width()+'px'}},resize:function(){var $overlays=$([]);$.each($.ui.dialog.overlay.instances,function(){$overlays=$overlays.add(this)});$overlays.css({width:0,height:0}).css({width:$.ui.dialog.overlay.width(),height:$.ui.dialog.overlay.height()})}});$.extend($.ui.dialog.overlay.prototype,{destroy:function(){$.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function($){$.fn.unwrap=$.fn.unwrap||function(expr){return this.each(function(){$(this).parents(expr).eq(0).after(this).remove()})};$.widget("ui.slider",{plugins:{},ui:function(e){return{options:this.options,handle:this.currentHandle,value:this.options.axis!="both"||!this.options.axis?Math.round(this.value(null,this.options.axis=="vertical"?"y":"x")):{x:Math.round(this.value(null,"x")),y:Math.round(this.value(null,"y"))},range:this._getRange()}},_propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n=="slide"?n:"slide"+n,[e,this.ui()],this.options[n])},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider");if(this.handle&&this.handle.length){this.handle.unwrap("a");this.handle.each(function(){$(this).data("mouse")._mouseDestroy()})}this.generated&&this.generated.remove()},_setData:function(key,value){$.widget.prototype._setData.apply(this,arguments);if(/min|max|steps/.test(key)){this._initBoundaries()}if(key=="range"){value?this.handle.length==2&&this._createRange():this._removeRange()}},_init:function(){var self=this;this.element.addClass("ui-slider");this._initBoundaries();this.handle=$(this.options.handle,this.element);if(!this.handle.length){self.handle=self.generated=$(self.options.handles||[0]).map(function(){var handle=$("<div/>").addClass("ui-slider-handle").appendTo(self.element);if(this.id)handle.attr("id",this.id);return handle[0]})}var handleclass=function(el){this.element=$(el);this.element.data("mouse",this);this.options=self.options;this.element.bind("mousedown",function(){if(self.currentHandle)this.blur(self.currentHandle);self._focus(this,true)});this._mouseInit()};$.extend(handleclass.prototype,$.ui.mouse,{_mouseStart:function(e){return self._start.call(self,e,this.element[0])},_mouseStop:function(e){return self._stop.call(self,e,this.element[0])},_mouseDrag:function(e){return self._drag.call(self,e,this.element[0])},_mouseCapture:function(){return true},trigger:function(e){this._mouseDown(e)}});$(this.handle).each(function(){new handleclass(this)}).wrap('<a href="#" style="outline:none;border:none;"></a>').parent().bind('click',function(){return false}).bind('focus',function(e){self._focus(this.firstChild)}).bind('blur',function(e){self._blur(this.firstChild)}).bind('keydown',function(e){if(!self.options.noKeyboard)return self._keydown(e.keyCode,this.firstChild)});this.element.bind('mousedown.slider',function(e){self._click.apply(self,[e]);self.currentHandle.data("mouse").trigger(e);self.firstValue=self.firstValue+1});$.each(this.options.handles||[],function(index,handle){self.moveTo(handle.start,index,true)});if(!isNaN(this.options.startValue))this.moveTo(this.options.startValue,0,true);this.previousHandle=$(this.handle[0]);if(this.handle.length==2&&this.options.range)this._createRange()},_initBoundaries:function(){var element=this.element[0],o=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};$.extend(o,{axis:o.axis||(element.offsetWidth<element.offsetHeight?'vertical':'horizontal'),max:!isNaN(parseInt(o.max,10))?{x:parseInt(o.max,10),y:parseInt(o.max,10)}:({x:o.max&&o.max.x||100,y:o.max&&o.max.y||100}),min:!isNaN(parseInt(o.min,10))?{x:parseInt(o.min,10),y:parseInt(o.min,10)}:({x:o.min&&o.min.x||0,y:o.min&&o.min.y||0})});o.realMax={x:o.max.x-o.min.x,y:o.max.y-o.min.y};o.stepping={x:o.stepping&&o.stepping.x||parseInt(o.stepping,10)||(o.steps?o.realMax.x/(o.steps.x||parseInt(o.steps,10)||o.realMax.x):0),y:o.stepping&&o.stepping.y||parseInt(o.stepping,10)||(o.steps?o.realMax.y/(o.steps.y||parseInt(o.steps,10)||o.realMax.y):0)}},_keydown:function(keyCode,handle){var k=keyCode;if(/(33|34|35|36|37|38|39|40)/.test(k)){var o=this.options,xpos,ypos;if(/(35|36)/.test(k)){xpos=(k==35)?o.max.x:o.min.x;ypos=(k==35)?o.max.y:o.min.y}else{var oper=/(34|37|40)/.test(k)?"-=":"+=";var step=/(37|38|39|40)/.test(k)?"_oneStep":"_pageStep";xpos=oper+this[step]("x");ypos=oper+this[step]("y")}this.moveTo({x:xpos,y:ypos},handle);return false}return true},_focus:function(handle,hard){this.currentHandle=$(handle).addClass('ui-slider-handle-active');if(hard)this.currentHandle.parent()[0].focus()},_blur:function(handle){$(handle).removeClass('ui-slider-handle-active');if(this.currentHandle&&this.currentHandle[0]==handle){this.previousHandle=this.currentHandle;this.currentHandle=null}},_click:function(e){var pointer=[e.pageX,e.pageY];var clickedHandle=false;this.handle.each(function(){if(this==e.target)clickedHandle=true});if(clickedHandle||this.options.disabled||!(this.currentHandle||this.previousHandle))return;if(!this.currentHandle&&this.previousHandle)this._focus(this.previousHandle,true);this.offset=this.element.offset();this.moveTo({y:this._convertValue(e.pageY-this.offset.top-this.currentHandle[0].offsetHeight/2,"y"),x:this._convertValue(e.pageX-this.offset.left-this.currentHandle[0].offsetWidth/2,"x")},null,!this.options.distance)},_createRange:function(){if(this.rangeElement)return;this.rangeElement=$('<div></div>').addClass('ui-slider-range').css({position:'absolute'}).appendTo(this.element);this._updateRange()},_removeRange:function(){this.rangeElement.remove();this.rangeElement=null},_updateRange:function(){var prop=this.options.axis=="vertical"?"top":"left";var size=this.options.axis=="vertical"?"height":"width";this.rangeElement.css(prop,(parseInt($(this.handle[0]).css(prop),10)||0)+this._handleSize(0,this.options.axis=="vertical"?"y":"x")/2);this.rangeElement.css(size,(parseInt($(this.handle[1]).css(prop),10)||0)-(parseInt($(this.handle[0]).css(prop),10)||0))},_getRange:function(){return this.rangeElement?this._convertValue(parseInt(this.rangeElement.css(this.options.axis=="vertical"?"height":"width"),10),this.options.axis=="vertical"?"y":"x"):null},_handleIndex:function(){return this.handle.index(this.currentHandle[0])},value:function(handle,axis){if(this.handle.length==1)this.currentHandle=this.handle;if(!axis)axis=this.options.axis=="vertical"?"y":"x";var curHandle=$(handle!=undefined&&handle!==null?this.handle[handle]||handle:this.currentHandle);if(curHandle.data("mouse").sliderValue){return parseInt(curHandle.data("mouse").sliderValue[axis],10)}else{return parseInt(((parseInt(curHandle.css(axis=="x"?"left":"top"),10)/(this.actualSize[axis=="x"?"width":"height"]-this._handleSize(handle,axis)))*this.options.realMax[axis])+this.options.min[axis],10)}},_convertValue:function(value,axis){return this.options.min[axis]+(value/(this.actualSize[axis=="x"?"width":"height"]-this._handleSize(null,axis)))*this.options.realMax[axis]},_translateValue:function(value,axis){return((value-this.options.min[axis])/this.options.realMax[axis])*(this.actualSize[axis=="x"?"width":"height"]-this._handleSize(null,axis))},_translateRange:function(value,axis){if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&value>=this._translateValue(this.value(1),axis))value=this._translateValue(this.value(1,axis)-this._oneStep(axis),axis);if(this.currentHandle[0]==this.handle[1]&&value<=this._translateValue(this.value(0),axis))value=this._translateValue(this.value(0,axis)+this._oneStep(axis),axis)}if(this.options.handles){var handle=this.options.handles[this._handleIndex()];if(value<this._translateValue(handle.min,axis)){value=this._translateValue(handle.min,axis)}else if(value>this._translateValue(handle.max,axis)){value=this._translateValue(handle.max,axis)}}return value},_translateLimits:function(value,axis){if(value>=this.actualSize[axis=="x"?"width":"height"]-this._handleSize(null,axis))value=this.actualSize[axis=="x"?"width":"height"]-this._handleSize(null,axis);if(value<=0)value=0;return value},_handleSize:function(handle,axis){return $(handle!=undefined&&handle!==null?this.handle[handle]:this.currentHandle)[0]["offset"+(axis=="x"?"Width":"Height")]},_oneStep:function(axis){return this.options.stepping[axis]||1},_pageStep:function(axis){return 10},_start:function(e,handle){var o=this.options;if(o.disabled)return false;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(!this.currentHandle)this._focus(this.previousHandle,true);this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:e.pageY-this.handleOffset.top,left:e.pageX-this.handleOffset.left};this.firstValue=this.value();this._propagate('start',e);this._drag(e,handle);return true},_stop:function(e){this._propagate('stop',e);if(this.firstValue!=this.value())this._propagate('change',e);this._focus(this.currentHandle,true);return false},_drag:function(e,handle){var o=this.options;var position={top:e.pageY-this.offset.top-this.clickOffset.top,left:e.pageX-this.offset.left-this.clickOffset.left};if(!this.currentHandle)this._focus(this.previousHandle,true);position.left=this._translateLimits(position.left,"x");position.top=this._translateLimits(position.top,"y");if(o.stepping.x){var value=this._convertValue(position.left,"x");value=Math.round(value/o.stepping.x)*o.stepping.x;position.left=this._translateValue(value,"x")}if(o.stepping.y){var value=this._convertValue(position.top,"y");value=Math.round(value/o.stepping.y)*o.stepping.y;position.top=this._translateValue(value,"y")}position.left=this._translateRange(position.left,"x");position.top=this._translateRange(position.top,"y");if(o.axis!="vertical")this.currentHandle.css({left:position.left});if(o.axis!="horizontal")this.currentHandle.css({top:position.top});this.currentHandle.data("mouse").sliderValue={x:Math.round(this._convertValue(position.left,"x"))||0,y:Math.round(this._convertValue(position.top,"y"))||0};if(this.rangeElement)this._updateRange();this._propagate('slide',e);return false},moveTo:function(value,handle,noPropagation){var o=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(handle==undefined&&!this.currentHandle&&this.handle.length!=1)return false;if(handle==undefined&&!this.currentHandle)handle=0;if(handle!=undefined)this.currentHandle=this.previousHandle=$(this.handle[handle]||handle);if(value.x!==undefined&&value.y!==undefined){var x=value.x,y=value.y}else{var x=value,y=value}if(x!==undefined&&x.constructor!=Number){var me=/^\-\=/.test(x),pe=/^\+\=/.test(x);if(me||pe){x=this.value(null,"x")+parseInt(x.replace(me?'=':'+=',''),10)}else{x=isNaN(parseInt(x,10))?undefined:parseInt(x,10)}}if(y!==undefined&&y.constructor!=Number){var me=/^\-\=/.test(y),pe=/^\+\=/.test(y);if(me||pe){y=this.value(null,"y")+parseInt(y.replace(me?'=':'+=',''),10)}else{y=isNaN(parseInt(y,10))?undefined:parseInt(y,10)}}if(o.axis!="vertical"&&x!==undefined){if(o.stepping.x)x=Math.round(x/o.stepping.x)*o.stepping.x;x=this._translateValue(x,"x");x=this._translateLimits(x,"x");x=this._translateRange(x,"x");o.animate?this.currentHandle.stop().animate({left:x},(Math.abs(parseInt(this.currentHandle.css("left"))-x))*(!isNaN(parseInt(o.animate))?o.animate:5)):this.currentHandle.css({left:x})}if(o.axis!="horizontal"&&y!==undefined){if(o.stepping.y)y=Math.round(y/o.stepping.y)*o.stepping.y;y=this._translateValue(y,"y");y=this._translateLimits(y,"y");y=this._translateRange(y,"y");o.animate?this.currentHandle.stop().animate({top:y},(Math.abs(parseInt(this.currentHandle.css("top"))-y))*(!isNaN(parseInt(o.animate))?o.animate:5)):this.currentHandle.css({top:y})}if(this.rangeElement)this._updateRange();this.currentHandle.data("mouse").sliderValue={x:Math.round(this._convertValue(x,"x"))||0,y:Math.round(this._convertValue(y,"y"))||0};if(!noPropagation){this._propagate('start',null);this._propagate('stop',null);this._propagate('change',null);this._propagate("slide",null)}}});$.ui.slider.getter="value";$.ui.slider.defaults={handle:".ui-slider-handle",distance:1,animate:false}})(jQuery);(function($){$.widget("ui.tabs",{_init:function(){this.options.event+='.tabs';this._tabify(true)},_setData:function(key,value){if((/^selected/).test(key))this.select(value);else{this.options[key]=value;this._tabify()}},length:function(){return this.$tabs.length},_tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a)},ui:function(tab,panel){return{options:this.options,tab:tab,panel:panel,index:this.$tabs.index(tab)}},_tabify:function(init){this.$lis=$('li:has(a[href])',this.element);this.$tabs=this.$lis.map(function(){return $('a',this)[0]});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#',''))self.$panels=self.$panels.add(a.hash);else if($(a).attr('href')!='#'){$.data(a,'href.tabs',a.href);$.data(a,'load.tabs',a.href);var id=self._tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.element);$panel.data('destroy.tabs',true)}self.$panels=self.$panels.add($panel)}else o.disabled.push(i+1)});if(init){this.element.addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.addClass(o.panelClass)});if(o.selected===undefined){if(location.hash){this.$tabs.each(function(i,a){if(a.hash==location.hash){o.selected=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId)},500)}scrollTo(0,0);return false}})}else if(o.cookie){var index=parseInt($.cookie('ui-tabs-'+$.data(self.element[0])),10);if(index&&self.$tabs[index])o.selected=index}else if(self.$lis.filter('.'+o.selectedClass).length)o.selected=self.$lis.index(self.$lis.filter('.'+o.selectedClass)[0])}o.selected=o.selected===null||o.selected!==undefined?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.$lis.filter('.'+o.disabledClass),function(n,i){return self.$lis.index(n)}))).sort();if($.inArray(o.selected,o.disabled)!=-1)o.disabled.splice($.inArray(o.selected,o.disabled),1);this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(o.selected!==null){this.$panels.eq(o.selected).show().removeClass(o.hideClass);this.$lis.eq(o.selected).addClass(o.selectedClass);var onShow=function(){self._trigger('show',null,self.ui(self.$tabs[o.selected],self.$panels[o.selected]))};if($.data(this.$tabs[o.selected],'load.tabs'))this.load(o.selected,onShow);else onShow()}$(window).bind('unload',function(){self.$tabs.unbind('.tabs');self.$lis=self.$tabs=self.$panels=null})}else o.selected=this.$lis.index(this.$lis.filter('.'+o.selectedClass)[0]);if(o.cookie)$.cookie('ui-tabs-'+$.data(self.element[0]),o.selected,o.cookie);for(var i=0,li;li=this.$lis[i];i++)$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass(o.selectedClass)?'addClass':'removeClass'](o.disabledClass);if(o.cache===false)this.$tabs.removeData('cache.tabs');var hideFx,showFx,baseFx={'min-width':0,duration:1},baseDuration='normal';if(o.fx&&o.fx.constructor==Array)hideFx=o.fx[0]||baseFx,showFx=o.fx[1]||baseFx;else hideFx=showFx=o.fx||baseFx;var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie)resetCSS.opacity='';function hideTab(clicked,$hide,$show){$hide.animate(hideFx,hideFx.duration||baseDuration,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideFx.opacity)$hide[0].style.filter='';if($show)showTab(clicked,$show,$hide)})}function showTab(clicked,$show,$hide){if(showFx===baseFx)$show.css('display','block');$show.animate(showFx,showFx.duration||baseDuration,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showFx.opacity)$show[0].style.filter='';self._trigger('show',null,self.ui(clicked,$show[0]))})}function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show)}this.$tabs.unbind('.tabs').bind(o.event,function(){var $li=$(this).parents('li:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||$(this).hasClass(o.loadingClass)||self._trigger('select',null,self.ui(this,$show[0]))===false){this.blur();return false}self.options.selected=self.$tabs.index(this);if(o.unselect){if($li.hasClass(o.selectedClass)){self.options.selected=null;$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false}else if(!$hide.length){self.$panels.stop();var a=this;self.load(self.$tabs.index(this),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show)});this.blur();return false}}if(o.cookie)$.cookie('ui-tabs-'+$.data(self.element[0]),self.options.selected,o.cookie);self.$panels.stop();if($show.length){var a=this;self.load(self.$tabs.index(this),$hide.length?function(){switchTab(a,$li,$hide,$show)}:function(){$li.addClass(o.selectedClass);showTab(a,$show)})}else throw'jQuery UI Tabs: Mismatching fragment identifier.';if($.browser.msie)this.blur();return false});if(!(/^click/).test(o.event))this.$tabs.bind('click.tabs',function(){return false})},add:function(url,label,index){if(index==undefined)index=this.$tabs.length;var o=this.options;var $li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label));$li.data('destroy.tabs',true);var id=url.indexOf('#')==0?url.replace('#',''):this._tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.hideClass).data('destroy.tabs',true)}$panel.addClass(o.panelClass);if(index>=this.$lis.length){$li.appendTo(this.element);$panel.appendTo(this.element[0].parentNode)}else{$li.insertBefore(this.$lis[index]);$panel.insertBefore(this.$panels[index])}o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this._tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'load.tabs');if(href)this.load(index,href)}this._trigger('add',null,this.ui(this.$tabs[index],this.$panels[index]))},remove:function(index){var o=this.options,$li=this.$lis.eq(index).remove(),$panel=this.$panels.eq(index).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1)this.select(index+(index+1<this.$tabs.length?1:-1));o.disabled=$.map($.grep(o.disabled,function(n,i){return n!=index}),function(n,i){return n>=index?--n:n});this._tabify();this._trigger('remove',null,this.ui($li.find('a')[0],$panel[0]))},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1)return;var $li=this.$lis.eq(index).removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block')},0)}o.disabled=$.grep(o.disabled,function(n,i){return n!=index});this._trigger('enable',null,this.ui(this.$tabs[index],this.$panels[index]))},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.$lis.eq(index).addClass(o.disabledClass);o.disabled.push(index);o.disabled.sort();this._trigger('disable',null,this.ui(this.$tabs[index],this.$panels[index]))}},select:function(index){if(typeof index=='string')index=this.$tabs.index(this.$tabs.filter('[href$='+index+']')[0]);this.$tabs.eq(index).trigger(this.options.event)},load:function(index,callback){var self=this,o=this.options,$a=this.$tabs.eq(index),a=$a[0],bypassCache=callback==undefined||callback===false,url=$a.data('load.tabs');callback=callback||function(){};if(!url||!bypassCache&&$.data(a,'cache.tabs')){callback();return}var inner=function(parent){var $parent=$(parent),$inner=$parent.find('*:last');return $inner.length&&$inner.is(':not(img)')&&$inner||$parent};var cleanup=function(){self.$tabs.filter('.'+o.loadingClass).removeClass(o.loadingClass).each(function(){if(o.spinner)inner(this).parent().html(inner(this).data('label.tabs'))});self.xhr=null};if(o.spinner){var label=inner(a).html();inner(a).wrapInner('<em></em>').find('em').data('label.tabs',label).html(o.spinner)}var ajaxOptions=$.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(a.hash).html(r);cleanup();if(o.cache)$.data(a,'cache.tabs',true);self._trigger('load',null,self.ui(self.$tabs[index],self.$panels[index]));o.ajaxOptions.success&&o.ajaxOptions.success(r,s);callback()}});if(this.xhr){this.xhr.abort();cleanup()}$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions)},0)},url:function(index,url){this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs',url)},destroy:function(){var o=this.options;this.element.unbind('.tabs').removeClass(o.navClass).removeData('tabs');this.$tabs.each(function(){var href=$.data(this,'href.tabs');if(href)this.href=href;var $this=$(this).unbind('.tabs');$.each(['href','load','cache'],function(i,prefix){$this.removeData(prefix+'.tabs')})});this.$lis.add(this.$panels).each(function(){if($.data(this,'destroy.tabs'))$(this).remove();else $(this).removeClass([o.selectedClass,o.unselectClass,o.disabledClass,o.panelClass,o.hideClass].join(' '))})}});$.ui.tabs.defaults={unselect:false,event:'click',disabled:[],cookie:null,spinner:'Loading&#8230;',cache:false,idPrefix:'ui-tabs-',ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:'<div></div>',navClass:'ui-tabs-nav',selectedClass:'ui-tabs-selected',unselectClass:'ui-tabs-unselect',disabledClass:'ui-tabs-disabled',panelClass:'ui-tabs-panel',hideClass:'ui-tabs-hide',loadingClass:'ui-tabs-loading'};$.ui.tabs.getter="length";$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){continuing=continuing||false;var self=this,t=this.options.selected;function start(){self.rotation=setInterval(function(){t=++t<self.$tabs.length?t:0;self.select(t)},ms)}function stop(e){if(!e||e.clientX){clearInterval(self.rotation)}}if(ms){start();if(!continuing)this.$tabs.bind(this.options.event,stop);else this.$tabs.bind(this.options.event,function(){stop();t=self.options.selected;start()})}else{stop();this.$tabs.unbind(this.options.event,stop)}}})})(jQuery);(function($){$.widget('ui.spinner',{_init:function(){if($.data(this.element[0],'spinner'))return;if(this.options.init){this.options.init(this.ui(null))}this._decimals=0;if(this.options.stepping.toString().indexOf('.')!=-1){var s=this.options.stepping.toString();this._decimals=s.slice(s.indexOf('.')+1,s.length).length}var self=this;this.element.addClass('ui-spinner-box').attr('autocomplete','off');this._setValue(isNaN(this._getValue())?this.options.start:this._getValue());this.element.wrap('<div>').parent().addClass('ui-spinner').append('<button class="ui-spinner-up" type="button">&#9650;</button>').find('.ui-spinner-up').bind('mousedown',function(e){$(this).addClass('ui-spinner-pressed');if(!self.counter)self.counter=1;self._mousedown(100,'_up',e)}).bind('mouseup',function(e){$(this).removeClass('ui-spinner-pressed');if(self.counter==1)self._up(e);self._mouseup(e)}).bind('mouseout',function(e){$(this).removeClass('ui-spinner-pressed');self._mouseup(e)}).bind('dblclick',function(e){$(this).removeClass('ui-spinner-pressed');self._up(e)}).bind('keydown.spinner',function(e){var KEYS=$.keyCode;if(e.keyCode==KEYS.SPACE||e.keyCode==KEYS.ENTER){$(this).addClass('ui-spinner-pressed');if(!self.counter)self.counter=1;self._up.call(self,e)}else if(e.keyCode==KEYS.DOWN||e.keyCode==KEYS.RIGHT){self.element.siblings('.ui-spinner-down').focus()}else if(e.keyCode==KEYS.LEFT){self.element.focus()}}).bind('keyup.spinner',function(e){$(this).removeClass('ui-spinner-pressed');self.counter=0;self._propagate('change',e)}).end().append('<button class="ui-spinner-down" type="button">&#9660;</button>').find('.ui-spinner-down').bind('mousedown',function(e){$(this).addClass('ui-spinner-pressed');if(!self.counter)self.counter=1;self._mousedown(100,'_down',e)}).bind('mouseup',function(e){$(this).removeClass('ui-spinner-pressed');if(self.counter==1)self._down();self._mouseup(e)}).bind('mouseout',function(e){$(this).removeClass('ui-spinner-pressed');self._mouseup(e)}).bind('dblclick',function(e){$(this).removeClass('ui-spinner-pressed');self._down(e)}).bind('keydown.spinner',function(e){var KEYS=$.keyCode;if(e.keyCode==KEYS.SPACE||e.keyCode==KEYS.ENTER){$(this).addClass('ui-spinner-pressed');if(!self.counter)self.counter=1;self._down.call(self,e)}else if(e.keyCode==KEYS.UP||e.keyCode==KEYS.LEFT){self.element.siblings('.ui-spinner-up').focus()}}).bind('keyup.spinner',function(e){$(this).removeClass('ui-spinner-pressed');self.counter=0;self._propagate('change',e)}).end();this._items=this.element.children().length;if(this._items>1){this.element.addClass('ui-spinner-list').css('height',this.element.outerHeight()/this._items).children().addClass('ui-spinner-listitem').end().parent().css('height',this.element.outerHeight()).end();this.options.stepping=1;this.options.min=0;this.options.max=this._items-1}this.element.bind('keydown.spinner',function(e){if(!self.counter)self.counter=1;return self._keydown.call(self,e)}).bind('keyup.spinner',function(e){self.counter=0;self._propagate('change',e)}).bind('blur.spinner',function(e){self._cleanUp()});if($.fn.mousewheel){this.element.mousewheel(function(e,delta){self._mousewheel(e,delta)})}},_constrain:function(){if(this.options.min!=undefined&&this._getValue()<this.options.min)this._setValue(this.options.min);if(this.options.max!=undefined&&this._getValue()>this.options.max)this._setValue(this.options.max)},_cleanUp:function(){this._setValue(this._getValue());this._constrain()},_spin:function(d,e){if(this.disabled)return;if(isNaN(this._getValue()))this._setValue(this.options.start);this._setValue(this._getValue()+(d=='up'?1:-1)*(this.options.incremental&&this.counter>100?(this.counter>200?100:10):1)*this.options.stepping);this._animate(d);this._constrain();if(this.counter)this.counter++;this._propagate('spin',e)},_down:function(e){this._spin('down',e);this._propagate('down',e)},_up:function(e){this._spin('up',e);this._propagate('up',e)},_mousedown:function(i,d,e){var self=this;i=i||100;if(this.timer)window.clearInterval(this.timer);this.timer=window.setInterval(function(){self[d](e);if(self.counter>20)self._mousedown(20,d,e)},i)},_mouseup:function(e){this.counter=0;if(this.timer)window.clearInterval(this.timer);this.element[0].focus();this._propagate('change',e)},_keydown:function(e){var KEYS=$.keyCode;if(e.keyCode==KEYS.UP)this._up(e);if(e.keyCode==KEYS.DOWN)this._down(e);if(e.keyCode==KEYS.HOME)this._setValue(this.options.min||this.options.start);if(e.keyCode==KEYS.END&&this.options.max!=undefined)this._setValue(this.options.max);return(e.keyCode==KEYS.TAB||e.keyCode==KEYS.BACKSPACE||e.keyCode==KEYS.LEFT||e.keyCode==KEYS.RIGHT||e.keyCode==KEYS.PERIOD||e.keyCode==KEYS.NUMPAD_DECIMAL||e.keyCode==KEYS.NUMPAD_SUBTRACT||(e.keyCode>=96&&e.keyCode<=105)||(/[0-9\-\.]/).test(String.fromCharCode(e.keyCode)))?true:false},_mousewheel:function(e,delta){delta=($.browser.opera?-delta/Math.abs(delta):delta);delta>0?this._up(e):this._down(e);e.preventDefault()},_getValue:function(){return parseFloat(this.element.val().replace(/[^0-9\-\.]/g,''))},_setValue:function(newVal){if(isNaN(newVal))newVal=this.options.start;this.element.val(this.options.currency?$.ui.spinner.format.currency(newVal,this.options.currency):$.ui.spinner.format.number(newVal,this._decimals))},_animate:function(d){if(this.element.hasClass('ui-spinner-list')&&((d=='up'&&this._getValue()<=this.options.max)||(d=='down'&&this._getValue()>=this.options.min))){this.element.animate({marginTop:'-'+this._getValue()*this.element.outerHeight()},{duration:'fast',queue:false})}},_addItem:function(html){if(!this.element.is('input')){var wrapper='div';if(this.element.is('ol')||this.element.is('ul')){wrapper='li'}this.element.append('<'+wrapper+' class="ui-spinner-dyn">'+html+'</'+wrapper+'>')}},plugins:{},ui:function(e){return{options:this.options,element:this.element,value:this._getValue(),add:this._addItem}},_propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);return this.element.triggerHandler(n=='spin'?n:'spin'+n,[e,this.ui()],this.options[n])},destroy:function(){if(!$.data(this.element[0],'spinner'))return;if($.fn.mousewheel){this.element.unmousewheel()}this.element.removeClass('ui-spinner-box ui-spinner-list').removeAttr('disabled').removeAttr('autocomplete').removeData('spinner').unbind('.spinner').siblings().remove().end().children().removeClass('ui-spinner-listitem').remove('.ui-spinner-dyn').end().parent().removeClass('ui-spinner ui-spinner-disabled').before(this.element.clone()).remove().end()},enable:function(){this.element.removeAttr('disabled').siblings().removeAttr('disabled').parent().removeClass('ui-spinner-disabled');this.disabled=false},disable:function(){this.element.attr('disabled',true).siblings().attr('disabled',true).parent().addClass('ui-spinner-disabled');this.disabled=true}});$.extend($.ui.spinner,{defaults:{stepping:1,start:0,incremental:true,currency:false},format:{number:function(num,dec){return this.round(num,dec)},currency:function(num,sym){return(num!==Math.abs(num)?'-':'')+sym+this.round(Math.abs(num),2)},round:function(num,dec){var s=Math.round(parseFloat(num)*Math.pow(10,dec))/Math.pow(10,dec); if(dec>0){s=s+((s.toString().indexOf('.')==-1)?'.':'')+'0000000001';s=s.substr(0,s.indexOf('.')+1+dec)}else{s=Math.round(s)}return s}}})})(jQuery);(function($){$.effects=$.effects||{};$.extend($.effects,{save:function(el,set){for(var i=0;i<set.length;i++){if(set[i]!==null)$.data(el[0],"ec.storage."+set[i],el[0].style[set[i]])}},restore:function(el,set){for(var i=0;i<set.length;i++){if(set[i]!==null)el.css(set[i],$.data(el[0],"ec.storage."+set[i]))}},setMode:function(el,mode){if(mode=='toggle')mode=el.is(':hidden')?'show':'hide';return mode},getBaseline:function(origin,original){var y,x;switch(origin[0]){case'top':y=0;break;case'middle':y=0.5;break;case'bottom':y=1;break;default:y=origin[0]/original.height};switch(origin[1]){case'left':x=0;break;case'center':x=0.5;break;case'right':x=1;break;default:x=origin[1]/original.width};return{x:x,y:y}},createWrapper:function(el){if(el.parent().attr('id')=='fxWrapper')return el;var props={width:el.outerWidth({margin:true}),height:el.outerHeight({margin:true}),'float':el.css('float')};el.wrap('<div id="fxWrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var wrapper=el.parent();if(el.css('position')=='static'){wrapper.css({position:'relative'});el.css({position:'relative'})}else{var top=el.css('top');if(isNaN(parseInt(top)))top='auto';var left=el.css('left');if(isNaN(parseInt(left)))left='auto';wrapper.css({position:el.css('position'),top:top,left:left,zIndex:el.css('z-index')}).show();el.css({position:'relative',top:0,left:0})}wrapper.css(props);return wrapper},removeWrapper:function(el){if(el.parent().attr('id')=='fxWrapper')return el.parent().replaceWith(el);return el},setTransition:function(el,list,factor,val){val=val||{};$.each(list,function(i,x){unit=el.cssUnit(x);if(unit[0]>0)val[x]=unit[0]*factor+unit[1]});return val},animateClass:function(value,duration,easing,callback){var cb=(typeof easing=="function"?easing:(callback?callback:null));var ea=(typeof easing=="object"?easing:null);return this.each(function(){var offset={};var that=$(this);var oldStyleAttr=that.attr("style")||'';if(typeof oldStyleAttr=='object')oldStyleAttr=oldStyleAttr["cssText"];if(value.toggle){that.hasClass(value.toggle)?value.remove=value.toggle:value.add=value.toggle}var oldStyle=$.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(value.add)that.addClass(value.add);if(value.remove)that.removeClass(value.remove);var newStyle=$.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(value.add)that.removeClass(value.add);if(value.remove)that.addClass(value.remove);for(var n in newStyle){if(typeof newStyle[n]!="function"&&newStyle[n]&&n.indexOf("Moz")==-1&&n.indexOf("length")==-1&&newStyle[n]!=oldStyle[n]&&(n.match(/color/i)||(!n.match(/color/i)&&!isNaN(parseInt(newStyle[n],10))))&&(oldStyle.position!="static"||(oldStyle.position=="static"&&!n.match(/left|top|bottom|right/))))offset[n]=newStyle[n]}that.animate(offset,duration,ea,function(){if(typeof $(this).attr("style")=='object'){$(this).attr("style")["cssText"]="";$(this).attr("style")["cssText"]=oldStyleAttr}else $(this).attr("style",oldStyleAttr);if(value.add)$(this).addClass(value.add);if(value.remove)$(this).removeClass(value.remove);if(cb)cb.apply(this,arguments)})})}});$.fn.extend({_show:$.fn.show,_hide:$.fn.hide,__toggle:$.fn.toggle,_addClass:$.fn.addClass,_removeClass:$.fn.removeClass,_toggleClass:$.fn.toggleClass,effect:function(fx,o,speed,callback){return $.effects[fx]?$.effects[fx].call(this,{method:fx,options:o||{},duration:speed,callback:callback}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])))return this._show.apply(this,arguments);else{var o=arguments[1]||{};o['mode']='show';return this.effect.apply(this,[arguments[0],o,arguments[2]||o.duration,arguments[3]||o.callback])}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])))return this._hide.apply(this,arguments);else{var o=arguments[1]||{};o['mode']='hide';return this.effect.apply(this,[arguments[0],o,arguments[2]||o.duration,arguments[3]||o.callback])}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0]))||(arguments[0].constructor==Function))return this.__toggle.apply(this,arguments);else{var o=arguments[1]||{};o['mode']='toggle';return this.effect.apply(this,[arguments[0],o,arguments[2]||o.duration,arguments[3]||o.callback])}},addClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{add:classNames},speed,easing,callback]):this._addClass(classNames)},removeClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{remove:classNames},speed,easing,callback]):this._removeClass(classNames)},toggleClass:function(classNames,speed,easing,callback){return speed?$.effects.animateClass.apply(this,[{toggle:classNames},speed,easing,callback]):this._toggleClass(classNames)},morph:function(remove,add,speed,easing,callback){return $.effects.animateClass.apply(this,[{add:add,remove:remove},speed,easing,callback])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(key){var style=this.css(key),val=[];$.each(['em','px','%','pt'],function(i,unit){if(style.indexOf(unit)>0)val=[parseFloat(style),unit]});return val}});jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end)}fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")"}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];if(result=/rgba\(0, 0, 0, 0\)/.exec(color))return colors['transparent'];return colors[jQuery.trim(color).toLowerCase()]}function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))break;attr="backgroundColor"}while(elem=elem.parentNode);return getRGB(color)};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}})})(jQuery);(function($){$.effects.blind=function(o){return this.queue(function(){var el=$(this),props=['position','top','left'];var mode=$.effects.setMode(el,o.options.mode||'hide');var direction=o.options.direction||'vertical';$.effects.save(el,props);el.show();var wrapper=$.effects.createWrapper(el).css({overflow:'hidden'});var ref=(direction=='vertical')?'height':'width';var distance=(direction=='vertical')?wrapper.height():wrapper.width();if(mode=='show')wrapper.css(ref,0);var animation={};animation[ref]=mode=='show'?distance:0;wrapper.animate(animation,o.duration,o.options.easing,function(){if(mode=='hide')el.hide();$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(el[0],arguments);el.dequeue()})})}})(jQuery);(function($){$.effects.highlight=function(o){return this.queue(function(){var el=$(this),props=['backgroundImage','backgroundColor','opacity'];var mode=$.effects.setMode(el,o.options.mode||'show');var color=o.options.color||"#ffff99";var oldColor=el.css("backgroundColor");$.effects.save(el,props);el.show();el.css({backgroundImage:'none',backgroundColor:color});var animation={backgroundColor:oldColor};if(mode=="hide")animation['opacity']=0;el.animate(animation,{queue:false,duration:o.duration,easing:o.options.easing,complete:function(){if(mode=="hide")el.hide();$.effects.restore(el,props);if(mode=="show"&&jQuery.browser.msie)this.style.removeAttribute('filter');if(o.callback)o.callback.apply(this,arguments);el.dequeue()}})})}})(jQuery);(function($){$.effects.pulsate=function(o){return this.queue(function(){var el=$(this);var mode=$.effects.setMode(el,o.options.mode||'show');var times=o.options.times||5;if(mode=='hide')times--;if(el.is(':hidden')){el.css('opacity',0);el.show();el.animate({opacity:1},o.duration/2,o.options.easing);times=times-2}for(var i=0;i<times;i++){el.animate({opacity:0},o.duration/2,o.options.easing).animate({opacity:1},o.duration/2,o.options.easing)};if(mode=='hide'){el.animate({opacity:0},o.duration/2,o.options.easing,function(){el.hide();if(o.callback)o.callback.apply(this,arguments)})}else{el.animate({opacity:0},o.duration/2,o.options.easing).animate({opacity:1},o.duration/2,o.options.easing,function(){if(o.callback)o.callback.apply(this,arguments)})};el.queue('fx',function(){el.dequeue()});el.dequeue()})}})(jQuery);(function($){$.effects.puff=function(o){return this.queue(function(){var el=$(this);var options=$.extend(true,{},o.options);var mode=$.effects.setMode(el,o.options.mode||'hide');var percent=parseInt(o.options.percent)||150;options.fade=true;var original={height:el.height(),width:el.width()};var factor=percent/100;el.from=(mode=='hide')?original:{height:original.height*factor,width:original.width*factor};options.from=el.from;options.percent=(mode=='hide')?percent:100;options.mode=mode;el.effect('scale',options,o.duration,o.callback);el.dequeue()})};$.effects.scale=function(o){return this.queue(function(){var el=$(this);var options=$.extend(true,{},o.options);var mode=$.effects.setMode(el,o.options.mode||'effect');var percent=parseInt(o.options.percent)||(parseInt(o.options.percent)==0?0:(mode=='hide'?0:100));var direction=o.options.direction||'both';var origin=o.options.origin;if(mode!='effect'){options.origin=origin||['middle','center'];options.restore=true}var original={height:el.height(),width:el.width()};el.from=o.options.from||(mode=='show'?{height:0,width:0}:original);var factor={y:direction!='horizontal'?(percent/100):1,x:direction!='vertical'?(percent/100):1};el.to={height:original.height*factor.y,width:original.width*factor.x};if(o.options.fade){if(mode=='show'){el.from.opacity=0;el.to.opacity=1};if(mode=='hide'){el.from.opacity=1;el.to.opacity=0}};options.from=el.from;options.to=el.to;options.mode=mode;el.effect('size',options,o.duration,o.callback);el.dequeue()})};$.effects.size=function(o){return this.queue(function(){var el=$(this),props=['position','top','left','width','height','overflow','opacity'];var props1=['position','top','left','overflow','opacity'];var props2=['width','height','overflow'];var cProps=['fontSize'];var vProps=['borderTopWidth','borderBottomWidth','paddingTop','paddingBottom'];var hProps=['borderLeftWidth','borderRightWidth','paddingLeft','paddingRight'];var mode=$.effects.setMode(el,o.options.mode||'effect');var restore=o.options.restore||false;var scale=o.options.scale||'both';var origin=o.options.origin;var original={height:el.height(),width:el.width()};el.from=o.options.from||original;el.to=o.options.to||original;if(origin){var baseline=$.effects.getBaseline(origin,original);el.from.top=(original.height-el.from.height)*baseline.y;el.from.left=(original.width-el.from.width)*baseline.x;el.to.top=(original.height-el.to.height)*baseline.y;el.to.left=(original.width-el.to.width)*baseline.x};var factor={from:{y:el.from.height/original.height,x:el.from.width/original.width},to:{y:el.to.height/original.height,x:el.to.width/original.width}};if(scale=='box'||scale=='both'){if(factor.from.y!=factor.to.y){props=props.concat(vProps);el.from=$.effects.setTransition(el,vProps,factor.from.y,el.from);el.to=$.effects.setTransition(el,vProps,factor.to.y,el.to)};if(factor.from.x!=factor.to.x){props=props.concat(hProps);el.from=$.effects.setTransition(el,hProps,factor.from.x,el.from);el.to=$.effects.setTransition(el,hProps,factor.to.x,el.to)}};if(scale=='content'||scale=='both'){if(factor.from.y!=factor.to.y){props=props.concat(cProps);el.from=$.effects.setTransition(el,cProps,factor.from.y,el.from);el.to=$.effects.setTransition(el,cProps,factor.to.y,el.to)}};$.effects.save(el,restore?props:props1);el.show();$.effects.createWrapper(el);el.css('overflow','hidden').css(el.from);if(scale=='content'||scale=='both'){vProps=vProps.concat(['marginTop','marginBottom']).concat(cProps);hProps=hProps.concat(['marginLeft','marginRight']);props2=props.concat(vProps).concat(hProps);el.find("*[width]").each(function(){child=$(this);if(restore)$.effects.save(child,props2);var c_original={height:child.height(),width:child.width()};child.from={height:c_original.height*factor.from.y,width:c_original.width*factor.from.x};child.to={height:c_original.height*factor.to.y,width:c_original.width*factor.to.x};if(factor.from.y!=factor.to.y){child.from=$.effects.setTransition(child,vProps,factor.from.y,child.from);child.to=$.effects.setTransition(child,vProps,factor.to.y,child.to)};if(factor.from.x!=factor.to.x){child.from=$.effects.setTransition(child,hProps,factor.from.x,child.from);child.to=$.effects.setTransition(child,hProps,factor.to.x,child.to)};child.css(child.from);child.animate(child.to,o.duration,o.options.easing,function(){if(restore)$.effects.restore(child,props2)})})};el.animate(el.to,{queue:false,duration:o.duration,easing:o.options.easing,complete:function(){if(mode=='hide')el.hide();$.effects.restore(el,restore?props:props1);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(this,arguments);el.dequeue()}})})}})(jQuery);(function($){$.effects.slide=function(o){return this.queue(function(){var el=$(this),props=['position','top','left'];var mode=$.effects.setMode(el,o.options.mode||'show');var direction=o.options.direction||'left';$.effects.save(el,props);el.show();$.effects.createWrapper(el).css({overflow:'hidden'});var ref=(direction=='up'||direction=='down')?'top':'left';var motion=(direction=='up'||direction=='left')?'pos':'neg';var distance=o.options.distance||(ref=='top'?el.outerHeight({margin:true}):el.outerWidth({margin:true}));if(mode=='show')el.css(ref,motion=='pos'?-distance:distance);var animation={};animation[ref]=(mode=='show'?(motion=='pos'?'+=':'-='):(motion=='pos'?'-=':'+='))+distance;el.animate(animation,{queue:false,duration:o.duration,easing:o.options.easing,complete:function(){if(mode=='hide')el.hide();$.effects.restore(el,props);$.effects.removeWrapper(el);if(o.callback)o.callback.apply(this,arguments);el.dequeue()}})})}})(jQuery);(function($){$.effects.transfer=function(o){return this.queue(function(){var el=$(this);var mode=$.effects.setMode(el,o.options.mode||'effect');var target=$(o.options.to);var position=el.offset();var transfer=$('<div class="ui-effects-transfer"></div>').appendTo(document.body);if(o.options.className)transfer.addClass(o.options.className);transfer.addClass(o.options.className);transfer.css({top:position.top,left:position.left,height:el.outerHeight()-parseInt(transfer.css('borderTopWidth'))-parseInt(transfer.css('borderBottomWidth')),width:el.outerWidth()-parseInt(transfer.css('borderLeftWidth'))-parseInt(transfer.css('borderRightWidth')),position:'absolute'});position=target.offset();animation={top:position.top,left:position.left,height:target.outerHeight()-parseInt(transfer.css('borderTopWidth'))-parseInt(transfer.css('borderBottomWidth')),width:target.outerWidth()-parseInt(transfer.css('borderLeftWidth'))-parseInt(transfer.css('borderRightWidth'))};transfer.animate(animation,o.duration,o.options.easing,function(){transfer.remove();if(o.callback)o.callback.apply(el[0],arguments);el.dequeue()})})}})(jQuery);(function($){$.ui=$.ui||{};$.extend($.ui,{plugin:{add:function(w,c,o,p){var a=$.ui[w].prototype;if(!a.plugins[c])a.plugins[c]=[];a.plugins[c].push([o,p])},call:function(instance,name,arguments){var c=instance.plugins[name];if(!c)return;var o=instance.interaction?instance.interaction.options:instance.options;var e=instance.interaction?instance.interaction.element:instance.element;for(var i=0;i<c.length;i++){if(o[c[i][0]])c[i][1].apply(e,arguments)}}}});$.fn.mouseInteractionDestroy=function(){this.each(function(){if($.data(this,"ui-mouse"))$.data(this,"ui-mouse").destroy()})};$.ui.mouseInteraction=function(el,o){if(!o)var o={};this.element=el;$.data(this.element,"ui-mouse",this);this.options={};$.extend(this.options,o);$.extend(this.options,{handle:o.handle?($(o.handle,el)[0]?$(o.handle,el):$(el)):$(el),helper:o.helper||'original',preventionDistance:o.preventionDistance||0,dragPrevention:o.dragPrevention?o.dragPrevention.toLowerCase().split(','):['input','textarea','button','select','option'],cursorAt:{top:((o.cursorAt&&o.cursorAt.top)?o.cursorAt.top:0),left:((o.cursorAt&&o.cursorAt.left)?o.cursorAt.left:0),bottom:((o.cursorAt&&o.cursorAt.bottom)?o.cursorAt.bottom:0),right:((o.cursorAt&&o.cursorAt.right)?o.cursorAt.right:0)},cursorAtIgnore:(!o.cursorAt)?true:false,appendTo:o.appendTo||'parent'});o=this.options;if(!this.options.nonDestructive&&(o.helper=='clone'||o.helper=='original')){o.margins={top:parseInt($(el).css('marginTop'))||0,left:parseInt($(el).css('marginLeft'))||0,bottom:parseInt($(el).css('marginBottom'))||0,right:parseInt($(el).css('marginRight'))||0};if(o.cursorAt.top!=0)o.cursorAt.top=o.margins.top;if(o.cursorAt.left!=0)o.cursorAt.left+=o.margins.left;if(o.cursorAt.bottom!=0)o.cursorAt.bottom+=o.margins.bottom;if(o.cursorAt.right!=0)o.cursorAt.right+=o.margins.right;if(o.helper=='original')o.wasPositioned=$(el).css('position')}else{o.margins={top:0,left:0,right:0,bottom:0}}var self=this;this.mousedownfunc=function(e){return self.click.apply(self,[e])};o.handle.bind('mousedown',this.mousedownfunc);if($.browser.msie)$(this.element).attr('unselectable','on')};$.extend($.ui.mouseInteraction.prototype,{plugins:{},currentTarget:null,lastTarget:null,timer:null,slowMode:false,init:false,destroy:function(){this.options.handle.unbind('mousedown',this.mousedownfunc)},trigger:function(e){return this.click.apply(this,arguments)},click:function(e){var o=this.options;window.focus();if(e.which!=1)return true;var targetName=(e.target)?e.target.nodeName.toLowerCase():e.srcElement.nodeName.toLowerCase();for(var i=0;i<o.dragPrevention.length;i++){if(targetName==o.dragPrevention[i])return true}if(o.startCondition&&!o.startCondition.apply(this,[e]))return true;var self=this;this.mouseup=function(e){return self.stop.apply(self,[e])};this.mousemove=function(e){return self.drag.apply(self,[e])};var initFunc=function(){$(document).bind('mouseup',self.mouseup);$(document).bind('mousemove',self.mousemove);self.opos=[e.pageX,e.pageY]};if(o.preventionTimeout){if(this.timer)clearInterval(this.timer);this.timer=setTimeout(function(){initFunc()},o.preventionTimeout);return false}initFunc();return false},start:function(e){var o=this.options;var a=this.element;o.co=$(a).offset();this.helper=typeof o.helper=='function'?$(o.helper.apply(a,[e,this]))[0]:(o.helper=='clone'?$(a).clone()[0]:a);if(o.appendTo=='parent'){var cp=a.parentNode;while(cp){if(cp.style&&($(cp).css('position')=='relative'||$(cp).css('position')=='absolute')){o.pp=cp;o.po=$(cp).offset();o.ppOverflow=!!($(o.pp).css('overflow')=='auto'||$(o.pp).css('overflow')=='scroll');break}cp=cp.parentNode?cp.parentNode:null};if(!o.pp)o.po={top:0,left:0}}this.pos=[this.opos[0],this.opos[1]];this.rpos=[this.pos[0],this.pos[1]];if(o.cursorAtIgnore){o.cursorAt.left=this.pos[0]-o.co.left+o.margins.left;o.cursorAt.top=this.pos[1]-o.co.top+o.margins.top}if(o.pp){this.pos[0]-=o.po.left;this.pos[1]-=o.po.top}this.slowMode=(o.cursorAt&&(o.cursorAt.top-o.margins.top>0||o.cursorAt.bottom-o.margins.bottom>0)&&(o.cursorAt.left-o.margins.left>0||o.cursorAt.right-o.margins.right>0))?true:false;if(!o.nonDestructive)$(this.helper).css('position','absolute');if(o.helper!='original')$(this.helper).appendTo((o.appendTo=='parent'?a.parentNode:o.appendTo)).show();if(o.cursorAt.right&&!o.cursorAt.left)o.cursorAt.left=this.helper.offsetWidth+o.margins.right+o.margins.left-o.cursorAt.right;if(o.cursorAt.bottom&&!o.cursorAt.top)o.cursorAt.top=this.helper.offsetHeight+o.margins.top+o.margins.bottom-o.cursorAt.bottom;this.init=true;if(o._start)o._start.apply(a,[this.helper,this.pos,o.cursorAt,this,e]);this.helperSize={width:$(this.helper).outerWidth(),height:$(this.helper).outerHeight()};return false},stop:function(e){var o=this.options;var a=this.element;var self=this;$(document).unbind('mouseup',self.mouseup);$(document).unbind('mousemove',self.mousemove);if(this.init==false)return this.opos=this.pos=null;if(o._beforeStop)o._beforeStop.apply(a,[this.helper,this.pos,o.cursorAt,this,e]);if(this.helper!=a&&!o.beQuietAtEnd){$(this.helper).remove();this.helper=null}if(!o.beQuietAtEnd){if(o._stop)o._stop.apply(a,[this.helper,this.pos,o.cursorAt,this,e])}this.init=false;this.opos=this.pos=null;return false},drag:function(e){if(!this.opos||($.browser.msie&&!e.button))return this.stop.apply(this,[e]);var o=this.options;this.pos=[e.pageX,e.pageY];if(this.rpos&&this.rpos[0]==this.pos[0]&&this.rpos[1]==this.pos[1])return false;this.rpos=[this.pos[0],this.pos[1]];if(o.pp){this.pos[0]-=o.po.left;this.pos[1]-=o.po.top}if((Math.abs(this.rpos[0]-this.opos[0])>o.preventionDistance||Math.abs(this.rpos[1]-this.opos[1])>o.preventionDistance)&&this.init==false)this.start.apply(this,[e]);else{if(this.init==false)return false}if(o._drag)o._drag.apply(this.element,[this.helper,this.pos,o.cursorAt,this,e]);return false}})})(jQuery);(function($){if(window['webforms']){$(document).ready(function(){$("input").each(function(){if(this.getAttribute("type")=="range"){var cur=$(this);var slider=$("<div class='ui-slider'></div>").css({width:cur.innerWidth()+"px",height:cur.innerHeight()+"px"}).insertAfter(cur);var handle=$("<div class='ui-slider-handle'></div>").appendTo(slider);slider.css({"position":cur.css("position")=="absolute"?"absolute":"relative","left":cur.css("left"),"right":cur.css("right"),"zIndex":cur.css("zIndex"),"float":cur.css("float"),"clear":cur.css("clear")});cur.css({position:"absolute",opacity:0,top:"-1000px",left:"-1000px"});slider.slider({maxValue:cur.attr("max"),minValue:cur.attr("min"),startValue:this.getAttribute("value"),stepping:cur.attr("step"),change:function(e,ui){cur[0].value=ui.value;cur[0].setAttribute("value",ui.value)}});slider=slider.sliderInstance();cur.bind("keydown",function(e){var o=slider.interaction.options;switch(e.keyCode){case 37:slider.moveTo(slider.interaction.curValue+o.minValue-(o.stepping||1));break;case 39:slider.moveTo(slider.interaction.curValue+o.minValue+(o.stepping||1));break}if(e.keyCode!=9)return false})}})})}$.extend($.expr[':'],{slider:"(' '+a.className+' ').indexOf(' ui-slider ') != -1"});$.fn.slider=function(o){return this.each(function(){new $.ui.slider(this,o)})};var methods="destroy,enable,disable,moveTo".split(",");for(var i=0;i<methods.length;i++){var cur=methods[i],f;eval('f = function() { var a = arguments; return this.each(function() { if(jQuery(this).is(".ui-slider")) jQuery.data(this, "ui-slider")["'+cur+'"](a); }); }');$.fn["slider"+cur.substr(0,1).toUpperCase()+cur.substr(1)]=f};$.fn.sliderInstance=function(){if($(this[0]).is(".ui-slider"))return $.data(this[0],"ui-slider");return false};$.ui.slider=function(el,o){var options={};o=o||{};$.extend(options,o);$.extend(options,{axis:o.axis||(el.offsetWidth<el.offsetHeight?'vertical':'horizontal'),maxValue:parseInt(o.maxValue)||100,minValue:parseInt(o.minValue)||0,startValue:parseInt(o.startValue)||0,_start:function(h,p,c,t,e){self.start.apply(t,[self,e])},_beforeStop:function(h,p,c,t,e){self.stop.apply(t,[self,e])},_drag:function(h,p,c,t,e){self.drag.apply(t,[self,e])},startCondition:function(){return!self.disabled}});var self=this;var o=options;$.data(el,"ui-slider",this);o.stepping=parseInt(o.stepping)||(o.steps?o.maxValue/o.steps:0);o.realValue=(o.maxValue-o.minValue);this.handle=options.handle?$(options.handle,el):$('.ui-slider-handle',el);if(this.handle.length==1){this.interaction=new $.ui.mouseInteraction(this.handle[0],options);this.multipleHandles=false}else{this.interactions=[];this.handle.each(function(){self.interactions.push(new $.ui.mouseInteraction(this,options))});this.multipleHandles=true}this.element=el;$(this.element).addClass("ui-slider");if(o.axis=='horizontal'){this.parentSize=$(this.element).outerWidth()-this.handle.outerWidth();this.prop='left'}if(o.axis=='vertical'){this.parentSize=$(this.element).outerHeight()-this.handle.outerHeight();this.prop='top'}if(!this.multipleHandles){$(el).bind('click',function(e){self.click.apply(self,[e])});if(!isNaN(o.startValue))this.moveTo(o.startValue,options.realValue,null,false)}else{var tmpi=0;var tmpo=this;this.handle.each(function(){if(!isNaN(o.values[tmpi]))tmpo.moveTo(tmpi,options.realValue,null,false);tmpi++})}};$.extend($.ui.slider.prototype,{currentTarget:null,lastTarget:null,destroy:function(){$(this.element).removeClass("ui-slider").removeClass("ui-slider-disabled");this.interaction.destroy()},enable:function(){$(this.element).removeClass("ui-slider-disabled");this.disabled=false},disable:function(){$(this.element).addClass("ui-slider-disabled");this.disabled=true},nonvalidRange:function(self){for(var i=0;i<this.interactions.length;i++){if(self==this.interactions[i]){if(this.interactions[i-1]){if(this.interactions[i-1].curValue>this.interactions[i].curValue)return this.interactions[i-1].curValue}if(this.interactions[i+1]){if(this.interactions[i+1].curValue<this.interactions[i].curValue)return this.interactions[i+1].curValue}}}return false},prepareCallbackObj:function(self,m){var cur=this;var func=function(){var retVal=[];for(var i=0;i<cur.interactions.length;i++){retVal.push((cur.interactions[i].curValue||0)+self.options.minValue)}return retVal};return{handle:self.helper,pixel:m,value:self.curValue+self.options.minValue,values:this.multipleHandles?func():self.curValue+self.options.minValue,slider:self}},click:function(e){var o=this.interaction.options;var pointer=[e.pageX,e.pageY];var offset=$(this.interaction.element).offsetParent().offset({border:false});if(this.interaction.element==e.target||this.disabled)return;this.interaction.pickValue=this.interaction.curValue;this.drag.apply(this.interaction,[this,e,[pointer[0]-offset.left-this.handle[0].offsetWidth/2,pointer[1]-offset.top-this.handle[0].offsetHeight/2]]);if(this.interaction.pickValue!=this.interaction.curValue)$(this.element).triggerHandler("slidechange",[e,this.prepareCallbackObj(this.interaction)],o.change)},start:function(that,e){var o=this.options;$(that.element).triggerHandler("slidestart",[e,that.prepareCallbackObj(this)],o.start);this.pickValue=this.curValue;return false},stop:function(that,e){var o=this.options;$(that.element).triggerHandler("slidestop",[e,that.prepareCallbackObj(this)],o.stop);if(this.pickValue!=this.curValue)$(that.element).triggerHandler("slidechange",[e,that.prepareCallbackObj(this)],o.change);return false},drag:function(that,e,pos){var o=this.options;this.pos=pos||[this.pos[0]-this.element.offsetWidth/2,this.pos[1]-this.element.offsetHeight/2];if(o.axis=='horizontal')var m=this.pos[0];if(o.axis=='vertical')var m=this.pos[1];var p=that.parentSize;var prop=that.prop;if(m<0)m=0;if(m>p)m=p;this.curValue=(Math.round((m/p)*o.realValue));if(o.stepping){this.curValue=Math.round(this.curValue/o.stepping)*o.stepping;m=((this.curValue)/o.realValue)*p}if(that.interactions){nonvalidRange=that.nonvalidRange(this);if(nonvalidRange){this.curValue=nonvalidRange;m=((this.curValue)/o.realValue)*p}}$(this.element).css(prop,m+'px');$(that.element).triggerHandler("slide",[e,that.prepareCallbackObj(this,m)],o.slide);return false},moveTo:function(value,scale,changeslide,p){if(this.multipleHandles){var o=this.interactions[value].options;var offset=$(this.interactions[value].element).offsetParent().offset({border:false});this.interactions[value].pickValue=this.interactions[value].curValue;value=value-o.minValue;var modifier=scale||o.realValue;if(!p)var p=this.parentSize;var prop=this.prop;var m=Math.round(((o.values[value])/modifier)*p);if(m<0)m=0;if(m>p)m=p;this.interactions[value].curValue=(Math.round((m/p)*o.realValue));if(o.stepping){this.interactions[value].curValue=Math.round(this.interactions[value].curValue/o.stepping)*o.stepping;m=((this.interactions[value].curValue)/o.realValue)*p}$(this.interactions[value].element).css(prop,m+'px');if(!changeslide&&this.interactions[value].pickValue!=this.interactions[value].curValue&&!p)$(this.element).triggerHandler("slidechange",[null,this.prepareCallbackObj(this.interactions[value])],o.change);if(changeslide)$(this.element).triggerHandler("slide",[null,this.prepareCallbackObj(this.interactions[value])],o.slide)}else{var o=this.interaction.options;var offset=$(this.interaction.element).offsetParent().offset({border:false});this.interaction.pickValue=this.interaction.curValue;value=value-o.minValue;var modifier=scale||o.realValue;if(!p)var p=this.parentSize;var prop=this.prop;var m=Math.round(((value)/modifier)*p);if(m<0)m=0;if(m>p)m=p;this.interaction.curValue=(Math.round((m/p)*o.realValue));if(o.stepping){this.interaction.curValue=Math.round(this.interaction.curValue/o.stepping)*o.stepping;m=((this.interaction.curValue)/o.realValue)*p}$(this.interaction.element).css(prop,m+'px');if(!changeslide&&this.interaction.pickValue!=this.interaction.curValue&&!p)$(this.element).triggerHandler("slidechange",[null,this.prepareCallbackObj(this.interaction)],o.change);if(changeslide)$(this.element).triggerHandler("slide",[null,this.prepareCallbackObj(this.interaction)],o.slide)}}})})(jQuery);var tabs=new Array();function initTabs(){tabs=new Array();var liste=document.getElementsByTagName("div");var nbTab=0;for(var i=0;i<liste.length;++i){if(liste[i].id.indexOf("onglet",0)==0){for(var k=0;k<tabs.length;++k){if(tabs[k]==liste[i])return}tabs.push(liste[i]);if(nbTab!=0){hide(liste[i].id)}nbTab++}}var title=getObj("titleTabs");title.innerHTML="";for(var i=0;i<tabs.length;++i){var classN="selectTab";if(i==0)classN="selectedTab";title.innerHTML+='<span id="tabTitle'+i+'" class="'+classN+'"><a href="javascript:;" onClick="drawTab('+i+');">'+tabs[i].className+'</a></span>'}}function drawTab(id){for(var i=0;i<tabs.length;++i){if(i==id)show(tabs[i].id);else hide(tabs[i].id);getObj("tabTitle"+i).className="selectTab"}if(getObj("tabTitle"+id)!=null){if(getObj("tabTitle"+id).className=="selectTab")getObj("tabTitle"+id).className="selectedTab";else getObj("tabTitle"+id).className="selectTab"}}function Range(){this._value=0;this._minimum=0;this._maximum=100;this._extent=0;this._step=1.0;this._isChanging=false}Range.prototype.setValue=function(value){value=Math.round(parseFloat(value));if(isNaN(value))return;value=this._minimum+this._step*Math.round((value-this._minimum)/this._step);if(this._value!=value){if(value+this._extent>this._maximum)this._value=this._maximum-this._extent;else if(value<this._minimum)this._value=this._minimum;else this._value=value;if(!this._isChanging&&typeof this.onchange=="function")this.onchange()}return this._value};Range.prototype.getValue=function(){return this._value};Range.prototype.setExtent=function(extent){if(this._extent!=extent){if(extent<0)this._extent=0;else if(this._value+extent>this._maximum)this._extent=this._maximum-this._value;else this._extent=extent;if(!this._isChanging&&typeof this.onchange=="function")this.onchange()}};Range.prototype.getExtent=function(){return this._extent};Range.prototype.setMinimum=function(minimum){if(this._minimum!=minimum){var oldIsChanging=this._isChanging;this._isChanging=true;this._minimum=minimum;if(minimum>this._value)this.setValue(minimum);if(minimum>this._maximum){this._extent=0;this.setMaximum(minimum);this.setValue(minimum)}if(minimum+this._extent>this._maximum)this._extent=this._maximum-this._minimum;this._isChanging=oldIsChanging;if(!this._isChanging&&typeof this.onchange=="function")this.onchange()}};Range.prototype.getMinimum=function(){return this._minimum};Range.prototype.setMaximum=function(maximum){if(this._maximum!=maximum){var oldIsChanging=this._isChanging;this._isChanging=true;this._maximum=maximum;if(maximum<this._value)this.setValue(maximum-this._extent);if(maximum<this._minimum){this._extent=0;this.setMinimum(maximum);this.setValue(this._maximum)}if(maximum<this._minimum+this._extent)this._extent=this._maximum-this._minimum;if(maximum<this._value+this._extent)this._extent=this._maximum-this._value;this._isChanging=oldIsChanging;if(!this._isChanging&&typeof this.onchange=="function")this.onchange()}};Range.prototype.getMaximum=function(){return this._maximum};var CURRENT_CAT=1;var scrollers=Array();function do_reloadModele(z){loaded();var con=z.split("|||");eval(con[1]);if(eval("myScroller"+CURRENT_CAT).baseScroller.scroller!=null){if(z!="END")eval("myScroller"+CURRENT_CAT).baseScroller.scroller.innerHTML+=con[0]}else{alert("Error prodSelect Module")}try{if(initSearch)initSearch(false)}catch(err){}}function BaseScroller(id){var BaseScroller=new Object;BaseScroller.imgSize=80;BaseScroller.nbView=4;BaseScroller.scroller=null;BaseScroller.Timer=0;BaseScroller.Pas=88;BaseScroller.left=0;BaseScroller.nbItems=0;BaseScroller.nbDl=10;BaseScroller.maxLeft=90000;BaseScroller.finalWidth=90000;BaseScroller.maxRight=-90000;BaseScroller.id=id;BaseScroller.child=null;BaseScroller.setImgSize=function(taille){this.imgSize=taille;this.maxLeft=-(this.imgSize*this.nbView)};BaseScroller.init=function(idObj,newImgSize,newNbItems,newNbDl,newNbView,newPas){this.id=idObj;this.nbDl=newNbDl;this.nbView=newNbView;this.setImgSize(newImgSize);this.Pas=newPas;this.nbItems=newNbItems;scrollers[""+this.id]=this;this.getPageNum()};BaseScroller.resetValues=function(){this.left=0;if(this.scroller!=null)this.scroller.style.left=0+"px";this.nbItems=0;this.setImgSize(this.imgSize);this.finalWidth=90000;this.maxRight=-90000};BaseScroller.moveLayer=function(Sens,offsetWidth){var retBool=new Array(0,0,0);this.finalWidth=(Math.floor(this.nbItems/this.nbDl)*this.imgSize*this.nbDl)+(this.nbItems%this.nbDl*this.imgSize)-this.nbView*this.imgSize;this.scroller=getObj("scroller"+this.id);if(this.scroller==null)return null;try{if(parseInt(this.scroller.style.left)+(this.Pas*Sens)>0){if(this.child)this.child.moveTo("start");else this.moveTo("start");if(this.Timer!=null&&is_numeric(this.Timer))clearTimeout(this.Timer)}else if(parseInt(this.scroller.style.left)+(this.Pas*Sens)<-(this.scroller.offsetWidth-offsetWidth)){if(this.Timer!=null&&is_numeric(this.Timer))clearTimeout(this.Timer)}else{this.left=(parseInt(this.scroller.style.left)+(this.Pas*Sens));if(this.left<(this.finalWidth*-1)){if(this.child)this.child.moveTo("end");else this.moveTo("end");return null}this.scroller.style.left=this.left+"px";if(Math.abs(parseInt(this.scroller.style.left))%(this.nbDl*this.imgSize)==0){if(this.maxLeft>=this.left){var nb=Math.abs(parseInt(this.scroller.style.left)/(this.nbDl*this.imgSize))*(this.nbDl);this.maxLeft=this.maxLeft-(this.imgSize*this.nbDl);retBool[1]=true;retBool[2]=nb}}}retBool[0]=true}catch(e){alert("BaseScroll: Move Layer: "+e)}this.Timer=setTimeout("myScroller"+this.id+".moveLayer("+Sens+");",500);if(retBool[0])this.getPageNum();return retBool};BaseScroller.moveTo=function(to){try{var ret=-1;this.finalWidth=(Math.floor(this.nbItems/this.nbDl)*this.imgSize*this.nbDl)+(this.nbItems%this.nbDl*this.imgSize)-this.nbView*this.imgSize;if(to=="start")to=0;else{var nb=Math.abs(this.left/this.imgSize);ret=nb;if(this.nbItems>this.nbView)to=this.finalWidth*-1;else to=0}this.scroller=getObj("scroller"+this.id);if(this.scroller==null)CURRENT_CAT=this.id;else this.scroller.style.left=to+"px";this.left=to;loaded();this.getPageNum();return ret}catch(e){alert("BaseSCroller.moveTo "+e)}};BaseScroller.stopScroll=function(){clearTimeout(this.Timer)};BaseScroller.setNbItems=function(nb){this.nbItems=nb};BaseScroller.empty=function(){};BaseScroller.getPageNum=function(){var curp=Math.abs((this.left/this.imgSize));if(getObj("scrollerCurrentPage"+this.id)!=null)getObj("scrollerCurrentPage"+this.id).innerHTML=curp;this.validateButtons(curp);return curp};BaseScroller.validateButtons=function(page){try{var startbtn=getObj("startBtn"+this.id);var endbtn=getObj("endBtn"+this.id);if(page==0){if(startbtn!=null)startbtn.className="startBtnSelected"}else{if(startbtn!=null)startbtn.className="startBtn"}var completeL=(this.nbItems*this.imgSize);if(page==Math.ceil(completeL/this.Pas-this.nbView)){if(endbtn!=null)endbtn.className="endBtnSelected"}else{if(endbtn!=null)endbtn.className="endBtn"}var nbVisibleItems=0;var items=$("#scroller"+this.id).children();for(var i=0;i<items.length;++i)if(items[i].style.display!="none")nbVisibleItems++;var obj=getObj("endBtn"+this.id);if(obj){if(nbVisibleItems<=this.nbView)hideObj(obj);else showObj(obj)}}catch(e){alert("BaseScroller.validateButtons "+e)}};BaseScroller.updateCtrls=function(){var curP=this.getPageNum();try{var nbVisibleItems=0,selIndex=-1;var items=$("#scroller"+this.id).children(),itemsChildren;for(var i=0;i<items.length;++i){if(items[i].style.display!="none"){if(items[i].className!="ressourceToSelect"){if(items[i].className=="ressourceSelected"){selIndex=nbVisibleItems}else{itemsChildren=$("#"+items[i].id).children();if((itemsChildren.length==1)&&(itemsChildren[0].className=="ressourceSelected"))selIndex=nbVisibleItems}}nbVisibleItems++}}var nbVisiblePages=nbVisibleItems/this.nbView,nbVisiblePagesf=Math.floor(nbVisiblePages);if(nbVisiblePages>nbVisiblePagesf)nbVisiblePages=nbVisiblePagesf+1;if(selIndex&&(selIndex!=-1)){var selPage=selIndex/this.nbView;selPagef=Math.floor(selPage);if(selPage>selPagef)selPage=selPagef+1;if(curP!=selPage){var step=Math.abs(selPage-curP)*this.Pas,sign=1;if(selPage>curP)sign*=-1;this.moveLayer(sign,step);this.stopScroll()}}else if(nbVisiblePages<curP)this.moveTo("start")}catch(e){alert("BaseScroller.updateCtrls"+e)}};return BaseScroller};function Scroller(id){var Scroller=new Object;Scroller.baseScroller=new BaseScroller;Scroller.baseScroller.id=id;Scroller.cat=1;Scroller.genre=1;Scroller.marchand=1;Scroller.marque=0;Scroller.setImgSize=function(taille){this.baseScroller.setImgSize(taille)};Scroller.init=function(idObj,newImgSize,newNbDl,newNbView,newPas,newCat,newGenre,newMarchand,newMarque){this.baseScroller.init(idObj,newImgSize,0,newNbDl,newNbView,newPas);this.baseScroller.child=this;this.cat=newCat;this.genre=newGenre;this.marchand=newMarchand;this.marque=newMarque};Scroller.setCat=function(val){if(this.baseScroller.scroller!=null)this.baseScroller.scroller.innerHTML="LOADING...";this.cat=val;this.resetValues();this.reloadModele(0,this.nbDl);if(this.baseScroller.scroller!=null)this.baseScroller.scroller.innerHTML=""};Scroller.getPageNum=function(){return this.baseScroller.getPageNum()};Scroller.validateButtons=function(curp){return this.baseScroller.validateButtons(curp)};Scroller.reloadNbModele=function(){CURRENT_CAT=this.baseScroller.id;x_getNBResult(eval("myScroller"+this.baseScroller.id).do_reloadNbModele)};Scroller.resetValues=function(){this.baseScroller.resetValues()};Scroller.goToProd=function(id){var found=false;var liste=eval("modeles_list_"+this.baseScroller.id);var liste_taille=liste.length;var position=0;for(var i=0;i<liste_taille;++i){if(id==liste[i]){position=i;found=true}}if(found){selectModele(id,this.baseScroller.id)}else{}this.baseScroller.getPageNum()};Scroller.reloadModele=function(dep,nb){loading();CURRENT_CAT=this.position;x_selectProd(this.position,this.cats,this.genre,this.marchand,this.marque,dep,nb,do_reloadModele)};Scroller.setNbModele=function(nb){this.baseScroller.setNbItems(nb);if(getObj("scrollerNbPage"+this.baseScroller.id)!=null){var pp=Math.ceil(nb/this.baseScroller.nbView);if(pp<1)pp=1;getObj("scrollerNbPage"+this.baseScroller.id).innerHTML=pp}};Scroller.moveLayer=function(Sens){var offset=0;var obj=getObj("productSelector"+this.baseScroller.id);if(obj)offset=obj.offsetWidth;var ret=this.baseScroller.moveLayer(Sens,offset);if(ret!=null){if(ret[1]){this.reloadModele(ret[2],this.baseScroller.nbDl)}}};Scroller.stopScroll=function(){clearTimeout(this.baseScroller.Timer)};Scroller.moveTo=function(to){var nb=this.baseScroller.moveTo(to);if(nb>=1)this.reloadModele(nb,this.baseScroller.nbItems)};Scroller.change=function(text){try{if(getObj("prodName"+this.baseScroller.id)!=null)getObj("prodName"+this.baseScroller.id).innerHTML=eval("modele_libelle"+text)}catch(err){}};Scroller.empty=function(){if(getObj("prodName"+this.baseScroller.id)!=null)getObj("prodName"+this.baseScroller.id).innerHTML="&nbsp;"};Scroller.toString=function(){return"Scroller "+this.id};return Scroller};Slider.isSupported=typeof document.createElement!="undefined"&&typeof document.documentElement!="undefined"&&typeof document.documentElement.offsetWidth=="number";function Slider(oElement,oInput,sOrientation){if(!oElement)return;this._orientation=sOrientation||"horizontal";this._range=new Range();this._range.setExtent(0);this._blockIncrement=10;this._unitIncrement=1;this._timer=new Timer(100);if(Slider.isSupported&&oElement){this.document=oElement.ownerDocument||oElement.document;this.element=oElement;this.element.slider=this;this.element.unselectable="on";this.element.className=this._orientation+" "+this.classNameTag+" "+this.element.className;this.line=this.document.createElement("DIV");this.line.className="line";this.line.unselectable="on";this.line.appendChild(this.document.createElement("DIV"));this.element.appendChild(this.line);this.handle=this.document.createElement("DIV");this.handle.className="handle";this.handle.unselectable="on";this.handle.appendChild(this.document.createElement("DIV"));this.handle.firstChild.appendChild(this.document.createTextNode(String.fromCharCode(160)));this.element.appendChild(this.handle)}this.input=oInput;var oThis=this;this._range.onchange=function(){oThis.recalculate();if(typeof oThis.onchange=="function")oThis.onchange()};if(Slider.isSupported&&oElement){this.element.onfocus=Slider.eventHandlers.onfocus;this.element.onblur=Slider.eventHandlers.onblur;this.element.onmousedown=Slider.eventHandlers.onmousedown;this.element.onmouseover=Slider.eventHandlers.onmouseover;this.element.onmouseout=Slider.eventHandlers.onmouseout;this.element.onkeydown=Slider.eventHandlers.onkeydown;this.element.onkeypress=Slider.eventHandlers.onkeypress;this.element.onmousewheel=Slider.eventHandlers.onmousewheel;this.handle.onselectstart=this.element.onselectstart=function(){return false};this._timer.ontimer=function(){oThis.ontimer()};window.setTimeout(function(){oThis.recalculate()},1)}else{this.input.onchange=function(e){oThis.setValue(oThis.input.value)}}this.deactivate=function(){var left,top;left=this.handle.style.left;top=this.handle.style.top;this.handle.className="handleOff";this.line.className="lineOff";this.handle.style.position="absolute";this.handle.style.left=left;this.handle.style.top=top;this.onchange=null;this.ontimer=function(){};this.element.onfocus=this.element.onblur=this.element.onmousedown=this.element.onmouseover=this.element.onmouseout=this.element.onkeydown=this.element.onkeypress=this.element.onmousewheel=this.handle.onselectstart=this.element.onselectstart=function(){}}}Slider.eventHandlers={getEvent:function(e,el){if(!e){if(el)e=el.document.parentWindow.event;else e=window.event}if(!e.srcElement){var el=e.target;while(el!=null&&el.nodeType!=1)el=el.parentNode;e.srcElement=el}if(typeof e.offsetX=="undefined"){e.offsetX=e.layerX;e.offsetY=e.layerY}return e},getDocument:function(e){if(e.target)return e.target.ownerDocument;return e.srcElement.document},getSlider:function(e){var el=e.target||e.srcElement;while(el!=null&&el.slider==null){el=el.parentNode}if(el)return el.slider;return null},getLine:function(e){var el=e.target||e.srcElement;while(el!=null&&el.className!="line"){el=el.parentNode}return el},getHandle:function(e){var el=e.target||e.srcElement;var re=/handle/;while(el!=null&&!re.test(el.className)){el=el.parentNode}return el},onfocus:function(e){var s=this.slider;s._focused=true;s.handle.className="handle hover"},onblur:function(e){var s=this.slider;s._focused=false;s.handle.className="handle"},onmouseover:function(e){e=Slider.eventHandlers.getEvent(e,this);var s=this.slider;if(e.srcElement==s.handle)s.handle.className="handle hover"},onmouseout:function(e){e=Slider.eventHandlers.getEvent(e,this);var s=this.slider;if(e.srcElement==s.handle&&!s._focused)s.handle.className="handle"},onmousedown:function(e){e=Slider.eventHandlers.getEvent(e,this);var s=this.slider;if(s.element.focus)s.element.focus();Slider._currentInstance=s;var doc=s.document;if(doc.addEventListener){doc.addEventListener("mousemove",Slider.eventHandlers.onmousemove,true);doc.addEventListener("mouseup",Slider.eventHandlers.onmouseup,true)}else if(doc.attachEvent){doc.attachEvent("onmousemove",Slider.eventHandlers.onmousemove);doc.attachEvent("onmouseup",Slider.eventHandlers.onmouseup);doc.attachEvent("onlosecapture",Slider.eventHandlers.onmouseup);s.element.setCapture()}if(Slider.eventHandlers.getHandle(e)){Slider._sliderDragData={screenX:e.screenX,screenY:e.screenY,dx:e.screenX-s.handle.offsetLeft,dy:e.screenY-s.handle.offsetTop,startValue:s.getValue(),slider:s}}else{var lineEl=Slider.eventHandlers.getLine(e);s._mouseX=e.offsetX+(lineEl?s.line.offsetLeft:0);s._mouseY=e.offsetY+(lineEl?s.line.offsetTop:0);s._increasing=null;s.ontimer()}},onmousemove:function(e){e=Slider.eventHandlers.getEvent(e,this);if(Slider._sliderDragData){var s=Slider._sliderDragData.slider;var boundSize=s.getMaximum()-s.getMinimum();var size,pos,reset;if(s._orientation=="horizontal"){size=s.element.offsetWidth-s.handle.offsetWidth;pos=e.screenX-Slider._sliderDragData.dx;reset=Math.abs(e.screenY-Slider._sliderDragData.screenY)>100}else{size=s.element.offsetHeight-s.handle.offsetHeight;pos=s.element.offsetHeight-s.handle.offsetHeight-(e.screenY-Slider._sliderDragData.dy);reset=Math.abs(e.screenX-Slider._sliderDragData.screenX)>100}s.setValue(reset?Slider._sliderDragData.startValue:s.getMinimum()+boundSize*pos/size);return false}else{var s=Slider._currentInstance;if(s!=null){var lineEl=Slider.eventHandlers.getLine(e);s._mouseX=e.offsetX+(lineEl?s.line.offsetLeft:0);s._mouseY=e.offsetY+(lineEl?s.line.offsetTop:0)}}},onmouseup:function(e){e=Slider.eventHandlers.getEvent(e,this);var s=Slider._currentInstance;var doc=s.document;if(doc.removeEventListener){doc.removeEventListener("mousemove",Slider.eventHandlers.onmousemove,true);doc.removeEventListener("mouseup",Slider.eventHandlers.onmouseup,true)}else if(doc.detachEvent){doc.detachEvent("onmousemove",Slider.eventHandlers.onmousemove);doc.detachEvent("onmouseup",Slider.eventHandlers.onmouseup);doc.detachEvent("onlosecapture",Slider.eventHandlers.onmouseup);s.element.releaseCapture()}if(Slider._sliderDragData){Slider._sliderDragData=null}else{s._timer.stop();s._increasing=null}Slider._currentInstance=null},onkeydown:function(e){e=Slider.eventHandlers.getEvent(e,this);var s=this.slider;var kc=e.keyCode;switch(kc){case 33:s.setValue(s.getValue()+s.getBlockIncrement());break;case 34:s.setValue(s.getValue()-s.getBlockIncrement());break;case 35:s.setValue(s.getOrientation()=="horizontal"?s.getMaximum():s.getMinimum());break;case 36:s.setValue(s.getOrientation()=="horizontal"?s.getMinimum():s.getMaximum());break;case 38:case 39:s.setValue(s.getValue()+s.getUnitIncrement());break;case 37:case 40:s.setValue(s.getValue()-s.getUnitIncrement());break}if(kc>=33&&kc<=40){return false}},onkeypress:function(e){e=Slider.eventHandlers.getEvent(e,this);var kc=e.keyCode;if(kc>=33&&kc<=40){return false}},onmousewheel:function(e){e=Slider.eventHandlers.getEvent(e,this);var s=this.slider;if(s._focused){s.setValue(s.getValue()+e.wheelDelta/120*s.getUnitIncrement());return false}}};Slider.prototype.classNameTag="dynamic-slider-control",Slider.prototype.setStep=function(v){this._range._step=v};Slider.prototype.getStep=function(){return parseInt(this._range._step)};Slider.prototype.setValue=function(v){this.input.value=this._range.setValue(v);this.recalculate()};Slider.prototype.getValue=function(){return this._range.getValue()};Slider.prototype.setMinimum=function(v){this._range.setMinimum(v);this.input.value=this.getValue()};Slider.prototype.getMinimum=function(){return this._range.getMinimum()};Slider.prototype.setMaximum=function(v){this._range.setMaximum(v);this.input.value=this.getValue()};Slider.prototype.getMaximum=function(){return this._range.getMaximum()};Slider.prototype.setUnitIncrement=function(v){this._unitIncrement=v};Slider.prototype.getUnitIncrement=function(){return this._unitIncrement};Slider.prototype.setBlockIncrement=function(v){this._blockIncrement=v};Slider.prototype.getBlockIncrement=function(){return this._blockIncrement};Slider.prototype.getOrientation=function(){return this._orientation};Slider.prototype.setOrientation=function(sOrientation){if(sOrientation!=this._orientation){if(Slider.isSupported&&this.element){this.element.className=this.element.className.replace(this._orientation,sOrientation)}this._orientation=sOrientation;this.recalculate()}};function SliderrealOffset(obj,offsetType){var offset=0;while(obj){offset+=obj[offsetType];obj=obj.offsetParent}return offset}Slider.prototype.recalculate=function(){if(!Slider.isSupported||!this.element){alert("return");return}var w=this.element.offsetWidth;var h=this.element.offsetHeight;var hw=this.handle.offsetWidth;var hh=this.handle.offsetHeight;var lw=this.line.offsetWidth;var lh=this.line.offsetHeight;var handlePos=0;if(this._orientation=="horizontal"){handlePos=(w-hw)*(this.getValue()-this.getMinimum())/(this.getMaximum()-this.getMinimum());this.handle.style.left=handlePos+"px";this.handle.style.top=(h-hh)/2+"px";this.line.style.top=(h-lh)/2+"px";this.line.style.left="0"+"px";this.line.style.width=Math.max(0,handlePos)+"px";this.line.firstChild.style.width=Math.max(0,w-hw-4)+"px"}else{this.handle.style.left=(w-hw)/2+"px";this.handle.style.top=h-hh-(h-hh)*(this.getValue()-this.getMinimum())/(this.getMaximum()-this.getMinimum())+"px";this.line.style.left=(w-lw)/2+"px";this.line.style.top=hh/2+"px";this.line.style.height=Math.max(0,h-hh-2)+"px";this.line.firstChild.style.height=Math.max(0,h-hh-4)+"px"}};Slider.prototype.ontimer=function(){var hw=this.handle.offsetWidth;var hh=this.handle.offsetHeight;var hl=this.handle.offsetLeft;var ht=this.handle.offsetTop;if(this._orientation=="horizontal"){if(this._mouseX>hl+hw&&(this._increasing==null||this._increasing)){this.setValue(this.getValue()+this.getBlockIncrement());this._increasing=true}else if(this._mouseX<hl&&(this._increasing==null||!this._increasing)){this.setValue(this.getValue()-this.getBlockIncrement());this._increasing=false}}else{if(this._mouseY>ht+hh&&(this._increasing==null||!this._increasing)){this.setValue(this.getValue()-this.getBlockIncrement());this._increasing=false}else if(this._mouseY<ht&&(this._increasing==null||this._increasing)){this.setValue(this.getValue()+this.getBlockIncrement());this._increasing=true}}this._timer.start()};function SlideShow(id){var Slide=new Object;Slide.id=id;Slide.height=0;Slide.offsetHeight=0;Slide.current=0;Slide.max=0;Slide.vitesse=1;Slide.Timer=null;Slide.overflow="";Slide.setSpeed=function(hei){this.vitesse=hei};Slide.updateSlideShow=function(){if(parseInt(getObj(this.id).style.height)<this.max){if(this.current<this.max){getObj(this.id).style.height=this.current+"px";this.current=this.current+1*this.vitesse;this.Timer=window.setTimeout(this.id+".updateSlideShow()",10)}else{getObj(this.id).style.height=this.height;getObj(this.id).style.overflow=this.overflow}}else{show(this.id);getObj(this.id).style.height=this.height;getObj(this.id).style.overflow=this.overflow;if(this.Timer!=null)clearTimeout(this.Timer)}};Slide.updateSlideShow2=function(){if(this.max<this.offsetHeight){if(this.max<this.current){getObj(this.id).style.height=this.current+"px";this.current=this.current-1*this.vitesse;this.Timer=window.setTimeout(this.id+".updateSlideShow2()",10)}else{hide(this.id);getObj(this.id).style.height=this.height}}else{hide(this.id);getObj(this.id).style.height=this.height;if(this.Timer!=null)clearTimeout(this.Timer)}};Slide.show=function(){this.max=this.offsetHeight;this.overflow=getObj(this.id).style.overflow;getObj(this.id).style.overflow="hidden";getObj(this.id).style.height=0;show(this.id);this.current=0;this.Timer=window.setTimeout(this.id+".updateSlideShow()",10)};Slide.hide=function(){this.max=0;getObj(this.id).style.overflow="hidden";this.current=this.offsetHeight;slideshow=window.setTimeout(this.id+".updateSlideShow2()",10)};Slide.slideShow=function(){if(getObj(this.id).style.display=="none"){this.show()}else{this.hide()}};Slide.init=function(){this.height=getObj(this.id).style.height;this.offsetHeight=getObj(this.id).offsetHeight;hide(this.id)};return Slide};if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1)}if(id){this.setAttribute("id",id)}if(w){this.setAttribute("width",w)}if(h){this.setAttribute("height",h)}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(c){this.addParam("bgcolor",c)}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9)}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true)},setAttribute:function(_e,_f){this.attributes[_e]=_f},getAttribute:function(_10){return this.attributes[_10]},addParam:function(_11,_12){this.params[_11]=_12},getParams:function(){return this.params},addVariable:function(_13,_14){this.variables[_13]=_14},getVariable:function(_15){return this.variables[_15]},getVariables:function(){return this.variables},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key]}return _16},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" "}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\""}_19+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />"}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />"}_19+="</object>"}return _19},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0])}catch(e){axo=null}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always"}catch(e){if(_23.major==6){return _23}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))}}}return _23};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false}if(this.major>fv.major){return true}if(this.minor<fv.minor){return false}if(this.minor>fv.minor){return true}if(this.rev<fv.rev){return false}return true};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;function Timer(nPauseTime){this._pauseTime=typeof nPauseTime=="undefined"?1000:nPauseTime;this._timer=null;this._isStarted=false}Timer.prototype.start=function(){if(this.isStarted())this.stop();var oThis=this;this._timer=window.setTimeout(function(){if(typeof oThis.ontimer=="function")oThis.ontimer()},this._pauseTime);this._isStarted=false};Timer.prototype.stop=function(){if(this._timer!=null)window.clearTimeout(this._timer);this._isStarted=false};Timer.prototype.isStarted=function(){return this._isStarted};Timer.prototype.getPauseTime=function(){return this._pauseTime};Timer.prototype.setPauseTime=function(nPauseTime){this._pauseTime=nPauseTime};var ns6=(document.getElementById)?true:false;var ie;try{ie=navigator.userAgent.indexOf("MSIE")>0}catch(ep){ie=1}var OSName="Unknown OS";if(navigator.appVersion.indexOf("Win")!=-1)OSName="Windows";if(navigator.appVersion.indexOf("Mac")!=-1)OSName="MacOS";if(navigator.appVersion.indexOf("X11")!=-1)OSName="UNIX";if(navigator.appVersion.indexOf("Linux")!=-1)OSName="Linux";function checkBrowser(){if(OSName=="MacOS")if((navigator.appName.toLowerCase().indexOf("firefox")!=-1)||(navigator.userAgent.toLowerCase().indexOf("camino")!=-1)){window.location='/browsererror'}}var mouseX,mouseY;mouseX=mouseY=0;function mouseInit(){try{if(navigator.appName.substring(0,3)=="Net")document.onclick=sourisxy}catch(err){mouseX=0;mouseY=0}}function sourisxy(e){try{e=e||window.event;mouseX=(e.pageX)?e.pageX:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mouseY=(e.pageY)?e.pageY:e.clientY+document.body.scrollTop+document.documentElement.scrollTop}catch(err){mouseX=0;mouseY=0}try{if(mouseMoveHandler)mouseMoveHandler()}catch(err){}}mouseInit();var version=false;var fullscreen=false;function popup(url,width,height,name){if(!name)name='_popup';return window.open(url.replace(/&amp;/g,'&'),name,'height='+height+',resizable=yes,scrollbars=yes, width='+width);return false}function GetJavaInfo(){if(navigator.javaEnabled()==1||navigator.javaEnabled()==true){var oApplet=document.getElementById("VersionApplet");if(oApplet!=null){if(navigator.userAgent.indexOf("afari")>0||navigator.userAgent.indexOf("Konqueror")>0||navigator.userAgent.indexOf("pera")>0)version=true;else if(ie){try{var sVendor=oApplet.a("java.vendor");if(sVendor!="ERROR"){if(sVendor.toLowerCase().indexOf("sun")!=-1){sVendor+=" VM v"+oApplet.a("java.version");version=jVersion(oApplet.a("java.version"),1)}else if(sVendor.toLowerCase().indexOf("apple")!=-1){version=jVersion(oApplet.a("java.version"),2)}else if(sVendor.toLowerCase().indexOf("microsoft")!=-1){version=false}}}catch(error){}}else{version=true}hide("VersionApplet")}}if(!version){messageJava()}else{hide("java");writeCookie("JAVAOK","YES")}}function messageJava(){show("java")}function installJava(){getObj("java").innerHTML+='<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab" ><param name="code" value="com.sun.opengl.util.JOGLAppletLauncher" /><param name="codeBase" value="subj3d/lib/" /><param name="archive" value="jogl.jar,gluegen-rt.jar,subdo.jar" /><param name="subapplet.classname" value="subdo.Applet" /><param name="subapplet.displayname" value="VB2S - Subdo Java3D" /><param name="progressbar" value="true" /><param name="cache_archive" value="jogl.jar;preload,gluegen-rt.jar;preload,subdo.jar;preload" /><param name="cache_archive_ex" value="jogl.jar;preload,gluegen-rt.jar;preload,subdo.jar;preload" /></object>'}function jVersion(j,v){var evalVersion='';if(v==1){if(j.substring(0,3)>1.3)return true;else return false}else if(v==2){if(j.substring(0,3)>1.)return true;else return false}return false}function loading(text){show("loading")}function loaded(){hide("loading")}function realOffset(obj,offsetType){var offset=0;while(obj){offset+=obj[offsetType];obj=obj.offsetParent}return offset}function ShowHide(post_id){id1=post_id;id2="qr_closed";if(id1!='')expMenu(id1);if(id2!='')expMenu(id2)}function expMenu(id){var itm=null;if(document.getElementById){itm=document.getElementById(id)}else if(document.all){itm=document.all[id]}else if(document.layers){itm=document.layers[id]}if(!itm){}else if(itm.style){if(itm.style.display=="none"){itm.style.display=""}else{itm.style.display="none"}}else itm.visibility="show"}function getObj(id){var itm=null;if(document.getElementById)itm=document.getElementById(id);else if(document.all)itm=document.all[id];else if(document.layers)itm=document.layers[id];return itm}function progressiveShow(id){var itm=getObj(id);var opac=parseFloat(itm.style.opacity);if(opac<1){opac+=0.1;itm.style.opacity=opac;window.setTimeout("progressiveShow('"+id+"')",50)}else itm.style.opacity=1.0}function progressiveHide(id){var itm=getObj(id);var opac=parseFloat(itm.style.opacity);if(isNaN(opac))opac=1;if(opac>0){opac-=0.1;itm.style.opacity=opac;window.setTimeout("progressiveHide('"+id+"')",50)}else itm.style.opacity=0.0}function show(id){var itm=getObj(id);if(!itm){}else if(itm.style){if(itm.style.display=="none"){itm.style.display=""}}else{itm.visibility="show"}}function showObj(itm){if(!itm){}else if(itm.style){if(itm.style.display=="none"){itm.style.display=""}}else{itm.visibility="show"}}function hide(id){var itm=getObj(id);if(!itm){}else if(itm.style){if(itm.style.display=="none"){}else{itm.style.display="none"}}}function hideObj(itm){if(!itm){}else if(itm.style){if(itm.style.display=="none"){}else{itm.style.display="none"}}}function showPic(e,id){var obj=document.getElementById(id);show(id);obj.style.zIndex=200}function hidePic(id){hide(id)}function remAcc(text){text=text.replace(/à|á|â|ã|ä/g,"a");text=text.replace(/ç/g,"c");text=text.replace(/è|é|ê|ë/g,"e");text=text.replace(/ì|í|î|ï/g,"i");text=text.replace(/ñ/g,"n");text=text.replace(/ò|ó|ô|õ|ö/g,"o");text=text.replace(/ù|ú|û|ü/g,"u");text=text.replace(/ý|ÿ/g,"y");text=text.replace(/À|Á|Â|Ã|Ä/g,"A");text=text.replace(/Ç/g,"C");text=text.replace(/È|É|Ê|Ë/g,"E");text=text.replace(/Ì|Í|Î|Ï/g,"I");text=text.replace(/Ñ/g,"N");text=text.replace(/Ò|Ó|Ô|Õ|Ö/g,"O");text=text.replace(/Ù|Ú|Û|Ü/g,"U");text=text.replace(/Ý/g,"Y");return text}function remplacer(id,contenu){document.getElementById(id).innerHTML=contenu}function inputReplace(id,contenu){try{getObj(id).value=contenu}catch(e){id.value=contenu}}function redirection(page){window.location.replace(page)}function is_numeric(num){return IsNumeric(num)}function isArray(obj){if(obj.constructor.toString().indexOf("Array")==-1)return false;else return true}function IsNumeric(sText){var ValidChars="0123456789";var IsNumber=true;var Char;for(TEST=0;TEST<sText.length;TEST++){Char=sText.charAt(TEST);if(ValidChars.indexOf(Char)==-1){IsNumber=false;break}}return IsNumber}function is_passwd(sText){if(sText.length<2)return false;var ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var IsPasswd=true;var Char;for(TEST=0;TEST<sText.length;TEST++){Char=sText.charAt(TEST);if(ValidChars.indexOf(Char)==-1){IsPasswd=false;break}}return IsPasswd}function is_text(sText){if(sText.length==0)return false;var ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";var IsText=true;var Char;for(TEST=0;TEST<sText.length;TEST++){Char=sText.charAt(TEST);if(ValidChars.indexOf(Char)==-1){IsText=false;break}}return IsText}var bookmarkObj=new Array();var bookmarkAddText=new Array();var bookmarkRemText=new Array();function diggit(id){loading("");if(is_numeric(id))x_diggit(id,do_diggit);else alert("Invalid ID !")}function do_diggit(z){if(z=="true"){alert("Vous avez voté pour ce produit !");getObj("intDigg").innerHTML=parseInt(getObj("intDigg").innerHTML)+1}else{alert("Vous avez déja voté pour ce produit !")}loaded()}function addFav(id,obj,addText,remText){if(is_numeric(id)){loading("Ajout du favoris");bookmarkObj[id]=obj;bookmarkAddText[id]=addText;bookmarkRemText[id]=remText;x_addBookmark(id,do_addFav)}else alert("Invalid ID !")}function do_addFav(z){if(z>0){alertMsg("Le produit à été ajouté dans votre liste de favoris !");if($('#'+bookmarkObj[z]+' span')[0]!=null)$('#'+bookmarkObj[z]+' span')[0].innerHTML=bookmarkRemText[z];var o=getObj(bookmarkObj[z]);o.href=o.href.replace("add","remove");if(o.className=="bookmarkButton")o.className="bookmarkButton2";else o.className="bookmarkButton2mini";o.title=bookmarkRemText[z]}loaded()}var removeFavId=0;function removeFav(id,obj,addText,remText){if(confirm("Validez-vous cette action ?")){loading("Suppression du Favoris");if(is_numeric(id)){bookmarkObj[id]=obj;bookmarkAddText[id]=addText;bookmarkRemText[id]=remText;x_removeBookmark(id,do_removeFav)}else alert("Invalid ID :"+id+" - "+obj)}}function do_removeFav(z){if(z>0){if($('#'+bookmarkObj[z]+' span')[0]!=null)$('#'+bookmarkObj[z]+' span')[0].innerHTML=bookmarkAddText[z];var o=getObj(bookmarkObj[z]);o.href=o.href.replace("remove","add");if(o.className=="bookmarkButton2")o.className="bookmarkButton";else o.className="bookmarkButtonmini";o.title=bookmarkAddText[z];if(getObj("bookmark"+removeFavId)!=null){getObj("bookmark"+removeFavId).className="resultElementHidden";history.go(0)}}loaded()}function errFav(){if(confirm("Vous devez être connecté pour utiliser cette fonction. Vous allez être redirigé vers la page de connexion. Continuer ou Annuler"))redirection("/mon-compte/inscription")}var keywords=new Array();var curSearch=null;var emptyedFields=new Array();function suggestion(obj){curSearch=obj;var search=obj.value;if(search.length>1){var wordList=search.split(" ");var lastWord=wordList[wordList.length-1];lastWord=search;if(lastWord.length>1){var inputTop=realOffset(obj,"offsetTop");var inputLeft=realOffset(obj,"offsetLeft");var obj2=getObj("searchingHelper");if(obj2!=null){obj2.style.top=inputTop+(obj.offsetHeight)+"px";obj2.style.left=inputLeft+"px";obj2.style.zIndex=100;x_askKeyword(lastWord,do_suggestion)}return}}$("#searchingHelper").hide("fast");return}function do_suggestion(z){if(z.length>0){var results=z.split(";");var print="";for(var i=0;i<results.length-1;++i)print+="<li><a href='javascript:selectKey(\""+results[i]+"\");'>"+results[i]+"<\/a><\/li>";getObj("searchingHelperContent").innerHTML=print;$("#searchingHelper").show("normal")}}function selectKey(texte){$("#searchingHelper").hide("fast");if(curSearch!=null)obj=curSearch;else obj=getObj("toplineSearch");var search=obj.value;var wordList=search.split(" ");wordList[wordList.length-1]=texte;var recherche2="";for(var i=0;i<wordList.length;i++){recherche2+=wordList[i]+" "}obj.value=recherche2}function emptyTopLineSearch(obj){if(obj==null)obj=getObj("toplineSearch");if(emptyedFields[obj.id]==null){inputReplace(obj,"");emptyedFields[obj.id]=true}}var idNote=0;var idMode="";var idProd=0;var nouvelleNote=0;function noter(note,mode,id,idChange){loading("Notation en cours...");idNote=idChange;idMode=mode;idProd=id;nouvelleNote=note;x_noter(note,mode,id,do_noter)}function do_noter(z){if(z==-1){if(confirm("Vous devez être connecté pour utiliser cette fonction. Vous allez être redirigé vers la page de connexion. Continuer ou Annuler"))redirection("index.php?page=register")}else{if(z>0)alert("Merci d'avoir voté !");if(z==1&&getObj("nbVoteInt")!=null)getObj("nbVoteInt").innerHTML=parseInt(getObj("nbVoteInt").innerHTML)+1;x_getNewNotation(do_newNote)}}function do_newNote(z){x_notation(z,idProd,do_changerNote)}function do_changerNote(z){getObj("NOTATION"+idProd).innerHTML=z;idNote=0;idMode="";idProd="";nouvelleNote=0;loaded()}var NOTES=new Array();function changeNote(id,valeur){NOTE=valeur;idProd=id;NOTES[id]=valeur}function resetNote(id){var stars=document.getElementsByTagName("img");for(var i=0;i<stars.length;++i){if(stars[i].id.indexOf("star"+id+'-',0)==0){var val=stars[i].id.split("-");var value=val[1];var vv=1;if(NOTES[id]>0)vv=NOTES[id];if(value<=vv){getObj("star"+id+"-"+value).className=getObj("star"+id+"-"+value).className.replace("0",'1')}else{getObj("star"+id+"-"+value).className=getObj("star"+id+"-"+value).className.replace("1",'0')}}}}function changeState(id,valeur){var stars=document.getElementsByTagName("img");for(var i=0;i<stars.length;++i){if(stars[i].id.indexOf("star"+id+'-',0)==0){var val=stars[i].id.split("-");var value=val[1];if(value<=valeur){getObj("star"+id+"-"+value).className=getObj("star"+id+"-"+value).className.replace("0",'1')}else{getObj("star"+id+"-"+value).className=getObj("star"+id+"-"+value).className.replace("1",'0')}}}}function writeCookie(nom,valeur){var argv=writeCookie.arguments;var argc=writeCookie.arguments.length;var expires=(argc>2)?argv[2]:null;var path=(argc>3)?argv[3]:null;var domain=(argc>4)?argv[4]:null;var secure=(argc>5)?argv[5]:false;document.cookie=nom+"="+escape(valeur)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"")}function getCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr))}function readCookie(nom){var arg=nom+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg)return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)break}return null}function emptyCookie(nom){date=new Date;date.setFullYear(date.getFullYear()-1);writeCookie(nom,null,date)}function wheel(event){var delta=0;if(!event)event=window.event;if(event.wheelDelta){delta=event.wheelDelta/120;if(window.opera)delta=-delta}else if(event.detail){delta=-event.detail/3}var escape=false;try{if(delta&&handle)escape=handle(delta);if(escape){if(event.preventDefault)event.preventDefault();event.returnValue=false}}catch(err){}}if(window.addEventListener)window.addEventListener('DOMMouseScroll',wheel,false);else window.onmousewheel=document.onmousewheel=wheel;function hiddenFullscreen(afficher){var arrElements=new Array(2);arrElements[0]="object";arrElements[1]="embed";arrElements[2]="div";for(n=0;n<arrElements.length;n++){replaceObj=document.getElementsByTagName(arrElements[n]);for(i=0;i<replaceObj.length;i++){if(arrElements[n]=="div"){if(replaceObj[i].id=="abstract"||replaceObj[i].className=="fullProductSelectorItems"||replaceObj[i].className=="productFocus")continue}else{if(afficher)showObj(replaceObj[i]);else hideObj(replaceObj[i])}}}}function randomNumber(Minimum,Maximum){return(Math.floor(Math.random()*(Maximum-Minimum))+Minimum)}function randomChar(Nombres,Minuscules,Majuscules){var LesChiffres="0123456789";var LesMinuscules="abcdefghijklmnopqrstuvwxyz";var LesMajuscules="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var ChaineCaracteres="";if(Nombres==true)ChaineCaracteres+=LesChiffres;if(Minuscules==true)ChaineCaracteres+=LesMinuscules;if(Majuscules==true)ChaineCaracteres+=LesMajuscules;return ChaineCaracteres.charAt(randomNumber(0,ChaineCaracteres.length))}function ComposerMotPasse(Longueur,NombreEnPremier,MinusculeEnPremier,MajusculeEnPremier,NombreEnsuite,MinusculeEnsuite,MajusculeEnsuite){var Resultat="";if(Longueur>0)Resultat=Resultat+randomChar(NombreEnPremier,MinusculeEnPremier,MajusculeEnPremier);for(var i=1;i<Longueur;++i){Resultat=Resultat+randomChar(NombreEnsuite,MinusculeEnsuite,MajusculeEnsuite)}return Resultat}function isCP(text){return IsNumeric(text)}function isMail(adrr){var reg=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;return reg.test(adrr)}function isPassword(text){if(text.length>2&&text.length<100)return true;return false}function exit(){return}function getWindowDimensions(){var dimensions;if(window.innerWidth!=null)dimensions={width:window.innerWidth,height:window.innerHeight};else if(document.documentElement&&document.documentElement.clientWidth)dimensions={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight};else if(document.body!=null)dimensions={width:document.body.clientWidth,height:document.body.clientHeight};return dimensions}function trim(str,chars){return ltrim(rtrim(str,chars),chars)}function ltrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("^["+chars+"]+","g"),"")}function rtrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("["+chars+"]+$","g"),"")}function ajaxeval(z){var scripts=z.split("<script type=\"text/javascript\">");for(var i=1;i<scripts.length;++i){var script=scripts[i].split("<\/script>");if(script.length&&(script[0]!="")){try{eval(script[0])}catch(err){}}}}function alertMsg(text){return;var obj=getObj("alertMessage");obj.innerHTML="";obj.innerHTML+="<div class='alertHeader'>Message de snowreef:<\/div>";obj.innerHTML+="<div class='alertContent'>"+text+"<\/div>";obj.innerHTML+="<div class='alertFooter'><a href='javascript:hide(\"alertMessage\");'>Fermer</a><\/div>";obj.innerHTML+="<\/div>";show("alertMessage");var height=obj.offsetHeight;var width=obj.offsetWidth;myParent=obj.parentNode;var pHeight=myParent.offsetHeight;var pWidth=myParent.offsetWidth;var sTop=myParent.scrollTop;var sLeft=myParent.scrollLeft;var posY=20;var posX=(pWidth/2)-(width/2)+sLeft;obj.style.top=posY+"px";obj.style.left=posX+"px"}function html_entity_decode(texte){texte=texte.replace(/&quot;/g,'"');texte=texte.replace(/&amp;/g,'&');texte=texte.replace(/&#39;/g,"'");texte=texte.replace(/&lt;/g,'<');texte=texte.replace(/&gt;/g,'>');texte=texte.replace(/&circ;/g,'^');texte=texte.replace(/&lsquo;/g,'‘');texte=texte.replace(/&rsquo;/g,'’');texte=texte.replace(/&ldquo;/g,'“');texte=texte.replace(/&rdquo;/g,'”');texte=texte.replace(/&bull;/g,'•');texte=texte.replace(/&ndash;/g,'–');texte=texte.replace(/&mdash;/g,'—');texte=texte.replace(/&tilde;/g,'˜');texte=texte.replace(/&trade;/g,'™');texte=texte.replace(/&scaron;/g,'š');texte=texte.replace(/&rsaquo;/g,'›');texte=texte.replace(/&oelig;/g,'œ');texte=texte.replace(/&#357;/g,'');texte=texte.replace(/&#382;/g,'ž');texte=texte.replace(/&Yuml;/g,'Ÿ');texte=texte.replace(/&nbsp;/g,' ');texte=texte.replace(/&iexcl;/g,'¡');texte=texte.replace(/&cent;/g,'¢');texte=texte.replace(/&pound;/g,'£');texte=texte.replace(/&curren;/g,' ');texte=texte.replace(/&yen;/g,'¥');texte=texte.replace(/&brvbar;/g,'¦');texte=texte.replace(/&sect;/g,'§');texte=texte.replace(/&uml;/g,'¨');texte=texte.replace(/&copy;/g,'©');texte=texte.replace(/&ordf;/g,'ª');texte=texte.replace(/&laquo;/g,'«');texte=texte.replace(/&not;/g,'¬');texte=texte.replace(/&shy;/g,'­');texte=texte.replace(/&reg;/g,'®');texte=texte.replace(/&macr;/g,'¯');texte=texte.replace(/&deg;/g,'°');texte=texte.replace(/&plusmn;/g,'±');texte=texte.replace(/&sup2;/g,'²');texte=texte.replace(/&sup3;/g,'³');texte=texte.replace(/&acute;/g,'´');texte=texte.replace(/&micro;/g,'µ');texte=texte.replace(/&para/g,'¶');texte=texte.replace(/&middot;/g,'·');texte=texte.replace(/&cedil;/g,'¸');texte=texte.replace(/&sup1;/g,'¹');texte=texte.replace(/&ordm;/g,'º');texte=texte.replace(/&raquo;/g,'»');texte=texte.replace(/&frac14;/g,'¼');texte=texte.replace(/&frac12;/g,'½');texte=texte.replace(/&frac34;/g,'¾');texte=texte.replace(/&iquest;/g,'¿');texte=texte.replace(/&Agrave;/g,'À');texte=texte.replace(/&Aacute;/g,'Á');texte=texte.replace(/&Acirc;/g,'Â');texte=texte.replace(/&Atilde;/g,'Ã');texte=texte.replace(/&Auml;/g,'Ä');texte=texte.replace(/&Aring;/g,'Å');texte=texte.replace(/&AElig;/g,'Æ');texte=texte.replace(/&Ccedil;/g,'Ç');texte=texte.replace(/&Egrave;/g,'È');texte=texte.replace(/&Eacute;/g,'É');texte=texte.replace(/&Ecirc;/g,'Ê');texte=texte.replace(/&Euml;/g,'Ë');texte=texte.replace(/&Igrave;/g,'Ì');texte=texte.replace(/&Iacute;/g,'Í');texte=texte.replace(/&Icirc;/g,'Î');texte=texte.replace(/&Iuml;/g,'Ï');texte=texte.replace(/&ETH;/g,'Ð');texte=texte.replace(/&Ntilde;/g,'Ñ');texte=texte.replace(/&Ograve;/g,'Ò');texte=texte.replace(/&Oacute;/g,'Ó');texte=texte.replace(/&Ocirc;/g,'Ô');texte=texte.replace(/&Otilde;/g,'Õ');texte=texte.replace(/&Ouml;/g,'Ö');texte=texte.replace(/&times;/g,'×');texte=texte.replace(/&Oslash;/g,'Ø');texte=texte.replace(/&Ugrave;/g,'Ù');texte=texte.replace(/&Uacute;/g,'Ú');texte=texte.replace(/&Ucirc;/g,'Û');texte=texte.replace(/&Uuml;/g,'Ü');texte=texte.replace(/&Yacute;/g,'Ý');texte=texte.replace(/&THORN;/g,'Þ');texte=texte.replace(/&szlig;/g,'ß');texte=texte.replace(/&agrave;/g,'à');texte=texte.replace(/&aacute;/g,'á');texte=texte.replace(/&acirc;/g,'â');texte=texte.replace(/&atilde;/g,'ã');texte=texte.replace(/&auml;/g,'ä');texte=texte.replace(/&aring;/g,'å');texte=texte.replace(/&aelig;/g,'æ');texte=texte.replace(/&ccedil;/g,'ç');texte=texte.replace(/&egrave;/g,'è');texte=texte.replace(/&eacute;/g,'é');texte=texte.replace(/&ecirc;/g,'ê');texte=texte.replace(/&euml;/g,'ë');texte=texte.replace(/&igrave;/g,'ì');texte=texte.replace(/&iacute;/g,'í');texte=texte.replace(/&icirc;/g,'î');texte=texte.replace(/&iuml;/g,'ï');texte=texte.replace(/&eth;/g,'ð');texte=texte.replace(/&ntilde;/g,'ñ');texte=texte.replace(/&ograve;/g,'ò');texte=texte.replace(/&oacute;/g,'ó');texte=texte.replace(/&ocirc;/g,'ô');texte=texte.replace(/&otilde;/g,'õ');texte=texte.replace(/&ouml;/g,'ö');texte=texte.replace(/&divide;/g,'÷');texte=texte.replace(/&oslash;/g,'ø');texte=texte.replace(/&ugrave;/g,'ù');texte=texte.replace(/&uacute;/g,'ú');texte=texte.replace(/&ucirc;/g,'û');texte=texte.replace(/&uuml;/g,'ü');texte=texte.replace(/&yacute;/g,'ý');texte=texte.replace(/&thorn;/g,'þ');texte=texte.replace(/&yuml;/g,'ÿ');return texte}function urlencode(content){return escape(content)}function urldecode(content){return unescape(content.replace(/\+/g," "))}window.onresize=initMaxVignettes;var activeMouseHandler=true;$(document).ready(function(){$(document).mousemove(function(){printMaxVignettes()})});var loadMaxVignette=null;function Maximizer(id,photo,width,bigWidth,href,title){var Maxim=new Object();Maxim.id=id;Maxim.x1=0;Maxim.x2=0;Maxim.y1=0;Maxim.y2=0;Maxim.width=width;Maxim.height=width;Maxim.bigWidth=bigWidth;Maxim.bigHeight=bigWidth;Maxim.url=photo;Maxim.img=new Image();Maxim.img.src=photo;Maxim.obj=null;Maxim.href=href;Maxim.title=title;Maxim.complete=false;Maxim.init=function(){clearInterval(loadMaxVignette);loadMaxVignette=setInterval("initMaxVignettes()",500);this.obj=$('#pic-'+this.id)[0];vignetteLeft=realOffset(this.obj,"offsetLeft");vignetteTop=realOffset(this.obj,"offsetTop");this.x1=vignetteLeft;this.y1=vignetteTop;this.x2=vignetteLeft+this.width;this.y2=vignetteTop+this.height};Maxim.getWidth=function(){if(this.img.complete&&this.img.width)return this.img.width;else return this.bigWidth};Maxim.getHeight=function(){if(this.img.complete&&this.img.height)return this.img.height;else return this.bigHeight};Maxim.init();return Maxim};var maximizerArray=new Array();function initMaxVignettes(){var allInited=true;for(var i=0;i<maximizerArray.length;i++){maximizerArray[i].init();if(!maximizerArray[i].img.complete)allInited=false}if(allInited)clearInterval(loadMaxVignette)}var backMax='';window.printMaxVignettes=function(){if(!activeMouseHandler)return;var found=false;for(var i=0;i<maximizerArray.length;i++){if(mouseX>maximizerArray[i].x1&&mouseX<maximizerArray[i].x2&&mouseY>maximizerArray[i].y1&&mouseY<maximizerArray[i].y2){maximizerArray[i].init();found=true;if(backMax!=''&&backMax!="#max-"+maximizerArray[i].id)$(backMax).dialog("close");if($("#max-"+maximizerArray[i].id).length==0){popup='';if(maximizerArray[i].href!='')popup+="<a class='maximumSize' id='max-"+maximizerArray[i].id+"' href='"+maximizerArray[i].href+"'>";popup+="<img src='"+maximizerArray[i].url+"' />";if(maximizerArray[i].href!='')popup+='</a>';$("body").append(popup);$("#max-"+maximizerArray[i].id).dialog({modal:false,resizable:false,closable:false,title:maximizerArray[i].title,width:maximizerArray[i].getWidth(),height:maximizerArray[i].getHeight()+28})}else{$("#max-"+maximizerArray[i].id).dialog("open")}backMax="#max-"+maximizerArray[i].id}}if(!found){$(".maximumSize").dialog("destroy");$(".maximumSize").remove()}};function toCompare(newId){if(getObj("c"+newId).checked){var compr=readCookie("comparator");compr+=";"+newId;writeCookie("comparator",compr)}else{var compr=readCookie("comparator");compr=compr.replace(";"+newId,"");writeCookie("comparator",compr)}}function comparator(url){var objs=document.getElementsByTagName("input");var j=0;if(readCookie("comparator")!=null){var compr=readCookie("comparator").split(";");for(i=0;i<compr.length;++i){if(is_numeric(compr[i])){if(j!=0)url+='-';url+=compr[i];j++}}}if(j>1){emptyCookie("comparator");redirection(""+url)}else alert("Impossible de charger le comparateur de produits")}function printObj(obj,title){popup=window.open('',"snowreef","height=500,width=600,menubar=yes,scrollbars=yes,resizable=yes,,left=10,top=10");popup.document.write("<html><head><title>snowreef</title></head><body bgcolor='#ffffff'>"+getObj(obj).innerHTML+"</body></html>");popup.focus()}var childMenuX2=childMenuX1=childMenuY2=childMenuY1=0;var cloneChild=null;function genererMenuEnfant(){cloneChild=$(".childSelector").clone();$("body").append(cloneChild);$("#navbar-modeenfant").mouseover(function(){cloneChild.show();cloneChild.css("position","absolute");childMenuX1=realOffset(getObj("navbar-modeenfant"),"offsetLeft");childMenuY1=realOffset(getObj("navbar-modeenfant"),"offsetTop");cloneChild.css("left",childMenuX1+"px");cloneChild.css("top",childMenuY1+"px")});$(".childSelector a").mouseover(function(){childMenuX2=childMenuX1+cloneChild[0].offsetWidth;childMenuY2=childMenuY1+cloneChild[0].offsetHeight})}function hideChildMenu(){if(cloneChild!=null&&childMenuX2>childMenuX1&&childMenuY2>childMenuY1&&!(mouseX>childMenuX1&&mouseX<childMenuX2&&mouseY>childMenuY1&&mouseY<childMenuY2)){cloneChild.hide()}}$(document).ready(function(){genererMenuEnfant()});$(document).mousemove(function(){hideChildMenu()});try{}catch(e){}var g_subdoApplet=null;window.onscroll=redrawApplet;window.onresize=redrawApplet;window.onmouseup=redrawApplet;function redrawApplet(e){if(!e)e=window.event;if(e.type=="scroll"){}else if(e.type=="resize"){}return true}window.appletInited=function(obj){var version=obj.eval("build_id");var titlePage=getObj("page_title");if(titlePage!=null){titlePage.text+=" - Subdo Version: "+new String(version)}if(g_subdoApplet!=null){g_subdoApplet.player=obj;if(g_subdoApplet.commands!=null)this.appletLoaded(obj)}return true};window.appletLoaded=function(obj){if(g_subdoApplet!=null){if(g_subdoApplet.player==null)return"NOT_INITED";var cmds=g_subdoApplet.commands;if(cmds!=null){g_subdoApplet.commands=null;for(var j=0,cmd;j<cmds.length;++j){cmd=cmds[j];obj.cmd(cmd.Cmd,cmd.Param1,cmd.Param2)}}return true}return"ERROR"};function SubdoApplet(id){var Applet=new Object;Applet.id=id;Applet.player=null;Applet.loaded=false;Applet.commands=new Array();Applet.kikoo=function(){alert("lol")};Applet.eval=function(com){if(this.player!=null)return this.player.eval(com);return""};Applet.cmd=function(C,P1,P2){return this.Cmd(C,P1,P2)};Applet.Cmd=function(C,P1,P2){if(C=="")return"error";if(this.player!=null){return this.player.cmd(C,P1,P2)}var CO=new Object;CO.Cmd=C;CO.Param1=P1;CO.Param2=P2;this.commands.push(CO);return"Not Ready"};g_subdoApplet=Applet;return Applet};function Vector(x,y,z){this.x=x;this.y=y;this.z=z};Vector.prototype.set=function(x,y,z){this.x=x;this.y=y;this.z=z};Vector.prototype.read=function(pos){var xyz=(""+pos).split(" ");if(xyz.length<3)return null;this.x=parseFloat(xyz[0]);this.y=parseFloat(xyz[1]);this.z=parseFloat(xyz[2]);return this};Vector.prototype.equals=function(pt2){return(this.x==pt2.x)&&(this.y==pt2.y)&&(this.z==pt2.z)};Vector.prototype.dot=function(pt2){return this.x*pt2.x+this.y*pt2.y+this.z*pt2.z};Vector.prototype.vect=function(v2){return new Vector(this.y*v2.z-this.z*v2.y,this.z*v2.x-this.x*v2.z,this.x*v2.y-this.y*v2.x)};Vector.prototype.mul=function(factor){this.x*=factor;this.y*=factor;this.z*=factor;return this};Vector.prototype.snap=function(factor){if(factor!=0.0){this.x=factor*Math.round(this.x/factor);this.y=factor*Math.round(this.y/factor);this.z=factor*Math.round(this.z/factor)}return this};Vector.prototype.div=function(factor){if(factor==0.0)return null;this.x/=factor;this.y/=factor;this.z/=factor;return this};Vector.prototype.add=function(v2){this.x+=v2.x;this.y+=v2.y;this.z+=v2.z;return this};Vector.prototype.subtract=function(v2){this.x-=v2.x;this.y-=v2.y;this.z-=v2.z;return this};Vector.prototype.flip=function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this};Vector.prototype.distance=function(pt2){var x=(this.x-pt2.x),y=(this.y-pt2.y),z=(this.z-pt2.z);return Math.sqrt(x*x+y*y+z*z)};Vector.prototype.norm=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)};Vector.prototype.normalize=function(){var norm=this.x*this.x+this.y*this.y+this.z*this.z;if((norm!=1.0)&&(norm!=0.0)){norm=Math.sqrt(norm);this.x/=norm;this.y/=norm;this.z/=norm}return this};Vector.prototype.toString=function(){return this.x+" "+this.y+" "+this.z};function readVector(pos){var xyz=(""+pos).split(" ");if(xyz.length<3)return null;return new Vector(parseFloat(xyz[0]),parseFloat(xyz[1]),parseFloat(xyz[2]))};window.avatarLoaded=function(applet,param){eval(param+"_js").ready=true;return true};window.ressourceLoaded=function(applet,param){cabine_js.ressource=true;return true};window.avatarLoadedStuff=function(avatar){};window.fullScreenAddOps=function(bEnterFullScreen){};var g_selectedProduct=null;var g_morphoTabID=1;function Avatar(idCabine){var avatar=new Object;avatar.genre=1;avatar.id=idCabine;avatar.name="avatar";avatar.background="";avatar.ready=false;avatar.multipleInstances=false;avatar.type=0;avatar.isolatedId=0;avatar.isolatedInst=0;avatar.ressource=true;avatar.morphologie_key=new Array();avatar.morphologie_value=new Array();avatar.produits=new Array();avatar.dontRecordCookie=false;avatar.toString=function(){return this.id};avatar.addMorph=function(key,value){avatar.morphologie_key.push(key);avatar.morphologie_value.push(value)};avatar.getRootProd=function(rootName){for(var i=0;i<this.produits.length;i++){if(this.produits[i]!=null&&this.produits[i].root==rootName){return this.produits[i]}}return null};avatar.getProd=function(id){for(var i=0;i<this.produits.length;i++){if(this.produits[i]!=null&&this.produits[i].id==id){return this.produits[i]}}return null};avatar.hasProd=function(){for(var i=0;i<this.produits.length;++i)if(this.produits[i]!=null)return true;return false};avatar.hasTriedProd=function(){for(var i=0;i<this.produits.length;++i)if((this.produits[i]!=null)&&(this.produits[i].KparK==false))return true;return false};avatar.getProduct=function(id,inst){if(this.multipleInstances){if(!inst)return null;for(var i=0;i<this.produits.length;i++){if(this.produits[i]!=null&&this.produits[i].id==id){if(this.produits[i].prodInstance!=inst)continue;if(this.produits[i].KparK)continue;return this.produits[i]}}}else{for(var i=0;i<this.produits.length;i++){if(this.produits[i]!=null&&this.produits[i].id==id)return this.produits[i]}}return null};avatar.getModele=function(id,inst){if(this.multipleInstances){if(!inst)return null;for(var i=0;i<this.produits.length;i++){if(this.produits[i]!=null&&this.produits[i].idModele==id){if(this.produits[i].prodInstance!=inst)continue;if(this.produits[i].KparK)continue;return this.produits[i]}}}else{for(var i=0;i<this.produits.length;i++){if(this.produits[i]!=null&&this.produits[i].idModele==id)return this.produits[i]}}return null};avatar.getModelePosition=function(id,inst){for(var i=0;i<this.produits.length;i++){if(this.produits[i]!=null&&this.produits[i].idModele==id){if(inst&&(this.produits[i].prodInstance!=inst))continue;if(this.produits[i].KparK)continue;return this.produits[i].positionGroupe}}return null};avatar.addProd=function(id,modele,produit,position,bKparK){var tmp=new Produit(id);return this.addObjectProd(tmp,modele,produit,position,bKparK)};avatar.addObjectProd=function(obj,modele,produit,position,bKparK){try{modele.length;produit.length}catch(err){modele=obj.modeleUrl;produit=obj.prodUrl}obj.init(this,modele,produit);if(bKparK&&(bKparK!="undefined"))obj.KparK=bKparK;obj.positionGroupe=position;var pos=0,prod;for(;pos<this.produits.length;++pos){prod=this.produits[pos];if(prod&&prod.positionGroupe>position)break}if(pos<this.produits.length){this.produits.push(null);for(var i=this.produits.length;--i>pos;)this.produits[i]=this.produits[i-1];this.produits[pos]=obj}else this.produits.push(obj);return obj};avatar.countInstanceOf=function(idModele){var count=0;for(var i=0;i<this.produits.length;i++)if(this.produits[i]!=null&&this.produits[i].idModele==idModele)count++;return count};avatar.removeProd=function(idModele,count,instanceNum,caller){var position=-1;if(this.multipleInstances){var removedCount=0;for(var i=0;i<this.produits.length;i++){if((this.produits[i]!=null)&&(this.produits[i].idModele==idModele)&&!this.produits[i].KparK){if(this.produits[i].prodInstance){if(count==1){if(this.produits[i].prodInstance!=instanceNum)continue}laySupportedProducts(this.produits[i],eval(this.id));this.produits[i].destroy();this.produits[i]=null;removedCount++}if(removedCount>=count)break}}if((count==1)&&(removedCount==1)){obj=eval(this.id);for(var i=0;i<this.produits.length;i++)if((this.produits[i]!=null)&&(this.produits[i].idModele==idModele)){if(this.produits[i].prodInstance>instanceNum)this.produits[i].prodInstance--;this.produits[i].loaded=true}this.finished()}try{if(morphers_sliders){for(var i=0;i<morphers_sliders.length;++i)morphers_sliders[i].recalculate()}}catch(e){}this.recordCookie("AvatarRemovePrd")}else{for(var i=0;i<this.produits.length;i++){try{if(this.produits[i]!=null&&this.produits[i].idModele==idModele){position=i;this.produits[position].destroy();this.produits[position]=null}}catch(errO){alert(errO+" - "+this.produits[i])}}this.recordCookie("")}};avatar.removeObjProd=function(obj,caller){var position=-1;this.removeProd(obj.idModele,1,obj.prodInstance,caller)};avatar.mustDelete=function(id){for(var i=0;i<this.produits.length;i++){if(!this.multipleInstances&&this.produits[i]!=null&&this.produits[i].id==id){if(!this.produits[i].KparK)return this.produits[i].mustDelete}}return null};avatar.setBackground=function(bgPath){var obj=eval(this.id);obj.Cmd("EnableLight","BG_ROOT","false, recursive");if(this.background&&(this.background!=""))obj.Cmd("deleteObject","BG_ROOT","recursive");this.background=bgPath;if(bgPath&&bgPath!=""){obj.Cmd("load",this.background,"merge, parent World")}this.recordCookie("avatar.setBackground")};avatar.apply=function(bg){var obj=eval(this.id);obj.Cmd("begin","","");for(var i=0;i<this.produits.length;i++)if(this.produits[i]!=null)this.produits[i].apply();this.setBackground(this.background);obj.Cmd("Javascript","avatarLoaded","cabine");obj.Cmd("end","","")};avatar.finished=function(){var nb=0;if(this.multipleInstances){var doneIds=new Array();for(var i=0;i<this.produits.length;i++){if((this.produits[i]!=null)&&this.produits[i].loaded){var alreadyDone=false;for(var j=0;j<doneIds.length;++j){if(doneIds[j]==this.produits[i].idModele){alreadyDone=true;break}}if(!alreadyDone){doneIds.push(this.produits[i].idModele);var count=this.countInstanceOf(this.produits[i].idModele);for(var j=0;j<count;++j){if(getObj("positionRemove"+this.produits[i].idModele+"-"+j))show("positionRemove"+this.produits[i].idModele+"-"+j)}}}}try{this.dontRecordCookie=true;for(var i=0;i<this.produits.length;i++)if((this.produits[i]!=null)&&this.produits[i].prodInstance){if(this.produits[i].linked)linkUnlinkProduct(this.produits[i].id,this.produits[i].prodInstance,true);else if(!this.produits[i].isLinkable()){if(obj=getObj("abstractProductLinkUnlink"+this.produits[i].id+"-"+this.produits[i].prodInstance))obj.innerHTML=""}}for(var i=0;i<this.produits.length;i++)if((this.produits[i]!=null)&&this.produits[i].prodInstance&&!this.produits[i].visible)showHideProduct(this.produits[i].id,this.produits[i].prodInstance,true);this.dontRecordCookie=false;this.recordCookie();showHideAbstract()}catch(e){}}else{for(var i=0;i<this.produits.length;i++){if(this.produits[i]!=null&&this.produits[i].loaded){try{show("positionRemove"+this.produits[i].id);getObj("declinaison"+this.produits[i].id).disabled=false}catch(err3){}nb++}}return nb}return};avatar.setTab=function(id){var obj=eval(this.id);return nb};avatar.setProductsPositions=function(){var applet=eval(this.id);try{for(var i=0,j=0,prod;i<this.produits.length;++i){prod=this.produits[i];if(!prod||prod.KparK)continue;var transform=this.transformsProduits[j++].split(";");if(transform.length<2)continue;applet.Cmd("setObjectPosition",prod.name,prod.position=transform[0]);applet.Cmd("setObjectRotation",prod.name,prod.rotation=transform[1])}}catch(err){alert("setProductsPositions:"+err)}};avatar.getInstance=function(idProduit,instanceNum){for(var i=0;i<this.produits.length;++i){if(this.produits[i]==null)continue;if((this.produits[i].id==idProduit)&&(this.produits[i].prodInstance==instanceNum))return this.produits[i]}return NULL};avatar.setProductProperty=function(idProduit,instanceNum,idMethod,value){if(!idProduit||!instanceNum||!idMethod||!value)return;for(var i=0;i<this.produits.length;++i){if((this.produits[i]==null)||this.produits[i].KparK)continue;if((this.produits[i].id!=idProduit)||(this.produits[i].prodInstance!=instanceNum))continue;try{this.produits[i].setProperty(idMethod,value);this.recordCookie("avatar.setProductProperty")}catch(err){alert("PROPERTY: "+err)}}};avatar.showProducts=function(show){var subdo=eval(this.id);for(var i=0;i<this.produits.length;++i){if(this.produits[i]==null)continue;if(this.produits[i].KparK)continue;subdo.cmd("showObject",this.produits[i].name,show);if(show=="false"){if(this.produits[i].soutif)subdo.Cmd("SetMaterialTiling","Peau","Wrap U 0");else if(this.produits[i].culotte)subdo.Cmd("SetMaterialTiling","Peau","Wrap V 0")}else{if(this.produits[i].soutif)subdo.Cmd("SetMaterialTiling","Peau","Mirror U 0");else if(this.produits[i].culotte)subdo.Cmd("SetMaterialTiling","Peau","Mirror V 0")}}};avatar.showProdSelection=function(){};avatar.showHide=function(idProd,instance,makeVisible){for(var i=0;i<this.produits.length;++i){if((this.produits[i]!=null)&&(this.produits[i].id==idProd)&&(this.produits[i].prodInstance==instance)){var relatedProducts;if(this.produits[i].linked)relatedProducts=this.getLinkedProducts();else{relatedProducts=new Array();relatedProducts.push(this.produits[i])}if(relatedProducts){try{for(var j=0;j<relatedProducts.length;++j){relatedProducts[j].setVisible(makeVisible);if((relatedProducts[j].id!=idProd)||(relatedProducts[j].prodInstance!=instance))showHideCtrlsUpdate(relatedProducts[j].id,relatedProducts[j].prodInstance,makeVisible);var subdo=eval(this.id);subdo.Cmd("showObject",relatedProducts[j].root,makeVisible+",true");g_selectedProduct.enableLight(makeVisible);if(g_selectedProduct==relatedProducts[j])this.showProdSelection()}}catch(e){}this.recordCookie()}return}}};avatar.linkUnlink=function(idProd,instance,makeLink){for(var i=0;i<this.produits.length;++i){if((this.produits[i]!=null)&&(this.produits[i].id==idProd)&&(this.produits[i].prodInstance==instance)){if(!this.produits[i].isLinkable())return false;this.produits[i].setLinked(makeLink);this.recordCookie();this.setSelection(this.produits[i]);return true}}return false};avatar.getLinkedProducts=function(){var linkedProducts=null;for(var i=0;i<this.produits.length;++i){if(this.produits[i]&&this.produits[i].linked){if(!linkedProducts)linkedProducts=new Array();linkedProducts.push(this.produits[i])}}return linkedProducts};avatar.showSelProd=function(prod,sel){var prodNameItem=null;if(g_selectedProduct)prodNameItem=getObj("abstractProductName"+g_selectedProduct.id+"-"+g_selectedProduct.prodInstance);if(prodNameItem){if(!sel)prodNameItem.className="abstractProductName";else{prodNameItem=getObj("abstractProductName"+prod.id+"-"+prod.prodInstance);if(prodNameItem)prodNameItem.className="abstractProductNameSel"}}};avatar.setSelection=function(prod){this.showSelProd(null,false);if(g_selectedProduct=prod)this.showSelProd(prod,true)};avatar.recordCookie=function(caller){if(this.dontRecordCookie)return;try{registry.toString()}catch(er){return}if(this.produits.length<=0){if(this.background)registry.setValue("snowreef.myprodlist.genre"+this.genre+".background",this.background);return}var realI=0;var prod,key,params;var strtype=this.type?"type"+this.type:"";while(key=registry.getKey("snowreef.myprodlist.genre"+this.genre+".produit"+realI+strtype)){if(!(value=key.getValue("id")))break;registry.remove("snowreef.myprodlist.genre"+this.genre+".produit"+realI+strtype);realI++}registry.setValue("snowreef.myprodlist.genre"+this.genre+".background",this.background);realI=0;for(var i=0;i<this.produits.length;i++){prod=this.produits[i];if(!prod||prod.KparK)continue;try{key=registry.getKey("snowreef.myprodlist.genre"+this.genre+".produit"+realI+strtype);key.setValue("id",prod.id);if(prod.prodInstance!=0)key.setValue("instance",prod.prodInstance);key.setValue("visible",prod.visible);key.setValue("linked",prod.linked);params=prod.getParams();if(params!=null){key.setValue("parametres",params)}realI++}catch(e){}}var dateExpire=new Date();dateExpire.setMonth(dateExpire.getMonth()+1);writeCookie("registry",registry,dateExpire,"/")};avatar.isProdSelected=function(prod){if((prod==undefined)||(prod==null))return false;return prod==g_selectedProduct};avatar.productEndLoading=function(subdo,id){};avatar.update=function(){};return avatar};window.onMouseDown=function(a,b){};window.onMouseUp=function(a,b){};window.onMouseDoubleClick=function(a,b){};window.onMouseOver=function(a,b){};window.onMouseOut=function(a,b){};window.onMouseDrag=function(a,b){};window.onMouseDrop=function(a,b){};window.produitCharge=function(applet,param){var splitt=param+"|";try{var tmp=splitt.split("|");var cab=eval("cabine_js");if(cab.getProd(tmp[0])!=null){cab.getProd(tmp[0]).loaded=true}}catch(err2){alert("produit.js - produitCharge: "+err2)}cab.finished();selectLoading=false;return true};function Produit(id){var produit=new Object;produit.idModele=0;produit.prodInstance=0;produit.id=id;produit.avatar=null;produit.modele="";produit.produit="";produit.positions=new Array();produit.mustDelete=false;produit.loaded=false;produit.KparK=false;produit.visible=true;produit.linked=false;produit.getParams=function(){return null};produit.setParams=function(params){};produit.enableLight=function(enable){try{if(this.light&&this.avatar){var obj=eval(this.avatar.id);if(this.light=="shaderlight")obj.Cmd("EnableLight","shaderlight"+this.getSuffix(),enable);else obj.Cmd("EnableLight",this.name,enable+" , recursive");if(enable){++this.avatar.lights;obj.Cmd("SetLightDiffuse","Light","0 0 0")}else{if(--this.avatar.lights==0)obj.Cmd("SetLightDiffuse","Light","1 1 1")}return obj}}catch(e){}return null};produit.copy=function(prod){this.id=prod.id;this.modele=prod.modele;this.produit=prod.produit;this.positions=prod.positions;this.boundingBox=prod.boundingBox;this.idModele=prod.idModele;this.prodUrl=prod.prodUrl;this.modeleUrl=prod.modeleUrl;this.load=prod.load;this.unload=prod.unload;this.classe=prod.classe;this.KparK=prod.KparK;this.copyParams=prod.copyParams;prod.copyParams(this)};produit.make=function(idModele,avatar,modele,produit,position){this.idModele=idModele;this.avatar=getObj(avatar);this.modele=modele;this.produit=produit;this.positions.push(position);this.init(this.avatar,this.modele,this.produit)};produit.init=function(avatar,modele,produit){this.mustDelete=false;this.modele=modele;this.produit=produit;this.avatar=avatar};produit.setVisible=function(makeVisible){this.visible=makeVisible};produit.setLinked=function(bLink){this.linked=bLink};produit.isLinkable=function(){var onWall=false,onFloor=false,onCeiling=false;for(var p=this.positions.length;--p>=0;){switch(this.positions[p]){case 18:onFloor=true;break;case 19:onCeiling=true;break;case 20:onWall=true;break}}return((onFloor||onCeiling)&&!onWall)};produit.getSuffix=function(){return this.root.substring(4,this.root.length)};produit.setProduit=function(id,produit){var oldProd=this.produit;var obj=eval(this.avatar.id);this.id=id;this.produit=produit;obj.Cmd("begin","","");var options="quiet,merge,reload, suffix "+this.getSuffix();if(this.parent)options+=", parent "+this.parent;obj.Cmd("load",this.produit,options);try{if(this.avatar)this.avatar.recordCookie("produit.setProduit")}catch(err){}if(oldProd!=""){obj.Cmd("unload",oldProd,"")}obj.Cmd("Javascript","productEndLoading",this.id);obj.Cmd("Javascript","produitCharge",this.id+"|"+this.avatar.id);obj.Cmd("end","","")};produit.destroy=function(){this.remove()};produit.remove=function(){var obj=eval(this.avatar.id);try{this.mustDelete=true;this.unload(obj);if(this.produit!="")obj.Cmd("unload",this.produit,"");if(this.modele!="")obj.Cmd("unload",this.modele,"materials")}catch(err){}};produit.apply=function(){this.name="MODEL"+this.idModele;this.root="ROOT"+this.idModele;this.camera="CAMERA"+this.idModele;try{var obj=eval(this.avatar.id);obj.Cmd("begin","","");this.load(obj);obj.Cmd("Javascript","produitCharge",this.id+"|"+this.avatar.id);obj.Cmd("end","","")}catch(err){alert("produit.apply: "+err)}};produit.toString=function(){return"id= "+this.id+"instance="+this.prodInstance+"modele="+this.idModele+" visible= "+this.visible+" KparK="+this.KparK+" soutif="+this.soutif+" culotte="+this.culotte};return produit};