/* -- 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 CSSetStyleVis(s,v) {
	if (CSIsW3CDOM){CSIDOM();document.getElementById(s).style.visibility=(v==0)?"hidden":"visible";}
	else if(IsIE())CSIEStyl(s).visibility=(v==0)?"hidden":"visible";
	else CSNSStyl(s).visibility=(v==0)?'hide':'show';
}
function CSGetStyleVis(s) {
	if (CSIsW3CDOM) {CSIDOM();return(document.getElementById(s).style.visibility=="hidden")?0:1;}
	else if(IsIE())return(CSIEStyl(s).visibility=="hidden")?0:1;
	else return(CSNSStyl(s).visibility=='hide')?0:1;
}
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++];}}}
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 newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
mustInitImg = true;
function initImgID() {var di = document.images; if (mustInitImg && di) { for (var i=0; i<di.length; i++) { if (!di[i].id) di[i].id=di[i].name; } mustInitImg = false;}}
function findElement(n,ly) {
	var d = document;
	if (browserVers < 4)		return d[n];
	if ((browserVers >= 6) && (d.getElementById)) {initImgID; return(d.getElementById(n))}; 
	var cd = ly ? ly.document : d;
	var elem = cd[n];
	if (!elem) {
		for (var i=0;i<cd.layers.length;i++) {
			elem = findElement(n,cd.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}
function changeImagesArray(array) {
	if (preloadFlag == true) {
		var d = document; var img;
		for (i=0;i<array.length;i+=2) {
			img = null; var n = array[i];
			if (d.images) {
				if (d.layers) {img = findElement(n,0);}
				else {img = d.images[n];}
			}
			if (!img && d.getElementById) {img = d.getElementById(n);}
			if (!img && d.getElementsByName) {
				var elms = d.getElementsByName(n);
				if (elms) {
					for (j=0;j<elms.length;j++) {
						if (elms[j].src) {img = elms[j]; break;}
					}
				}
			}
			if (img) {img.src = array[i+1];}
		}
	}
}
function changeImages() {
	changeImagesArray(changeImages.arguments);
}
function toggleImages() {
	for (var i=0; i<toggleImages.arguments.length; i+=2) {
		if (selected == toggleImages.arguments[i])
			changeImagesArray(toggleImages.arguments[i+1]);
	}
}
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 */
// Auto Image Window Action 1.4.1 by Nate Baldwin, www.mindpalette.com, 12/2/03
function MPImageWindow(action) {
	for (i=10; i<17; i++) action[i] = (action[i] == false) ? "no" : "yes";
	if (action[7] > screen.availWidth) action[7] = screen.availWidth;
	if (action[8] > screen.availHeight) action[8] = screen.availHeight;
	var posX = 0;
	var posY = 0;
	if (action[9] == true) {
		posX = Math.round((screen.availWidth/2)-(action[7]/2));
		posY = Math.round((screen.availHeight/2)-(action[8]/2));
		} else {
		posX = action[17];
		posY = action[18];
		}
		
	var ImageURL = action[1];
	
	var newString = "";
	if (ImageURL.indexOf(".") >= 0) {
		var testArray = ImageURL.split(".");
		for (i=0; i<testArray.length; i++) {
			newString += "^";
			newString += testArray[i];
			}
		ImageURL = newString.substr(1);
		}
	
	var queryString = "*MPImage="+ImageURL+"*MPImageX="+action[2]+"*MPImageY="+action[3]+"*MPTitle="+action[4]+"*";
	var queryString = escape(queryString);
	var queryString = "?"+queryString;
	action[5] += queryString;
	var windowOptions = "";
	windowOptions += "width=" + action[7];
	windowOptions += ",height=" + action[8];
	windowOptions += ",resizable=" + action[16];
	windowOptions += ",scrollbars=" + action[10];
	windowOptions += ",menubar=" + action[11];
	windowOptions += ",toolbar=" + action[14];
	windowOptions += ",directories=" + action[12];
	windowOptions += ",location=" + action[15];
	windowOptions += ",status=" + action[13];
	windowOptions += ",left=" + posX;
	windowOptions += ",top=" + posY;
	window.open(action[5], action[6], windowOptions);
	}
