/* -- Adobe GoLive JavaScript Library */

CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false;
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0);  }
CSIImg=false;
function CSInitImgID() {if (!CSIImg && document.images) { for (var i=0; i<document.images.length; i++) { if (!document.images[i].id) document.images[i].id=document.images[i].name; } CSIImg = true;}}
function CSFindElement(n,ly) { if (CSBVers<4) return document[n];
	if (CSIsW3CDOM) {CSInitImgID();return(document.getElementById(n));}
	var curDoc = ly?ly.document:document; var elem = curDoc[n];
	if (!elem) {for (var i=0;i<curDoc.layers.length;i++) {elem=CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
	return elem;
}
function CSGetImage(n) {if(document.images) {return ((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);} else {return null;}}
CSDInit=false;
function CSIDOM() { if (CSDInit)return; CSDInit=true; if(document.getElementsByTagName) {var n = document.getElementsByTagName('DIV'); for (var i=0;i<n.length;i++) {CSICSS2Prop(n[i].id);}}}
function CSICSS2Prop(id) { var n = document.getElementsByTagName('STYLE');for (var i=0;i<n.length;i++) { var cn = n[i].childNodes; for (var j=0;j<cn.length;j++) { CSSetCSS2Props(CSFetchStyle(cn[j].data, id),id); }}}
function CSFetchStyle(sc, id) {
	var s=sc; while(s.indexOf("#")!=-1) { s=s.substring(s.indexOf("#")+1,sc.length); if (s.substring(0,s.indexOf("{")).toUpperCase().indexOf(id.toUpperCase())!=-1) return(s.substring(s.indexOf("{")+1,s.indexOf("}")));}
	return "";
}
function CSGetStyleAttrValue (si, id) {
	var s=si.toUpperCase();
	var myID=id.toUpperCase()+":";
	var id1=s.indexOf(myID);
	if (id1==-1) return "";
	s=s.substring(id1+myID.length+1,si.length);
	var id2=s.indexOf(";");
	return ((id2==-1)?s:s.substring(0,id2));
}
function CSSetCSS2Props(si, id) {
	var el=document.getElementById(id);
	if (el==null) return;
	var style=document.getElementById(id).style;
	if (style) {
		if (style.left=="") style.left=CSGetStyleAttrValue(si,"left");
		if (style.top=="") style.top=CSGetStyleAttrValue(si,"top");
		if (style.width=="") style.width=CSGetStyleAttrValue(si,"width");
		if (style.height=="") style.height=CSGetStyleAttrValue(si,"height");
		if (style.visibility=="") style.visibility=CSGetStyleAttrValue(si,"visibility");
		if (style.zIndex=="") style.zIndex=CSGetStyleAttrValue(si,"z-index");
	}
}
function CSSetStylePos(s,d,p) {
	if (CSIsW3CDOM)d==0?document.getElementById(s).style.left=p+"px":document.getElementById(s).style.top=p+"px";
	else if(IsIE())(d==0)?CSIEStyl(s).posLeft=p:CSIEStyl(s).posTop=p;
	else (d==0)?CSNSStyl(s).left=p:CSNSStyl(s).top=p;
}
function CSGetStylePos(s,d) {
	if (CSIsW3CDOM){CSIDOM();return parseInt((d==0)?document.getElementById(s).style.left:document.getElementById(s).style.top);}
	else if (IsIE()) {CSIEWinInit();return(d==0)?CSIEStyl(s).posLeft:CSIEStyl(s).posTop;}
	else {return (d==0)?CSNSStyl(s).left:CSNSStyl(s).top;}
}
CSIEWInit=false;
function CSIEWinInit() { if(CSIEWInit==true) return; else CSIEWInit=true; if (IsIE()&&(CSAg.indexOf("Win")!=-1)&&CSBVers==4) { var i=0; var lyr=document.all.tags("div")[i++]; while(lyr) {lyr.style.posLeft=lyr.offsetLeft; lyr.style.posTop=lyr.offsetTop; lyr=document.all.tags("div")[i++];}}}
CSLoopIsRunning = false; CSFctArray = new Array; CSTimeoutID = null;
function CSLoop() {	
	CSLoopIsRunning = false;
	for (i=0;i<CSFctArray.length;i++) {
		var curFct = CSFctArray[i];
		if (curFct)	{
			if (curFct.DoFunction(curFct)) { CSLoopIsRunning = true; curFct.counter++; }
			else CSFctArray[i] = 0;
		}
	}
	if (CSLoopIsRunning) CSTimeoutID = setTimeout("CSLoop()", 1);
}
function CSStartFunction(fct,data) {
	if (!CSLoopIsRunning) { CSFctArray = 0; CSFctArray = new Array; }
	var fctInfo = new Object;
	fctInfo.DoFunction = fct; fctInfo.counter = 0; fctInfo.data = data;
	CSFctArray[CSFctArray.length] = fctInfo; 
	if (!CSLoopIsRunning) CSLoop();
}
function CSStopFunction(sceneName) {
	var i;
	for (i=0;i<CSFctArray.length;i++) {
		var curFct = CSFctArray[i];
		if (curFct){ if (curFct.data.name == sceneName){ CSFctArray[i] = 0; return; } }
	}
}
function CSStopComplete() {
	if (CSTimeoutID == null) return;
	clearTimeout (CSTimeoutID); CSLoopIsRunning = false; CSTimeoutID = null;
}
function CSMoveLoop(fInf) {
	var ticks = 60 * (((new Date()).getTime()) - fInf.data.startTime)/1000;
	var f = ticks/fInf.data.ticks;
	if (f < 1) { CSSetStylePos(fInf.data.layer,0,fInf.data.start[0] * (1-f) + fInf.data.end[0] * f);
		CSSetStylePos(fInf.data.layer,1,fInf.data.start[1] * (1-f) + fInf.data.end[1] * f); return true; }
	else { CSSetStylePos(fInf.data.layer,0,fInf.data.end[0]);
		CSSetStylePos(fInf.data.layer,1,fInf.data.end[1]); }
	return false;
}
function CSSlideObj (layer,start,end,ticks,startTime) {
	this.layer=layer;this.start=start;this.end=end;this.ticks=ticks;this.startTime=startTime;
}
function CSSlideLayer(l,pos,anim,ticks) {
	var x = pos[0]; var y = pos[1];
	if (l == '') return;
	if (ticks < 0) ticks = 0;
	if (!anim) { CSSetStylePos(l,0,x); CSSetStylePos(l,1,y); }
	else {  var fctData = new CSSlideObj(l,new Array(CSGetStylePos(l,0),CSGetStylePos(l,1)),new Array(x,y),ticks,(new Date()).getTime()); CSStartFunction(CSMoveLoop,fctData); }
}
CSInit = new Array;
function CSScriptInit() {
if(typeof(skipPage) != "undefined") { if(skipPage) return; }
idxArray = new Array;
for(var i=0;i<CSInit.length;i++)
	idxArray[i] = i;
CSAction2(CSInit, idxArray);
}
CSStopExecution=false;
function CSAction(array) {return CSAction2(CSAct, array);}
function CSAction2(fct, array) { 
	var result;
	for (var i=0;i<array.length;i++) {
		if(CSStopExecution) return false; 
		var aa = fct[array[i]];
		if (aa == null) return false;
		var ta = new Array;
		for(var j=1;j<aa.length;j++) {
			if((aa[j]!=null)&&(typeof(aa[j])=="object")&&(aa[j].length==2)){
				if(aa[j][0]=="VAR"){ta[j]=CSStateArray[aa[j][1]];}
				else{if(aa[j][0]=="ACT"){ta[j]=CSAction(new Array(new String(aa[j][1])));}
				else ta[j]=aa[j];}
			} else ta[j]=aa[j];
		}			
		result=aa[0](ta);
	}
	return result;
}
CSAct = new Object;
CSIm=new Object();
function CSIShow(n,i) {
	if (document.images) {
		if (CSIm[n]) {
			var img=CSGetImage(n);
			if (img&&typeof(CSIm[n][i].src)!="undefined") {img.src=CSIm[n][i].src;}
			if(i!=0) self.status=CSIm[n][3]; else self.status=" ";
			return true;
		}
	}
	return false;
}
function CSILoad(action) {
	im=action[1];
	if (document.images) {
		CSIm[im]=new Object();
		for (var i=2;i<5;i++) {
			if (action[i]!='') {CSIm[im][i-2]=new Image(); CSIm[im][i-2].src=action[i];}
			else CSIm[im][i-2]=0;
		}
		CSIm[im][3] = action[5];
	}
}

function CSClickReturn () {
	var bAgent = window.navigator.userAgent; 
	var bAppName = window.navigator.appName;
	if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
		return true; /* dont follow link */
	else return false; /* dont follow link */
}
function CSButtonReturn () { return !CSClickReturn(); }

// OUT utility Javascript library 1.4.3
// Script copyright 1999-2001 OUT Media Design GmbH. All rights reserved.
// This version needs the Adobe GoLive Netscape 6 Fix installed to work in NN6

var CSIsW3CDOM = CSIsW3CDOM; // declare variable in case the NN6 Fix isn't installed
if(!CSIsW3CDOM) { CSIsW3CDOM = false; } // define in case the NN6 Fix isn't installed

function OUTFindFrame(n,win) {
	var curFrames = win ? win.frames : top.frames;
	var frame = n=='' ? window : curFrames[n];
	if (!frame) {
		for (var i=0;i<curFrames.length;i++) {
			frame = OUTFindFrame(n,curFrames[i]);
			if (frame)
				return frame;
		}
	}
	return frame;
}

function OUTFindElement(n,ly,cmp) {
	if (cmp) n=OUTfindComponentElementName(n,ly);
	if (CSIsW3CDOM) { CSInitImgID();return document.getElementById(n); } 
	var curDoc = ly ? (ly.document ? ly.document : ly) : document;
	var elem = curDoc[n];
	if (!elem && curDoc.layers) { for (var i=0;i<curDoc.layers.length;i++) {
		elem = OUTFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
	return elem;
}


// functions to search for AGL component objects named like this "Cmp003B4E7300brian"

function OUTfindComponentElementName(n,ly){
	var objn = '';
	var curDoc = ly ? (ly.document ? ly.document : ly) : (document.all ? document.all : document);
	if (CSIsW3CDOM) {
		curDoc = document.getElementsByTagName("*");
		for (var i=0; i<curDoc.length; i++) {
			objn = curDoc[i].name;
			if (objn && objn.indexOf("Cmp")==0 && objn.substr(13)==n) return objn;
 		}
	}
	else {
		for (objn in curDoc) {
			if (objn && objn.indexOf("Cmp")==0 && objn.substr(13)==n) return objn;
 		}
		if (!IsIE() && curDoc.layers) { for (var i=0;i<curDoc.layers.length;i++) {
			objn = OUTfindComponentElementName(n,curDoc.layers[i]);if (objn) return objn; }
		}
	}
	return null;
}


function OUTgetValuesFromURL(n) {
	var u=window.location.search;
	var a=new Array();
	if (u!="") {
		u=u.substring(u.indexOf('?')+1, u.length);
		u=u.split('&');
        for (var i=0; i<u.length; i++) { var p=u[i].split('='); if (p[0]==n) a[a.length]=p; }
	}
	return a;
}


function OUTcheckValueFromURL(n,v) {
	var a = OUTgetValuesFromURL(n);
	if (a) { for (var i in a) { if (a[i] && a[i][1]==v) return true; } }
	return false;
}
// OUT Lock Rollover Action Script Library 1.3.6
// Script copyright 1999 - 2002 OUT Media Design GmbH. All rights reserved.

var OUTlckTimeout = new Array();
var OUTlckIm = new Object();
function OUTdoLckBtnIm(action,cmp) {
	var n = cmp ? OUTfindComponentElementName(action[1]) : action[1];
	var g = OUTlckGrpName(action[2]);
	var img = null;
	OUTlckTimeout[n] = OUTlckTimeout[n] ? clearTimeout(OUTlckTimeout[n]) : 0;
	if (n!="" && !CSIm[n]) {//in case the CSIm object is not available, defer locking
		OUTlckTimeout[n] = setTimeout("OUTdoLckBtnIm(new Array('','"+action[1]+"','"+action[2]+"',"+action[3]+"),"+cmp+")",500);
		return false;
	}
	if (document.images) {
		if (!OUTlckIm[g]){//create group if not available
			eval("OUTlckIm."+g +" = new Object()");
			OUTlckIm[g].name='';OUTlckIm[g].main='';OUTlckIm[g].over='';
		} else if (OUTlckIm[g].name!=n) {
			var lckd = OUTlckIm[g].name;
			if (CSIm[lckd]) {//restore last locked image
				img = (!IsIE()) ? OUTFindElement(lckd,0) : document[lckd];
				if (img) {
					img.src = OUTlckIm[g].main;
					CSIm[lckd][0].src = OUTlckIm[g].main;
					CSIm[lckd][1].src = OUTlckIm[g].over;
				}
			}
		}
		if (CSIm[n] && OUTlckIm[g].name!=n) {//lock image
			//save new locked image
			OUTlckIm[g].main = CSIm[n][0].src;
			OUTlckIm[g].over = CSIm[n][1].src;
			//replace main & over with click image
			CSIm[n][0].src = CSIm[n][2].src;
			if (action[3]!=true) CSIm[n][1].src = CSIm[n][2].src;
		}
		OUTlckIm[g].name = n; // change name here to allow unlock
		//display image
		CSIShow(n,2);
		return true;
	}
	return false;
}

function OUTlckGrpName(g) {  return g ? "group_"+g : "group_all"; }


// OUT Lock Rollover Action v1.4
// Script copyright 1999-2002, OUT Media Design GmbH. All rights reserved.

function OUTlckBtnIm(action) {
	return OUTdoLckBtnIm(action,false);
}
// OUT Lock Rollover in Frame Action v1.4
// Script copyright 2000, OUT Media Design GmbH. All rights reserved.

function OUTlckBtnImFrm(action) {
	var lckTarget = null;
	if (action[3]=='') lckTarget = window; else lckTarget = OUTFindFrame(action[3],0);
	if (action[4]) {//automatic
		var docDir = window.location.pathname;
		var lckBtn = '';
		if (action[1]) docDir=docDir.substring(docDir.indexOf(action[1])+action[1].length,docDir.length);
		docDir=docDir.substring(docDir.charAt(0)=='/'?1:0,docDir.lastIndexOf('.')>0?docDir.lastIndexOf('.'):docDir.length);
		docDir=docDir.split('/');
		if(!action[6]) docDir.length-=1;
		if(docDir.length){
			if(action[4]==1) lckBtn=docDir[0];
			if(action[4]==2) lckBtn=docDir[docDir.length-1];
			if(action[4]==3) {for(var i=0; i<docDir.length; i++){lckBtn+=docDir[i];if(i<docDir.length-1)lckBtn+=action[5];}}
		}
		action[1]=lckBtn;
	}
	if (lckTarget && lckTarget.CSIShow && lckTarget.OUTdoLckBtnIm){
		action[3] = action[8]? true : false; //copy params to correct position
		lckTarget.OUTdoLckBtnIm(action,action[7]);
		return true;
	}
	return false;
}
function CSGotoLink(action) {
	if (action[2].length) {
		var hasFrame=false;
		for(i=0;i<parent.frames.length;i++) { if (parent.frames[i].name==action[2]) { hasFrame=true; break;}}
		if (hasFrame==true)
			parent.frames[action[2]].location = action[1];
		else
			window.open (action[1],action[2],"");
	}
	else location = action[1];
}

function CSMoveTo(action) { CSSlideLayer(action[1],action[2],action[3],action[4]); }

// OUT PNG library 1.0.7
// Script copyright 2004 OUT Media Design GmbH. All rights reserved.

function OUTpngBrowserCheck(){
// Code partially taken from:
// Browser Detect Lite  v2.1 <http://www.dithered.com/javascript/browser_detect/index.html>
// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
// modified by Oliver Zahorka
	var ua=navigator.userAgent.toLowerCase(); 
	this.ua=ua;
	// browser name
	this.isGecko=(ua.indexOf('gecko')>=0);
	this.isMozilla=(this.isGecko && ua.indexOf("gecko/")+14 == ua.length);
	this.isNS=((this.isGecko)?(ua.indexOf('netscape')>=0):((ua.indexOf('mozilla')>=0) && (ua.indexOf('spoofer')<0) && (ua.indexOf('compatible')<0) && (ua.indexOf('opera')<0) && (ua.indexOf('webtv')<0) && (ua.indexOf('hotjava')<0)));
	this.isIE=((ua.indexOf("msie")>=0) && (ua.indexOf("opera")<0) && (ua.indexOf("webtv")<0)); 
	this.isOpera=(ua.indexOf("opera")>=0); 
	this.isAol=(ua.indexOf("aol")>=0); 
	// browser version
	this.vers=parseFloat(navigator.appVersion); 
	// correct version number for NS6+ 
	if (this.isNS && this.isGecko){this.vers=parseFloat(ua.substring(ua.lastIndexOf('/')+1));}
	// correct version number for IE4+ 
	else if (this.isIE && this.vers >= 4){this.vers=parseFloat(ua.substring(ua.indexOf('msie ')+5));}
	// correct version number for Opera 
	else if (this.isOpera){if (ua.indexOf('opera/')>=0){this.vers=parseFloat(ua.substring(ua.indexOf('opera/')+6));}else{this.vers=parseFloat(ua.substring(ua.indexOf('opera ')+6));}}
	// platform
	this.isWin  =(ua.indexOf('win')>=0);
	this.isMac  =(ua.indexOf('mac')>=0);
	this.isUnix =(ua.indexOf('unix')>=0 || ua.indexOf('linux')>=0 || ua.indexOf('sunos')>=0 || ua.indexOf('bsd')>=0 || ua.indexOf('x11')>=0)
}

function OUTcheckPNGSupport()
{
	var b=new OUTpngBrowserCheck();
	// support for PNG via AlphaImageLoader, if is IE5.5+ on windows; set flag to 1
	if (b.isIE && b.vers>=5.5) return 1;
	// no support for PNG; set flag to -1 for Opera < 6 on Win/Unix, Opera < 5 on Mac, Netscape < 5, AOL
	else if ((b.isIE && b.isWin) || (b.isIE && b.isMac && b.vers < 5) || (b.isOpera && (b.isWin || b.isUnix) && b.vers < 6) || (b.isOpera && b.isMac && b.vers < 5) || (b.isNS && b.vers < 5) || b.isAol) return -1;
	// support for PNG right away; set flag to 0 for all others
	else return 0;
}

var OUTpngSupport=OUTcheckPNGSupport();

function OUTisPNGsrc(s,n){s=s.toLowerCase();n="."+n.toLowerCase();return s.lastIndexOf(n)==(s.length-n.length);}

function OUTpngImgReplace(img,isrc,psrc,rsrc){
	if (OUTpngSupport>0 && psrc && psrc!="#" && isrc && isrc!="#"){
		img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+isrc+"', sizingMethod='scale')";
		img.src=psrc;
	}
	if(OUTpngSupport<0 && rsrc && rsrc!="#"){img.src=rsrc;}
	if(OUTpngSupport==0 && isrc && isrc!="#" && img.src!=isrc){img.src=isrc;}
}

function OUTpngCSILoadTrans(s) {if(typeof(CSIm)!="undefined"){for(var n in CSIm){CSIm[n][4]=new Image();CSIm[n][4].src=s;}}}

function OUTpngCSIShow(n,i) {
	if (document.images) {
		if (CSIm[n]) {
			var img=CSGetImage(n);
			if (img&&typeof(CSIm[n][i].src)!="undefined") {
				if(!OUTisPNGsrc(CSIm[n][i].src,"png")) img.src=CSIm[n][i].src;
				else OUTpngImgReplace(img,CSIm[n][i].src,CSIm[n][4].src,"#")
			}
			if(i!=0) self.status=CSIm[n][3]; else self.status=" ";
			return true;
		}
	}
	return false;
}

function OUTpngRolloverInit(a) {OUTpngCSILoadTrans(a[1]); if(typeof(CSIShow)!="undefined" && OUTpngCSIShow)CSIShow=OUTpngCSIShow;}

//
// OUT PNG Transparency for IE 1.0.6
// Script copyright 2004 OUT Media Design GmbH. All rights reserved.

function OUTpngIEBgReplace(style,s,m){
	style.backgroundImage="";
	style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+s+"', sizingMethod='"+m+"')";
}

function OUTiePNGimgXparency(a) {
	/* check browser */
	if (OUTpngSupport>0){
		/* add Smart Rollover support */
		OUTpngRolloverInit(a);
		/* replace img */
		if(document.images){
			for (var i=0;i<document.images.length;i++) {
				var img=document.images[i];
				if(img&&OUTisPNGsrc(img.src,a[2]))OUTpngImgReplace(img,img.src,a[1],"#");
			}
		}
		/* replace style backgrounds */
		if (a[3] && document.all) {
			for(var i=0;i<document.all.length;i++){
			 	var e=document.all[i],s=null;
			 	if (e.background) s=e.background;
			 	else if (e.style && e.style.backgroundImage) {
			 		s=e.style.backgroundImage;
			 		s=s.substr(4,s.length-5);
			 	}
			 	if(s&&OUTisPNGsrc(s,a[2])){e.background="";OUTpngIEBgReplace(e.style,s,a[4]);}
			}
		}
		/* replace css backgrounds */
		if (a[5] && document.styleSheets) {
			for (var j=0; j<document.styleSheets.length; j++){
				for(var i=0;i<document.styleSheets[j].rules.length;i++){
				 	var e=document.styleSheets[j].rules[i],s=null;
				 	if (e.style && e.style.backgroundImage) {
				 		s=e.style.backgroundImage;
				 		s=s.substr(4,s.length-5);
				 	}
				 	if(s&&OUTisPNGsrc(s,a[2]))OUTpngIEBgReplace(e.style,s,a[6]);
				}
			}
		}
	}
}
//
//-->

function CSRandomImg(action) { 
	var img = CSGetImage(action[1]);
	if (img) 
		{
		var v1 =  Math.floor(Math.random() * 10);
		var whichone = v1-(Math.floor(v1/3)*3);
		img.src = action[whichone+2];
		}
}

// OUT Call Action Later Action Library 1.0
// Script copyright 2001, OUT Media Design GmbH. All rights reserved.


var OUTactsLater = new Array();

function OUTcallActionLater(action)
{
	for(var i=2;i<action.length;i++) {
		var a = new Array();
		a[0] = action[i];
		a[1] = setTimeout("CSAction(new Array('"+action[i]+"'))",action[1]);
		OUTactsLater[OUTactsLater.length]=a;
	}
}


function CSOpenWindow(action) {
	var wf = "";	
	wf = wf + "width=" + action[3];
	wf = wf + ",height=" + action[4];
	wf = wf + ",resizable=" + (action[5] ? "yes" : "no");
	wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no");
	wf = wf + ",menubar=" + (action[7] ? "yes" : "no");
	wf = wf + ",toolbar=" + (action[8] ? "yes" : "no");
	wf = wf + ",directories=" + (action[9] ? "yes" : "no");
	wf = wf + ",location=" + (action[10] ? "yes" : "no");
	wf = wf + ",status=" + (action[11] ? "yes" : "no");		
	window.open(action[1],action[2],wf);
}


