/* -- Adobe GoLive JavaScript Library */
/* -- Global Functions */
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 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);
}
CSInit = new Array;
CSExit = new Array;
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 */
}
/* -- Action Functions */
//\s*\S\s*\/\/.+\.$
// CustomFit.action v1.3.5 - April, 2003
// © Copyright 2000 by Walter Blady
// All rights reserved
//-----------------------------------------------------------------------------------
//Default Height and Width compensation values to make up for Browser window toolbars etc
//Win... IE5 CFWinIEwx = 25, CFWinIEhx = 163 - NN62 CFWinNNwx = 18, CFWinNNhx = 134
//Mac... IE4 CFMacIEwx = 40, CFMacIEhx = 101 - IE5+ CFMacIEwx = 37, CFMacIEhx = 109 
//- NN4 CFMacNNwx = 28, CFMacNNhx = 154 - NN6+ CFMacNNwx = 10, CFMacNNhx = 85
var CFWinIEwx = 25, CFWinIEhx = 163, CFWinNNwx = 18, CFWinNNhx = 134;
var CFMacIEwx = 37, CFMacIEhx = 109, CFMacNNwx = 10, CFMacNNhx = 85;
//-----------------------------------------------------------------------------------
//Set browser flags and parameter string variables.
var CFisNav4 = navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) == 4;
var CFisIE4 = navigator.appVersion.indexOf("MSIE 4") >= 0;
var CFW3C = document.getElementById ? true : false;
var CFisIE = navigator.appVersion.indexOf("MSIE") >= 0;
var CFisWin = navigator.platform.indexOf("Win") >= 0;
var CFisMac = navigator.platform.indexOf("Mac") >= 0;
//var CFisOpera = navigator.userAgent.indexOf("Opera") >= 0;.
//var CFsuff = CFisOpera ? "" : "px";.
//Set global variables.
var CFResArray = new Array("640", "480", "800", "600", "832", "624", "1024", "768", "1152", "870", "1280", "960", "1280", "1024", "1600", "1024", "1600", "1200", "1792", "1344", "1856", "1392", "1920", "1080");
//Main function.
function WBCustomFit(action) {
	if (CFVersion()) {
		var screenWidth = screen.width;
		var screenHeight = screen.height;
		if (action[44]) alert("The resolution of this screen is: " + screenWidth + " X " + screenHeight);
		var matchWidth = action[2] != 7 ? CFResArray[action[2]*2] : action[3];
		var matchHeight = action[2] != 7 ? CFResArray[(action[2]*2)+1] : action[4];
		var match = eval("CFRes" + action[1] + "(" + screenWidth + ", " + screenHeight + ", " + matchWidth + ", " + matchHeight + ")");
		if (match) {
			//Resize window if entered.
			if (action[5] > 0) {
				window.moveTo(0,0);
				//Pixels.
				if (action[5] == 1) {
					var newWidth = (action[6] <= screen.availWidth) ? action[6] : screen.availWidth;
					var newHeight = (action[7] <= screen.availHeight) ? action[7] : screen.availHeight;
				}
				//Percentage of max screen size.
				else if (action[5] == 2) {
					var w = CFisIE ? Math.round(action[6]*document.body.clientWidth/100) : Math.round(action[6]*window.innerWidth/100);
					var h = CFisIE ? Math.round(action[7]*document.body.clientHeight/100) : Math.round(action[7]*window.innerHeight/100);
					var newWidth = w <= screen.availWidth ? w : screen.availWidth;
					var newHeight = h <= screen.availHeight ? h : screen.availHeight;
					//Adjustment amounts for Windows.
					if (CFisWin) {
						newWidth += CFisIE ? CFWinIEwx : CFWinNNwx;
						newHeight += CFisIE ? CFWinIEhx : CFWinNNhx;
					}
					//Adjustment amounts for Mac.
					else {
						newWidth += CFisIE ? CFMacIEwx : CFMacNNwx;
						newHeight += CFisIE ? CFMacIEhx : CFMacNNhx;
					}
				}
				//Max screen size.
				else if (action[5] == 3) {
					var newWidth = screen.availWidth;
					var newHeight = screen.availHeight;
				}
				//Resize for IE4, IE5 & NN6.
				if (CFW3C || CFisIE4) {
					window.resizeTo(newWidth, newHeight);
				}
				//Resize for NN4.
				else {
					window.outerWidth = newWidth;
					window.outerHeight = newHeight;
				}
			}
			//Check for floating box changes.
			for (var i = 8; i < 44; i = i + 9) {
				if (action[i] != "") {
					//Get layer object.
					CFparams = CFgetObject(action[i]);
					var cwidth = action[i+1], cheight = action[i+2];
					//Resize floating box.
					if (action[i+3] > 0) {
						//If pixel.
						if (action[i+3] == 1) {
							var nw = action[i+4], nh = action[i+5];
						}
						//If percentage.
						else if (action[i+3] == 2) {
							var nw = Math.round(action[i+4]*cwidth/100), nh = Math.round(action[i+5]*cheight/100);
						}
						//Resize the box for IE5 & NN6.
						if (CFW3C) {
							CFparams.width = nw + "px";
							var t = document.getElementsByTagName("div");
							CFparams.height = t[action[i]].height > nh ? t[action[i]].height + "px" : nh + "px";
						}
						//Resize the box for IE4.
						else if (CFisIE4) {
							CFparams.pixelWidth = nw;
							var t = document.all.tags("div");
							CFparams.pixelHeight = t[action[i]].offsetHeight > nh ? t[action[i]].offsetHeight : nh;
						}
						//Resize the box for NN4. (may have to enter CFparams.clip.width etc.
						else {
							CFparams.width = nw;
							CFparams.height = CFparams.height > nh ? CFparams.height : nh;
						}
					}
					//Move box to screen location.
					if (action[i+6] > 0) {
						if (CFW3C || CFisIE4) {
							var boxLeft = CFW3C ? parseInt(CFparams.left) : CFparams.pixelLeft;
							var boxTop = CFW3C ? parseInt(CFparams.top) : CFparams.pixelTop;
						}
						else {
							var boxLeft = CFparams.left;
							var boxTop = CFparams.top;
						}
						//If pixel.
						if (action[i+6] == 1) {
							var nleft = action[i+7] >= 0 ? action[i+7] : boxLeft;
							var ntop = action[i+8] >= 0 ? action[i+8] : boxTop;
						}
						//If percentage.
						else if (action[i+6] == 2) {
							//If IE browsers.
							 if (CFisIE) {
								var nleft = action[i+7] >= 0 ? action[i+7]*document.body.clientWidth/100 : boxLeft*100/document.body.clientWidth;
								var ntop = action[i+8] >= 0 ? action[i+8]*document.body.clientHeight/100 : boxTop*100/document.body.clientHeight;
							}
							//If other browsers.
							else {
								var nleft = action[i+7] >= 0 ? action[i+7]*window.innerWidth/100 : boxLeft*100/window.innerWidth;
								var ntop = action[i+8] >= 0 ? action[i+8]*window.innerHeight/100 : boxTop*100/window.innerHeight;
							}
						}
						//Move the floating box.
						CFscrollTo(CFparams, nleft, ntop);
					}
				}
			}
		}
	}
	return;
}
//Equals.
function CFRes0(w, h, mw, mh) {
	var matchFlag = (w == mw && h == mh);
	return matchFlag;
}
//Greater than.
function CFRes1(w, h, mw, mh) {
	var matchFlag = (w > mw && h > mh);
	return matchFlag;
}
//Less than.
function CFRes2(w, h, mw, mh) {
	var matchFlag = (w < mw && h < mh);
	return matchFlag;
}
//Greater than or equal to.
function CFRes3(w, h, mw, mh) {
	var matchFlag = (w >= mw && h >= mh);
	return matchFlag;
}
//Less than or equal to.
function CFRes4(w, h, mw, mh) {
	var matchFlag = (w <= mw && h <= mh);
	return matchFlag;
}
//Scroll to next location.
function CFscrollTo(obj, x, y) {
	if (CFW3C) {
		obj.left = x + "px";
		obj.top = y + "px";
	}
	else if (CFisIE4) {
		obj.pixelLeft = x;
		obj.pixelTop = y;
	}
	else {
		obj.moveTo(x, y);
	}
	return;
}
//Build the parameter string for either IE or NN.
function CFgetObject(objName) {
	var params;
	if (CFW3C) {
		params = eval('document.getElementById("' + objName + '").style');
	}
	else if (CFisIE4) {
		params = eval("document.all." + objName + ".style");
	}
	else {
		params = CFFindLayerObject(objName, 0);
	}
	return params;
}
// Search all NN layers for the specified layer object.
function CFFindLayerObject(layer, thisLayer) {
	if (thisLayer) {
		var thisDocument = thisLayer.document;
	}
	else {
		var thisDocument = document;
	}
	var layerObj = thisDocument[layer];
	if (layerObj) {
		return layerObj;
	}
	else {
		for (var i = 0; i < thisDocument.layers.length; i++) {
			layerObj = CFFindLayerObject(layer, thisDocument.layers[i]); 
			if (layerObj) {
				break;
			}
		}
	}
	return layerObj;
}
// Browser check.
function CFVersion() {
	return (navigator.appName.indexOf("Netscape") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 4)
          || (navigator.appName.indexOf("Explorer") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 4)
          || (navigator.appName.indexOf("WebTV") >= 0 && parseInt(navigator.appVersion.charAt(0)) >= 3);
}
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];
		}
}
/* EOF */
