// -------------------------------------------------------------------
// Image Thumbnail Viewer Script- By Dynamic Drive, available at: http://www.dynamicdrive.com
// Last updated: July 7th, 2008- Fixed enlarged image not showing in IE sometimes
// -------------------------------------------------------------------

var thumbnailviewer={
enableTitle: true, //Should "title" attribute of link be used as description?
enableAnimation: true, //Enable fading animation?
definefooter: '<div class="footerbar"><a href="photo_gallery.php">Visit our Photo Gallery</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CLOSE X</div>', //Define HTML for footer interface
defineLoading: '<img src="loading.gif" /> Loading Image...', //Define HTML for "loading" div

/////////////No need to edit beyond here/////////////////////////

scrollbarwidth: 16,
opacitystring: 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=10); -moz-opacity: 0.1; opacity: 0.1',
targetlinks:[], //Array to hold links with rel="thumbnail"

createthumbBox:function(){
//write out HTML for Image Thumbnail Viewer plus loading div
document.write('<div id="thumbBox" onClick="thumbnailviewer.closeit()"><div id="thumbImage"></div>'+this.definefooter+'</div>')
document.write('<div id="thumbLoading">'+this.defineLoading+'</div>')
this.thumbBox=document.getElementById("thumbBox")
this.thumbImage=document.getElementById("thumbImage") //Reference div that holds the shown image
this.thumbLoading=document.getElementById("thumbLoading") //Reference "loading" div that will be shown while image is fetched
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
},


centerDiv:function(divobj){ //Centers a div element on the page
var ie=document.all && !window.opera
var dom=document.getElementById
var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth
var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight //Full scroll height of document
var objwidth=divobj.offsetWidth //width of div element
var objheight=divobj.offsetHeight //height of div element
var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+10+"px" //Vertical position of div element: Either centered, or if element height larger than viewpoint height, 10px from top of viewpoint
divobj.style.left=docwidth/2-objwidth/2+"px" //Center div element horizontally
divobj.style.top=Math.floor(parseInt(topposition))+"px"
divobj.style.visibility="visible"
},

showthumbBox:function(){ //Show ThumbBox div
thumbnailviewer.thumbLoading.style.visibility="hidden" //Hide "loading" div
this.centerDiv(this.thumbBox)
if (this.enableAnimation){ //If fading animation enabled
this.currentopacity=0.1 //Starting opacity value
this.opacitytimer=setInterval("thumbnailviewer.opacityanimation()", 20)
}
},


loadimage:function(link){ //Load image function that gets attached to each link on the page with rel="thumbnail"
if (this.thumbBox.style.visibility=="visible") //if thumbox is visible on the page already
this.closeit() //Hide it first (not doing so causes triggers some positioning bug in Firefox
var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" />' //Construct HTML for shown image
if (this.enableTitle && link.getAttribute("title")) //Use title attr of the link as description?
imageHTML+='<br />'+link.getAttribute("title")
this.centerDiv(this.thumbLoading) //Center and display "loading" div while we set up the image to be shown
this.thumbImage.innerHTML=imageHTML //Populate thumbImage div with shown image's HTML (while still hidden)
this.featureImage=this.thumbImage.getElementsByTagName("img")[0] //Reference shown image itself
if (this.featureImage.complete)
thumbnailviewer.showthumbBox()
else{
this.featureImage.onload=function(){ //When target image has completely loaded
thumbnailviewer.showthumbBox() //Display "thumbbox" div to the world!
}
}
if (document.all && !window.createPopup) //Target IE5.0 browsers only. Address IE image cache not firing onload bug: panoramio.com/blog/onload-event/
this.featureImage.src=link.getAttribute("href")
this.featureImage.onerror=function(){ //If an error has occurred while loading the image to show
thumbnailviewer.thumbLoading.style.visibility="hidden" //Hide "loading" div, game over
}
},

setimgopacity:function(value){ //Sets the opacity of "thumbimage" div per the passed in value setting (0 to 1 and in between)
var targetobject=this.featureImage
if (targetobject.filters && targetobject.filters[0]){ //IE syntax
if (typeof targetobject.filters[0].opacity=="number") //IE6
targetobject.filters[0].opacity=value*100
else //IE 5.5
targetobject.style.filter="alpha(opacity="+value*100+")"
}
else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax
targetobject.style.MozOpacity=value
else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax
targetobject.style.opacity=value
else //Non of the above, stop opacity animation
this.stopanimation()
},

opacityanimation:function(){ //Gradually increase opacity function
this.setimgopacity(this.currentopacity)
this.currentopacity+=0.1
if (this.currentopacity>1)
this.stopanimation()
},

stopanimation:function(){
if (typeof this.opacitytimer!="undefined")
clearInterval(this.opacitytimer)
},


closeit:function(){ //Close "thumbbox" div function
this.stopanimation()
this.thumbBox.style.visibility="hidden"
this.thumbImage.innerHTML=""
this.thumbBox.style.left="-2000px"
this.thumbBox.style.top="-2000px"
},

cleanup:function(){ //Clean up routine on page unload
this.thumbLoading=null
if (this.featureImage) this.featureImage.onload=null
this.featureImage=null
this.thumbImage=null
for (var i=0; i<this.targetlinks.length; i++)
this.targetlinks[i].onclick=null
this.thumbBox=null
},

dotask:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},

init:function(){ //Initialize thumbnail viewer script by scanning page and attaching appropriate function to links with rel="thumbnail"
if (!this.enableAnimation)
this.opacitystring=""
var pagelinks=document.getElementsByTagName("a")
for (var i=0; i<pagelinks.length; i++){ //BEGIN FOR LOOP
if (pagelinks[i].getAttribute("rel") && pagelinks[i].getAttribute("rel")=="thumbnail"){ //Begin if statement
pagelinks[i].onclick=function(){
thumbnailviewer.stopanimation() //Stop any currently running fade animation on "thumbbox" div before proceeding
thumbnailviewer.loadimage(this) //Load image
return false
}
this.targetlinks[this.targetlinks.length]=pagelinks[i] //store reference to target link
} //end if statement
} //END FOR LOOP
//Reposition "thumbbox" div when page is resized
this.dotask(window, function(){if (thumbnailviewer.thumbBox.style.visibility=="visible") thumbnailviewer.centerDiv(thumbnailviewer.thumbBox)}, "resize")


} //END init() function

}

