//(c) 2007-2009 SmoothStep (www.smooth-step.com)
function pAjaxClass(){this.xmlHttp=null;if(window.XMLHttpRequest){this.xmlHttp=new XMLHttpRequest();}else if(window.ActiveXObject){this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}this.vars='';this.varslist='';this.url='/p.ajax';this.add=function(n,v,t){with(this){v=urlencode(v);if(vars!='')vars=vars+"\x26";if(t==0){if(v=='on')v=0;vars=vars+n+"\x3d"+v;}else vars=vars+n+"='"+v+"\x27";}};this.send=function(){this.xmlHttp.abort();this.xmlHttp.open("POST",this.url,true);var c=this;won();this.xmlHttp.onreadystatechange=function(){if(c.httpOK()){c.objx=c.responseObject(c.xmlHttp.responseText);eval(c.objx['script']);woff();}};with(this){xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8");xmlHttp.setRequestHeader("Content-length",vars.length);xmlHttp.setRequestHeader("Connection","close");xmlHttp.send(vars);vars='';}};this.responseObject=function(d){var f={},g=d.split(":|:");for(i=0;i<g.length;i+=2)f[g[i]]=g[i+1];return f;};this.httpOK=function(){return this.xmlHttp.readyState==4||this.xmlHttp.readyState=="complete";};}function won(){}function woff(){}function xDOM(d,f){if(getEl(d))getEl(d).innerHTML=f;}function getEl(d){return document.getElementById(d);}function cel(d){return document.createElement(d);}function xc(d,n){getEl(d).className=n;}function urlencode(d){return escape(d).replace(/\+/g,'%2B').replace(/%20/g,'\x2b').replace(/\*/g,'%2A').replace(/\//g,'%2F').replace(/@/g,'%40');}
var pAjax=new pAjaxClass();function ajaxw(){if(pAjax.xmlHttp){pAjax.add("\x66",ajaxw.arguments[0],0);for(var i=1;i<ajaxw.arguments.length-1;i+=2)pAjax.add(ajaxw.arguments[i],ajaxw.arguments[i+1],0);document.getElementById("ajax").innerHTML="";xDOM("lbImage","");pAjax.send();} else return true;}
function removeDOM(d){var e=document.getElementById(d);if(e.childNodes[0]) e.removeChild(e.childNodes[0]);}
function loadFlash(eid,n,dx,dy,f,fvars){
f=f+'"';var o='object',dh='height',m='.macromedia.com/',s='shockwave',p='"><param name="',v='" value="',w=' width="'+dx+'" wmode="opaque" '+dh+'="'+dy+'" ',
q='quality',a='"'+eid+'f" align="middle',r='allowScriptAccess',c='bgcolor',d='sameDomain',fparam;
if(fvars) {fparam=p+"flashvars"+v+fvars;fvars="flashvars=\""+fvars+"\" ";}else{fparam='';fvars='';}
var buf='<'+o+' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload'+m+
'pub/'+s+'/cabs/flash/swflash.cab#version=7,0,0,0"'+w+'id='+a+p+r+v+d+p+'wmode'+v+'opaque'+p+'movie'+v+n+fparam+p+q+v+'high'+p+c+v+f+'>'+
'<embed src="'+n+'" '+q+'="high" '+c+'="'+f+w+'name='+a+'" '+r+'="'+d+'"'+'type="application/x-'+s+'-flash" pluginspage="http://www'+m+'go/getflashplayer" '+fvars+' /></'+o+'>',
fle=document.getElementById(eid);if(fle) fle.innerHTML=buf;}
function startSite(){loadFlash('intro','/flash/intro.swf?'+Math.random(),'930','400','#fff');}
//(c) 2007-2009 Christophe Beyls
(function($){var c=$(window),d,e,g=-1,h,j,k,m,n,o,p,q,r,s=!window.XMLHttpRequest,t=window.opera&&(document.compatMode=="CSS1Compat")&&($.browser.version>=9.3),u=document.documentElement,v={},x=new Image(),y=new Image(),z,A,B,C,D,E,F,G,H,I;$(function(){});function J(L,M,N){$("div[id^='ajax']").append($([z=$('<div id="lbOverlay" />')[0],A=$('<div id="lbCenter" />')[0],F=$('<div id="lbBottomContainer" />')[0]]).css("display","none"));B=$('<div id="lbImage" />').appendTo(A).append(C=$('<div style="position: relative;" />').append([D=$('<a id="lbPrevLink" href="#" />').click(previous)[0],E=$('<a id="lbNextLink" href="#" />').click(next)[0]])[0])[0];G=$('<div id="lbBottom" />').appendTo(F).append([$('<a id="lbCloseLink" href="#" />').add(z).click(close)[0],H=$('<div id="lbCaption" />')[0],I=$('<div id="lbNumber" />')[0],$('<div style="clear: both;" />')[0]])[0];d=$.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Image {x} of {y}",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},N);if(typeof L=="string"){L=[[L,M]];M=0;}p=c.scrollTop()+((t?u.clientHeight:c.height())/2);q=d.initialWidth;r=d.initialHeight;$(A).css({top:Math.max(0,p-(r/2)),width:q,height:r,marginLeft:-q/2}).show();o=s||(z.currentStyle&&(z.currentStyle.position!="fixed"));if(o)z.style.position="absolute";$(z).css("opacity",d.overlayOpacity).fadeIn(d.overlayFadeDuration);position();setup(1);e=L;d.loop=d.loop&&(e.length>1);}$.slimbox=function(L,M,N){J(L,M,N);return changeImage(M);};$.fn.slimbox=function(L,M,N){M=M||function(P){return[P.href,P.title];};N=N||function(){return true;};var O=this;return O.unbind("click").click(function(){var P=this,Q=0,R,i=0,length;R=$.grep(O,function(S,i){return N.call(P,S,i);});for(length=R.length;i<length;++i){if(R[i]==P)Q=i;R[i]=M(R[i],i);}return $.slimbox(R,Q,L);});};function position(){var l=c.scrollLeft(),w=t?u.clientWidth:c.width();$([A,F]).css("left",l+(w/2));if(o)$(z).css({left:l,top:c.scrollTop(),width:w,height:c.height()});}function setup(open){$("object").add(s?"select":"embed").each(function(M,N){if(open)$.data(N,"slimbox",N.style.visibility);if(N.style.visibility)N.style.visibility=open?"hidden":$.data(N,"slimbox");});var L=open?"bind":"unbind";c[L]("scroll resize",position);$(document)[L]("keydown",keyDown);}function keyDown(event){var L=event.keyCode,M=$.inArray;return(M(L,d.closeKeys)>=0)?close():(M(L,d.nextKeys)>=0)?next():(M(L,d.previousKeys)>=0)?previous():false;}function previous(){return changeImage(m);}function next(){return changeImage(n);}$.goNext=function(){next();};$.goPrev=function(){previous();};function changeImage(L){if(L>=0){g=L;k=e[g][0];m=(g||(d.loop?e.length:0))-1;n=((g+1)%e.length)||(d.loop?0:-1);stop();A.className="lbLoading";v=new Image();v.onload=animateBox;v.src=k;}return false;}function K(){$(H).html(e[g][1]||"");$(I).html((((e.length>1)&&d.counterText)||"").replace(/{x}/,g+1).replace(/{y}/,e.length));A.className="";if(m>=0)x.src=e[m][0];if(n>=0)y.src=e[n][0];q=B.offsetWidth;r=B.offsetHeight;var top=Math.max(0,p-(r/2));if(A.offsetHeight!=r){$(A).animate({height:r,top:top},d.resizeDuration,d.resizeEasing);}if(A.offsetWidth!=q){$(A).animate({width:q,marginLeft:-q/2},d.resizeDuration,d.resizeEasing);}return top;}function animateBox(){$(B).css({backgroundImage:"url("+k+"\x29",visibility:"hidden",display:""});$(C).width(v.width);$([C,D,E]).height(v.height);var top=K();$(A).queue(function(){$(F).css({width:q,top:top+r,marginLeft:-q/2,visibility:"hidden",display:""});$(B).css({display:"none",visibility:"",opacity:""}).fadeIn(d.imageFadeDuration,animateCaption);});}function animateCaption(){if(m>=0)$(D).show();if(n>=0)$(E).show();$(G).css("marginTop",-G.offsetHeight).animate({marginTop:0},d.captionAnimationDuration);F.style.visibility="";}function stop(){v.onload=null;v.src=x.src=y.src=k;$([A,B,G]).stop(true);$([D,E,B,F]).hide();}function close(){if(g>=0){stop();g=m=n=-1;$(A).hide();$(z).stop().fadeOut(d.overlayFadeDuration,xsetup);}return false;}function xsetup(){document.getElementById("ajax").innerHTML="";setup();}$.pbox=function(L,M,N){J(L,M,N);return changeBox(M);};function changeBox(L){if(L>=0){g=L;k=e[g][0];h=e[g][2];j=e[g][3];m=(g||(d.loop?e.length:0))-1;n=((g+1)%e.length)||(d.loop?0:-1);stop();A.className="lbLoading";animateBox2();}return false;}function animateBox2(){$(C).width(h);$([C,D,E]).height(j);$(B).css({visibility:"hidden",display:""});var top=K();$(A).queue(function(){var L=k.split("\x3f"),f;for(f=2;f<L.length;f++)L[1]=L[1]+"\x3f"+L[f];loadFlash("lbImage",L[0],h,j,'#ffffff',L[1]);$(F).css({width:q,top:top+r,marginLeft:-q/2,visibility:"hidden",display:""});$(B).css({display:"none",visibility:"",opacity:""}).fadeIn(d.imageFadeDuration,animateCaption2);});}function animateCaption2(){animateCaption();}})(jQuery);
