<!--
// These Functions should be assigned
// to the onFocus() and onBlur() methods,
// respectively. GH_Highlight() creates
// a red border around the selected object,
// and GH_Obscure returns the object to
// its original state, as defined by the 
// style class .textbox (located in 
// "/include/sitestyle.css"

/* 2006-12-15 - Steve Pellham */
/*  Remarked out the line below to prevent error logs - this path is not used in myfsn.com */
/* imgDynamic.src = "/images/themes/vendor_root/clearbox.gif"; */

function GH_openFrames(strMenu, strContent) {
	parent.submenu.location.href=strMenu;
	parent.content.location.href=strContent;
}

function GH_Highlight(objName) {
	objName.style.borderColor = "#50441F"; // FF0000";
	objName.style.borderStyle = "solid";
	objName.style.borderWidth = "4px";
}

function GH_Obscure(objName) {
	objName.style.borderColor = "#000000";
	objName.style.borderStyle = "solid";
	objName.style.borderWidth = "1px";
}

function fcnGetURL(newURL, target)
{
  switch (target)
  {
    case "top"    : top.location.href = newURL;
				    break;
					
	case "parent" : parent.location.href = newURL;
				    break;
					
	case "self"   : location.href = newURL;
					break;
					
    default       : location.href = newURL;
	                break;
  }
}

// Looks to drop-down list, for planid to jump to
// creates URL and jumps
function quickJumpPlanEdit() {
	var strURL = "/admin/plan_edit.php?planid=";
	var intIndex = document.form1.selQuickjump.selectedIndex;
	var planID = document.form1.selQuickjump.options[intIndex].value;
	strURL = strURL + planID;
	location.href=strURL;
}

// Form Checking Functions

/*
	function: GH_checkLength
	parameters: form name, field name, descriptive name for field, required length
	action: checks to see if value of field length meets
	requirements. 
	returns: onSuccess() - blank string
			onError() - descriptive text.
*/
function GH_checkLength(frmName, objName, strFieldName, intMinLength) {
	oField = eval("document." + frmName + "." + objName);
	strFieldValue = new String(oField.value);
	if ((strFieldValue.length < intMinLength) || ((intMinLength == -1) && (strFieldValue.length == 0))) {
		if (intMinLength == -1) {
			strError = strFieldName + " cannot be left blank.\n";
		} else {
			strError = strFieldName + " must be at least " + intMinLength + " characters in length.\n";
		}
		
		return strError;
	} else {
		return "";
	}
}

function GH_addToFavorites(planid) {
	strURL = "/admin/addtofavorites.php?planid=" + planid;
	MM_openBrWindow(strURL, 'wndAddFav', 'width=150,height=95');
}

function GH_prevClicked() {
	document.form1.intStartAt.value = document.form1.tempPrevStartAt.value;
	document.form1.submit();
}

function GH_nextClicked() {
	document.form1.intStartAt.value = document.form1.tempNextStartAt.value;
	document.form1.submit();	
}

/*
// Popup Image Handler, form step through handler
function GH_prevClicked() {
	document.form1.intPos.value = document.form1.tempPrevStartAt.value;
	document.form1.submit();
}

function GH_nextClicked() {
	document.form1.intPos.value = document.form1.tempNextStartAt.value;
	document.form1.submit();	
}
*/

// function and code to enable popup image display
var imgDynamic = new Image();
/* imgDynamic.src = "/images/themes/vendor_root/clearbox.gif"; */

function GH_loadImage(strImgURL) {
	// update image src
	document.imgDynamic.src = strImgURL;
	
	// reset position to default
	var oImg = MM_findObj('popupImg');
	oImg.style.left = 250;
	oImg.style.top = 360;
	
	// show image layer
	MM_showHideLayers('popupImg','','show');
}

function GH_moveObject(objName, intLeft, intTop) {
	// get object
	oObj = MM_findObj(objName);
	
	// set left, right
	oObj.style.left = intLeft;
	oObj.style.top = intTop;
}

// A Function to give focus to the passed
// object