thumbnailviewer.createthumbBox() //Output HTML for the image thumbnail viewer
thumbnailviewer.dotask(window, function(){thumbnailviewer.init()}, "load") //Initialize script on page load
thumbnailviewer.dotask(window, function(){thumbnailviewer.cleanup()}, "unload")





/*
This license text has to stay intact at all times:
fleXcroll Public License Version
Cross Browser Custom Scroll Bar Script by Hesido.
Public version - Free for non-commercial uses.

This script cannot be used in any commercially built
web sites, or in sites that relates to commercial
activities. This script is not for re-distribution.
For licensing options:
Contact Emrah BASKAYA @ www.hesido.com

Derivative works are only allowed for personal uses,
and they cannot be redistributed.

FleXcroll Public Key Code: 20050907122003339
MD5 hash for this license: 9ada3be4d7496200ab2665160807745d

End of license text---
*/

// fleXcroll v1.9.5f

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 E={4L:6(){Q.N(1i,\'4v\',Q.51)},3s:6(f){7 g=17,G=1i,1Z=6Q;5(!g.20||!g.4b)B;5(3M(f)==\'4f\')f=17.20(f);5(f==14||1Z.3b.2v(\'5H\')!=-1||((1Z.3b.2v(\'5l\')!=-1||1Z.3b.2v(\'6n\')!=-1)&&!(3M(4O)!="6y"&&4O.6z))||1Z.65==\'67\'||(1Z.6d.2v(\'5h\')!=-1&&1Z.3b.2v(\'5J\')!=-1))B;5(f.1G){f.1G();B};5(!f.1W||f.1W==\'\'){7 h="6h",c=1;1E(17.20(h+c)!=14){c++};f.1W=h+c}7 k=f.1W;f.3n=2n 5E();7 l=f.3n;l.1K={6G:[\'-1s\',0],5r:[0,\'-1s\'],5f:[\'1s\',0],5m:[0,\'1s\'],5w:[0,\'-1p\'],5M:[0,\'1p\'],5Z:[0,\'-52\'],66:[0,\'+52\']};l.3R=["-2s","2s"];l.3z=["-2s","2s"];7 m=Z(\'6e\',C),D=Z(\'6c\',C),H=Z(\'6m\',C),18=Z(\'6O\',C);7 o=Z(\'5x\',C),1g=Z(\'5O\',C),2M=8;18.A.1v=\'4B 4P 5F\';18.1N();f.19.4W=\'2w\';1g.A.6F="6J";1g.A.1x="4j";1g.A.T="4j";1g.A.1P="3X";1g.A.3F="-6u";1g.1N();7 p=f.R,4X=f.1e;2c(f,18,\'16\',[\'1v-12-T\',\'1v-26-T\',\'1v-13-T\',\'1v-1R-T\']);7 q=f.R,4g=f.1e,3A=4X-4g,3C=p-q;7 s=(f.1T)?f.1T:0,5b=(f.1S)?f.1S:0;7 t=17.3O.1k,3S=/#([^#.]*)$/;7 u=[\'5B\',\'60\',\'5c\'];l.V=[];l.21=[];l.5s=l.O=[];l.5A=l.1M=[];l.1u=[8,8];l.W=[];l.1H=[0,0];l.1m=[];l.3x=[];l.X=[];1E(f.4M){m.Y(f.4M)};m.Y(o);f.Y(D);f.Y(18);5(L(f,\'1P\')!=\'3X\')f.19.1P="37";7 w=L(f,\'6p-6r\');f.19.4d=\'12\';D.A.T="4x";D.A.1x="4x";D.A.13="16";D.A.12="16";2c(f,18,"16",[\'J-12\',\'J-13\',\'J-26\',\'J-1R\']);7 x=f.1e,4e=f.R,3p;3p=D.R;D.A.5g="6b 4P 6I";5(D.R>3p)2M=C;D.A.5j="16";2c(18,f,8,[\'J-12\',\'J-13\',\'J-26\',\'J-1R\']);1o(D);1o(f);l.X[0]=D.1f-f.1f;l.X[2]=D.1h-f.1h;f.19.53=L(f,"J-1R");f.19.4G=L(f,"J-26");1o(D);1o(f);l.X[1]=D.1f-f.1f;l.X[3]=D.1h-f.1h;f.19.53=L(18,"J-13");f.19.4G=L(18,"J-12");7 y=l.X[2]+l.X[3],3E=l.X[0]+l.X[1];D.19.4d=w;2c(f,D,8,[\'J-12\',\'J-26\',\'J-13\',\'J-1R\']);H.A.T=f.1e+\'F\';H.A.1x=f.R+\'F\';D.A.T=x+\'F\';D.A.1x=4e+\'F\';H.A.1P=\'3X\';H.A.13=\'16\';H.A.12=\'16\';D.Y(m);f.Y(H);H.Y(1g);m.A.1P=\'37\';D.A.1P=\'37\';m.A.13="0";m.A.T="4y%";D.A.4W=\'2w\';D.A.12="-"+l.X[2]+"F";D.A.13="-"+l.X[0]+"F";l.3T=1g.R;l.2G=6(){7 a=m.5Q,2H=6j=0;1q(7 i=0;i<a.4A;i++){5(a[i].1e){2H=11.1Y(a[i].1e,2H)}};l.O[0]=((l.W[1]&&!l.1m[1])||l.21[1])?f.1e-l.1H[0]:f.1e;l.1M[0]=2H+y;B l.1M[0]};l.2K=6(){l.O[1]=((l.W[0]&&!l.1m[0])||l.21[0])?f.R-l.1H[1]:f.R;l.1M[1]=m.R+3E-2;B l.1M[1]};l.4D=6(){m.A.3I=\'6g\';m.A.3I=\'5t\'};l.3K=6(){D.A.T=(2M)?(l.O[0]-y-3A)+\'F\':l.O[0]+\'F\'};l.3U=6(){D.A.1x=(2M)?(l.O[1]-3E-3C)+\'F\':l.O[1]+\'F\'};l.2m=6(){l.2G();l.2K();H.2E=2n 3v();7 a=H.2E;2m(a,\'6N\');a.2i=[1a(L(a.4,\'J-13\')),1a(L(a.4,\'J-1R\'))];a.4.A.J=\'16\';a.4.K=0;a.4.2O=C;a.4.2a=1;m.4h=a.4;3o(a,0);l.1H[0]=a.1b.1e;l.3K();H.2Q=2n 3v();7 b=H.2Q;2m(b,\'5p\');b.2i=[1a(L(b.4,\'J-12\')),1a(L(b.4,\'J-26\'))];b.4.A.J=\'16\';b.4.K=0;b.4.2O=8;b.4.2a=0;m.5D=b.4;5(G.4T)b.4.A.1P=\'37\';3o(b,0);l.1H[1]=b.1b.R;l.3U();H.A.1x=f.R+\'F\';b.2p=Z(\'68\');H.Y(b.2p);b.2p.3r=6(){b.4.2S=C;l.1Q=b.4;b.4.2U=C;b.4.29=8;H.2E.4.29=8;E.N(g,\'3G\',2x);E.N(g,\'2g\',2W);E.N(g,\'2X\',2F);B 8}};l.1Q=14;l.2m();m.57(o);5(!Q.28(f,\'49\',2f)||!Q.28(f,\'4a\',2f)){f.5C=2f};Q.28(f,\'49\',2f);Q.28(f,\'4a\',2f);f.5G(\'5I\',\'0\');Q.N(f,\'5K\',6(e){5(f.2Z)B;5(!e){7 e=G.1w};7 a=e.4k;l.4u=a;l.27();5(l.1K[\'1L\'+a]&&!1i.4T){f.1c(l.1K[\'1L\'+a][0],l.1K[\'1L\'+a][1],C);5(e.1J)e.1J();B 8}});Q.N(f,\'6q\',6(e){5(f.2Z)B;5(!e){7 e=G.1w};7 a=e.4k;5(l.1K[\'1L\'+a]){f.1c(l.1K[\'1L\'+a][0],l.1K[\'1L\'+a][1],C);5(e.1J)e.1J();B 8}});Q.N(f,\'6s\',6(){l.4u=8});Q.N(g,\'2X\',2A);Q.N(f,\'6w\',6(e){5(!e)e=G.1w;7 a=(e.1A)?e.1A:(e.1n)?e.1n:8;5(!a||(a.1r&&a.1r.U(31("\\\\64\\\\b"))))B;l.4i=e.2r;l.4t=e.2k;33();1o(f);2A();E.N(g,\'2g\',3V);l.2u=[f.1h+10,f.1h+l.O[0]-10,f.1f+10,f.1f+l.O[1]-10]});6 3V(e){5(!e)e=G.1w;7 a=e.2r,3B=e.2k,3j=a+l.3D,3c=3B+l.3d;l.3e=(3j<l.2u[0]||3j>l.2u[1])?1:0;l.3f=(3c<l.2u[2]||3c>l.2u[3])?1:0;l.3k=a-l.4i;l.3m=3B-l.4t;l.36=(l.3k>40)?1:(l.3k<-40)?-1:0;l.39=(l.3m>40)?1:(l.3m<-40)?-1:0;5((l.36!=0||l.39!=0)&&!l.1U)l.1U=G.3a(6(){5(l.36==0&&l.39==0){G.2l(l.1U);l.1U=8;B};33();5(l.3e==1||l.3f==1)f.1c((l.36*l.3e)+"s",(l.39*l.3f)+"s",C)},45)};6 2A(){E.2d(g,\'2g\',3V);5(l.1U)G.2l(l.1U);l.1U=8;5(l.44)G.4V(l.44);5(l.46)G.2l(l.46)};6 33(){l.3D=(G.4Z)?G.4Z:(g.2e&&g.2e.1S)?g.2e.1S:0;l.3d=(G.54)?G.54:(g.2e&&g.2e.1T)?g.2e.1T:0};f.1G=6(a){H.2C();5(H.M[1]()===0||H.M[0]()===0)B;m.A.J=\'4B\';7 b=l.W[0],4p=l.W[1],47=H.2E,2t=H.2Q,2V,2J,2z=[];H.A.T=f.1e-3A+\'F\';H.A.1x=f.R-3C+\'F\';2z[0]=l.O[0];2z[1]=l.O[1];l.W[0]=l.2G()>l.O[0];l.W[1]=l.2K()>l.O[1];7 c=(b!=l.W[0]||4p!=l.W[1]||2z[0]!=l.O[0]||2z[1]!=l.O[1])?C:8;47.1b.3H(l.W[1]);2t.1b.3H(l.W[0]);2V=(l.W[1]||l.21[1]);2J=(l.W[0]||l.21[0]);l.2G();l.2K();l.3U();l.3K();5(!l.W[0]||!l.W[1]||l.1m[0]||l.1m[1])2t.2p.1N();1l 2t.2p.2C();5(2V)2N(47,(2J&&!l.1m[0])?l.1H[1]:0);1l m.A.13="0";5(2J)2N(2t,(2V&&!l.1m[1])?l.1H[0]:0);1l m.A.12="0";5(c&&!a)f.1G(C);m.A.J=\'16\';l.1u[0]=l.1u[1]=8};f.62=f.1c=6(a,b,c){7 d=[[8,8],[8,8]],P;5((a||a===0)&&l.V[0]){a=3L(a,0);P=H.2Q.4;P.1d=(c)?11.22(11.1Y(P.1I,P.1d-a),0):-a;P.3Q();d[0]=[-P.1d-P.24,-P.1I]}5((b||b===0)&&l.V[1]){b=3L(b,1);P=H.2E.4;P.1d=(c)?11.22(11.1Y(P.1I,P.1d-b),0):-b;P.3Q();d[1]=[-P.1d-P.24,-P.1I]}5(!c)l.1u[0]=l.1u[1]=8;B d};f.2Y=6(a){5(a==14||!59(a))B;7 b=48(a);f.1c(b[0]+l.X[2],b[1]+l.X[0],8);f.1c(0,0,C)};2c(18,f,\'16\',[\'1v-12-T\',\'1v-26-T\',\'1v-13-T\',\'1v-1R-T\']);f.57(18);f.1T=0;f.1S=0;f.2I=C;30(f,\'6i\',8);f.1G();f.1c(5b,s,C);5(t.U(3S)){f.2Y(g.20(t.U(3S)[1]))};l.5L=G.3a(6(){7 n=1g.R;5(n!=l.3T){f.1G();l.3T=n}},5N);6 3L(v,i){7 a=v.5P();v=5i(a);B 1a((a.U(/p$/))?v*l.O[i]*0.9:(a.U(/s$/))?v*l.O[i]*0.1:v)}6 41(a){7 a=a.6x(\'-\'),42=a[0],i;1q(i=1;3q=a[i];i++){42+=3q.6B(0).5U()+3q.5z(1)}B 42}6 L(a,b){5(G.4m)B G.4m(a,14).5W(b);5(a.4o)B a.4o[41(b)];B 8};6 2c(a,b,c,d){7 e=2n 3v();1q(7 i=0;i<d.4A;i++){e[i]=41(d[i]);b.19[e[i]]=L(a,d[i],e[i]);5(c)a.19[e[i]]=c}};6 Z(b,c){7 d=g.4b(\'4q\');d.1W=k+\'1L\'+b;d.1r=(c)?b:b+\' 5Y\';d.M=[6(){B d.1e},6(){B d.R}];d.2h=[6(a){d.A.T=a},6(a){d.A.1x=a}];d.4s=[6(){B L(d,"12")},6(){B L(d,"13")}];d.15=[6(a){d.A.12=a},6(a){d.A.13=a}];d.1N=6(){d.A.2j="2w"};d.2C=6(a){d.A.2j=(a)?L(a,\'2j\'):"5d"};d.A=d.19;B d};6 2m(a,b){a.1b=Z(b+\'5e\');a.2o=Z(b+\'5k\');a.25=Z(b+\'5o\');a.4=Z(b+\'5q\');a.1V=Z(b+\'5u\');a.1t=Z(b+\'5y\');H.Y(a.1b);a.1b.Y(a.4);a.1b.Y(a.2o);a.1b.Y(a.25);a.4.Y(a.1V);a.4.Y(a.1t)};6 3o(b,c){7 d=b.1b,4=b.4,i=4.2a;4.1O=b.2i[0];4.2P=d;4.D=D;4.4w=m;4.24=0;2N(b,c,C);4.3h=6(){4.K=(11.22(11.1Y(4.K,0),4.2b));4.1d=1a((4.K/4.32)*4.1I);4.24=(4.K==0)?0:(4.K==4.2b)?0:4.24;4.15[i](4.K+4.1O+"F");m.15[i](4.1d+4.24+"F")};4.3Q=6(){4.K=1a((4.1d*4.32)/4.1I);4.24=4.1d-1a((4.K/4.32)*4.1I);4.K=(11.22(11.1Y(4.K,0),4.2b));4.15[i](4.K+4.1O+"F");4.15[i](4.K+4.1O+"F");m.15[i](4.1d+"F")};l.2B=L(4,\'z-4F\');4.A.3F=(l.2B=="5R"||l.2B=="0"||l.2B==\'5T\')?2:l.2B;D.A.3F=L(4,\'z-4F\');4.3r=6(){4.2U=C;l.1Q=4;4.2S=8;4.29=8;E.N(g,\'3G\',2x);E.N(g,\'2g\',2W);E.N(g,\'2X\',2F);B 8};4.5V=2A;d.3r=d.5X=6(e){5(!e){7 e=G.1w}5(e.1A&&(e.1A==b.1V||e.1A==b.1t||e.1A==b.4))B;5(e.1n&&(e.1n==b.1V||e.1n==b.1t||e.1n==b.4))B;7 a,1X=[];33();l.27();1o(4);a=(4.2O)?e.2k+l.3d-4.1f:e.2r+l.3D-4.1h;1X[4.2a]=(a<0)?l.3z[0]:l.3z[1];1X[1-4.2a]=0;f.1c(1X[0],1X[1],C);5(e.61!="63"){2A();l.44=G.4H(6(){l.46=G.3a(6(){f.1c(1X[0],1X[1],C)},4J)},69)}B 8};d.3H=6(r){5(r){d.2C(f);l.1m[i]=(L(d,"2j")=="2w")?C:8;5(!l.1m[i])4.2C(f);1l 4.1N();l.V[i]=C;30(d,"","4N")}1l{d.1N();4.1N();l.21[i]=(L(d,"2j")!="2w")?C:8;l.V[i]=8;4.K=0;m.15[i](\'16\');30(d,"4N","")}D.15[1-i]((l.3x[i]&&(r||l.21[i])&&!l.1m[i])?l.1H[1-i]-l.X[i*2]+"F":"-"+l.X[i*2]+"F")};d.6f=2x};6 2N(a,b,c){7 d=a.1b,4=a.4,2o=a.2o,1V=a.1V,25=a.25,1t=a.1t,i=4.2a;d.2h[i](H.M[i]()-b+\'F\');d.15[1-i](H.M[1-i]()-d.M[1-i]()+\'F\');l.3x[i]=(1a(d.4s[1-i]())===0)?C:8;a.3l=a.2i[0]+a.2i[1];a.3J=1a((d.M[i]()-a.3l)*0.6l);4.4R=11.22(11.1Y(11.22(1a(l.O[i]/l.1M[i]*d.M[i]()),a.3J),45),a.3J);4.2h[i](4.4R+\'F\');4.2b=d.M[i]()-4.M[i]()-a.3l;4.K=11.22(11.1Y(0,4.K),4.2b);4.15[i](4.K+4.1O+\'F\');4.1I=D.M[i]()-l.1M[i];4.32=4.2b;2o.2h[i](d.M[i]()-25.M[i]()+\'F\');1V.2h[i](4.M[i]()-1t.M[i]()+\'F\');1t.15[i](4.M[i]()-1t.M[i]()+\'F\');25.15[i](d.M[i]()-25.M[i]()+\'F\');5(!c)4.3h();l.4D()};l.27=6(){D.1T=0;D.1S=0;f.1T=0;f.1S=0};Q.N(G,\'4v\',6(){5(f.2I)f.1G()});Q.N(G,\'6o\',6(){5(f.3t)G.4V(f.3t);f.3t=G.4H(6(){5(f.2I)f.1G()},4J)});1q(7 j=0,3i;3i=u[j];j++){7 z=f.34(3i);1q(7 i=0,2R;2R=z[i];i++){E.N(2R,\'6A\',6(){f.2Z=C});E.N(2R,\'6C\',6E=6(){f.2Z=8})}};6 2x(){B 8};6 2W(e){5(!e){7 e=G.1w};7 a=l.1Q,I,3N,6K,6M;5(a==14)B;5(!E.56&&!e.6P)2F();3N=(a.2S)?2:1;1q(7 i=0;i<3N;i++){I=(i==1)?a.4w.4h:a;5(a.2U){5(!I.29){l.27();1o(I);1o(I.2P);I.58=e.2k-I.1f;I.5a=e.2r-I.1h;I.4E=I.K;I.29=C};I.K=(I.2O)?e.2k-I.58-I.2P.1f-I.1O:e.2r-I.5a-I.2P.1h-I.1O;5(a.2S)I.K=I.K+(I.K-I.4E);I.3h()}1l I.29=8}};6 2F(){5(l.1Q!=14){l.1Q.2U=8}l.1Q=14;E.2d(g,\'3G\',2x);E.2d(g,\'2g\',2W);E.2d(g,\'2X\',2F)};6 2f(e){5(!e)e=G.1w;5(!Q.2I)B;7 a=Q,35,3P,1C=8,1j=0,1D;l.27();3g=(e.1A)?e.1A:(e.1n)?e.1n:Q;5(3g.1W&&3g.1W.U(/6a/))1C=C;5(e.4K)1j=-e.4K;5(e.4r)1j=e.4r;1j=(1j<0)?-1:+1;1D=(1j<0)?0:1;l.1u[1-1D]=8;5((l.1u[1D]&&!1C)||(!l.V[0]&&!l.V[1]))B;5(l.V[1]&&!1C)1B=f.1c(8,l.3R[1D],C);35=!l.V[1]||1C||(l.V[1]&&((1B[1][0]==1B[1][1]&&1j>0)||(1B[1][0]==0&&1j<0)));5(l.V[0]&&(!l.V[1]||1C))1B=f.1c(l.3R[1D],8,C);3P=!l.V[0]||(l.V[0]&&l.V[1]&&35&&!1C)||(l.V[0]&&((1B[0][0]==1B[0][1]&&1j>0)||(1B[0][0]==0&&1j<0)));5(35&&3P&&!1C)l.1u[1D]=C;1l l.1u[1D]=8;5(e.1J)e.1J();B 8};6 59(a){1E(a.1y){a=a.1y;5(a==f)B C}B 8};6 1o(a){7 b=a,23=1z=0;7 c="";5(b.2T){1E(b){23+=b.4c;1z+=b.4Q;b=b.2T;c+=1z+" "}}1l 5(b.x){23+=b.x;1z+=b.y}a.1h=23;a.1f=1z};6 48(a){7 b=a;23=1z=0;1E(!b.R&&b.1y&&b!=m&&L(b,\'3I\')=="6k"){b=b.1y}5(b.2T){1E(b!=m){23+=b.4c;1z+=b.4Q;b=b.2T}}B[23,1z]};6 30(a,b,c){5(!a.1r)a.1r=\'\';7 d=a.1r;5(b&&!d.U(31("(^|\\\\s)"+b+"($|\\\\s)")))d=d.3W(/(\\S$)/,\'$1 \')+b;5(c)d=d.3W(31("((^|\\\\s)+"+c+")+($|\\\\s)","g"),\'$2\').3W(/\\s$/,\'\');a.1r=d}},51:6(){5(E.38)1i.2l(E.38);7 d=/#([^#.]*)$/,2q=/(.*)#.*$/,5v,i,1F,4U=17.34("a"),2y=17.3O.1k;5(2y.U(2q))2y=2y.U(2q)[1];1q(i=0;1F=4U[i];i++){5(1F.1k&&1F.1k.U(d)&&1F.1k.U(2q)&&2y===1F.1k.U(2q)[1]){1F.3Y=C;E.N(1F,\'6t\',6(e){5(!e)e=1i.1w;7 a=(e.1n)?e.1n:Q;1E(!a.3Y&&a.1y){a=a.1y};5(!a.3Y)B;7 b=17.20(a.1k.U(d)[1]),2L=8;5(b==14)b=(b=17.6v(a.1k.U(d)[1])[0])?b:14;5(b!=14){7 c=b;1E(c.1y){c=c.1y;5(c.2Y){c.2Y(b);2L=c}};5(2L){5(e.1J)e.1J();17.3O.1k="#"+a.1k.U(d)[1];2L.3n.27();B 8}}})}};E.3Z();5(1i.4Y)1i.4Y()},3Z:6(){5(E.4z)B;E.4z=C;7 a=E.50(17.34("5n")[0],"4q",\'4l\');1q(7 i=0,3u;3u=a[i];i++)E.3s(3u)},50:6(a,b,c){5(3M(a)==\'4f\')a=17.20(a);5(a==14)B 8;7 d=2n 31("(^|\\\\s)"+c+"($|\\\\s)"),6D,3w=[],43=0;7 e=a.34(b);1q(7 i=0,2D;2D=e[i];i++){5(2D.1r&&2D.1r.U(d)){3w[43]=2D;43++}};B 3w},38:1i.3a(6(){7 a=17.20(\'4l-6H\');5(a!=14){E.3Z();1i.2l(E.38)}},4y),N:6(a,b,c){5(!E.28(a,b,c)&&a.55){a.55(\'4C\'+b,c)}},28:6(a,b,c){5(a.3y){a.3y(b,c,8);E.56=C;1i.3y("6L",6(){E.2d(a,b,c)},8);B C}1l B 8},2d:6(a,b,c){5(!E.4n(a,b,c)&&a.4I)a.4I(\'4C\'+b,c)},4n:6(a,b,c){5(a.4S){a.4S(b,c,8);B C}1l B 8}};6 5S(a){E.3s(a)};E.4L();',62,425,'||||sBr|if|function|var|false||||||||||||||||||||||||||||sY|return|true|mDv|fleXenv|px|wD|tDv|movBr|padding|curPos|getStyle|getSize|addTrggr|cntRSize|Bar|this|offsetHeight||width|match|scroller|reqS|paddings|appendChild|createDiv||Math|left|top|null|setPos|0px|document|pDv|style|parseInt|sDv|contentScroll|trgtScrll|offsetWidth|yPos|fDv|xPos|window|delta|href|else|forcedHide|srcElement|findPos||for|className||sSBr|edge|border|event|height|parentNode|curtop|target|scrollState|hoverH|iNDx|while|anchoR|scrollUpdate|barSpace|mxScroll|preventDefault|keyAct|_|cntSize|fHide|minPos|position|goScroll|bottom|scrollLeft|scrollTop|tSelectFunc|sFBr|id|mV|max|nV|getElementById|forcedBar|min|curleft|targetSkew|sSDv|right|mDPosFix|addChckTrggr|moved|indx|maxPos|copyStyles|remTrggr|documentElement|mWheelProc|mousemove|setSize|barPadding|visibility|clientY|clearInterval|createScrollBars|new|sFDv|jBox|urlExt|clientX||hBr|mTBox|indexOf|hidden|retFalse|urlBase|cPSize|intClear|barZ|fShow|pusher|vrt|mMouseUp|getContentWidth|maxCWidth|fleXcroll|hUpReq|getContentHeight|eScroll|stdMode|updateScroll|vertical|ofstParent|hrz|formItem|scrollBoth|offsetParent|clicked|vUpReq|mMoveBar|mouseup|scrollToElement|focusProtect|classChange|RegExp|sRange|pageScrolled|getElementsByTagName|vEdge|sXdir|relative|catchFastInit|sYdir|setInterval|userAgent|mdY|yScrld|mOnXEdge|mOnYEdge|hElem|doScrollPos|inputName|mdX|xAw|padLoss|yAw|fleXdata|prepareScroll|mHeight|parT|onmousedown|fleXcrollMain|refreshTimeout|tgDiv|Array|retArray|forcedPos|addEventListener|baseAct|brdWidthLoss|mY|brdHeightLoss|xScrld|padHeightComp|zIndex|selectstart|setVisibility|display|baseProp|setWidth|calcCScrollVal|typeof|maxx|location|hEdge|contentScrollPos|wheelAct|uReg|zTHeight|setHeight|tSelectMouse|replace|absolute|fleXanchor|initByClass||camelConv|reT|key|barClickRetard||barClickScroll|vBr|findRCpos|mousewheel|DOMMouseScroll|createElement|offsetLeft|textAlign|postHeight|string|intlWidth|vBar|inMposX|1em|keyCode|flexcroll|getComputedStyle|remChckTrggr|currentStyle|reqV|div|detail|getPos|inMposY|pkeY|load|scrlTrgt|100px|100|initialized|length|1px|on|fixIEDispBug|inCurPos|index|paddingLeft|setTimeout|detachEvent|80|wheelDelta|fleXcrollInit|firstChild|flexinactive|HTMLElement|solid|offsetTop|aSize|removeEventListener|opera|anchorList|clearTimeout|overflow|brdWidth|onfleXcrollRun|pageXOffset|getByClassName|globalInit|100p|paddingTop|pageYOffset|attachEvent|w3events|removeChild|pointerOffsetY|isddvChild|pointerOffsetX|oScrollX|select|visible|base|_39|borderBottom|Mac|parseFloat|borderBottomWidth|basebeg|AppleWebKit|_40|body|baseend|hscroller|bar|_38|containerSize|block|barbeg|matcH|_33|domfixdiv|barend|substr|contentSize|textarea|onmousewheel|hBar|Object|blue|setAttribute|OmniWeb|tabIndex|MSIE|keydown|sizeChangeDetect|_34|2500|zoomdetectdiv|toString|childNodes|auto|CSBfleXcroll|normal|toUpperCase|onmouseover|getPropertyValue|ondblclick|scrollgeneric|_36|input|type|commitScroll|dblclick|bscrollgeneric|vendor|_35|KDE|scrollerjogbox|425|_hscroller|2px|mcontentwrapper|platform|contentwrapper|onmouseclick|none|flex__|flexcrollactive|compPad|inline|75|scrollwrapper|Safari|resize|text|keypress|align|keyup|click|999|getElementsByName|mousedown|split|undefined|prototype|focus|charAt|blur|clsnm|onblur|fontSize|_37|init|black|12px|xScroll|unload|yScroll|vscroller|copyholder|button|navigator'.split('|'),0,{}))



var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)

