function PrevPage(){
	history.go(-1);
}
function WriteLayer(ID,parentID,sText) { 
 if (document.layers) { 
   var oLayer; 
   if(parentID){ 
	 oLayer = eval('document.' + parentID + '.document.' + ID + '.document'); 
   }else{ 
	 oLayer = document.layers[ID].document; 
   } 
   oLayer.open(); 
   oLayer.write(sText); 
   oLayer.close(); 
 } 
 else if (parseInt(navigator.appVersion)>=5&&navigator. 
appName=="Netscape") { 
   document.getElementById(ID).innerHTML = sText; 
 } 
 else if (document.all) document.all[ID].innerHTML = sText 
}

function MakeInt(str){
	//remove leading zeros, if any
	while(str.length > 1 && str.substring(0,1) == '0'){
		str = str.substring(1,str.length);
	}
	var val = parseInt(str);
	if(isNaN(val) || val==''){ val=0; }
	return val;
}

function SumInt(v1,v2){
	return parseInt(v1)+parseInt(v2);
}

function DoM2_2(alias,domain){
	window.location = 'mai'+'lto'+':'+alias+'@'+domain;
}

function openWin(p_url,p_width,p_height){
	window.open(p_url,'newWin','width='+p_width+',height='+p_height+',scrollbars=no,top=50,left=50');
}

function openScrollWin(p_url,p_width,p_height){
	w = window.open(p_url,'newWin','width='+p_width+',height='+p_height+',scrollbars=yes,top=50,left=50');
	w.focus();
}

function ToggleVisibility(id,visible_style){
	v = GetControldisplayValue(id);
	if(v=='none'){
		SetControldisplayValue(id,visible_style);
	} else {
		SetControldisplayValue(id,'none');
	}
}

function GetControldisplayValue(id)
{
	res = '';
	if (document.layers)
	{
		res = document.layers[id].display;
	}
	else if (document.all)
	{
		res = document.all[id].style.display;
	}
	else if (document.getElementById)
	{
		res = document.getElementById(id).style.display;
	}
	return res;
}

function SetControldisplayValue(id,displayvalue)
{
	if (document.layers)
	{
		document.layers[id].display = displayvalue;
	}
	else if (document.all)
	{
		document.all[id].style.display = displayvalue;
	}
	else if (document.getElementById)
	{
		document.getElementById(id).style.display = displayvalue;
	}
}
function isValidEmail(emailAddress) {
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    return re.test(emailAddress);
}
