function UnderConstruction() {
	alert("Under Construction.");
};

function Back() {
	window.history.back(1);
};

function Forward() {
	window.history.forward(1);
};

function LoginForm() {
	window.location = "http://secure.meetingexpectations.com/oaug/LoginForm.asp";
};

function MembershipApplication() {
	window.location = "https://secure.meetingexpectations.com/oaug/secure/membershipApplication.asp";
};

function ResetForm(strFormName){
    var theForm = gfntGetForm(strFormName);
	theForm.reset();
};

function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');

	if ( isNaN(num) ) num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
	cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + '$' + num + '.' + cents);
};

function launchRemote() {
	window.open("http://secure.meetingexpectations.com/oaug/MultiSelectHelp.htm", "_blank", "scrollbars, status, height=500, width=500, top=10, left=200")
};

function launchHelpWindow(strURL) {
	window.open(strURL, "_blank", "scrollbars, status, height=500, width=500, top=10, left=200")
};

function launchDataPop(iSomeID) {
	window.open("https://secure.meetingexpectations.com/oaug/Secure/ExhibitBoothPopUp.asp?ConferenceID=" + iSomeID, "_blank", "scrollbars, status, height=500, width=500, top=10, left=200")
};	

function change(name, src) {
	document.images[name].src = src;
};

function Redirect() {
	window.top.location = "http://secure.meetingexpectations.com/oaug/foyer.asp";
};

function printPage() {
	if (window.print) {
		agree = confirm('If your payment is by check or money order, \nplease remember to print this invoice and mail \nit along with your payment. \n\nOK to print now?');
		if (agree) window.print(); 
	};
};

function PopWindow(destination, windowName, parms) {
	OpenWin = this.open(destination, windowName, parms);
};

function CloseWindow() {
	window.close();
};	

// ********* ********* ********* ********* *********
// *  new functions
// ********* ********* ********* ********* *********
function gfntFocus(strFormName, strElementName) {
	var theForm = gfntGetForm(strFormName);
	var theElement = gfntGetFormElement(theForm, strElementName);
	
	theElement.focus();
};

function gfntDisableField(obj, blnValue) {
	if (document.getElementById) {
		obj.disabled = blnValue;
		obj.style["backgroundColor"] = "#ffffff";
		if (blnValue) obj.style["backgroundColor"] = "#eeeeee";
		if (blnValue) obj.value = "";
		if (blnValue) obj.checked = false;
	} else {
		// can't disable NS 4.79 fields
		// permanently disabled fields have [onFocus="blur();"]
	};
};

function gfntNewWindow(vUrl, vWinName, vHeight, vWidth, vTop, vLeft) {
	var strValues;
	
	if (vHeight==null) vHeight=400;
	if (vWidth==null) vWidth=500;
	if (vTop==null) vTop=10;
	if (vLeft==null) vLeft=200;

	strValues = "scrollbars, height=" + vHeight + ", width=" + vWidth + ", top=" + vTop + ", left=" + vLeft

	remote = window.open(vUrl, vWinName, strValues)
};

function gfntNewWindow2(vUrl, vWinName, vHeight, vWidth, vTop, vLeft, vResize) {
	var strValues;
	
	if (vHeight==null) vHeight=400;
	if (vWidth==null) vWidth=500;
	if (vTop==null) vTop=10;
	if (vLeft==null) vLeft=200;
	if (vResize==null) vResize=1;

	strValues = "scrollbars, height=" + vHeight + ", width=" + vWidth + ", top=" + vTop + ", left=" + vLeft + ", resizable=" + vResize

	remote = window.open(vUrl, vWinName, strValues)
};

