// JavaScript Document

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}




<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


function openPage(varReport) {
/*
  sURL = document.location.href;
  if (sURL.indexOf("?") > -1) {
    sURL = sURL.substring(0,sURL.indexOf("?"));
  }
*/
  sURL = "/main/index.php";
  sURL += "?REPORT_ID="+varReport; // getParameters(top);
  document.location.href = sURL;  
}

function toggle( targetId ){ 
	
	for (i=0; i < document.all.length; i++) {
	  if (document.all[i].id.indexOf("MENU_") > -1) {
	    if (targetId == document.all[i].id) {
	    	show(document.all[i].id);
	    } else {
	    	hide(document.all[i].id);
	    }
	  }
	} 
} 

function offon (targetId, onOff) {
	if (document.getElementById){ 
		target = document.getElementById( targetId ); 
		if (onOff == "ON"){ 
			target.style.display = ""; 
		}
		if (onOff == "OFF"){ 
			target.style.display = "none"; 
		} 
/*
		if (target.style.display == "none"){ 
			target.style.display = ""; 
		} else { 
			target.style.display = "none"; 
		} 
*/
	} 
}

function show(targetId) {
  offon (targetId, "ON");
}

function hide(targetId) {
  offon (targetId, "OFF");
}

function getParameters(objFrame) {
  sParam = "";
  objForm = objFrame.document.Options;
  if (objForm == null) {
    return sParam;
  }
  for (i=0;i<objForm.elements.length; i++) {
    objElement = objForm.elements[i];
    sParam += "&" + escape(objElement.name) + "=" + escape(objElement.value);
  }
  return sParam;
}

function checkBlank(field, argMessage){
	var regexp = /^\s*/g;
	var regexp2 = /\s*$/g;

	if (field.replace(regexp,"").replace(regexp2,"") == ""){
		if (argMessage != null && argMessage.length > 0) {
			alert(argMessage);
		}
		return false;
	} else{
		return true;
	}
}

function checkEmail(field, value){
	var k = 1;
	var regexp = /^\s*/g;
	var regexp2 = /\s*$/g;

	if (value.replace(regexp,"").replace(regexp2,"") == "") {
		alert(field + " is blank");
		return false;
	}

	if (value.charAt(0) == "@"){
		alert("You must have at least one character before the @.");
		return false;
	}

	while ((k < value.length) && (value.charAt(k) != "@"))
		k++;
		if ((k >= value.length) || (value.charAt(k) != "@")){
			alert("There is no @ symbol in your email address.");
      return false;
    } else k += 2;

	while ((k < value.length) && (value.charAt(k) != "."))
		k++;
    if ((k >= value.length) || (value.charAt(k) != ".")){
      alert("There must be a . somewhere after the @ in your email address.");
      return false;
    }
    return true;
    if ((k >= value.length-1) || (value.charAt(k) != ".")){
      alert("There must be at least one character after the . in address.");
      return false;
    }
    return true;
}

function subscribe(vYesNo) {
  objForm = document.SubsForm;
  objForm.SUBSCRIBE.value = vYesNo;
  if(!checkBlank(objForm.EMAIL.value)) {
    alert("You must specify your email address");
    objForm.EMAIL.focus();
    return;
  }
  if (!checkEmail("Email",objForm.EMAIL.value)) {
    objForm.EMAIL.focus();
    return;
  }
  if(!checkBlank(objForm.FIRSTNAME.value)) {
    alert("You must specify your first name");
    objForm.FIRSTNAME.focus();
    return;
  }
  if(!checkBlank(objForm.LASTNAME.value)) {
    alert("You must specify your last name");
    objForm.LASTNAME.focus();
    return;
  }
  if(!checkBlank(objForm.FIRSTNAME.value)) {
    alert("You must specify your first name");
    objForm.FIRSTNAME.focus();
    return;
  }
  if(!objForm.NEWSLETTER.checked && !objForm.EVENTS.checked ) {
    alert("You must select Newsletter or Events");
    return;
  }

  objForm.action = "../process/subscribe.php";
  objForm.target="_blank";
  objForm.submit();
}

function openLink(sUrl){
  window.open(sUrl,"_blank","top=100,left=100,width=800,height=500,toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no");
}
<!--
/*
 * NumberFormat 1.0.3
 * v1.0.3 - 23-March-2002
 * v1.0.2 - 13-March-2002
 * v1.0.1 - 20-July-2001
 * v1.0.0 - 13-April-2000
 * http://www.mredkj.com
 */
 
/*
 * NumberFormat -The constructor
 * num - The number to be formatted
 */
function NumberFormat(num)
{

	// member variables
	this.num;
	this.numOriginal;
	this.isCommas;
	this.isCurrency;
	this.currencyPrefix;
	this.places;

	// external methods
	this.setNumber = setNumberNF;
	this.toUnformatted = toUnformattedNF;
	this.setCommas = setCommasNF;
	this.setCurrency = setCurrencyNF;
	this.setCurrencyPrefix = setCurrencyPrefixNF;
	this.setPlaces = setPlacesNF;
	this.toFormatted = toFormattedNF;
	this.getOriginal = getOriginalNF;

	// internal methods
	this.getRounded = getRoundedNF;
	this.preserveZeros = preserveZerosNF;
	this.justNumber = justNumberNF;

	// setup defaults
	this.setNumber(num);
	this.setCommas(true);
	this.setCurrency(true);
	this.setCurrencyPrefix('$');
	this.setPlaces(2);
}