document.onmousemove = getMouseXY;

var mosX = 0
var mosY = 0
viewportTop = 0
viewportLeft = 0
containerTop = 0
containerLeft = 0 

//Gets the mouse position on the page
function getMouseXY(e) {
  if (IE) {
    mosX = event.clientX + document.body.scrollLeft
    mosY = event.clientY + document.body.scrollTop
  } else {
    mosX = e.pageX
    mosY = e.pageY
  }  
  if (mosX < 0){mosX = 0}
  if (mosY < 0){mosY = 0}  
  return true
}

//The main function that is called in the mouseover event of your viewport element(s)
function hsscroll(theLink){
  viewport = theLink.id;
  container = document.getElementById(viewport).getElementsByTagName("DIV")[0].id;
  
  var vel=document.getElementById(viewport);
  var viewportLeft=0,viewportTop=0;
  if (vel.offsetParent)
  {
	do
	{
		viewportLeft+=vel.offsetLeft;
		viewportTop+=vel.offsetTop;
	}
	while(vel=vel.offsetParent);
  }
  
  var cel=document.getElementById(container);
  var containerLeft=0,containerTop=0;
  if (cel.offsetParent)
  {
	do
	{
		containerLeft+=cel.offsetLeft;
		containerTop+=cel.offsetTop;
	}
	while(cel=cel.offsetParent);
  }
  
  if (document.getElementById(theLink.id).className=="hs-vertical"){
  	if (document.getElementById(container).offsetHeight>document.getElementById(viewport).offsetHeight){
	  varA = ((mosY-viewportTop)/document.getElementById(viewport).offsetHeight);
	  varB = document.getElementById(container).offsetHeight - document.getElementById(viewport).offsetHeight;
	  contop = (varA*varB)^-1;
	  document.getElementById(container).style.top = contop+"px";
	}
  }
  if (document.getElementById(theLink.id).className=="hs-horizontal"){
  	if (document.getElementById(container).offsetWidth>document.getElementById(viewport).offsetWidth){
	  varA = ((mosX-viewportLeft)/document.getElementById(viewport).offsetWidth);
	  varB = document.getElementById(container).offsetWidth - document.getElementById(viewport).offsetWidth;
	  conleft = (varA*varB)^-1;
	  document.getElementById(container).style.left = conleft+"px";
	}
  }
  if (document.getElementById(theLink.id).className=="hs-pan"){
  	if (document.getElementById(container).offsetWidth>document.getElementById(viewport).offsetWidth || document.getElementById(container).offsetHeight>document.getElementById(viewport).offsetHeight){
	  varA = ((mosX-viewportLeft)/document.getElementById(viewport).offsetWidth);
	  varB = document.getElementById(container).offsetWidth - document.getElementById(viewport).offsetWidth;
	  conleft = (varA*varB)^-1;
	  varC = ((mosY-viewportTop)/document.getElementById(viewport).offsetHeight);
	  varD = document.getElementById(container).offsetHeight - document.getElementById(viewport).offsetHeight;
	  contop = (varC*varD)^-1;
	  document.getElementById(container).style.left = conleft+"px";
	  document.getElementById(container).style.top = contop+"px";
	}
  }
}





