function MM_swapImgRestore() 

{ //v2.0
  if (document.MM_swapImgData != null)
	for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
	  document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

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_swapImage() 

{ //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
	objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
	if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
		(objStr.indexOf('document.all[')   ==0 && document.all   ==null))
	  objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
	obj = eval(objStr);
	if (obj != null) {
	  swapArray[j++] = obj;
	  swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
	  obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}

function popUp_help(url) {

if (document.all) {var xMax = screen.width, yMax = screen.height} 
else if (document.layers) {var xMax = window.outerWidth, yMax = window.outerHeight} 
else {var xMax = 640, yMax=480}; var xOffset = (xMax - 670)/2, yOffset = (yMax - 650)/2; 

sealWin=window.open(url,"",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=700,height=500,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
self.name = "";
}

var popupfeatures = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=780,height=500";
function popUp(myurl) {var win = open(myurl,'popupwindow' + Math.floor(Math.random() * 100),popupfeatures);win.focus();}

function enlarge(pic,title,width,height)
{
	preview = window.open("", title, "resizable=yes,toolbar=no,scrollbars=no,menubar=no,status=no,directories=no,width="+width+",height="+height+"");
	preview.document.write('<html><head><title>Picture<\/title><\/head>'+'<body onBlur="self.focus();" marginWidth="0" marginHeight="0" topmargin="0" leftmargin="0">'+'<center><img border="0" src="'+pic+'" width="'+width+'" height="'+height+'">'+'<\/center><\/body><\/html>');
	preview.document.close();
}

var counter = 0;
function count() 
{
	counter++;
	if(counter > 1) 
	{ 
		return false;
	}
	return true;
}
function ResetCounter() {
	counter = 0;
}
window.onunload = ResetCounter;

function IsEmail(email) 
{
	invalidChars = " ~\'^\`\"*+=\\|][(){}$&!#%/:,;";
	
	// Check for null
	if (email == "") return false;

	// Check for invalid characters as defined above
	for (i=0; i<invalidChars.length; i++) 
	{
		badChar = invalidChars.charAt(i);
		if (email.indexOf(badChar,0) > -1) return false;
	}
	
	lengthOfEmail = email.length;
	if ((email.charAt(lengthOfEmail - 1) == ".") || (email.charAt(lengthOfEmail - 2) == ".")) return false;
	
	Pos = email.indexOf("@",1);
	if (email.charAt(Pos + 1) == ".") return false;
	
	while ((Pos < lengthOfEmail) && ( Pos != -1)) 
	{
		Pos = email.indexOf(".",Pos);
		if (email.charAt(Pos + 1) == ".") return false;
		if (Pos != -1) Pos++;
	}

	// There must be at least one @ symbol
	atPos = email.indexOf("@",1);
	if (atPos == -1) return false;

	// But only ONE @ symbol
	if (email.indexOf("@",atPos+1) != -1) return false;

	// Also check for at least one period after the @ symbol
	periodPos = email.indexOf(".",atPos);
	if (periodPos == -1) return false;

	if (periodPos+3 > email.length) return false;

	return true;
}

function IsNumeric(CheckString)
{
	if (CheckString.match(/^\d+$/)) {return true} else {return false};
}