/*
 * setNumber - Sets the number
 * num - The number to be formatted
 */
function setNumberNF(num)
{
	this.numOriginal = num;
	this.num = this.justNumber(num);
}

/*
 * toUnformatted - Returns the number as just a number.
 * If the original value was '100,000', then this method will return the number 100000
 * v1.0.2 - Modified comments, because this method no longer returns the original value.
 */
function toUnformattedNF()
{
	return (this.num);
}

/*
 * getOriginal - Returns the number as it was passed in, which may include non-number characters.
 * This function is new in v1.0.2
 */
function getOriginalNF()
{
	return (this.numOriginal);
}

/*
 * setCommas - Sets a switch that indicates if there should be commas
 * isC - true, if should be commas; false, if no commas
 */
function setCommasNF(isC)
{
	this.isCommas = isC;
}

/*
 * setCurrency - Sets a switch that indicates if should be displayed as currency
 * isC - true, if should be currency; false, if not currency
 */
function setCurrencyNF(isC)
{
	this.isCurrency = isC;
}

/*
 * setCurrencyPrefix - Sets the symbol that precedes currency.
 * cp - The symbol
 */
function setCurrencyPrefixNF(cp)
{
	this.currencyPrefix = cp;
}

/*
 * setPlaces - Sets the precision of decimal places
 * p - The number of places. Any number of places less than or equal to zero is considered zero.
 */
function setPlacesNF(p)
{
	this.places = p;
}

/*
 * toFormatted - Returns the number formatted according to the settings (a string)
 */
function toFormattedNF()
{
	var pos;
	var nNum = this.num; // v1.0.1 - number as a number
	var nStr;            // v1.0.1 - number as a string

	// round decimal places
	nNum = this.getRounded(nNum);
	nStr = this.preserveZeros(Math.abs(nNum)); // this step makes nNum into a string. v1.0.1 Math.abs

	if (this.isCommas)
	{
		pos = nStr.indexOf('.');
		if (pos == -1)
		{
			pos = nStr.length;
		}
		while (pos > 0)
		{
			pos -= 3;
			if (pos <= 0) break;
			nStr = nStr.substring(0,pos) + ',' + nStr.substring(pos, nStr.length);
		}
	}
	
	nStr = (nNum < 0) ? '-' + nStr : nStr; // v1.0.1

	if (this.isCurrency)
	{
		// add dollar sign in front
		nStr = this.currencyPrefix + nStr;
	}

	return (nStr);
}

/*
 * getRounded - Used internally to round a value
 * val - The number to be rounded
 */
function getRoundedNF(val)
{
	var factor;
	var i;

	// round to a certain precision
	factor = 1;
	for (i=0; i<this.places; i++)
	{	factor *= 10; }
	val *= factor;
	val = Math.round(val);
	val /= factor;

	return (val);
}

/*
 * preserveZeros - Used internally to make the number a string
 * 	that preserves zeros at the end of the number
 * val - The number
 */
function preserveZerosNF(val)
{
	var i;

	// make a string - to preserve the zeros at the end
	val = val + '';
	if (this.places <= 0) return val; // leave now. no zeros are necessary - v1.0.1 less than or equal
	
	var decimalPos = val.indexOf('.');
	if (decimalPos == -1)
	{
		val += '.';
		for (i=0; i<this.places; i++)
		{
			val += '0';
		}
	}
	else
	{
		var actualDecimals = (val.length - 1) - decimalPos;
		var difference = this.places - actualDecimals;
		for (i=0; i<difference; i++)
		{
			val += '0';
		}
	}
	
	return val;
}

/*
 * justNumber - Used internally to parse the value into a floating point number.
 * If the value is not set, then return 0.
 * If the value is not a number, then replace all characters that are not 0-9, a decimal point, or a negative sign.
 *
 *  Note: The regular expression cleans up the number, but doesn't get rid of - and .
 *  Because all negative signs and all decimal points are allowed,
 *  extra negative signs or decimal points may corrupt the result.
 *  parseFloat will ignore all values after any character that is NaN.
 *
 *  A number can be entered using special notation.
 *  For example, the following is a valid number: 0.0314E+2
 *
 * This function is new in v1.0.2
 */
function justNumberNF(val)
{
	val = (val==null) ? 0 : val;

	// check if a number, otherwise try taking out non-number characters.
	if (isNaN(val))
	{
		var newVal = parseFloat(val.replace(/[^\d\.\-]/g, ''));

		// check if still not a number. Might be undefined, '', etc., so just replace with 0.
		// v1.0.3
		return (isNaN(newVal) ? 0 : newVal); 
	}
	// return 0 in place of infinite numbers.
	// v1.0.3
	else if (!isFinite(val))
	{
		return 0;
  }
	
	return val;
}

//-->
