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();
}

//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_old(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   //alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    //alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function Right(str, n)
{
      if (n <= 0)
          return "";
      else if (n > String(str).length)
          return str;
      else
   {
          var iLen = String(str).length;
          return String(str).substring(iLen, iLen - n);
      }
}


function IsValidEmail(str)
{

	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	var reg2 =/^\s*[A-Za-z0-9._`~!@#$%^&*()+_=|/?'{}-]+()*@[A-Za-z0-9._`~!@#$%^&*()+_=|/?'{}-]+()*\.[A-Za-z0-9._`~!@#$%^&*()+_=|/?'{}-]+(){2,4}\s*$/;
	
	if ((!reg1.test(str) && Right(str,1) !=".") && reg2.test(str))
	//if (!reg1.test(str) && reg2.test(str) )
	 {
		 return true;
	 }
	else
	{
	 return false;
	} 
	
}


//if (document.layers) 
//{
 // document.captureEvents(Event.MOUSEDOWN);
//}
  //document.onmousedown=click;
  
  
	var specialcase = ((navigator.userAgent.indexOf('Mac') != -1) || document.all)
	var flag = 0;
	//var msg = 'This image is protected by copyright.\nWe request that you do not attempt to copy our images.';
                     var msg = 'This image is protected by copyright.';

                     
                     	var x,y,x1,y1,copyAttempt;

	var hidethis = "none";

                   	function click(e)
                    {
                       //  if (document.all) 
                          //  {
	       //   if (event.button == 2) 
                                //  {
                                      //alert(msg); 
	             //    return false;
	            //  }
                              // }
	           // if (document.layers) 
                                  //  {
                                   //   if (e.which == 3) 
                                    //    {
                                       //    alert(msg); 
		// return false;
	                  //  }
                                    //   }
                         }

//if (document.layers) 
//{
  //document.captureEvents(Event.MOUSEDOWN);
//}
 // document.onmousedown=click;
		                                                              

                                                                 

                   function toggle(e) {
	 	if ( document.getElementById(e).style.display=='none' ) {
			document.getElementById(e).style.display = '';
		 }
		else{
		   	document.getElementById(e).style.display = 'none';
		}
	}

	function init() {
		if (!(document.getElementById || document.all || document.layers)) return;
		if (specialcase && document.layers) {
			document.captureEvents(Event.MOUSEMOVE);
			document.onmousemove = special;
		}

		for (i=0;i<document.images.length;i++) {
			//document.images[i].onmousedown = checkIt;
                                                                 document.images[i].onmousedown = click;  
                                                                 document.images[i].onmouseup = function() {return false};

			if (specialcase) {
				//document.images[i].onmousemove = special;
				//document.images[i].onclick = clearIt;
			}
		}
	}

	 





	
	