//-->
// Detect Title Action 1.4 by Nate Baldwin, www.mindpalette.com, 2/9/03
function MPDetectTitle() {
	var MPData2 = unescape(location.search);
	var MPTitle = "";
	if (MPData2 != "") {
		var trimString2 = MPData2.substring(1);
		if (trimString2 != "") {
			var allPairs2 = trimString2.split("*");
			for (i=0; i<allPairs2.length; i++) {
				var thisPair = allPairs2[i];
				var splitPair = thisPair.split("=");
				if (splitPair[0] == "MPTitle") MPTitle = splitPair[1];
				}
				if (MPTitle != "" && MPTitle != "#") document.write("<title>"+MPTitle+"</title>");
					else document.write("<title>Popup Window</title>");
		}
	}
	window.focus();
	}
// Detect Image Action 1.4 by Nate Baldwin, www.mindpalette.com, 2/9/03
function MPDetectImg() {
	var MPData = unescape(location.search);
	var MPImage = "";
	var MPImageX = "";
	var MPImageY = "";
	if (MPData != "") {
		var trimString = MPData.substring(1);
		if (trimString != "") {
			var allPairs = trimString.split("*");
			for (i=0; i<allPairs.length; i++) {
				var thisPair = allPairs[i];
				var splitPair = thisPair.split("=");
				if (splitPair[0] == "MPImage") MPImage = splitPair[1];
				if (splitPair[0] == "MPImageX") MPImageX = splitPair[1];
				if (splitPair[0] == "MPImageY") MPImageY = splitPair[1];
				}
			}
			if (MPImage != "" && MPImage != "#") {
			
				var newString = "";
				if (MPImage.indexOf("^") >= 0) {
					var testArray = MPImage.split("^");
					for (i=0; i<testArray.length; i++) {
						newString += ".";
						newString += testArray[i];
						}
					MPImage = newString.substr(1);
					}
				document.write("<img src=\""+MPImage+"\" alt=\"\"");
				}
			if (MPImageX != "" && MPImageY != "" && MPImageX != 0 && MPImageY != 0) document.write(" width=\""+MPImageX+"\" height=\""+MPImageY+"\"");
			if (MPImage != "" && MPImage != "#") document.write(" border=\"0\">");
		}
	window.focus();
	}
