;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);var hasFlash=function(){var a=6;if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.indexOf("Windows")>-1){document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+a+'))) \n</script\> \n');if(window.hasFlash!=null)return window.hasFlash}if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){var b=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;return parseInt(b.substr(b.indexOf(".")-2,2),10)>=a}return false}();String.prototype.normalize=function(){return this.replace(/\s+/g," ")};if(Array.prototype.push==null){Array.prototype.push=function(){var i=0,a=this.length,b=arguments.length;while(i<b){this[a++]=arguments[i++]}return this.length}}if(!Function.prototype.apply){Function.prototype.apply=function(a,b){var c=[];var d,e;if(!a)a=window;if(!b)b=[];for(var i=0;i<b.length;i++){c[i]="b["+i+"]"}e="a.__applyTemp__("+c.join(",")+");";a.__applyTemp__=this;d=eval(e);a.__applyTemp__=null;return d}}function named(a){return new named.Arguments(a)}named.Arguments=function(a){this.oArgs=a};named.Arguments.prototype.constructor=named.Arguments;named.extract=function(a,b){var c,d;var i=a.length;while(i--){d=a[i];if(d!=null&&d.constructor!=null&&d.constructor==named.Arguments){c=a[i].oArgs;break}}if(c==null)return;for(e in c)if(b[e]!=null)b[e](c[e]);return};var parseSelector=function(){var a=/^([^#.>`]*)(#|\.|\>|\`)(.+)$/;function r(s,t){var u=s.split(/\s*\,\s*/);var v=[];for(var i=0;i<u.length;i++)v=v.concat(b(u[i],t));return v}function b(c,d,e){c=c.normalize().replace(" ","`");var f=c.match(a);var g,h,i,j,k,n;var l=[];if(f==null)f=[c,c];if(f[1]=="")f[1]="*";if(e==null)e="`";if(d==null)d=document;switch(f[2]){case"#":k=f[3].match(a);if(k==null)k=[null,f[3]];g=document.getElementById(k[1]);if(g==null||(f[1]!="*"&&!o(g,f[1])))return l;if(k.length==2){l.push(g);return l}return b(k[3],g,k[2]);case".":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;k=f[3].match(a);if(k!=null){if(g.className==null||g.className.match("(\\s|^)"+k[1]+"(\\s|$)")==null)continue;j=b(k[3],g,k[2]);l=l.concat(j)}else if(g.className!=null&&g.className.match("(\\s|^)"+f[3]+"(\\s|$)")!=null)l.push(g)}return l;case">":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;j=b(f[3],g,">");l=l.concat(j)}return l;case"`":h=m(d,f[1]);for(i=0,n=h.length;i<n;i++){g=h[i];j=b(f[3],g,"`");l=l.concat(j)}return l;default:if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;l.push(g)}return l}}function m(d,o){if(o=="*"&&d.all!=null)return d.all;return d.getElementsByTagName(o)}function o(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:","")==q.toLowerCase()}return r}();var sIFR=function(){var a="http://www.w3.org/1999/xhtml";var b=false;var c=false;var d;var ah=[];var al=document;var ak=al.documentElement;var am=window;var au=al.addEventListener;var av=am.addEventListener;var f=function(){var g=navigator.userAgent.toLowerCase();var f={a:g.indexOf("applewebkit")>-1,b:g.indexOf("safari")>-1,c:navigator.product!=null&&navigator.product.toLowerCase().indexOf("konqueror")>-1,d:g.indexOf("opera")>-1,e:al.contentType!=null&&al.contentType.indexOf("xml")>-1,f:true,g:true,h:null,i:null,j:null,k:null};f.l=f.a||f.c;f.m=!f.a&&navigator.product!=null&&navigator.product.toLowerCase()=="gecko";if(f.m&&g.match(/.*gecko\/(\d{8}).*/))f.j=new Number(g.match(/.*gecko\/(\d{8}).*/)[1]);f.n=g.indexOf("msie")>-1&&!f.d&&!f.l&&!f.m;f.o=f.n&&g.match(/.*mac.*/)!=null;if(f.d&&g.match(/.*opera(\s|\/)(\d+\.\d+)/))f.i=new Number(g.match(/.*opera(\s|\/)(\d+\.\d+)/)[2]);if(f.n||(f.d&&f.i<7.6))f.g=false;if(f.a&&g.match(/.*applewebkit\/(\d+).*/))f.k=new Number(g.match(/.*applewebkit\/(\d+).*/)[1]);if(am.hasFlash&&(!f.n||f.o)){var aj=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;f.h=parseInt(aj.substr(aj.indexOf(".")-2,2),10)}if(g.match(/.*(windows|mac).*/)==null||f.o||f.c||(f.d&&(g.match(/.*mac.*/)!=null||f.i<7.6))||(f.b&&f.h<7)||(!f.b&&f.a&&f.k<312)||(f.m&&f.j<20020523))f.f=false;if(!f.o&&!f.m&&al.createElementNS)try{al.createElementNS(a,"i").innerHTML=""}catch(e){f.e=true}f.p=f.c||(f.a&&f.k<312);return f}();function at(){return{bIsWebKit:f.a,bIsSafari:f.b,bIsKonq:f.c,bIsOpera:f.d,bIsXML:f.e,bHasTransparencySupport:f.f,bUseDOM:f.g,nFlashVersion:f.h,nOperaVersion:f.i,nGeckoBuildDate:f.j,nWebKitVersion:f.k,bIsKHTML:f.l,bIsGecko:f.m,bIsIE:f.n,bIsIEMac:f.o,bUseInnerHTMLHack:f.p}}if(am.hasFlash==false||!al.getElementsByTagName||!al.getElementById||(f.e&&(f.p||f.n)))return{UA:at()};function af(e){if((!k.bAutoInit&&(am.event||e)!=null)||!l(e))return;b=true;for(var i=0,h=ah.length;i<h;i++)j.apply(null,ah[i]);ah=[]}var k=af;function l(e){if(c==false||k.bIsDisabled==true||((f.e&&f.m||f.l)&&e==null&&b==false)||al.getElementsByTagName("body").length==0)return false;return true}function m(n){if(f.n)return n.replace(new RegExp("%\d{0}","g"),"%25");return n.replace(new RegExp("%(?!\d)","g"),"%25")}function as(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:","")==q.toLowerCase()}function o(p,q,r,s,t){var u="";var v=p.firstChild;var w,x,y,z;if(s==null)s=0;if(t==null)t="";while(v){if(v.nodeType==3){z=v.nodeValue.replace("<","&lt;");switch(r){case"lower":u+=z.toLowerCase();break;case"upper":u+=z.toUpperCase();break;default:u+=z}}else if(v.nodeType==1){if(as(v,"a")&&!v.getAttribute("href")==false){if(v.getAttribute("target"))t+="&sifr_url_"+s+"_target="+v.getAttribute("target");t+="&sifr_url_"+s+"="+m(v.getAttribute("href")).replace(/&/g,"%26");u+='<a href="asfunction:_root.launchURL,'+s+'">';s++}else if(as(v,"br"))u+="<br/>";if(v.hasChildNodes()){y=o(v,null,r,s,t);u+=y.u;s=y.s;t=y.t}if(as(v,"a"))u+="</a>"}w=v;v=v.nextSibling;if(q!=null){x=w.parentNode.removeChild(w);q.appendChild(x)}}return{"u":u,"s":s,"t":t}}function A(B){if(al.createElementNS&&f.g)return al.createElementNS(a,B);return al.createElement(B)}function C(D,E,z){var p=A("param");p.setAttribute("name",E);p.setAttribute("value",z);D.appendChild(p)}function F(p,G){var H=p.className;if(H==null)H=G;else H=H.normalize()+(H==""?"":" ")+G;p.className=H}function aq(ar){var a=ak;if(k.bHideBrowserText==false)a=al.getElementsByTagName("body")[0];if((k.bHideBrowserText==false||ar)&&a)if(a.className==null||a.className.match(/\bsIFR\-hasFlash\b/)==null)F(a,"sIFR-hasFlash")}function j(I,J,K,L,M,N,O,P,Q,R,S,r,T){if(!l())return ah.push(arguments);aq();named.extract(arguments,{sSelector:function(ap){I=ap},sFlashSrc:function(ap){J=ap},sColor:function(ap){K=ap},sLinkColor:function(ap){L=ap},sHoverColor:function(ap){M=ap},sBgColor:function(ap){N=ap},nPaddingTop:function(ap){O=ap},nPaddingRight:function(ap){P=ap},nPaddingBottom:function(ap){Q=ap},nPaddingLeft:function(ap){R=ap},sFlashVars:function(ap){S=ap},sCase:function(ap){r=ap},sWmode:function(ap){T=ap}});var U=parseSelector(I);if(U.length==0)return false;if(S!=null)S="&"+S.normalize();else S="";if(K!=null)S+="&textcolor="+K;if(M!=null)S+="&hovercolor="+M;if(M!=null||L!=null)S+="&linkcolor="+(L||K);if(O==null)O=0;if(P==null)P=0;if(Q==null)Q=0;if(R==null)R=0;if(N==null)N="#FFFFFF";if(T=="transparent")if(!f.f)T="opaque";else N="transparent";if(T==null)T="";var p,V,W,X,Y,Z,aa,ab,ac;var ad=null;for(var i=0,h=U.length;i<h;i++){p=U[i];if(p.className!=null&&p.className.match(/\bsIFR\-replaced\b/)!=null)continue;V=p.offsetWidth-R-P;W=p.offsetHeight-O-Q;aa=A("span");aa.className="sIFR-alternate";ac=o(p,aa,r);Z="txt="+m(ac.u).replace(/\+/g,"%2B").replace(/&/g,"%26").replace(/\"/g,"%22").normalize()+S+"&w="+V+"&h="+W+ac.t;F(p,"sIFR-replaced");if(ad==null||!f.g){if(!f.g){if(!f.n)p.innerHTML=['<embed class="sIFR-flash" type="application/x-shockwave-flash" src="',J,'" quality="best" wmode="',T,'" bgcolor="',N,'" flashvars="',Z,'" width="',V,'" height="',W,'" sifr="true"></embed>'].join("");else p.innerHTML=['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" sifr="true" width="',V,'" height="',W,'" class="sIFR-flash"><param name="movie" value="',J,'"></param><param name="flashvars" value="',Z,'"></param><param name="quality" value="best"></param><param name="wmode" value="',T,'"></param><param name="bgcolor" value="',N,'"></param> </object>'].join('')}else{if(f.d){ab=A("object");ab.setAttribute("data",J);C(ab,"quality","best");C(ab,"wmode",T);C(ab,"bgcolor",N)}else{ab=A("embed");ab.setAttribute("src",J);ab.setAttribute("quality","best");ab.setAttribute("flashvars",Z);ab.setAttribute("wmode",T);ab.setAttribute("bgcolor",N)}ab.setAttribute("sifr","true");ab.setAttribute("type","application/x-shockwave-flash");ab.className="sIFR-flash";if(!f.l||!f.e)ad=ab.cloneNode(true)}}else ab=ad.cloneNode(true);if(f.g){if(f.d)C(ab,"flashvars",Z);else ab.setAttribute("flashvars",Z);ab.setAttribute("width",V);ab.setAttribute("height",W);ab.style.width=V+"px";ab.style.height=W+"px";p.appendChild(ab)}p.appendChild(aa);if(f.p)p.innerHTML+=""}if(f.n&&k.bFixFragIdBug)setTimeout(function(){al.title=d},0)}function ai(){d=al.title}function ae(){if(k.bIsDisabled==true)return;c=true;if(k.bHideBrowserText)aq(true);if(am.attachEvent)am.attachEvent("onload",af);else if(!f.c&&(al.addEventListener||am.addEventListener)){if(f.a&&f.k>=132&&am.addEventListener)am.addEventListener("load",function(){setTimeout("sIFR({})",1)},false);else{if(al.addEventListener)al.addEventListener("load",af,false);if(am.addEventListener)am.addEventListener("load",af,false)}}else if(typeof am.onload=="function"){var ag=am.onload;am.onload=function(){ag();af()}}else am.onload=af;if(!f.n||am.location.hash=="")k.bFixFragIdBug=false;else ai()}k.UA=at();k.bAutoInit=true;k.bFixFragIdBug=true;k.replaceElement=j;k.updateDocumentTitle=ai;k.appendToClassName=F;k.setup=ae;k.debug=function(){aq(true)};k.debug.replaceNow=function(){ae();k()};k.bIsDisabled=false;k.bHideBrowserText=true;return k}();if(typeof sIFR=="function"&&!sIFR.UA.bIsIEMac&&(!sIFR.UA.bIsWebKit||sIFR.UA.nWebKitVersion>=100)){sIFR.setup();};if(typeof sIFR=="function")(function(){var j=document;var h=j.documentElement;sIFR.removeDecoyClasses=function(){function a(b){if(b&&b.className!=null)b.className=b.className.replace(/\bsIFR-hasFlash\b/,"")}return function(){a(h);a(j.getElementsByTagName("body")[0])}}();sIFR.preferenceManager={storage:{sCookieId:"sifr",set:function(a){var b=new Date();b.setFullYear(b.getFullYear()+3);j.cookie=[this.sCookieId,"=",a,";expires=",b.toGMTString(),";path=/"].join("")},get:function(){var a=j.cookie.match(new RegExp(";?"+this.sCookieId+"=([^;]+);?"));if(a!=null&&a[1]=="false")return false;else return true},reset:function(){var a=new Date();a.setFullYear(a.getFullYear()-1);j.cookie=[this.sCookieId,"=true;expires=",a.toGMTString(),";path=/"].join("")}},disable:function(){this.storage.set(false)},enable:function(){this.storage.set(true)},test:function(){return this.storage.get()}};if(sIFR.preferenceManager.test()==false){sIFR.bIsDisabled=true;sIFR.removeDecoyClasses()}sIFR.rollback=function(){function a(b){var c,d,e,f,g,h;var l=parseSelector(b);var i=l.length-1;var m=false;while(i>=0){c=l[i];l.length--;d=c.parentNode;if(c.getAttribute("sifr")=="true"){h=0;while(h<d.childNodes.length){c=d.childNodes[h];if(c.className=="sIFR-alternate"){e=c;h++;continue}d.removeChild(c)}if(e!=null){f=e.firstChild;while(f!=null){g=f.nextSibling;d.appendChild(e.removeChild(f));f=g}d.removeChild(e)}if(!sIFR.UA.bIsXML&&sIFR.UA.bUseInnerHTMLHack)d.innerHTML+="";d.className=d.className.replace(/\bsIFR\-replaced\b/,"")};m=true;i--}return m}return function(k){named.extract(arguments,{sSelector:function(a){k=a}});if(k==null)k="";else k+=">";sIFR.removeDecoyClasses();sIFR.bHideBrowserText=false;if(a(k+"embed")==false)a(k+"object")}}()})();(function($){$.fn.addOption=function()
{var add=function(el,v,t,sO)
{var option=document.createElement("option");option.value=v,option.text=t;var o=el.options;var oL=o.length;if(!el.cache)
{el.cache={};for(var i=0;i<oL;i++)
{el.cache[o[i].value]=i;}}
if(typeof el.cache[v]=="undefined")el.cache[v]=oL;el.options[el.cache[v]]=option;if(sO)
{option.selected=true;}};var a=arguments;if(a.length==0)return this;var sO=true;var m=false;var items,v,t;if(typeof(a[0])=="object")
{m=true;items=a[0];}
if(a.length>=2)
{if(typeof(a[1])=="boolean")sO=a[1];else if(typeof(a[2])=="boolean")sO=a[2];if(!m)
{v=a[0];t=a[1];}}
this.each(function()
{if(this.nodeName.toLowerCase()!="select")return;if(m)
{for(var item in items)
{add(this,item,items[item],sO);}}
else
{add(this,v,t,sO);}});return this;};$.fn.ajaxAddOption=function(url,params,select,fn,args)
{if(typeof(url)!="string")return this;if(typeof(params)!="object")params={};if(typeof(select)!="boolean")select=true;this.each(function()
{var el=this;$.getJSON(url,params,function(r)
{$(el).addOption(r,select);if(typeof fn=="function")
{if(typeof args=="object")
{fn.apply(el,args);}
else
{fn.call(el);}}});});return this;};$.fn.removeOption=function()
{var a=arguments;if(a.length==0)return this;var ta=typeof(a[0]);var v,index;if(ta=="string"||ta=="object"||ta=="function")
{v=a[0];if(v.constructor==Array)
{var l=v.length;for(var i=0;i<l;i++)
{this.removeOption(v[i],a[1]);}
return this;}}
else if(ta=="number")index=a[0];else return this;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return;if(this.cache)this.cache=null;var remove=false;var o=this.options;if(!!v)
{var oL=o.length;for(var i=oL-1;i>=0;i--)
{if(v.constructor==RegExp)
{if(o[i].value.match(v))
{remove=true;}}
else if(o[i].value==v)
{remove=true;}
if(remove&&a[1]===true)remove=o[i].selected;if(remove)
{o[i]=null;}
remove=false;}}
else
{if(a[1]===true)
{remove=o[index].selected;}
else
{remove=true;}
if(remove)
{this.remove(index);}}});return this;};$.fn.sortOptions=function(ascending)
{var sel=$(this).selectedValues();var a=typeof(ascending)=="undefined"?true:!!ascending;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return;var o=this.options;var oL=o.length;var sA=[];for(var i=0;i<oL;i++)
{sA[i]={v:o[i].value,t:o[i].text}}
sA.sort(function(o1,o2)
{o1t=o1.t.toLowerCase(),o2t=o2.t.toLowerCase();if(o1t==o2t)return 0;if(a)
{return o1t<o2t?-1:1;}
else
{return o1t>o2t?-1:1;}});for(var i=0;i<oL;i++)
{o[i].text=sA[i].t;o[i].value=sA[i].v;}}).selectOptions(sel,true);return this;};$.fn.selectOptions=function(value,clear)
{var v=value;var vT=typeof(value);if(vT=="object"&&v.constructor==Array)
{var $this=this;$.each(v,function()
{$this.selectOptions(this,clear);});};var c=clear||false;if(vT!="string"&&vT!="function"&&vT!="object")return this;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return this;var o=this.options;var oL=o.length;for(var i=0;i<oL;i++)
{if(v.constructor==RegExp)
{if(o[i].value.match(v))
{o[i].selected=true;}
else if(c)
{o[i].selected=false;}}
else
{if(o[i].value==v)
{o[i].selected=true;}
else if(c)
{o[i].selected=false;}}}});return this;};$.fn.copyOptions=function(to,which)
{var w=which||"selected";if($(to).size()==0)return this;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return this;var o=this.options;var oL=o.length;for(var i=0;i<oL;i++)
{if(w=="all"||(w=="selected"&&o[i].selected))
{$(to).addOption(o[i].value,o[i].text);}}});return this;};$.fn.containsOption=function(value,fn)
{var found=false;var v=value;var vT=typeof(v);var fT=typeof(fn);if(vT!="string"&&vT!="function"&&vT!="object")return fT=="function"?this:found;this.each(function()
{if(this.nodeName.toLowerCase()!="select")return this;if(found&&fT!="function")return false;var o=this.options;var oL=o.length;for(var i=0;i<oL;i++)
{if(v.constructor==RegExp)
{if(o[i].value.match(v))
{found=true;if(fT=="function")fn.call(o[i],i);}}
else
{if(o[i].value==v)
{found=true;if(fT=="function")fn.call(o[i],i);}}}});return fT=="function"?this:found;};$.fn.selectedValues=function()
{var v=[];this.selectedOptions().each(function()
{v[v.length]=this.value;});return v;};$.fn.selectedTexts=function()
{var t=[];this.selectedOptions().each(function()
{t[t.length]=this.text;});return t;};$.fn.selectedOptions=function()
{return this.find("option:selected");};})(jQuery);(function($){$.fn.customFadeIn=function(speed,callback){$(this).fadeIn(speed,function(){if(jQuery.browser.msie)
$(this).get(0).style.removeAttribute('filter');if(callback!=undefined)
callback();});};$.fn.customFadeOut=function(speed,callback){$(this).fadeOut(speed,function(){if(jQuery.browser.msie)
$(this).get(0).style.removeAttribute('filter');if(callback!=undefined)
callback();});};})(jQuery);spiegelpaleis={}
spiegelpaleis.formatNumber=function(num)
{num=num.toString().replace(/\$|\,/g,'');if(isNaN(num))
{num=0;}
var sign=(num==(num=Math.abs(num)));num=Math.floor(num*100+0.50000000001);var cents=num%100;num=Math.floor(num/100).toString();if(cents<10)
{cents="0"+cents;}
for(var i=0;i<Math.floor((num.length-(1+i))/3);i++)
{num=num.substring(0,num.length-(4*i+3))+'.'+num.substring(num.length-(4*i+3));}
return num+','+cents;}
spiegelpaleis.assortiment={}
spiegelpaleis.accessoires={}
spiegelpaleis.gegevens={}
spiegelpaleis.winkelmand={}
spiegelpaleis.assortiment.toevoegenInit=function(){$('#cdSpan').toggle();$('#liRotatie').toggle();$('#liKleur').toggle();$('#liMotief').toggle();$('#liDikte').toggle();$('#liFolie').toggle();$('#liRandafwerking').toggle();$('#liAantal').toggle();$('#liFacetAfmeting').toggle();$('#liOpmerkingen').toggle();$('#btnSubmit').toggle();$('#aNotification').toggle();$('#bNotification').toggle();$('#cNotification').toggle();$('#dNotification').toggle();$('#veiligheidsNotification').toggle();$('#motief_information').toggle();$('#kleur_information').toggle();$('#vierkant').click(function(){spiegelpaleis.assortiment.toggleAfmetingen('vierkant');spiegelpaleis.assortiment.toggleRotation('vierkant');spiegelpaleis.assortiment.submitForm();});$('#cirkel').click(function(){spiegelpaleis.assortiment.toggleAfmetingen('cirkel');spiegelpaleis.assortiment.toggleRotation('cirkel');spiegelpaleis.assortiment.submitForm();});$('#vierkant_missend').click(function(){spiegelpaleis.assortiment.toggleAfmetingen('vierkant_missend');spiegelpaleis.assortiment.toggleRotation('vierkant_missend');spiegelpaleis.assortiment.submitForm();});$('#driehoek').click(function(){spiegelpaleis.assortiment.toggleAfmetingen('driehoek');spiegelpaleis.assortiment.toggleRotation('driehoek');spiegelpaleis.assortiment.submitForm();});$('#vierkant_missend_2').click(function(){spiegelpaleis.assortiment.toggleAfmetingen('vierkant_missend_2');spiegelpaleis.assortiment.toggleRotation('vierkant_missend_2');spiegelpaleis.assortiment.submitForm();});$('#aSpan').keyup(function(){spiegelpaleis.assortiment.toggleProperties();});$('#a').blur(function(){spiegelpaleis.assortiment.submitForm();});$('#bSpan').keyup(function(){spiegelpaleis.assortiment.toggleProperties();});$('#b').blur(function(){spiegelpaleis.assortiment.submitForm();});$('#cSpan').keyup(spiegelpaleis.assortiment.toggleProperties);$('#dSpan').keyup(spiegelpaleis.assortiment.toggleProperties);$('#kleur').change(function(){spiegelpaleis.assortiment.submitForm();});$('#motief').change(function(){spiegelpaleis.assortiment.submitForm();});$('#dikte').change(function(){spiegelpaleis.assortiment.submitForm();});$('#veiligheids_folie').click(function(){spiegelpaleis.assortiment.submitForm();});$('#randafwerking').change(function(){spiegelpaleis.assortiment.submitForm();spiegelpaleis.assortiment.toggleFacetBreedte();$('#facet_breedte').focus();spiegelpaleis.assortiment.updateRandafwerkingInformation();$('#randafwerking_information').tooltip({showURL:false,width:200,fade:100});});$('#aantal').keyup(function(){spiegelpaleis.assortiment.submitForm();});spiegelpaleis.assortiment.toggleAfmetingen($("input[name='model']:checked").val());spiegelpaleis.assortiment.toggleRotation($("input[name='model']:checked").val());spiegelpaleis.assortiment.toggleFacetBreedte();spiegelpaleis.assortiment.updateRandafwerkingInformation();spiegelpaleis.assortiment.submitForm();}
spiegelpaleis.assortiment.updateRandafwerkingInformation=function(){switch(parseInt($('#randafwerking').val()))
{case 1:$('#randafwerking_information').attr('title','Bij het snijden van glas maakt men een beschadiging in de toplaag waar men vervolgens het glas op breekt. De randen zijn dan nog scherp en onafgewerkt. Dit kan worden toegepast indien men de spiegel of glas rondom in een lijst, kozijn of met afdekstrips monteert. De randen dienen dus uit het zicht te zijn om geen gevaarlijke situatie te krijgen.');break;case 8:$('#randafwerking_information').attr('title','Grof schuren van de randen zodat de scherpte er af is. Deze afwerking wordt handmatig gedaan en adviseren wij alleen als de randen van de spiegel of glasplaat in een kader of lijst komen.');break;case 512:$('#randafwerking_information').attr('title','Idem als &ldquo;onafgewerkt&rdquo; echter voorzien van een schuine rand aan spiegel of glas. Deze rand kan tussen de 15mm en 50 mm breed zijn. Op onze site zijn de prijzen gebaseerd op een minimale breedte van 15 mm en maximaal 30mm. Door deze rand weerkaatst het licht anders op de spiegel.<br />De randen zijn niet poly geslepen en dus nog scherp! Dit kan worden toegepast indien men de spiegel of glas rondom in een lijst, kozijn of met afdekstrips monteert. De randen dienen dus uit het zicht te zijn om geen gevaarlijke situatie te krijgen.');break;case 64:$('#randafwerking_information').attr('title','De scherpe randen worden door een slijpmachine met diamantschijven gehaald waardoor deze mooi glad worden afgewerkt. Dit kan worden toegepast als spiegel zonder lijst, glasplaat voor een tafel of koelkast etc.');break;case 576:$('#randafwerking_information').attr('title','Idem als &ldquo;geslepen randafwerking&rdquo; echter voorzien van een schuine rand aan spiegel of glas. Deze rand kan tussen de 15mm en 50 mm breed zijn. Op onze site zijn de prijzen gebaseerd op een minimale breedte van 15 mm en maximaal 30mm. Door deze rand weerkaatst het licht anders op de spiegel.<br />De scherpe randen worden door een slijpmachine met diamantschijven gehaald waardoor deze mooi glad worden afgewerkt. Dit kan worden toegepast als spiegel zonder lijst, glasplaat voor een tafel of koelkast etc.');break;}
$('#randafwerking_information').tooltip({showURL:false,width:200,fade:100});}
spiegelpaleis.assortiment.toggleAfmetingen=function(type){switch(type)
{case'vierkant':case'cirkel':case'driehoek':$('#cSpan').customFadeOut('def');$('#dSpan').customFadeOut('def');break;case'vierkant_missend':$('#cSpan').customFadeIn('def');$('#dSpan').customFadeIn('def');break;case'vierkant_missend_2':$('#cSpan').customFadeIn('def');$('#dSpan').customFadeOut('def');break;}
spiegelpaleis.assortiment.toggleProperties();}
spiegelpaleis.assortiment.toggleRotation=function(type){switch(type)
{case'vierkant':case'cirkel':$('#liRotatie').customFadeOut('def');break;case'driehoek':$('#rotatie_0_img').attr('src','img/spiegels/2-1.jpg');$('#rotatie_1_img').attr('src','img/spiegels/2-2.jpg');$('#rotatie_2_img').attr('src','img/spiegels/2-3.jpg');$('#rotatie_3_img').attr('src','img/spiegels/2-4.jpg');$('#span_rotatie_4').hide();$('#liRotatie').customFadeIn('def');break;case'vierkant_missend':$('#rotatie_0_img').attr('src','img/spiegels/1-1.jpg');$('#rotatie_1_img').attr('src','img/spiegels/1-2.jpg');$('#rotatie_2_img').attr('src','img/spiegels/1-3.jpg');$('#rotatie_3_img').attr('src','img/spiegels/1-4.jpg');$('#span_rotatie_4').hide();$('#liRotatie').customFadeIn('def');break;case'vierkant_missend_2':$('#rotatie_0_img').attr('src','img/spiegels/3-1.jpg');$('#rotatie_1_img').attr('src','img/spiegels/3-2.jpg');$('#rotatie_2_img').attr('src','img/spiegels/3-3.jpg');$('#rotatie_3_img').attr('src','img/spiegels/3-4.jpg');$('#span_rotatie_4').show();$('#rotatie_4_img').attr('src','img/spiegels/3-5.jpg');$('#liRotatie').customFadeIn('def');break;}}
spiegelpaleis.assortiment.toggleProperties=function(){if($('#a').val()!=''&&$('#b').val()!='')
{var showLi=false;if($("input[name='model']:checked").val()=='vierkant_missend')
{if($('#c').val()!=''&&$('#d').val()!='')
{showLi=true;}}
else if($("input[name='model']:checked").val()=='vierkant_missend_2')
{if($('#c').val()!='')
{showLi=true;}}
else
{showLi=true;}
if(showLi==true)
{$('#liKleur').customFadeIn('def');$('#liMotief').customFadeIn('def');$('#liDikte').customFadeIn('def');$('#liFolie').customFadeIn('def');$('#liRandafwerking').customFadeIn('def');$('#liAantal').customFadeIn('def');$('#liOpmerkingen').customFadeIn('def');$('#btnSubmit').customFadeIn('def');}
else
{$('#liKleur').customFadeOut('def');$('#liMotief').customFadeOut('def');$('#liDikte').customFadeOut('def');$('#liFolie').customFadeOut('def');$('#liRandafwerking').customFadeOut('def');$('#liFacetAfmeting').customFadeOut('def');$('#liAantal').customFadeOut('def');$('#liOpmerkingen').customFadeOut('def');$('#btnSubmit').customFadeOut('def');}
spiegelpaleis.assortiment.validateAfmetingen();}
else
{$('#liKleur').customFadeOut('def');$('#liMotief').customFadeOut('def');$('#liDikte').customFadeOut('def');$('#liFolie').customFadeOut('def');$('#liRandafwerking').customFadeOut('def');$('#liAantal').customFadeOut('def');$('#liOpmerkingen').customFadeOut('def');$('#btnSubmit').customFadeOut('def');}}
spiegelpaleis.assortiment.validateAfmetingen=function()
{var a=parseInt($("#a").val());var b=parseInt($("#b").val());var c=parseInt($("#c").val());var d=parseInt($("#d").val());if($("input[name='model']:checked").val()=='vierkant_missend')
{if(c>=b)
{$('#cNotification').text('C mag niet groter of gelijk zijn aan B');$('#cNotification').customFadeIn('def');}
else
{$('#cNotification').customFadeOut('def',function(){$('#cNotification').text('');});}
if(d>=a)
{$('#dNotification').text('D mag niet groter of gelijk zijn aan A');$('#dNotification').customFadeIn('def');}
else
{$('#dNotification').customFadeOut('def',function(){$('#dNotification').text('');});}}
else if($("input[name='model']:checked").val()=='vierkant_missend_2')
{if(c>=b)
{$('#cNotification').text('C mag niet groter of gelijk zijn aan B');$('#cNotification').customFadeIn('def');}
else
{$('#cNotification').customFadeOut('def',function(){$('#cNotification').text('');});}}
else
{$('#cNotification').customFadeOut('def');$('#dNotification').customFadeOut('def');}}
spiegelpaleis.assortiment.toggleFacetBreedte=function()
{if($("#randafwerking").val()==512||$("#randafwerking").val()==576)
{$('#liFacetAfmeting').customFadeIn('def');}
else
{$('#liFacetAfmeting').customFadeOut('def');}}
spiegelpaleis.assortiment.submitForm=function()
{var formData=$('#toevoegen').serialize();$.post('assortiment/get/'+new Date().getTime(),formData,function(data)
{if(data.order_type_id!=undefined)
{$('#orderTypeId').val(data.order_type_id);}
if(data.price!=undefined)
{var pricing=data.price;$('#bedrag-ex').html('&euro; '+spiegelpaleis.formatNumber(pricing.total));$('#bedrag-incl').html('&euro; '+spiegelpaleis.formatNumber(pricing.totalvat));if(data.image_available)
{$('#product_image').attr('src','upload/type/thumb92/'+data.types[0].id);}
else
{$('#product_image').attr('src','upload/type/thumb/empty.png');}
$('#btnSubmit').attr('disabled','');if(data.types[0].color_notes!='')
{$('#kleur_information').customFadeIn('def');$('#kleur_information').attr('title',data.types[0].color_notes);$('#kleur_information').tooltip({showURL:false,width:200,fade:100});}
else
{$('#kleur_information').customFadeOut('def');}
if(data.types[0].motif_notes!='')
{$('#motief_information').customFadeIn('def');$('#motief_information').attr('title',data.types[0].motif_notes);$('#motief_information').tooltip({showURL:false,width:200,fade:100});}
else
{$('#motief_information').customFadeOut('def');}
if(data.suitable_accessories>0)
{$('#btnSubmitAccessory').customFadeIn('def');$('#btnSubmitAccessory').val('Bijbehorende accessoires bekijken ('+data.suitable_accessories+')');}
else
{$('#btnSubmitAccessory').customFadeOut('def');}}
else
{$('#bedrag-ex').html('&euro; 0,00');$('#bedrag-incl').html('&euro; 0,00');$('#product_image').attr('src','upload/type/thumb/empty.png');$('#btnSubmit').attr('disabled','disabled');$('#btnSubmitAccessory').customFadeOut('def');}
spiegelpaleis.assortiment.completeField('dimensions');spiegelpaleis.assortiment.completeField('safety_finish');spiegelpaleis.assortiment.completeField('color');spiegelpaleis.assortiment.completeField('thickness');spiegelpaleis.assortiment.completeField('motif');},'json');}
spiegelpaleis.assortiment.completeField=function(f)
{var formData=$('#toevoegen').serialize();$.post('assortiment/get/skip:'+f,formData,function(data)
{switch(f)
{case'safety_finish':var folieAvailable=false;var withoutFolieAvailable=false;var aTypes=data.types;for(var i=0;i<aTypes.length;i++)
{var xType=aTypes[i];if(xType.safety_film_available==1)
{folieAvailable=true;}
else
{withoutFolieAvailable=true;}}
if(aTypes.length>0&&folieAvailable==false)
{$('#veiligheidsNotification').text('Geen model met veiligheidsfolie beschikbaar!');$('#veiligheidsNotification').customFadeIn('def');}
else
{if(aTypes.length>0&&withoutFolieAvailable==false&&($("#veiligheids_folie").attr('checked')==null||$("#veiligheids_folie").attr('checked')==false))
{$('#veiligheidsNotification').text('Geen model zonder veiligheidsfolie beschikbaar!');$('#veiligheidsNotification').customFadeIn('def');}
else
{$('#veiligheidsNotification').customFadeOut('def',function(){$('#veiligheidsNotification').text('');});}}
break;case'dimensions':var aMin=parseInt(data.properties.dimensions.min_length_a);var aMax=parseInt(data.properties.dimensions.max_length_a);var bMin=parseInt(data.properties.dimensions.min_length_b);var bMax=parseInt(data.properties.dimensions.max_length_b);if(aMin>0&&aMax>0)
{$('#aNotification').text('Tussen '+aMin+' en '+aMax);var a=parseInt($("#a").val());if(a<aMin||a>aMax)
{$('#aNotification').css('color','#B31100');}
else
{$('#aNotification').css('color','#000');}
$('#aNotification').customFadeIn('def');}
else
{$('#aNotification').customFadeOut('def',function(){$('#aNotification').text('');});}
if(bMin>0&&bMax>0)
{$('#bNotification').text('Tussen '+bMin+' en '+bMax);var b=parseInt($("#b").val());if(b<bMin||b>bMax)
{$('#bNotification').css('color','#B31100');}
else
{$('#bNotification').css('color','#000');}
$('#bNotification').customFadeIn('def');}
else
{$('#bNotification').customFadeOut('def',function(){$('#bNotification').text('');});}
break;case'color':var selection=$('#kleur').selectedValues();$('#kleur').removeOption(/./);var aTypes=data.types;for(var i=0;i<aTypes.length;i++)
{$('#kleur').addOption(aTypes[i].color,spiegelpaleis.upperCaseFirst(aTypes[i].color));}
$('#kleur').sortOptions();$('#kleur').selectOptions(selection[0]);break;case'thickness':var selection=$('#dikte').selectedValues();$('#dikte').removeOption(/./);var aTypes=data.types;for(var i=0;i<aTypes.length;i++)
{$('#dikte').addOption(aTypes[i].thickness,aTypes[i].thickness+' mm');}
$('#dikte').sortOptions();$('#dikte').selectOptions(selection[0]);break;case'motif':var selection=$('#motief').selectedValues();$('#motief').removeOption(/./);var aTypes=data.types;for(var i=0;i<aTypes.length;i++)
{$('#motief').addOption(aTypes[i].motif,spiegelpaleis.upperCaseFirst(aTypes[i].motif));}
$('#motief').sortOptions();$('#motief').selectOptions(selection[0]);break;}},'json');}
spiegelpaleis.upperCaseFirst=function(string){return string.charAt(0).toUpperCase()+string.substr(1,string.length);}
spiegelpaleis.accessoires.accessoireInit=function()
{$('.btnAdd').toggle();$('.btnAdd').click(function(){$('#'+this.id+'_input').val(parseInt($('#'+this.id+'_input').val())+1);});}
spiegelpaleis.gegevens.gegevensInit=function()
{$('#anderAfleveradres').change(function(){spiegelpaleis.gegevens.flip();});if(($("#anderAfleveradres").attr('checked')==null||$("#anderAfleveradres").attr('checked')==false)||$("input[name='delivery_address']").val()=='')
{$('.liAfleveradresVelden').hide();$("input[name='use_delivery']").val(0);}
else
{$('.liAfleveradresVelden').show();$("input[name='use_delivery']").val(1);}}
spiegelpaleis.gegevens.flip=function()
{if($("input[name='use_delivery']").val()==1)
{$("input[name='use_delivery']").val(0);}
else
{$("input[name='use_delivery']").val(1);}
$('.liAfleveradresVelden').toggle();}
spiegelpaleis.winkelmand.changeAmount=function(id)
{var amount=parseFloat($("#order_id_single_"+id).html());var quantity=parseInt($("#aantal_"+id+"_input").val());if(quantity==''||quantity==0||isNaN(quantity))
{quantity=1;}
$("#order_id_value_"+id).html(spiegelpaleis.formatNumber(amount*quantity));$.getJSON('winkelmand/get/update:yes/order_type_id:'+id+'/quantity:'+quantity,function(data)
{$("#order_price_label").html(spiegelpaleis.formatNumber(data.order_price));$("#transportation_costs_label").html(spiegelpaleis.formatNumber(data.transportation_costs));$("#surcharge_label").html(spiegelpaleis.formatNumber(data.surcharge));$("#discount_label").html(spiegelpaleis.formatNumber(data.discount));$("#total_label").html(spiegelpaleis.formatNumber(data.total));$("#vat_label").html(spiegelpaleis.formatNumber(data.vat));$("#totalvat_label").html(spiegelpaleis.formatNumber(data.totalvat));if(data.surcharge>0)
{$("#surcharge_row").css("display","table-row");}
else
{$("#surcharge_row").css("display","none");}
if(data.discount>0)
{$("#discount_row").css("display","table-row");}
else
{$("#discount_row").css("display","none");}});}