// Popup functions //

function popup(url) {
window.open(url,"WindowName", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=300,screenX=,screenY=,top=0,left=0");
}

function popup2(url) {
window.open(url,"WindowName", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=300,screenX=,screenY=,top=0,left=0");
}

function forum_popup(url) {
window.open(url,"WindowName", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=400,screenX=,screenY=,top=0,left=0");
}

function transpopup(url) {
window.open(url, 'MyWindow', 'toolbar=yes, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, top=0, left=0');
}

function amExhibitor_popup(url) {
window.open(url, "NewWindow", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=370,height=400,screenX=,screenY=,top=0,left=0");
}
function OpenWin(URL, WinName, Features){
window.open(URL, WinName, Features)
}


<!-- FORM VALIDATION SCRIPT -->
function findObj(n, d) {
  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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function validateForm() {
  var i,p,q,nm,test,num,min,max,errors='',args=validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+=nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+=nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+=nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors +=nm+' is required.\n'; }
  } if (errors) alert('Please note the following:\n\n'+errors);
  document.returnValue = (errors == '');
}
<!-- END FORM VALIDATION SCRIPT -->


<!-- BEGIN TEXTAREA COUNTER SCRIPT -->
function textCounter(field, countfield, maxlimit ) {
  if ( field.value.length > maxlimit )
  {
    field.value = field.value.substring( 0, maxlimit );
    alert( 'Textarea value can only be '+maxlimit+' characters in length.' );
    return false;
  }
  else
  {
    countfield.value = maxlimit - field.value.length;
  }
}
<!-- END TEXTAREA COUNTER SCRIPT -->

function ClearSearchText(){
	document.frmSearch.SearchText.value = ""
}

/* Format Currency function */
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;	
	return (((sign)?'':'-') + num + '.' + cents);
}
/* End Format Currency function */



/* The following function will make sure the value of the passed parameter 
does not include any spaces or symbols.  Only letters and numbers are valid. */
function validate_char(field) {
	var string = field.value;
	var separator = '@';
	
	var stringArray = string.split(separator);
	var address=stringArray[0];
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-:/";
	var ok = "yes";
	var temp;
	for (var i=0; i<address.length; i++) {
	temp = "" + address.substring(i, i+1);
	
	if (valid.indexOf(temp) == "-1") ok = "no";
	}
	
	if (ok == "no") {
		alert("Invalid entry!  Only characters and numbers are accepted! Please no spaces or unacceptabe symbols!!");
		field.focus();
		//field.select();
		return false;
   }
}

/*
 	
Validate Phone Number
Snippet Name: Validate Phone Number
Description: Validates a phone number against the regular expression: (555) 555-1234
Instructions: Call using isPhoneNumber(form.field.value);

Returns Boolean
*/
function isPhoneNumber(s) 
{
     // Check for correct phone number
     rePhoneNumber = new RegExp(/^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/);
 
     if (!rePhoneNumber.test(s)) {
          alert("Phone Number Must Be Entered As: (555) 555-1234");
          return false;
     }
 
//return true;
}

/*
function BookmarkPage(bookmarkurl,bookmarktitle){
if (document.all){
    window.external.AddFavorite(bookmarkurl,bookmarktitle)
}*/


function Back(){
	// local var used as the link to "go back" to
	var RedirURL
	var CurrURL
	CurrURL = document.location.href
	
	if (document.referrer != ''){
		RedirURL = document.referrer	// "go back" to the referring pg
	}
	else{
		RedirURL = "/"
	}
	//alert(RedirURL);
	window.location.replace (RedirURL);
}

//-------------------------------------------------------------------------------------------------------------------
// Bookmark page function
function BookmarkPage()
{
if (document.all)
	window.external.AddFavorite(window.location, document.title);
else
	alert("Netscape users must bookmark the pages manually by hitting <Ctrl-D>");
}
//-------------------------------------------------------------------------------------------------------------------


//-------------------------------------------------------------------------------------------------------------------
function popcal(vCaption, vField, vDate)
{ 
    var nW = window.open("", "calendar", 
        "screenX=0,screenY=0,top=0,left=0,resizable=1,scrollbars=0,width=175,height=225,status=0,titlebar=0,toolbar=0,menubar=0,dependent=1"); 
    nW.location.href = "/ssi/core/popcalendar/popcalendar.asp?caption=" + 
        escape(vCaption) + 
          "&field=" + vField + "&date=" + vDate; 
    nW = null; 
}

function showCalendar(Title, Form_Name, Field_Name) 
{
	document.write ("<a href=javascript:popcal('"+Title+"','document."+Form_Name+"."+Field_Name+"',document."+Form_Name+"."+Field_Name+".value);><img src='/images/icon/calendar.gif' border=0 alt='Click here to edit the date'></a>");
}


			function popdcal(vCaption, vField, vDate)
			{ 
				var nW = window.open("", "calendar", 
					"screenX=0,screenY=0,top=0,left=0,resizable=1,scrollbars=0,width=175,height=225,status=0,titlebar=0,toolbar=0,menubar=0,dependent=1"); 
				nW.location.href = "/ssi/core/popcalendar/popdropcalendar.asp?caption=" + 
					escape(vCaption) + 
					  "&field=" + vField + "&date=" + vDate; 
				nW = null; 
			}
			
			function showDropCalendar(Title, Form_Name, Field_Name) 
			{
				document.write ("<a href=javascript:popdcal('"+Title+"','document."+Form_Name+"."+Field_Name+"',document."+Form_Name+"."+Field_Name+".value);><img src='/images/icon/calendar.gif' border=0 alt='Click here to edit the date'></a>");
			}
//-------------------------------------------------------------------------------------------------------------------

/* Show or hide text by clicking the link. */
function toggle(targetId) {
	target = document.all(targetId);
		if (target.style.display == "none"){
			target.style.display=""; } 
		else {
			target.style.display="none"; }
}

function showWindowStatus(sMsg) {
    window.status = sMsg ;
    return true ;
}

//-------------------------------------------------------------------------------------------------------------------
// This is the function that will close the
// new window when the mouse is moved off the link
function close_window() 
{ 	
	new_window.close(); 
}