function gfntReplace(strData, strSrc, strDst) {
	var i;
	var j=-1;
	var strLeft;
	var strRight;
	var strTemp = String.fromCharCode(1);
	
	// replace strSrc with a temporary string ( place holder )
	i = strData.indexOf(strSrc)
	while (i>-1 || i<j) {
		strLeft = strData.substring(0, i);
		strRight = strData.substring(i + strSrc.length, strData.length);
		if (strRight!=strData) strData = strLeft + strTemp + strRight;

		j = i;
		i = strData.indexOf(strSrc);
	};

	// replace temporary string with strDst
	j=-1;
	i = strData.indexOf(strTemp)
	while (i>-1 || i<j) {
		strLeft = strData.substring(0, i);
		strRight = strData.substring(i + strTemp.length, strData.length);
		if (strRight!=strData) strData = strLeft + strDst + strRight;

		j = i;
		i = strData.indexOf(strTemp);
	};

	return strData;
};

// ********* ********* ********* ********* *********
// *  new validation functions
// ********* ********* ********* ********* *********

function ProcessCheckbox(chkbox) {	
	if (chkbox.checked) return true;
	return false;
};


function gfntValidateTextbox( obj, strFieldName, lngLength)
{
	if (obj.value == "")
	{
		alert("Please enter a value for the \"" + strFieldName +"\" field.");
		obj.focus();
		return false;
	};
  
	if (lngLength != null) {
		if (obj.value.length > lngLength)	
		{
			alert("Please limit the \"" + strFieldName +"\" field to " + lngLength.toString() + " characters.");
			obj.focus();
			return false;
		};
	};	

	return true;
};

function gfntValidateNumericTextbox( obj, strFieldName, lngLength)
{
	if (obj.value == "")
	{
		alert("Please enter a value for the \"" + strFieldName +"\" field.");
		obj.focus();
		return false;
	};
  
	if (lngLength != null) {
		if (obj.value.length > lngLength)	
		{
			alert("Please limit the \"" + strFieldName +"\" field to " + lngLength.toString() + " characters.");
			obj.focus();
			return false;
		};
	};	

	var vntValue = parseFloat(obj.value);	
	if (isNaN(vntValue)==true) {
		alert("Please enter a numeric value in the \"" + strFieldName +"\" field.");
		obj.focus();
		return false;
	}	

	return true;
};

function gfntValidateTextboxLength( obj, strFieldName, lngLength)
{
	if (obj.value.length > lngLength)	
	{
		alert("Please limit the \"" + strFieldName +"\" field to " + lngLength.toString() + " characters.");
		obj.focus();
		return false;
	};	

	return true;
};

function gfntValidateSelect( obj, strMsg )
{
	var lngCurIndex = obj.selectedIndex;
	if (lngCurIndex!=-1) {
		if (obj.options[lngCurIndex].value == "") {
			alert(strMsg);
			obj.focus();
			return false;
		};
	};

	return true;
};


function gfntValidateList( obj, strMsg, blnSetFocus ) {
	var lngCurIndex = obj.selectedIndex;
	if (lngCurIndex == -1) {
		if (strMsg != "") alert(strMsg);
		if (blnSetFocus == true) obj.focus();
		return false;
	} else {	
		if (obj.options[lngCurIndex].value == "") {
			if (strMsg != "") alert(strMsg);
			if (blnSetFocus == true) obj.focus();
			return false;
		};
	};
	return true;
};

// ********* ********* ********* ********* *********
// *  Cross browser compatability functions
// ********* ********* ********* ********* *********

function gfntSort(arr) {
	var i;
	var j;
	var s;

	for (j=0; j<=arr.length; j++) {
		for (i=1;  i<=arr.length; i++) {
			if (arr[i] < arr[i-1]) {
				s = arr[i];
				arr[i] = arr[i-1];
				arr[i-1] = s;
			};
		};
	};

	return arr;
};

function gfntDisplayProps(obj) {
// returns a string of an objects properties and methods
	var i;
	var strOutput;
	var strTerm;
	var strData;
	var strSpace;
	var lngCols;
	
	// initialize number of columns
	lngCols=4;
	if (document.layers) lngCols=3;

	// initialize an empty string
	strSpace = "                                        ";
	
	if (obj.name) strOutput = obj.name + "\n\n";
	i=1;
	for (var prop in obj) {
		strTerm = "\t";
		if (i==lngCols) strTerm = "\n";

		i=i+1;
		if (i>lngCols) i=1;	

		strData = "." + prop + " = " + obj[prop];
		if (strData.length<30) strData += strSpace.substring(0, 30-strData.length);
		if (strData.length>30) strData = strData.substring(0, 30);

		strOutput += strData + strTerm;
	};	
	alert(strOutput);
	return strOutput;
};

