
function ExpandDivClass() {
this.divID="default";
this.expandDisp = pExpandDisp;
this.closeDisp = pCloseDisp;
this.setDivID = pSetDivID;
this.getDivID = pGetDivID;
}

function pExpandDisp(id)
{

	if (this.divID == "default")
	{				   document.getElementById(id).style.display = ((document.getElementById(id).style.display == "none") ? "block" : "none");					}
	else {
	  document.getElementById(id).style.display = ((document.getElementById(id).style.display == "none") ? "block" : "none");					}
	this.divID = id;

}

function pCloseDisp(id)
{
	document.getElementById(id).style.display = "none";					this.divID = id;
}



function pGetDivID()
{
	return this.divID;
}
function pSetDivID(id)
{
	this.divID = id;
}


function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}

var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}


function isEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
  result = true;
  }
  return result;
}
function numbersonly(myfield, e)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

   
else
   return false;
}


function validEmail(formField,fieldLabel)
{
  var result = true;
  

  if (result && ((formField.value.length < 3) || !isEmailAddr(formField.value)) )
  {
    alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    formField.focus();
    result = false;
  }
   
  return result;

}


