function openPopUp(PageName){
	new_window = window.open(PageName,"new_window","width=400,height=400,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50"); 
	if (new_window.opener == null) { 
		new_window.opener = self; 
	} 
	new_window.focus();
}
function openSizedPopUp(PageName, Width, Height){
	new_window = window.open(PageName,"new_window","width="+Width+",height="+Height+",location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50"); 
	if (new_window.opener == null) { 
		new_window.opener = self; 
	} 
	new_window.focus();
}
function openSizedPopUpPrint(PageName, Width, Height){
	new_window = window.open(PageName,"new_window","width="+Width+",height="+Height+",location=0,resizable=1,scrollbars=1,status=0,menubar=1,titlebar=1,toolbar=1,left=150,top=50,screenx=150,screeny=50"); 
	if (new_window.opener == null) { 
		new_window.opener = self; 
	} 
	new_window.focus();
}
function bookmarksite(title, url)
{
	if (document.all)
	{
		window.external.AddFavorite(url, title);
		setCookie("bm", "yes" );
		window.location.reload();
	}
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}

//T20070314.0012 
function RTrim(str)
{
	for (var i=str.length-1; ((str.charAt(i)<=" ")&&(str.charAt(i)!="")); i--);
	return str.substring(0,i+1);
}

function IsValidEmail(str)
{

	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(.,.)|(,.)|(.,)|(.\s.)|(\s.)/; // not valid |(^,\s)
	var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; // valid
	
	if (!reg1.test(str) && reg2.test(str) )
	 {
		 return true;
	 }
	else
	{
	 return false;
	} 
	
}