function gfntGetForm(formName) {
// returns a reference to a Form

	// Netscape 6.2.2 
	// Internet Explorer 5
	if (document.getElementById) {
		return document.getElementById(formName);
	} else if (document.all) {
		return document.all[formName];
	// Netscape 4.79		
	} else if (document.layers) {
		return document.forms[formName];
	} else {
		return false;
	};
};

function gfntGetFormElement(formName, objectName) {
// returns a reference to an object of a Form
// formName = object reference or string

	// if we are passed an object rather than string
	// (test the name property)
	// translate the variable into the form name
	if (formName.name!=null) formName = formName.name;

	// Netscape 6.2.2 
	// Internet Explorer 5
	if (document.getElementById) {
		return document.getElementById(objectName);
	} else if (document.all) {
		return document.all[objectName];
	// Netscape 4.79	
	} else if (document.layers) {
		return document.forms[formName].elements[objectName];
	} else {
		return false;
	};
};

function gfntGetImage(objectName) {
// returns a reference to an image tag

	// Netscape 6.2.2 
	// Internet Explorer 5
	if (document.getElementById) {
		return document.getElementById(objectName);
	} else if (document.all) {
			return document.all[objectName];
	// Netscape 4.79		
	} else if (document.layers) {
		alert("ok");
		return document.images[objectName];
	} else {
		return false;
	};
};

function gfntGetRadio(theForm, objGroup, strID, lngValue) {
	var obj;	

	// Netscape 4.79		
	if (document.layers) {
		for (var i=0; i<objGroup.length; i++) {
			obj=objGroup[i];
			if (obj.value==lngValue) {
				return obj;
			};
		};
		//alert("gfntGetRadio : Bad call...\nstrID=" + strID + "\nlngValue=" + lngValue);
		return false;

	//everthing else
	} else {
		return gfntGetFormElement(theForm, strID);
	};	
};

function gfntGroupSelected(theForm, objGroup, strName) {
	var obj;	

	// Netscape 4.79		
	if (document.layers) {
		if (objGroup.length) {
			for (var i=0; i<objGroup.length; i++) {
				obj=objGroup[i];
				if (obj.checked) return true;
			};
		// if the "objGroup" isn't an array, just see if it's checked
		} else {
			if (objGroup.checked) return true;
		};			
		return false;

	//everthing else
	} else {
		for (i=0; i<theForm.elements.length; i++) {
			obj = theForm.elements[i];
			if (obj.type=="radio") {
				// alert(obj.id + "\n" + obj.name + "\n" + strName);
				if (obj.name==strName) {
					if (obj.checked) return true;
				};
			};
		};		
		return false;
	};	
};

function gfntDropdownSelected(theForm, objDropdown) {
	var obj;	

	// Netscape 4.79		
	if (document.layers) {
		if (objDropdown.length) {
			for (var i=0; i<objDropdown.length; i++) {
				obj=objDropdown[i];
				if (obj.selected==true && obj.value!=0) return true;
			};
		};			
		return false;

	//everthing else
	} else {
		if (objDropdown.value!=0) return true;
		return false;
	};	
};

function gfntDivOver(obj) {
	//obj.style.color = "#ffff00";
	obj.style.background = "#6699cc";
};	

function gfntDivOut(obj) {
	//obj.style.color = "#ffffff";
	obj.style.background = "#4775a3";
};	