function GH_GiveFocus(frmName, objName) {
//	objForm = eval("document." + frmName);
	objElement = eval("document." + frmName + "." + objName);
	objElement.focus();
}

// GH modified to auto-center the popup window

function MM_openBrWindow(theURL,winName,features) { //v2.0
	var startpos, endpos, intWidth, intHeight, top, left, length;
	
	// Get Width
	startpos = features.indexOf("width=") + 6;
	endpos = startpos;
	
	while ((features.charCodeAt(endpos) >= 48) && (features.charCodeAt(endpos) <= 57)) {
		endpos++;
	}

	intWidth = features.substring(startpos, endpos);

	// Get Height
	startpos = features.indexOf("height=") + 7;
	endpos = startpos;
	
	while ((features.charCodeAt(endpos) >= 48) && (features.charCodeAt(endpos) <= 57)) {
		endpos++;
	}
	
	intHeight = features.substring(startpos, endpos);
	
	// Now determine top and left positions (centering) based on height and width
	top = (screen.height - intHeight) / 2;
	left = (screen.width - intWidth) / 2;
	
	features += ", top=" + top + ", left=" + left;
	
  	return window.open(theURL,winName,features);
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

// Retrieves Parent URL,
// refreshes it and closes the current window
function GH_RefreshOpener(page) {

		// Refresh Opener
		var newURL = page;
		opener.location.href = newURL;
		
		// Close Current Window
		window.close();	
}

function GH_CheckPass(field1, field2, frmName) {
	// Get Values of Objects and compare
	objElement1 = eval("document." + frmName + "." + field1);
	objElement2 = eval("document." + frmName + "." + field2);
	
	objVal1 = objElement1.value;
	objVal2 = objElement2.value;
	
	if (objVal1 == objVal2) {
		objForm = eval("document." + frmName);
		objForm.submit();
	} else { 
		alert("Password Fields Don't Match");
		GH_GiveFocus(frmName, field1);
	} 
}

function GH_setText(frmName, frmField, strText) {
	objTarget = eval("document." + frmName + "." + frmField);
	
	objTarget.value = strText;
}

/* 	
	Function: Formats the following fields:
	social; dob; state; email; 
	
	If lnLglGuard == "yes", then requires that
	grdFname && grdLname != ""
	
	Action: If everything's fine, submits the form,
	otherwise, displays popup with details
*/
 
 function GH_ValidateAddUser(frmName) {
	var blnError, strError, strSocial, strDOB, strState, strEmail;
	var strBlnLglGuard, strGrdFname, strGrdLname;
	var intSelected, intValue;
	
	blnError = 0;
	strError = "";
	
	// get form object
	objForm = eval("document." + frmName);
	
	// Determine User Type and Proceed
	intSelected = objForm.userlevel.selectedIndex;
	intValue = objForm.userlevel[intSelected].value;
	
	switch (parseInt(intValue)) {
		case 5 :	// Client User
		
			
			
			// get needed values
				strSocial = new String(objForm.social.value);
				strDOB = new String(objForm.dob.value);
				strState = new String(objForm.state.value);
				strEmail = new String(objForm.email.value);
				strGrdFname = new String(objForm.grdFname.value);
				strGrdLname = new String(objForm.grdLname.value);
				
				
				// Format Social
					// 	first, remove all non-numeric characters
					var	strSocialTemp = new String();
					strSocialTemp = "";
					// alert("strSocial.length: " + strSocial.length);
					for (i = 0; i < strSocial.length; i++) {
						if ((strSocial.charCodeAt(i) <= 57) && (strSocial.charCodeAt(i) >= 48)) {
							// alert("strSocial.charCodeAt(" + i + "): " + strSocial.charCodeAt(i));
							strSocialTemp += strSocial.substr(i,1);
							// alert("strSocialTemp: " + strSocialTemp);
						}
					}
					
					// now Check length
					if (strSocialTemp.length != 9) {
						strError = strError + "Social Security Number not formatted properly: xxx-xx-xxxx\n";
						blnError = 1;
					} else {
						// length ok, now format it and assign it to the form field
						objForm.social.value = strSocialTemp.substr(0,3) + "-" + strSocialTemp.substr(3,2) + "-" + strSocialTemp.substr(5,4);
					}
					
					
				// Format DOB
					// 	first, remove all non-numeric characters
					var	strDOBTemp = new String();
					strDOBTemp = "";
					for (i = 0; i < strDOB.length; i++) {
						if ((strDOB.charCodeAt(i) <= 57) && (strDOB.charCodeAt(i) >= 48)) {
							strDOBTemp += strDOB.substr(i,1);
						}
					}
					
					// now Check length
					if (strDOBTemp.length != 8) {
						strError = strError + "DOB not formatted properly: xx/xx/xxxx\n";
						blnError = 1;
					} else {
						// length ok, now format it and assign it to the form field
						objForm.dob.value = strDOBTemp.substr(0,2) + "/" + strDOBTemp.substr(2,2) + "/" + strDOBTemp.substr(4,4);
					}
					
				// Format State
					if (strState.length != 2) {
						strError = strError + "You must enter a two-character state code.\n";
						blnError = 1;
					} else {
						objForm.state.value = strState.toUpperCase();
					}
				
				// Check Legal Guardian Status
			
					if (objForm.blnLglGuard[0].checked) {
						// First name and last name can't be null
						if ((strGrdFname.length == 0) || (strGrdLname.length == 0)) {
							strError = strError + "Legal Guardian first name and last name must be completed.\n";
							blnError = 1;
						}
					}		
					
			 	
				// Check length on all of these fields to make sure they're not blank
				var arrFields = new Array("Fname", "Lname", "address", "city", "state", "zip");
										  // "phone1", "phone2", "phone3");
										  
				for (i = 0; i < arrFields.length; i++) {
					objField = eval("document." + frmName + "." + arrFields[i]);
					strField = new String(objField.value);
					if (strField.length == 0) {
						strError = strError + arrFields[i] + " cannot be left blank.\n";
						blnError = 1;
					}
				}
			
				// Make sure one of two radio buttons is checked in the following fields
				var arrFields = new Array("gender", "blnSMI", "blnActive");
				for (i = 0; i < arrFields.length; i++) {
					objField = eval("document." + frmName + "." + arrFields[i]);
					if (!objField[0].checked && !objField[1].checked) {
						strError = strError + arrFields[i] + ": must select either 'yes' or 'no'.\n";
						blnError = 1;
					}
				}
				
			break;		
				
		
		case 4 :	// FMH User, email required
		
			// Check length on all of these fields to make sure they're not blank
			var arrFields = new Array("Fname", "Lname", "username", "password", "email");
									  
			for (i = 0; i < arrFields.length; i++) {
				objField = eval("document." + frmName + "." + arrFields[i]);
				strField = new String(objField.value);
				if (strField.length == 0) {
					strError = strError + arrFields[i] + " cannot be left blank.\n";
					blnError = 1;
				}
			}		
		
			break;
			
		default :	// All Other Users

			// Check length on all of these fields to make sure they're not blank
			var arrFields = new Array("Fname", "Lname", "username", "password");
									  
			for (i = 0; i < arrFields.length; i++) {
				objField = eval("document." + frmName + "." + arrFields[i]);
				strField = new String(objField.value);
				if (strField.length == 0) {
					strError = strError + arrFields[i] + " cannot be left blank.\n";
					blnError = 1;
				}
			}		

			break;
	}
	
	
		
	// Check to see if error flag has been set and prompt or submit accordingly
	
		if (blnError == 1) {
			alert(strError);
		} else {
			objForm.submit();
		}
			
}

/* 
	Used on Form 1
*/

function GH_updateLayout() {

	// look at current usertype, then display or hide 
	// appropriate sections
	
	// retrieve selected index of iv_reviewtype
	var intSelected, intValue;
	blnShowVIII = '0';
	intSelected = document.form1.userlevel.selectedIndex;
	intValue = document.form1.userlevel[intSelected].value;
	
	switch (parseInt(intValue)) {
		// alert(blnSMI);
		case 5 :
			// Client Level User
			MM_showHideLayers('layerLogin', '', 'hide');
			MM_showHideLayers('layerAddInfo', '', 'show');
			break;

		default :
			// All other users
			MM_showHideLayers('layerLogin', '', 'show');
			MM_showHideLayers('layerAddInfo', '', 'hide');
			break;
			
	}	
}


function ActiveBG(srcElement, Type) {
	if (Type == 0)
	{
	   if(srcElement.bgColor == "#CCCCCC")
	  {
   	   srcElement.bgColor = "#999999";
	  }else{
   	   srcElement.bgColor = "#CCCCCC";
	  }
	}else{
	   if(srcElement.bgColor == "#CCCCCC")
	  {
   	   srcElement.bgColor = "#999999";
	  }else{
   	   srcElement.bgColor = "#CCCCCC";
	  }	
	}
}

// Dynamic creates Axis elements for display based on the form value
// document.form1.intNumAxis. The innerHTML property of dynAxisArea is replaced
function GH_dynAxis(strForm, strField, strLayer, intLabel) {

	// Retrieve Objects && Values
	
	objField = eval("document." + strForm + "." + strField);
	intCount = parseInt(objField.value);
	
	objLayer = eval(strLayer);
	
	var i, strInnerHTML;
	strInnerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	//	alert(document.form1.intNumAxis.value);
	for (i = 1; i <= intCount; i++) {
        strInnerHTML += '  <tr> ';
        strInnerHTML += '    <td width="8%">&nbsp;</td>';
        strInnerHTML += '    <td width="19%" align="left" valign="top">Code:</td>';
        strInnerHTML += '    <td width="70%" align="left" valign="top"> ';
        strInnerHTML += '      <input type="text" class="textbox" onFocus="GH_Highlight(this)" onBlur="GH_Obscure(this)" name="axis' + intLabel + '_code_' + i + '" value="">';
        strInnerHTML += '    </td>';
        strInnerHTML += '  </tr>';
        strInnerHTML += '  <tr> ';
        strInnerHTML += '    <td width="8%">&nbsp;</td>';
        strInnerHTML += '    <td width="19%" align="left" valign="top">Description:</td>';
        strInnerHTML += '    <td width="70%" align="left" valign="top"> ';
        strInnerHTML += '      <input type="text" class="textbox" onFocus="GH_Highlight(this)" onBlur="GH_Obscure(this)" name="axis' + intLabel + '_description_' + i + '" value="">';
        strInnerHTML += '    </td>';
        strInnerHTML += '  </tr>';
        strInnerHTML += '  <tr>';
        strInnerHTML += '    <td width="8%">&nbsp;</td>';
        strInnerHTML += '    <td width="19%" align="left" valign="top">&nbsp;</td>';
        strInnerHTML += '    <td width="70%" align="left" valign="top">&nbsp;</td>';
        strInnerHTML += '  </tr>';
	}
	strInnerHTML += '</table>';
	
	// Update Text
	objLayer.innerHTML = strInnerHTML;
}

// Legacy Functions, left in place for backwards compatibility
var winCounter = 0;
function PopUp(strURL, isCustom, imgName)
{
	// Increment winCounter
	winCounter++;
	// Not the Custom Popup, the Howto Order Button
	if (strURL != "" && isCustom != "yes")
	{
	  var FlashWindow;
	  FlashWindow = window.open(strURL, imgName + winCounter, "status=no,toolbar=no,location=no,menu=no,width=300,height=345");
	}
	else // Custom Popup
	{
	  var FlashWindow;
	  FlashWindow = window.open(strURL, imgName + winCounter, "status=no,toolbar=no,location=no,menu=no,width=325,height=240");
	}
}

// Modifying fcnShowLarge to call MM_openBrWindow
function fcnShowLarge(strURL)
{
	winCounter++;
	
	var PopupWin;
	PopupWin = MM_openBrWindow(strURL, "win" + winCounter, "status=no,toolbar=no,location=no,menu=no,width=300,height=390");
	// PopupWin = window.open(strURL, "win" + winCounter, "status=no,toolbar=no,location=no,menu=no,width=300,height=390");
}
function popitupLarge(strTitle,strShownAt,imgSRC_lg,style)
{
	var intEnd = strTitle.indexOf('<');
	if (intEnd != -1) {
		strTitle = strTitle.substr(0, intEnd);
	}
	var Title = strTitle;
	var pop = window.open('','name','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,height=417,width=302,screenX=350,screenY=250,left=350,top=250');
	pop.document.open();
	pop.document.write('<html>\n<head>\n<title>Image of ' +Title+ '\n<\/title>' + 
	'\n<link href=\"http:\/\/www.myfsn.com\/images\/CSS\/base.css\" rel=\"stylesheet\" type=\"text\/css\"/>' + 
	'\n<link href=\"http:\/\/www.myfsn.com\/images\/CSS\/'+ style +'.css\" rel=\"stylesheet\" type=\"text\/css\"/>' +
	'\n<meta name=\"description\" content=\"Image of ' +Title+ '\">' +
	'\n<meta name=\"keywords\" content=\"' +Title+ '\">' + 
	'\n<\/head>\n<body>\n<div id=\"popupImgHdr\">\n<div id=\"popupImgTL\"><\/div>\n<div id=\"popupImgTitle\">'+strTitle + 
	'<\/div>\n<div id=\"popupImgTitleShadow\">'+strTitle+'<\/div>\n<\/div>' +
	'\n<div><img src=\"' +imgSRC_lg+ '\" name=\"imgLarge\" ><\/div>' +
	' <div id=\"popupImgFooter\">\n<div id=\"popupImgShownAt\"><\/div>\n<\/body>\n<\/html>');
	pop.document.close();
	if( pop.focus ) { pop.focus(); }
	return false;	
}


function popitup(strTitle,strShownAt,imgSRC_lg,style)
{

	var intEnd = strTitle.indexOf('<');
	if (intEnd != -1) {
		strTitle = strTitle.substr(0, intEnd);
	}

	document.getElementById('popupImgTitleMain').innerHTML = strTitle;
	document.getElementById('popupImgTitleShadow').innerHTML = strTitle;
	document.getElementById('popupImgShownAt').innerHTML = '&nbsp;';
	document.getElementById('imgLarge').src = imgSRC_lg;
	var popup = document.getElementById('popupProd');

	popup.style.display = 'block';
	popup.style.position = 'fixed';
	popup.style.left = '400px';
	popup.style.top = '100px';

	return false;
}

var imgLarge = new Image;
function showLargeImage(strName, strShownAt, strSRC) {
	// Get Amount scrolled and add to top
	// Base top == 300
	var intTop = 175 + document.documentElement.scrollTop + "px";
	// alert("scrollTop: " + document.documentElement.scrollTop);
	
	intEnd = strName.indexOf("<");
	if (intEnd != -1) {
		strName = strName.substr(0, intEnd);
	}
	
	document.imgLarge.src = "/images/CSS/clearbox.gif";
	
	// Update Image
	if (document.images) {
		document.imgLarge.src = strSRC;
	}
	
	// update title
	var text_el = document.getElementById("popupImgTitle");
	var new_txt = document.createTextNode(strName);
	text_el.replaceChild(new_txt, text_el.childNodes[0]);
	
	// update shadow
	var text_el = document.getElementById("popupImgTitleShadow");
	var new_txt = document.createTextNode(strName);
	text_el.replaceChild(new_txt, text_el.childNodes[0]);
	
	// update shown at
	var text_el = document.getElementById("popupImgShownAt");
	var new_txt = document.createTextNode(strShownAt);
	text_el.replaceChild(new_txt, text_el.childNodes[0]);
	
	obj = MM_findObj("popupImg");
	obj.style.top = intTop;
	
	// Show Layer
	MM_showHideLayers('popupImg', '', 'show');
}

function showLargeImage2(strName, strShownAt, strSRC) {
	// Update Image
	if (document.images) {
		document.imgLarge.src = strSRC;
	}
	
	// update title
	var text_el = document.getElementById("popupImgTitle");
	var new_txt = document.createTextNode(strName);
	text_el.replaceChild(new_txt, text_el.childNodes[0]);
	
	// update shadow
	var text_el = document.getElementById("popupImgTitleShadow");
	var new_txt = document.createTextNode(strName);
	text_el.replaceChild(new_txt, text_el.childNodes[0]);
	
	// update shown at
	var text_el = document.getElementById("popupImgShownAt");
	var new_txt = document.createTextNode(strShownAt);
	text_el.replaceChild(new_txt, text_el.childNodes[0]);
	
	var scrolling = new Array();
	scrolling = getScrollXY();
	/*
	alert(typeof(scrolling));
	alert(scrolling[0]);
	alert(scrolling[1]);
	*/
// 	alert("scrollX: " + (scrolling.scrOfX) + ", scrollY: " + (scrolling.scrOfY);
	
	// Define position of layer
	/*
	top = (window.innerHeight - 360) / 2; // screen.height
	left = (window.innerWidth - 300) / 2; // screen.width
	*/
	// Set left position of layer
	var strPrompt = "";
	for (el in document.body) {
		strPrompt += "document.body." + el + ": " + eval("document.body." + el);
	}
	alert(strPrompt);
	if(document.all) {
		// alert("document.all!, clientWidth: " + (document.body.clientWidth) + ", - 466: " + (document.body.clientWidth - 466) + ", / 2: " + ((document.body.clientWidth - 466) / 2));
		alert("document.body.clientHeight: " + document.body.clientHeight);
		alert("document.body.scrollTop: " + (document.documentElement.scrollTop));
		// document.getElementById("popupImg").style.left = (document.body.clientWidth - 466) / 2;
		// popupImg.style.pixelLeft = (document.body.clientWidth - 466) / 2;
		document.getElementById("popupImg").style.top = (document.body.clientHeight / 2) - 180 + scrolling[1]; // document.body.scrollTop + document.body.clientHeight - 360) / 2;
		// popupImg.style.pixelTop = (document.body.scrollTop + document.body.clientHeight - 360) / 2;
		// setTimeout('popupImg.style.visibility = "visible"', 50);
	} else if (document.layers) {
		alert("document.layers!");
//		document.popupImg.left += (window.innerWidth - 466) / 2;
		eval(document.popupImg.top = eval((window.pageYOffset + window.innerHeight - 360) / 2));
		// setTimeout('document.popupImg.visibility = "visible"', 50);
	} else if (document.getElementById && !document.all) {
		alert("getElementById, innerWidth: " + (window.innerWidth));
//		document.getElementById("popupImg").style.left = (window.innerWidth - 466) / 2;
		document.getElementById("popupImg").style.top = (window.pageYOffset + window.innerHeight - 360) / 2;
		// setTimeout('document.getElementById("popupImg").style.visibility = "visible"', 50);
	}	
	
	// Show Layer
	MM_showHideLayers('popupImg', '', 'show');
	
}

function hideLargeImage() {
	MM_showHideLayers('popupImg', '', 'hide');	
}

function GH_gotoImage(intPos) {
	// alert("intPos: " + intPos);
	if (document.images) {
		document.imgScreenShot.src = "images/" + arrImages[intPos];
	}
	
	// update caption
	var caption_el = document.getElementById("caption");
	
	var new_txt = document.createTextNode(arrTitles[intPos]);
	caption_el.replaceChild(new_txt, caption_el.childNodes[0]);
	
	// update details
	var details_el = document.getElementById("details");
	
	var new_txt = document.createTextNode(arrDescriptions[intPos]);
	details_el.replaceChild(new_txt, details_el.childNodes[0]);	
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return new Array(scrOfX, scrOfY);
}







function openInNewWindow(obj) {
	window.open(obj.href, "newWindow", "toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=480");
	return false;
}

function validate_text_length(textarea, validation_box, num_chars) {
	if (textarea.value.length > num_chars)
		document.getElementById(validation_box).innerHTML='<div class="warning_box_center"><div class="warning_box_right"><div class="warning_box_left">You are over the limit: '+textarea.value.length+'</div></div></div>';
	else
		document.getElementById(validation_box).innerHTML=textarea.value.length;
}

// -->