function CSCloseWindow() { 
if (self.parent.frames.length != 0) {
	self.parent.close()	
	} else {
	window.close()
	}
}
// Version 1.2. A Michael Ahgren action.
function CSRemoveIEbox(){
if (document.images&&navigator.userAgent.indexOf("MSIE")!=-1){
	for(i=0;i<document.links.length;i++){
		var target=eval("document.links[i]")
		target.onfocus=blurHandler
		}
	}
}
function blurHandler(){
obj=window.event.srcElement
if(obj.tagName == "A"||obj.tagName=="AREA") obj.blur()
}
function CSShowHide(action) {
	if (action[1] == '') return;
	var type=action[2];
	if(type==0) CSSetStyleVis(action[1],0);
	else if(type==1) CSSetStyleVis(action[1],1);
	else if(type==2) { 
		if (CSGetStyleVis(action[1]) == 0) CSSetStyleVis(action[1],1);
		else CSSetStyleVis(action[1],0);
	}
}
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];
}
var DJold = new Array();
function DJmoveNewPos(t) {
	if(document.all) {
		x = document.body.scrollLeft + DJold[t].originX;
		y = document.body.scrollTop + DJold[t].originY;
	} else {
		x = window.pageXOffset + DJold[t].originX;
		y = window.pageYOffset + DJold[t].originY;
	}
	d1 = x - DJold[t].x;
	d2 = y - DJold[t].y;
	DJold[t].x = DJold[t].x + (x - DJold[t].x)*DJold[t].smooth;
	DJold[t].y = DJold[t].y + (y - DJold[t].y)*DJold[t].smooth;
	CSSetStylePos(DJold[t].oldLayer,0,DJold[t].x);
	CSSetStylePos(DJold[t].oldLayer,1,DJold[t].y);
	setTimeout("DJmoveNewPos(" + t + ")",10);
}
function DJSmoothFloatLayer(action) {
	var x = action[2][0]; var y = action[2][1];
	DJold[DJold.length] = new Array();
	t = DJold.length - 1;
	DJold[t].oldLayer = action[1];
	CSSetStylePos(DJold[t].oldLayer,0,x);
	CSSetStylePos(DJold[t].oldLayer,1,y);
	DJold[t].x = x;
	DJold[t].y = y;
	DJold[t].originX = x;
	DJold[t].originY = y;
	DJold[t].smooth = 1.0/action[3];
	setTimeout("DJmoveNewPos(" + t + ")",10);
}
// OpenPopUp 1.4 action by Nate Baldwin, www.mindpalette.com, copyright 2002
function MPOpenPopup(action) {
var posX = 0;
var posY = 0;
if (action[4] == true) {
	posX = ((screen.availWidth/2)-(action[2]/2));
	posY = ((screen.availHeight/2)-(action[3]/2));
	} else {
	posX = action[12];
	posY = action[13];
	}
if (action[16] == true) {
	posX = 0;
	posY = 0;
	action[2] = screen.availWidth;
	action[3] = screen.availHeight;
	}
for (i=5; i<12; i++) {
	action[i] == true ? action[i] = "yes" : action[i] = "no";
	}
var windowOptions = "";
windowOptions += "width=" + action[2];
windowOptions += ",height=" + action[3];
windowOptions += ",resizable=" + action[11];
windowOptions += ",scrollbars=" + action[5];
windowOptions += ",menubar=" + action[6];
windowOptions += ",toolbar=" + action[9];
windowOptions += ",directories=" + action[7];
windowOptions += ",location=" + action[10];
windowOptions += ",status=" + action[8];
windowOptions += ",left=" + posX;
windowOptions += ",top=" + posY;
window.open(action[15], action[1], windowOptions);
if (action[14] != "" && action[14] != "#" && action[14] != "(EmptyReference!)" && action[14] != "(Empty Reference!)")
	window.location = action[14];
}
function CSSlideNewWindow(action) {
var wh = ""
if (action[7] || action[8] || action[9] == true) wh=action[4]-125
else wh = action[4]
var wf = "";	
wf = wf + "width=" + action[3];
wf = wf + ",height=" + wh;
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");		
if(navigator.appVersion.charAt(0) >=4) {
var sw=screen.width-20;
var sh=screen.height;
var newwidth=action[3]; 
var newheight=action[4];
var positionleft=(sw-newwidth)/2;
var positiontop=""
if (action[7] || action[8] || action[9] == true) positiontop=(sh-newheight)/3;
else positiontop=(sh-newheight)/2.5;
}
newwindow=window.open(action[1],action[2],wf); 
newwindow.focus()	
if(navigator.appVersion.charAt(0) >=4) {
	for(width1 = 1 ; width1 < positionleft ; width1 = width1 + 10)
	newwindow.moveTo(width1,positiontop)
	}
}
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);
}
// Close Popup Window Action 1.0.1 by Nate Baldwin, www.mindpalette.com, copyright 2002
var MPClosePopCount1 = 0;
function MPCloseWin1() {
	MPClosePopCount1++;
	self.close();
	}
function MPFocusWin1() {
	if (MPClosePopCount1 == 0) window.focus();
	}
window.onload = MPFocusWin1;
/* EOF */