/*
** ********* ********* ********* ********* ********* ********* ********* *********
** Function gfntIsEmailValid(strEmail) 
** Action: checks if an email is correct. 
** Parameter: strEmail - the Email address 
** Returned value: on success it returns True, else False. 
** ********* ********* ********* ********* ********* ********* ********* *********
*/
function gfntIsEmailValid(strEmail) {
	var strArray;
	var strItem;
	var strValidChars;
	var i;
	var j;
	var c;
	var r = "\r\n";
	
	// initialize array and local variables
	strArray = new Array("1", "2");
	strValidChars = "1234567890abcdefghijklmnopqrstuvwxyz_-.";
    
	// split the email address in two parts: name@domain.ext 
	i = strEmail.indexOf("@");
	if ( i == -1 ) return false;  // email didn't include @
	strArray[0] = strEmail.substring(0, i); 
	strArray[1] = strEmail.substring(i+1, strEmail.length);

	// check each part
	// This next line is not Netscape 4.79 compliant ( the line below it is a fudge )
	// for (strItem in strArray) {
	for (j=0; j<strArray.length; j++) {
		strItem = strArray[j];

	        // no part can be void 
        	i = strItem.length;
			if ( i <= 0 ) return false;

	        // check each character of the part 
        	// only following "abcdefghijklmnopqrstuvwxyz_-." 
	        // characters and the ten digits are allowed 
        	for (i=0; i<=strItem.length; i++) {
			c = strItem.substring(i, i+1);
			c = c.toLowerCase();
			if ( strValidChars.indexOf(c) == -1 ) return false;
		}; 		
       		
		// the first and the last character in the
		// part cannot be . (dot) 
		c = strItem.substring( strItem.length-1, strItem.length );
		if ( strItem.substring(0,1) == "." || c == "." ) return false;
	};

	// the second part (domain.ext) must contain a . (dot) 
	strItem = strArray[1];
	if ( strItem.indexOf(".") == -1 ) return false;

	// check the length of the extension  
	// the length of the extension can be only 2, 3, or 4 
	// to cover the new "info" extension 
	strItem = strArray[1];
	i = strItem.length - strItem.lastIndexOf(".");
	// "i" was not calculated correctly.  It was coming up one more than expected.
	// Thus we changed "if ( i < 2 || i > 4 )" to "if ( i < 2 || i > 5 )".  5-3-2006, CC.
	//alert(i);
	if ( i < 2 || i > 5 ) return false;

	// after . (dot) cannot follow a . (dot) 
	i = strEmail.indexOf("..") 
	if ( i > -1 ) return false;

	// finally it's OK  
	return true;
};

/*
** ********* ********* ********* ********* ********* ********* ********* *********
** Function gfntIsDate(dateStr) 
** Action: checks if an date is correct. 
** Parameter: dateStr - the date
** Returned value: on success it returns True, else False. 
** ********* ********* ********* ********* ********* ********* ********* *********
*/
function gfntIsDate(dateStr) {
	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{2,4})$/;
	var matchArray = dateStr.match(datePat);
	
	if (matchArray == null) {return false;};

	// parse date into variables
	var lngMonth = matchArray[1]; 
 	var lngDay = matchArray[3];
	var lngYear = matchArray[5];

	if (lngMonth < 1 || lngMonth > 12) return false;
	if (lngDay < 1 || lngDay > 31) return false;

	if ((lngMonth==4 || lngMonth==6 || lngMonth==9 || lngMonth==11) && lngDay==31) return false;

	if (lngMonth == 2) { // check for february 29th
		var isleap = (lngYear % 4 == 0 && (lngYear % 100 != 0 || lngYear % 400 == 0));
		if (lngDay > 29 || (lngDay==29 && !isleap)) return false;
	};

	return true; 
};

/*
** ********* ********* ********* ********* ********* ********* ********* *********
** Function gfntFormatCurrency(num) 
** Action: convrets a number to currency format 
** Parameter: num - the number to format
** Returned value: formatted value. 
** ********* ********* ********* ********* ********* ********* ********* *********
*/
function gfntFormatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num)) num = "0";

	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10) cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));
	return (((sign)?'':'-') + num + '.' + cents);
}

function goToURL(url)
{
	//alert(url)
	window.location = "" + url + ""
}