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

// OpenPopUpLite 2.0.1 action by Nate Baldwin, www.mindpalette.com, copyright 2004
if (typeof MPStoreOpenWin2 == "undefined") MPStoreOpenWin2 = new Array();
function MPOpenPopupLite(action) {
	var posX = 0;
	var posY = 0;
	if (action[4] == true) {
		posX = Math.round((screen.availWidth/2)-(action[2]/2));
		posY = Math.round((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;
	var thisPopup = window.open(action[15], action[1], windowOptions);
	MPStoreOpenWin2[action[1]] = thisPopup;
	if (action[14] != "" && action[14] != "#" && action[14] != "(EmptyReference!)" && action[14] != "(Empty Reference!)")
		window.location = action[14];
	}
//-->

// Count Field Input Action 1.0.1 by Nate Baldwin, www.mindpalette.com
if (typeof MPFormCalcStoredVars == "undefined") var MPFormCalcStoredVars = new Array();
function MPCFIMain2(a) {
	with (document.forms[a[1]]) {
		var input = elements[a[2]].value;
		regexp = /\r\n/g;
		input = input.replace(regexp, "\\n'");
		if (a[3] == 0) {
			var seps = new Array("\n", "\t", " ", "\r");
			for (var n=0; n<a[12].length; n++) {
				if (!MPCFIWhiteSpace(a[12].charAt(n))) seps[seps.length] = a[12].charAt(n);
				}
			var sepKey = new Array();
			regexp = /\*/g;
			input = input.replace(regexp, '!asterisk!');
			var results = '';
			var lastIsMatch = false;
			for (var n=0; n<input.length; n++) {
				var match = false;
				for (var i=0; i<seps.length; i++) {
					if (seps[i] == input.charAt(n)) {
						if (a[13] && lastIsMatch) {
							sepKey[sepKey.length-1] += input.charAt(n);
							} else {
							results += '*';
							sepKey[sepKey.length] = input.charAt(n);
							}
						match = true;
						lastIsMatch = true;
						break;
						}
					}
				if (!match) {
					results += input.charAt(n);
					lastIsMatch = false;
					}
				}
			var temp = results.split('*');
			if (temp.length > 0 && temp[temp.length-1] == '') temp = temp.slice(0, temp.length-1);
			if (temp.length > 0 && temp[0] == '') temp = temp.slice(1);
			var total = temp.length;
			} else if (a[3] == 2) {
			var total = 0;
			for (var n=0; n<input.length; n++) {
				if (!MPCFIWhiteSpace(input.charAt(n))) total++;
				}
			} else total = input.length;
		if (a[4] > 0 && total > a[4]) {
			if (a[5] != '') alert(a[5]);
			if (a[3] == 0) {
				temp = temp.slice(0, a[4]);
				temp = temp.join('*');
				var thisKey = 0;
				var results = '';
				for (var n=0; n<temp.length; n++) {
					if (temp.charAt(n) == '*') {
						results += sepKey[thisKey];
						thisKey++;
						} else results += temp.charAt(n);
					}
				regexp = /\!asterisk\!/g;
				temp = results.replace(regexp, '*');
				elements[a[2]].value = temp;
				} else if (a[3] == 1) {
				elements[a[2]].value = input.substr(0, a[4]);
				} else {
				var keep = 0;
				var test = 0;
				for (var n=0; n<input.length; n++) {
					if (!MPCFIWhiteSpace(input.charAt(n))) test++;
					keep++;
					if (test >= a[4]) break;
					}
				elements[a[2]].value = input.substr(0, keep);
				}
			total = a[4];
			}
		var r1 = (a[7] == 1 && a[4] > 0) ? a[4] - total : total;
		if (a[6] != '') elements[a[6]].value = r1+'';
		}
	var r2 = (a[9] == 1 && a[4] > 0) ? a[4] - total : total;
	if (a[8] != '') MPCFIDivTextWrite(a[8], r2+'');
	var r3 = (a[11] == 1 && a[4] > 0) ? a[4] - total : total;
	if (a[10] != '') MPFormCalcStoredVars[a[7]] = total;
	}
function MPCFIDivTextWrite(div, text) {
	if (document.layers) {
		if (typeof eval("document."+div+".document") != "undefined") {
			with (eval("document."+div+".document")) {
				open();
				write("<HTML><HEAD><\/HEAD><BODY>"+text+"<\/BODY><\/HTML>");
				close();
				}
			}
		} else if (document.all && typeof document.all[div] != "undefined") {
		document.all[div].innerHTML = text;
		} else if (document.getElementById && !document.all && typeof document.getElementById(div) != "undefined") {
		document.getElementById(div).innerHTML = text;
		}
	}
function MPCFIWhiteSpace(character) {
	if (character == " " || character == "\t" || character == "\n" || character == "\r")
		return true;
		else return false;
	}
//-->