//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}




/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
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;



/**
 * Multiple transitions
 * Use different transition for description and image
 * Use whatever type of content to slide. Not only images
 * Support for embeded content sliding
 * 
 */

(function($){
	$.fn.featuredbox = function(custom) {
		var defaults = {
		  	width: 600,
			height: 300,
			slidesAnimation: "slide-top",
			slidesSpeed: "slow",
			descriptionAnimation: "slide-bottom",
			descriptionSpeed: "slow",
			navigationHide: false,
			navigationAnimation: "slide",
			rotateInterval: 6000,
			next: "",
			previous: ""
		};
		var settings 			= $.extend({}, defaults, custom);
		 
		// Variables
		var box 				= this;
		var start_zindex		= 10;
		var current_slide		= "slide1";
		var current_slide_nr	= 1;
		var lock_slide			= false;
		var lock_description	= false;
		var slide_count			= box.find("ul li").length;
		var rotator				= "";
		var description_width	= 0;
		var description_height	= 0;
		var description_top		= 0;
		var description_left	= 0;
		var description_load_interval = "";
		var reloaded_calculation = false;
		
		/** Prepare featured box **/
		
		// Add featured box wrapper
		// In this wrapper we add the navigation block. This way you can show
		// the navigation beside the image
		box.wrapInner('<div class="featuredbox"></div>');
		var box_innner 	= box.find(".featuredbox");
		
		// Add extra divs
		box_innner.append('<div class="description" style="z-index:102"></div>');
		box.append('<div class="navigation" style="z-index:101"></div>');
		box_innner.prepend('<div class="box-slide1" style="z-index:50">qsd</div>');
		box_innner.prepend('<div class="box-slide2" style="z-index:51;display:none">tester</div>');
		
		// Show the box
		box.show();
		
		// Set auto rotate interval
		startRotate();
		
		// Add extra vars
		var description_box = box.find(".description");
		
		// Set z-index
		box.find("ul").addClass("slides");
		box.find("ul li").each(function (i) {
			$(this).hide();
			$(this).addClass("slide" + (i+1));
			start_zindex--;
		});
		
		// Set current image
		if(!$.browser.msie){
			box.find("ul").find("embed").attr("wmode", "transparent");
		}
		box.find(".box-slide1").html(box.find("." + current_slide).children().eq(0).clone());
		
		add_navigate_click_handlers();
		
		// Fix for IE browser
		box.find(".box-slide1").find("embed").attr("wmode", "transparent");

		// Create navigation
		var navigation = "<ul>";
		var first_active = " active";
		for(var i=0 ; i < slide_count ; i++){
			navigation += '<li class="nav' + (i+1) + first_active + '">' + box.find(".slide" + (i+1)).children().eq(2).html() + "</li>";
			first_active = "";
		}
		navigation += "</ul>";
		var navigation_box = box.find(".navigation");
		navigation_box.html(navigation);
		navigation_box.find("li").bind("click", function () { 
			if(!lock_slide && !lock_description){
				var current_click = $(this).attr("class").replace("nav", "").replace(" hover", "").replace(" active", "");
				slidesTransition(current_slide_nr, current_click);
			}
		}).bind("mouseenter",function(){
			$(this).addClass("hover");
		}).bind("mouseleave",function(){
			$(this).removeClass("hover");
		});

		// Set description
		description_box.html(box.find(".slide1").children().eq(1).html());
		
		// Add menu hider
		if(settings.navigationHide){
			box.find(".navigation").hide();
			box.bind("mouseenter",function(){
				box.find(".navigation:not(:animated)").fadeIn("slow");
			}).bind("mouseleave",function(){
				box.find(".navigation").fadeOut("slow");
			});
		}
		
		// Slide transition function
		function slidesTransition(from_nr, to_nr){
			
			// Stop interval timer
			stopRotate();
			
			// Create vars
			var from_slide 		= "slide" + from_nr;
			var to_slide		= "slide" + to_nr;
			
			// Set navigation active
			navigation_box.find("li").removeClass("active");
			navigation_box.find("li.nav" + to_nr).addClass("active");
			
			// If clicked the active slide
			// don't do any animation
			if(from_slide == to_slide){
				return;	
			}
			
			lock_slide			= true;
			lock_description	= true;
			
			// Set box slide 1 to from slide content
			box.find(".box-slide1").html(box.find("." + from_slide).children().eq(0).clone());
			box.find(".box-slide1").show();
			
			box.find(".box-slide2").html(box.find("." + to_slide).children().eq(0).clone());
			box.find(".box-slide2").hide();
			
			add_navigate_click_handlers();
			
			// Fix for IE browser
			box.find(".box-slide1").find("embed").attr("wmode", "transparent");
			box.find(".box-slide2").find("embed").attr("wmode", "transparent");
			
			switch(settings.slidesAnimation){
				case "slide-bottom":
					slideBottomSlidesAnimation();
					break;
				case "slide-top":
					slideTopSlidesAnimation();
					break;
				case "slide-left":
					slideLeftSlidesAnimation();
					break;
				case "slide-right":
					slideRightSlidesAnimation();
					break;
				case "size":
					sizeSlidesAnimation();
					break;
				case "line":
					lineSlidesAnimation();
					break;
				default:
					fadeSlidesAnimation();
					break;
			}
			
			var new_description_content = box.find("." + to_slide).children().eq(1).html();
			switch(settings.descriptionAnimation){
				case "slide-bottom":
					slideBottomDescriptionAnimation(new_description_content);
					break;
				case "slide-top":
					slideTopDescriptionAnimation(new_description_content);
					break;
				case "slide-left":
					slideLeftDescriptionAnimation(new_description_content);
					break;
				case "slide-right":
					slideRightDescriptionAnimation(new_description_content);
					break;
				default:
					fadeDescriptionAnimation(new_description_content);
					break;
			}
			
			// Set current slide
			current_slide = "slide" + to_nr;
			current_slide_nr = to_nr;

		}
		
		// Start rotate interval
		function startRotate(){
			if(settings.rotateInterval > 0 && settings.rotateInterval != "undefined"){
				rotator = setInterval(rotate, settings.rotateInterval);	
			}	
		}
		
		// Stop rotate interval
		function stopRotate(){
			window.clearInterval(rotator);
		}
		
		// Rotate trough slides
		function rotate(){
			// Calculate next slide
			var next_slide_nr = (current_slide_nr+1) > slide_count ? 1 : (current_slide_nr+1);
			slidesTransition(current_slide_nr, next_slide_nr);
		}
		
		// Rotate back trough slides
		function rotate_back(){
			// Calculate pervious slide
			var next_slide_nr = (current_slide_nr-1) < 1 ? slide_count : (current_slide_nr-1);
			slidesTransition(current_slide_nr, next_slide_nr);
		}
		
		/** Slide transitions **/
		function fadeSlidesAnimation(){
			box.find(".box-slide2").fadeIn(settings.slidesSpeed, unlock_slide);
		}
		
		function slideBottomSlidesAnimation(){
			box.find(".box-slide2").css("top", settings.height);
			box.find(".box-slide2").show();
			box.find(".box-slide2").animate({ top : "0px" }, settings.slidesSpeed, null, unlock_slide);
		}
		
		function slideTopSlidesAnimation(){
			box.find(".box-slide2").css("top", -settings.height);
			box.find(".box-slide2").show();
			box.find(".box-slide2").animate({ top : "0px" }, settings.slidesSpeed, null, unlock_slide);
		}
		
		function slideLeftSlidesAnimation(){
			box.find(".box-slide2").css("left", -settings.width);
			box.find(".box-slide2").show();
			box.find(".box-slide2").animate({ left : "0px" }, settings.slidesSpeed, null, unlock_slide);
		}
		
		function slideRightSlidesAnimation(){
			box.find(".box-slide2").css("left", settings.width);
			box.find(".box-slide2").show();
			box.find(".box-slide2").animate({ left : "0px" }, settings.slidesSpeed, null, unlock_slide);
		}
		
		function sizeSlidesAnimation(){
			box.find(".box-slide2").show(settings.slidesSpeed, unlock_slide);
		}
		
		function lineSlidesAnimation(){
			box.find(".box-slide2").css("left", settings.width);
			box.find(".box-slide2").show();
			box.find(".box-slide2").animate({ left : "0px" }, settings.slidesSpeed);
			box.find(".box-slide1").animate({ left : -settings.width+"px" }, settings.slidesSpeed, null, function(){
				//box.find(".box-slide2").css("left", 0);		
				box.find(".box-slide1").css("left", 0);
				unlock_slide();
			});
		}
		
		/** Description transitions **/
		function fadeDescriptionAnimation(new_content){
			var description_box = box.find(".description");
			description_box.fadeOut(settings.descriptionSpeed, function(){
				if(new_content == "" || new_content == "undefined"){ 
					description_box.hide();
					unlock_description();
				}else{
					description_box.html(new_content);
					description_box.fadeIn(settings.descriptionSpeed, unlock_description);	
				}
			});
		}
		
		function slideBottomDescriptionAnimation(new_content){
			description_box.animate({ top : settings.height + description_height + "px" }, settings.descriptionSpeed, null,
			function(){
				if(new_content == "" || new_content == "undefined"){ 
					description_box.hide();
				}else{
					description_box.show();
				}
				description_box.html(new_content);
				description_box.animate({ top : description_top + "px" }, settings.descriptionSpeed, null, unlock_description);												
			});
		}
		
		function slideTopDescriptionAnimation(new_content){
			description_box.animate({ top : "-" + description_height + "px" }, settings.descriptionSpeed, null, function(){
				if(new_content == "" || new_content == "undefined"){ 
					description_box.hide();
				}else{
					description_box.show();
				}
				description_box.html(new_content);
				description_box.animate({ top : description_top + "px" }, settings.descriptionSpeed, null, unlock_description);												
			});
		}
		
		function slideLeftDescriptionAnimation(new_content){
			description_box.animate({ left : "-" + description_width + "px" }, settings.descriptionSpeed, null, function(){
				if(new_content == "" || new_content == "undefined"){ 
					description_box.hide();
				}else{
					description_box.show();
				}
				description_box.html(new_content);
				description_box.animate({ left : description_left + "px" }, settings.descriptionSpeed, null, unlock_description);												
			});
		}
		
		function slideRightDescriptionAnimation(new_content){
			description_box.animate({ left : settings.width + description_width + "px" }, settings.descriptionSpeed, null, function(){
				if(new_content == "" || new_content == "undefined"){ 
					description_box.hide();
				}else{
					description_box.show();
				}
				description_box.html(new_content);
				description_box.animate({ left : description_left + "px" }, settings.descriptionSpeed, null, unlock_description);												
			});
		}
		
		/** Extra functions **/
		
		function unlock_description(){
			lock_description = false;
			is_unlocked();
		}
		
		function unlock_slide(){
			lock_slide = false;	
			is_unlocked();
		}
		
		function is_unlocked(){
			if(!lock_description && !lock_slide){
				startRotate();	
			}
		}
		
		function add_navigate_click_handlers(){
			// Add next click handler
			if(settings.next != ""){
				box.find(settings.next).bind("click", function(){ 
					if(!lock_description && !lock_slide){
						rotate();	
					}
				});
			}	
			
			// Add previous click handler
			if(settings.previous != ""){
				box.find(settings.previous).bind("click", function(){ 
					if(!lock_description && !lock_slide){
						rotate_back();	
					}
				});
			}
		}
		
		
		function calc_description_box_position(){
			window.clearInterval(description_load_interval);

			// Description size
			calc_description_box_size();

			// Calculate description top
			description_top =  parseInt(description_box.css("top").replace("px", ""));
			
			// Calculate description left
			description_left =  parseInt(description_box.css("left").replace("px", ""));
			
			if(isNaN(description_left)){
				description_box.hide();	
				description_load_interval = setInterval(calc_description_box_position, 200);	
			}else{
				description_box.fadeIn("fast");
				if(!reloaded_calculation){
					reloaded_calculation = true;
					calc_description_box_position();
				}
			}
		}
		
		function calc_description_box_size(){
			// Calculate description box height
			description_height = parseInt(description_box.css("padding-top").replace("px", "")) + 
								parseInt(description_box.css("padding-bottom").replace("px", "")) + 
								parseInt(description_box.css("height").replace("px", ""));
			
			description_width = parseInt(description_box.css("padding-left").replace("px", "")) + 
								parseInt(description_box.css("padding-right").replace("px", "")) + 
								parseInt(description_box.css("width").replace("px", ""));	
		}
		
		calc_description_box_position();
		
		// returns the jQuery object to allow for chainability.
		return this;
	}
	
})(jQuery);
