/* Wijnoverzicht Javascripts */ function ajaxFail(a,b){alert('AJAX Error');} function ajaxOK_form(request,opt){var formObj=document.getElementById(opt['form']);var targetObj=document.getElementById(formObj.target.value);if(request.responseText) {if(formObj!=null&&formObj.execute_script!=null) {var execute_script=formObj.execute_script.value;if(execute_script!='')eval(execute_script);} targetObj.innerHTML=request.responseText;}} function ajaxOK(request,opt){if(opt.params!=null){if(opt.params.test!=null&&opt.params.test==true){alert(request.responseText);} if(opt.params.load_content!=null&&opt.params.load_content==true){if(document.getElementById(opt.params.load_content_ID)!=null) document.getElementById(opt.params.load_content_ID).innerHTML=request.responseText;} if(opt.params.exec_script!=null&&opt.params.exec_script!=''){eval(opt.params.exec_script);} if(opt.params.response_is_script!=null&&opt.params.response_is_script==true){eval(request.responseText);}}} function do_ajax_post(target){Ext.Ajax.request({form:target,params:'return_html',success:ajaxOK_form,failure:ajaxFail});} function do_ajax_get(options){Ext.Ajax.request({url:options.url,params:{load_coent:options.load_content,load_content_ID:options.container_ID,exec_script:options.exec_script,test:options.test,response_is_script:options.response_is_script},success:ajaxOK,failure:ajaxFail});} function gotoDiv(d){if(document.documentElement&&!document.documentElement.scrollTop){document.body.scrollTop=document.getElementById(d).offsetTop+170;} else if(document.documentElement&&document.documentElement.scrollTop){document.documentElement.scrollTop=document.getElementById(d).offsetTop+170;}} function expand(thistag){styleObj=document.getElementById(thistag).style;if(styleObj.display=='none') {styleObj.display='block';}else {styleObj.display='none';}} function mouseOvr(i){document.images['i'+String(i)].src="/img/menu/i"+String(i)+"-2.gif";} function mouseOt(i){document.images['i'+String(i)].src="/img/menu/i"+String(i)+"-1.gif";} function add_email(value){do_ajax_HTML({url:"/ajax/addemail/E-mailadres-toevoegen.html?dsdcms_submit_email="+value+"&code="+(new Date()).getTime()});} function mail_a_friend(sender,sendername,receiver,receivername,url) {var request=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("MSXML2.XMLHTTP.3.0");request.open("POST","/ajax/mailafriend/Mail-a-friend.html?mail_a_friend_sendername="+sendername+"&mail_a_friend_sender="+sender+"&mail_a_friend_receiver="+receiver+"&mail_a_friend_name="+escape(receivername)+"&url="+escape(url)+"&code="+(new Date()).getTime(),true);request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");request.onreadystatechange=function() {if(request.readyState==4&&request.status==200) {if(request.responseText) {confirm(request.responseText);document.getElementById('mail_a_friend_sender').value='Uw e-mailadres';document.getElementById('mail_a_friend_sendername').value='Uw naam';document.getElementById('mail_a_friend_name').value='Naam ontvanger';document.getElementById('mail_a_friend_receiver').value='E-mailadres ontvanger';}}};request.send(null);} function mail_factsheet(mail_factsheet_email,wineCode) {var request=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("MSXML2.XMLHTTP.3.0");request.open("GET","/ajax/mailfactsheet/Mail-a-factsheet.html?mail_factsheet_email="+mail_factsheet_email+"&mail_factsheet="+wineCode+"&code="+(new Date()).getTime(),true);request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");request.onreadystatechange=function() {if(request.readyState==4&&request.status==200) {if(request.responseText) {confirm(request.responseText);}}};request.send(null);} function do_reactie(reactie,wineCode,waardering,groep){do_ajax_HTML({url:"/ajax/reactie/Reactie.html?reactie="+reactie+"&wineCode="+wineCode+"&waardering="+waardering+"&groep="+groep+"&code="+(new Date()).getTime()});} function isEnter(event) {var keyCode=event.keyCode?event.keyCode:event.which?event.which:event.charCode;if(keyCode==13)return true;} function limitText(limitField,limitCount){var limitNum=document.getElementById(limitField).getAttribute('maxLength');if(document.getElementById(limitField).value.length>limitNum){document.getElementById(limitField).value=document.getElementById(limitField).value.substring(0,limitNum);}else{var o=document.getElementById(limitCount);if(o!=null){setTimeout(function(){o.innerHTML=limitNum-document.getElementById(limitField).value.length;},50);}}} function doPoll(aID,value){do_ajax_HTML({url:"/ajax/poll/Poll.html?aID="+aID+"&value="+value+"&code="+(new Date()).getTime(),update:'pollResults'});} Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(B,A){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=$(B);this.parent(A);var C=this.element.retrieve("wrapper");this.wrapper=C||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth;},set:function(A){this.element.setStyle(this.margin,A[0]);this.wrapper.setStyle(this.layout,A[1]);return this;},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B[F]=Fx.compute(E[F],D[F],C);});return B;},start:function(B,E){if(!this.check(arguments.callee,B,E)){return this;}this[E||this.options.mode]();var D=this.element.getStyle(this.margin).toInt();var C=this.wrapper.getStyle(this.layout).toInt();var A=[[D,C],[0,this.offset]];var G=[[D,C],[-this.offset,0]];var F;switch(B){case"in":F=A;break;case"out":F=G;break;case"toggle":F=(this.wrapper["offset"+this.layout.capitalize()]==0)?A:G;}return this.parent(F[0],F[1]);},slideIn:function(A){return this.start("in",A);},slideOut:function(A){return this.start("out",A);},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(A){return this.start("toggle",A);}});Element.Properties.slide={set:function(B){var A=this.retrieve("slide");if(A){A.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},B));},get:function(A){if(A||!this.retrieve("slide")){if(A||!this.retrieve("slide:options")){this.set("slide",A);}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(D,E){D=D||"toggle";var B=this.get("slide"),A;switch(D){case"hide":B.hide(E);break;case"show":B.show(E);break;case"toggle":var C=this.retrieve("slide:flag",B.open);B[(C)?"slideOut":"slideIn"](E);this.store("slide:flag",!C);A=true;break;default:B.start(D,E);}if(!A){this.eliminate("slide:flag");}return this;}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);var D=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body);}var C=this.element;if(this.options.wheelStops){this.addEvent("start",function(){C.addEvent("mousewheel",D);},true);this.addEvent("complete",function(){C.removeEvent("mousewheel",D);},true);}},set:function(){var A=Array.flatten(arguments);this.element.scrollTo(A[0],A[1]);},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B.push(Fx.compute(E[F],D[F],C));});return B;},start:function(C,H){if(!this.check(arguments.callee,C,H)){return this;}var E=this.element.getSize(),F=this.element.getScrollSize();var B=this.element.getScroll(),D={x:C,y:H};for(var G in D){var A=F[G]-E[G];if($chk(D[G])){D[G]=($type(D[G])=="number")?D[G].limit(0,A):A;}else{D[G]=B[G];}D[G]+=this.options.offset[G];}return this.parent([B.x,B.y],[D.x,D.y]);},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);},toRight:function(){return this.start("right",false);},toBottom:function(){return this.start(false,"bottom");},toElement:function(B){var A=$(B).getPosition(this.element);return this.start(A.x,A.y);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(B,A){this.elements=this.subject=$$(B);this.parent(A);},compute:function(G,H,I){var C={};for(var D in G){var A=G[D],E=H[D],F=C[D]={};for(var B in A){F[B]=this.parent(A[B],E[B],I);}}return C;},set:function(B){for(var C in B){var A=B[C];for(var D in A){this.render(this.elements[C],D,A[D],this.options.unit);}}return this;},start:function(C){if(!this.check(arguments.callee,C)){return this;}var H={},I={};for(var D in C){var F=C[D],A=H[D]={},G=I[D]={};for(var B in F){var E=this.prepare(this.elements[D],B,F[B]);A[B]=E.from;G[B]=E.to;}}return this.parent(H,I);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var B=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(B.element);this.document=this.element.getDocument();this.setOptions(B.options||{});var A=$type(this.options.handle);this.handles=(A=="array"||A=="collection")?$$(this.options.handle):$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this;},start:function(C){if(this.options.preventDefault){C.preventDefault();}this.fireEvent("beforeStart",this.element);this.mouse.start=C.page;var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue;}if(this.options.style){this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();}else{this.value.now[D]=this.element[this.options.modifiers[D]];}if(this.options.invert){this.value.now[D]*=-1;}this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=2;B--;B){if($chk(A[D][B])){this.limit[D][B]=$lambda(A[D][B])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(A){if(this.options.preventDefault){A.preventDefault();}var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",this.element).fireEvent("snap",this.element);}},drag:function(A){if(this.options.preventDefault){A.preventDefault();}this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue;}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.options.invert){this.value.now[B]*=-1;}if(this.options.limit&&this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];}else{if($chk(this.limit[B][0])&&(this.value.now[B]B.left&&A.xB.top);},checkDroppables:function(){var A=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=A){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(A){this.overed=A;this.fireEvent("enter",[this.element,A]);}else{this.overed=null;}}},drag:function(A){this.parent(A);if(this.droppables.length){this.checkDroppables();}},stop:function(A){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed]);this.overed=null;return this.parent(A);}});Element.implement({makeDraggable:function(A){return new Drag.Move(this,A);}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(A,B){this.setOptions(B);this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(A)||A));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert));}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(A){this.elements.push(A);var B=A.retrieve("sortables:start",this.start.bindWithEvent(this,A));(this.options.handle?A.getElement(this.options.handle)||A:A).addEvent("mousedown",B);},this);return this;},addLists:function(){Array.flatten(arguments).each(function(A){this.lists.push(A);this.addItems(A.getChildren());},this);return this;},removeItems:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.elements.erase(B);var C=B.retrieve("sortables:start");(this.options.handle?B.getElement(this.options.handle)||B:B).removeEvent("mousedown",C);},this);return $$(A);},removeLists:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.lists.erase(B);this.removeItems(B.getChildren());},this);return $$(A);},getClone:function(B,A){if(!this.options.clone){return new Element("div").inject(document.body);}if($type(this.options.clone)=="function"){return this.options.clone.call(this,B,A,this.list);}return A.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:A.getStyle("width")}).inject(this.list).position(A.getPosition(A.getOffsetParent()));},getDroppables:function(){var A=this.list.getChildren();if(!this.options.constrain){A=this.lists.concat(A).erase(this.list);}return A.erase(this.clone).erase(this.element);},insert:function(C,B){var A="inside";if(this.lists.contains(B)){this.list=B;this.drag.droppables=this.getDroppables();}else{A=this.element.getAllPrevious().contains(B)?"before":"after";}this.element.inject(B,A);this.fireEvent("sort",[this.element,this.clone]);},start:function(B,A){if(!this.idle){return;}this.idle=false;this.element=A;this.opacity=A.get("opacity");this.list=A.getParent();this.clone=this.getClone(B,A);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){B.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]);}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(B);},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var A=this.element.getStyles("width","height");var B=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:B.top,left:B.left,width:A.width,height:A.height,opacity:0.25}).chain(this.reset.bind(this));}else{this.reset();}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element);},serialize:function(){var C=Array.link(arguments,{modifier:Function.type,index:$defined});var B=this.lists.map(function(D){return D.getChildren().map(C.modifier||function(E){return E.get("id");},this);},this);var A=C.index;if(this.lists.length==1){A=0;}return $chk(A)&&A>=0&&AB[F]){G=D.page[F]-this.options.offsets[F]-E[F];}this.tip.setStyle(C[F],G);}},fill:function(A,B){(typeof B=="string")?A.set("html",B):A.adopt(B);},show:function(){this.fireEvent("show",this.tip);},hide:function(){this.fireEvent("hide",this.tip);}});var SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(B,C){C=C||document;var E=C.getDocument(),D=C.getWindow();this.parent(E,B);this.links=(this.options.links)?$$(this.options.links):$$(E.links);var A=D.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(G){if(G.href.indexOf(A)!=0){return;}var F=G.href.substr(A.length);if(F&&$(F)){this.useLink(G,F);}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){D.location.hash=this.anchor;},true);}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;this.toElement(A);C.stop();}.bind(this));}});var Slider=new Class({Implements:[Events,Options],options:{onTick:function(A){if(this.options.snap){A=this.toPosition(this.step);}this.knob.setStyle(this.property,A);},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(E,A,D){this.setOptions(D);this.element=$(E);this.knob=$(A);this.previousChange=this.previousEnd=this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bind(this));if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement.bindWithEvent(this));}var F,B={},C={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";F="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";F="offsetWidth";}this.half=this.knob[F]/2;this.full=this.element[F]-this.knob[F]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);C[this.axis]=this.property;B[this.axis]=[-this.options.offset,this.full-this.options.offset];this.drag=new Drag(this.knob,{snap:0,limit:B,modifiers:C,onDrag:this.draggedKnob.bind(this),onStart:this.draggedKnob.bind(this),onComplete:function(){this.draggedKnob();this.end();}.bind(this)});if(this.options.snap){this.drag.options.grid=Math.ceil(this.stepWidth);this.drag.options.limit[this.axis][1]=this.full;}},set:function(A){if(!((this.range>0)^(A0)^(A>this.max))){A=this.max;}this.step=Math.round(A);this.checkStep();this.end();this.fireEvent("tick",this.toPosition(this.step));return this;},clickedElement:function(C){var B=this.range<0?-1:1;var A=C.page[this.axis]-this.element.getPosition()[this.axis]-this.half;A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();this.end();this.fireEvent("tick",A);},scrolledElement:function(A){var B=(this.options.mode=="horizontal")?(A.wheel<0):(A.wheel>0);this.set(B?this.step-this.stepSize:this.step+this.stepSize);A.stop();},draggedKnob:function(){var B=this.range<0?-1:1;var A=this.drag.value.now[this.axis];A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"");}},toStep:function(A){var B=(A+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(B-=B%this.stepSize):B;},toPosition:function(A){return(this.full*Math.abs(this.min-A))/(this.steps*this.stepSize)-this.options.offset;}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B);}},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.listener=($type(this.element)!="element")?$(this.element.getDocument().body):this.element;this.timer=null;this.coord=this.getCoords.bind(this);},start:function(){this.listener.addEvent("mousemove",this.coord);},stop:function(){this.listener.removeEvent("mousemove",this.coord);this.timer=$clear(this.timer);},getCoords:function(A){this.page=(this.listener.get("tag")=="body")?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this);}},scroll:function(){var B=this.element.getSize(),A=this.element.getScroll(),E=this.element.getPosition(),D={x:0,y:0};for(var C in this.page){if(this.page[C]<(this.options.area+E[C])&&A[C]!=0){D[C]=(this.page[C]-this.options.area-E[C])*this.options.velocity;}else{if(this.page[C]+this.options.area>(B[C]+E[C])&&B[C]+B[C]!=A[C]){D[C]=(this.page[C]-B[C]+this.options.area-E[C])*this.options.velocity;}}}if(D.y||D.x){this.fireEvent("change",[A.x+D.x,A.y+D.y]);}}});var Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(C.elements,C.options);this.togglers=$$(C.togglers);this.container=$(C.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true;}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}if(this.options.start){this.options.display=false;this.options.show=false;}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity";}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth";}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight";}for(var B=0,A=this.togglers.length;B0));this.fireEvent(C?"background":"active",[this.togglers[D],E]);for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]];}},this);return this.start(B);}});function URLDecode(encoded) {var HEXCHARS="0123456789ABCDEFabcdef";var plaintext="";var i=0;while(imax){return"[WARNING: Too much recursion]\n";} var i,r='',t=typeof x,tab='';if(x===null){r+="(null)\n";}else if(t=='object'){l++;for(i=0;i-2){options['url']=options['url']+'&';}else options['url']=options['url']+'?';options['url']=options['url']+'randcachevar='+(new Date()).getTime();options.url} var myHTMLRequest=new Request.HTML(options);myHTMLRequest.get();} function do_ajax_HTML_post(options,formID){var myHTMLRequest=new Request.HTML(options);myHTMLRequest.setHeader('Last-Modified','Sat, 1 Jan 2005 05:00:00 GMT');myHTMLRequest.post($(formID));} function toggleValue(id){if(document.getElementById(id).checked==true) document.getElementById(id).checked=false;else document.getElementById(id).checked=true;}function slideObj(id,options){this.id=id;this.slide_width=options['width'];this.panel_count=options['panels'];this.dot_count=options['dots'];this.active_panel=0;this.options=options;this.set_buttons();} slideObj.prototype.refresh=function(options){this.active_panel=0;if(this.options['dots']!=null)this.dot_count=options['dots'];if(this.options['panels']!=null)this.panel_count=options['panels'];if(this.options['active_panel']!=null)this.active_panel=options['active_panel'];this.set_buttons();} slideObj.prototype.set_buttons=function(){for(var i=0;ithis.panel_count-1){panel_obj.src=this.options['dot_null'];panel_obj.style.cursor='default';}else if(this.active_panel==i){panel_obj.src=this.options['dot_active'];panel_obj.style.cursor='default';}else {panel_obj.src=this.options['dot_inactive'];panel_obj.style.cursor='pointer';var self=this;panel_obj.rel=i;panel_obj.onclick=function(){self.swap_panel(this);};}}} var btn_obj=$(this.id+'-prev');if(btn_obj!=null){btn_obj.title='';if(this.active_panel==0){btn_obj.src=this.options['prev_inactive'];btn_obj.style.cursor='default';}else{btn_obj.src=this.options['prev_active'];btn_obj.style.cursor='pointer';btn_obj.rel=this.active_panel-1;btn_obj.onclick=function(){self.swap_panel(this);};}} var btn_obj=$(this.id+'-next');if(btn_obj!=null){btn_obj.title='';if(this.active_panel>=this.panel_count-1){btn_obj.src=this.options['next_inactive'];btn_obj.style.cursor='default';}else{btn_obj.src=this.options['next_active'];btn_obj.style.cursor='pointer';btn_obj.rel=this.active_panel+1;btn_obj.onclick=function(){self.swap_panel(this);};}}} slideObj.prototype.swap_panel=function(panel){this.active_panel=panel.rel;var myFx=new Fx.Tween(this.id);myFx.start('left','-'+(this.active_panel*this.slide_width)+'px');this.set_buttons();} function dsd_slide(options){var elements_slide=[];var mode='vertical';var elements=['toggle','slidein','slideout'];if(typeof options=='object'){for(var j=0;j0){for(var i=0;i0){options=[];options.call=func_slide_in;func_slide_out(options);}else if(options.infirst==true&&elements_slide['slidein'].length>0){options=[];options.call=func_slide_out;func_slide_in(options);}else {func_slide_out();func_slide_in();}} var Mediabox;(function(){var state=0,options,images,activeImage,prevImage,nextImage,top,fx,preload,preloadPrev=new Image(),preloadNext=new Image(),overlay,center,image,bottomContainer,bottom,captionSplit,title,caption,prevLink,number,nextLink,URL,WH,WHL,mediaWidth,mediaHeight,mediaType="none",mediaSplit,mediaId="mediaBox";window.addEvent("domready",function(){$(document.body).adopt($$([overlay=new Element("div",{id:"mbOverlay"}).addEvent("click",close),center=new Element("div",{id:"mbCenter"}),bottomContainer=new Element("div",{id:"mbBottomContainer"})]).setStyle("display","none"));image=new Element("div",{id:"mbImage"}).injectInside(center);bottom=new Element("div",{id:"mbBottom"}).injectInside(bottomContainer).adopt(new Element("a",{id:"mbCloseLink",href:"#"}).addEvent("click",close),nextLink=new Element("a",{id:"mbNextLink",href:"#"}).addEvent("click",next),prevLink=new Element("a",{id:"mbPrevLink",href:"#"}).addEvent("click",previous),title=new Element("div",{id:"mbTitle"}),number=new Element("div",{id:"mbNumber"}),caption=new Element("div",{id:"mbCaption"}),new Element("div",{styles:{clear:"both"}}));fx={overlay:new Fx.Tween(overlay,{property:"opacity",duration:360}).set(0),image:new Fx.Tween(image,{property:"opacity",duration:360,onComplete:nextEffect}),bottom:new Fx.Tween(bottom,{property:"margin-top",duration:240})};});Mediabox={open:function(_images,startImage,_options){options=$extend({loop:false,overlayOpacity:0.8,resizeDuration:240,resizeTransition:false,initialWidth:320,initialHeight:180,showCaption:true,animateCaption:true,showCounter:true,counterText:' ({x} of {y})',scriptaccess:'true',fullscreen:'true',fullscreenNum:'1',autoplay:'true',autoplayNum:'1',bgcolor:'#000000',playerpath:'/includes/mediabox/player.swf',backcolor:'000000',frontcolor:'999999',lightcolor:'000000',screencolor:'000000',controlbar:'over',controller:'true',flInfo:'true',revverID:'187866',revverFullscreen:'true',revverBack:'000000',revverFront:'ffffff',revverGrad:'000000',ytColor1:'000000',ytColor2:'333333',vmTitle:'1',vmByline:'1',vmPortrait:'1',vmColor:'ffffff'},_options||{});if(typeof _images=="string"){_images=[[_images,startImage,_options]];startImage=0;} if(/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){var ffversion=new Number(RegExp.$1);if(ffversion<3){options.overlayOpacity=1;overlay.className='mbOverlayFF';}} if(Browser.Engine.trident4){options.overlayOpacity=1;overlay.className='mbOverlayIE';} images=_images;options.loop=options.loop&&(images.length>1);position();setup(true);top=window.getScrollTop()+(window.getHeight()/15);fx.resize=new Fx.Morph(center,$extend({duration:options.resizeDuration,onComplete:nextEffect},options.resizeTransition?{transition:options.resizeTransition}:{}));center.setStyles({top:top,width:options.initialWidth,height:options.initialHeight,marginLeft:-(options.initialWidth/2),display:""});fx.overlay.start(options.overlayOpacity);state=1;return changeImage(startImage);}};Element.implement({mediabox:function(_options,linkMapper){$$(this).mediabox(_options,linkMapper);return this;}});Elements.implement({mediabox:function(_options,linkMapper,linksFilter){linkMapper=linkMapper||function(el){return[el.href,el.title,el.rel];};linksFilter=linksFilter||function(){return true;};var links=this;links.removeEvents("click").addEvent("click",function(){var filteredLinks=links.filter(linksFilter,this);return Mediabox.open(filteredLinks.map(linkMapper),filteredLinks.indexOf(this),_options);});return links;}});function position(){overlay.setStyles({top:window.getScrollTop(),height:window.getHeight()});} function setup(open){["object",window.ie?"select":"embed"].forEach(function(tag){Array.forEach(document.getElementsByTagName(tag),function(el){if(open)el._mediabox=el.style.visibility;el.style.visibility=open?"hidden":el._mediabox;});});overlay.style.display=open?"":"none";var fn=open?"addEvent":"removeEvent";window[fn]("scroll",position)[fn]("resize",position);document[fn]("keydown",keyDown);} function keyDown(event){switch(event.code){case 27:case 88:case 67:close();break;case 37:case 80:previous();break;case 39:case 78:next();}} function previous(){return changeImage(prevImage);} function next(){return changeImage(nextImage);} function changeImage(imageIndex){if((state==1)&&(imageIndex>=0)){state=2;image.set('html','');activeImage=imageIndex;prevImage=((activeImage||!options.loop)?activeImage:images.length)-1;nextImage=activeImage+1;if(nextImage==images.length)nextImage=options.loop?0:-1;$$(prevLink,nextLink,image,bottomContainer).setStyle("display","none");fx.bottom.cancel().set(0);fx.image.set(0);center.className="mbLoading";WH=images[imageIndex][2].match(/[0-9]+/g);if(WH){WHL=WH.length;mediaWidth=WH[WHL-2]+"px";mediaHeight=WH[WHL-1]+"px";}else{mediaWidth=options.initialWidth;mediaWidth=options.initialWidth;} URL=images[imageIndex][0];captionSplit=images[activeImage][1].split('::');if(URL.match(/\.gif|\.jpg|\.png/i)){mediaType='img';preload=new Image();preload.onload=nextEffect;preload.src=images[imageIndex][0];}else if(URL.match(/\.flv|\.mp4|\.avi|\.mpg|\.wmv/i)){mediaType='obj';preload=new Swiff(''+options.playerpath+'?file='+URL+'&backcolor='+options.backcolor+'&frontcolor='+options.frontcolor+'&lightcolor='+options.lightcolor+'&screencolor='+options.screencolor+'&autostart='+options.autoplay+'&controlbar='+options.controlbar,{id:'MediaboxSWF',width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/\.mp3|\.aac/i)){mediaType='obj';preload=new Swiff(''+options.playerpath+'?file='+URL+'&backcolor='+options.backcolor+'&frontcolor='+options.frontcolor+'&lightcolor='+options.lightcolor+'&screencolor='+options.screencolor+'&autostart='+options.autoplay,{id:'MediaboxSWF',width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/\.swf/i)){mediaType='obj';preload=new Swiff(URL,{id:'MediaboxSWF',width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/dailymotion\.com/i)){mediaType='obj';preload=new Swiff(URL,{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/flickr\.com/i)){mediaType='obj';mediaSplit=URL.split('/');mediaId=mediaSplit[5];preload=new Swiff('http://www.flickr.com/apps/video/stewart.swf',{id:mediaId,classid:'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',width:mediaWidth,height:mediaHeight,params:{flashvars:'photo_id='+mediaId+'&show_info_box='+options.flInfo,wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/google\.com\/videoplay/i)){mediaType='obj';mediaSplit=URL.split('=');mediaId=mediaSplit[1];preload=new Swiff('http://video.google.com/googleplayer.swf?docId='+mediaId+'&autoplay='+options.autoplayNum,{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/metacafe\.com\/watch/i)){mediaType='obj';mediaSplit=URL.split('/');mediaId=mediaSplit[4];preload=new Swiff('http://www.metacafe.com/fplayer/'+mediaId+'/.swf',{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/myspacetv\.com|vids\.myspace\.com/i)){mediaType='obj';mediaSplit=URL.split('=');mediaId=mediaSplit[2];preload=new Swiff('http://lads.myspace.com/videos/vplayer.swf?m='+mediaId+'&v=2&type=video',{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/revver\.com/i)){mediaType='obj';mediaSplit=URL.split('/');mediaId=mediaSplit[4];preload=new Swiff('http://flash.revver.com/player/1.0/player.swf?mediaId='+mediaId+'&affiliateId='+options.revverID+'&allowFullScreen='+options.revverFullscreen+'&backColor=#'+options.revverBack+'&frontColor=#'+options.revverFront+'&gradColor=#'+options.revverGrad+'&shareUrl=revver',{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/seesmic\.com/i)){mediaType='obj';mediaSplit=URL.split('/');mediaId=mediaSplit[5];preload=new Swiff('http://seesmic.com/Standalone.swf?video='+mediaId,{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/youtube\.com/i)){mediaType='obj';mediaSplit=URL.split('=');mediaId=mediaSplit[1];preload=new Swiff('http://www.youtube.com/v/'+mediaId+'&autoplay='+options.autoplayNum+'&fs='+options.fullscreenNum+'&color1=0x'+options.ytColor1+'&color2=0x'+options.ytColor2,{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/veoh\.com/i)){mediaType='obj';mediaSplit=URL.split('videos/');mediaId=mediaSplit[1];preload=new Swiff('http://www.veoh.com/videodetails2.swf?permalinkId='+mediaId+'&player=videodetailsembedded&videoAutoPlay='+options.AutoplayNum,{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/viddler\.com/i)){mediaType='obj';mediaSplit=URL.split('/');mediaId=mediaSplit[4];preload=new Swiff('http://www.viddler.com/player/e5398221/',{name:'viddler_'+mediaId+'_'+mediaSplit[6],id:mediaId,classid:'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/vimeo\.com/i)){mediaType='obj';mediaSplit=URL.split('/');mediaId=mediaSplit[3];preload=new Swiff('http://www.vimeo.com/moogaloop.swf?clip_id='+mediaId+'&server=www.vimeo.com&fullscreen='+options.fullscreenNum+'&show_title='+options.vmTitle+'&show_byline='+options.vmByline+'&show_portrait='+options.vmPortrait+'&color='+options.vmColor,{id:mediaId,width:mediaWidth,height:mediaHeight,params:{wmode:'opaque',bgcolor:options.bgcolor,allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/12seconds\.tv/i)){mediaType='obj';mediaSplit=URL.split('/');mediaId=mediaSplit[5];preload=new Swiff('http://embed.12seconds.tv/players/remotePlayer.swf',{id:mediaId,width:mediaWidth,height:mediaHeight,params:{flashvars:'vid='+mediaId+'',wmode:'opaque',bgcolor:'#ffffff',allowscriptaccess:options.scriptaccess,allowfullscreen:options.fullscreen}});nextEffect();}else if(URL.match(/\#mb_/i)){mediaType='inline';URLsplit=URL.split('#');preload=$(URLsplit[1]).get('html');nextEffect();}else{mediaType='url';mediaId="mediaId_"+new Date().getTime();preload=new Element('iframe',{'src':URL,'id':mediaId,'width':mediaWidth,'height':mediaHeight,'frameborder':0});nextEffect();}} return false;} function nextEffect(){switch(state++){case 2:if(mediaType=="img"){mediaWidth=preload.width;mediaHeight=preload.height;image.setStyles({backgroundImage:"url("+URL+")",display:""});}else if(mediaType=="obj"){if(Browser.Plugins.Flash.version<8){image.setStyles({backgroundImage:"none",display:""});image.set('html','
Error
Adobe Flash is either not installed or not up to date,
please visit Adobe.com to download the free player.
');}else{image.setStyles({backgroundImage:"none",display:""});preload.inject(image);}}else if(mediaType=="inline"){image.setStyles({backgroundImage:"none",display:""});image.set('html',preload);}else if(mediaType=="url"){image.setStyles({backgroundImage:"none",display:""});preload.inject(image);}else{alert('this file type is not supported\n'+URL+'\nplease visit iaian7.com/webcode/Mediabox for more information');} $$(image,bottom).setStyle("width",mediaWidth);image.setStyle("height",mediaHeight);title.set('html',(options.showCaption&&(captionSplit.length>1))?captionSplit[0]:images[activeImage][1]);caption.set('html',(options.showCaption&&(captionSplit.length>1))?captionSplit[1]:"");number.set('html',(options.showCounter&&(images.length>1))?options.counterText.replace(/{x}/,activeImage+1).replace(/{y}/,images.length):"");if((prevImage>=0)&&(images[prevImage][0].match(/\.gif|\.jpg|\.png/i)))preloadPrev.src=images[prevImage][0];if((nextImage>=0)&&(images[nextImage][0].match(/\.gif|\.jpg|\.png/i)))preloadNext.src=images[nextImage][0];state++;case 3:center.className="";fx.resize.start({height:image.offsetHeight,width:image.offsetWidth,marginLeft:-image.offsetWidth/2});break;state++;case 4:bottomContainer.setStyles({top:top+center.clientHeight,marginLeft:center.style.marginLeft,visibility:"hidden",display:""});fx.image.start(1);break;case 5:if(prevImage>=0)prevLink.style.display="";if(nextImage>=0)nextLink.style.display="";if(options.animateCaption){fx.bottom.set(-bottom.offsetHeight).start(0);} bottomContainer.style.visibility="";state=1;}} function close(){if(state){state=0;preload.onload=$empty;image.set('html','');for(var f in fx)fx[f].cancel();$$(center,bottomContainer).setStyle("display","none");fx.overlay.chain(setup).start(0);} return false;}})();Mediabox.scanPage=function(){var links=$$("a").filter(function(el){return el.rel&&el.rel.test(/^lightbox/i);});$$(links).mediabox({},null,function(el){var rel0=this.rel.replace(/[[]|]/gi," ");var relsize=rel0.split(" ");return(this==el)||((this.rel.length>8)&&el.rel.match(relsize[1]));});};