/* -- Adobe GoLive JavaScript Library */

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;
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 */
}


// The BannerAction. A Michael Ahgren action.
// Version 1.0
var objArray=new Array()
var instArray=new Array()
var currInst=0
var started=0
var mWin
function instObj(action){
this.posX=action[24]
this.posY=action[25]
this.popX=action[22]
this.popY=action[23]
this.banW=action[27]
this.banH=action[28]
this.centre=action[26]
this.name=action[29]
this.conRot=action[30]
this.objArray=new Array()
this.currBan=0
this.rotInt=action[21]
this.action=action
}
function SCInitBan(action){
instArray[currInst]=new instObj(action)
var j=0
for(i=1;i<20;i+=2){
if(action[i]!="#")
instArray[currInst].objArray[j]=new bannerObj(action[i],action[i+1])
j++
}
instArray[currInst].currBan=rndNum(instArray[currInst].objArray.length)
writeBan(instArray[currInst].currBan)
banTimer(instArray[currInst].rotInt);
currInst++
}
function rndNum(max){
var theRnd=Math.floor(Math.random()*max)
return theRnd
}
function banTimer(rotInt){
var intID=setInterval(displBan,rotInt*1000)
}
function displBan(){
if(instArray[started].conRot){
instArray[started].currBan++
if(instArray[started].currBan==instArray[started].objArray.length)instArray[started].currBan=0;

eval('document.'+instArray[started].name+'.src="'+instArray[started].objArray[instArray[started].currBan].imgSrc+'"')
}
started==instArray.length-1?started=0:started++
}
function SCMakeWin(inst){
if(instArray[inst].centre){
instArray[inst].posX=((screen.availWidth/2)-(instArray[inst].popX/2))
instArray[inst].posY=((screen.availHeight/2)-(instArray[inst].popY/2))
}
if(instArray[inst].objArray[instArray[inst].currBan].bannerUrl!="#"){
if(mWin&&!mWin.closed){
mWin.location=instArray[inst].objArray[currBan].bannerUrl
mWin.focus()
}else{
mWin=window.open(instArray[inst].objArray[instArray[inst].currBan].bannerUrl,instArray[inst].currBan,"height="+instArray[inst].popY+",width="+instArray[inst].popX+" toolbar=1,menubar=1,directories=1,scrollbars=1,resizable=1,status=1,toolbar=1,copyhistory=1,location=1,left="+instArray[inst].posX+",top="+instArray[inst].posY);
}
}
}
function bannerObj(imgSrc,theURL){
this.imgSrc=imgSrc
this.bannerUrl=theURL
}
function writeBan(currBan){
document.write('<a href="javascript:SCMakeWin('+currInst+')"><img src="'+instArray[currInst].objArray[currBan].imgSrc+'" alt="" name="'+instArray[currInst].name+'" height="'+instArray[currInst].banH+'" width="'+instArray[currInst].banW+'" border="0"></a>')
}
// End BannerAction
// 


