function DoTrim(strComp)
		{
			ltrim = /^\s+/
			rtrim = /\s+$/
			strComp = strComp.replace(ltrim,'');
			strComp = strComp.replace(rtrim,'');
			return strComp;
		}
function validate2()
	{
	
		var msg="";
		if((DoTrim(document.getElementById("txt_UserName").value).length == 0) || (DoTrim(document.getElementById("txt_UserName").value) == "Email Address"))
		{
			msg="-Email Address\n";
		}
		if(DoTrim(document.getElementById("txt_Password").value).length == 0)
		{
			msg=msg + "-Password";
		}
		if ( msg == "")
		{
			return true;
		}
		else
		{
			msg= "Please fill in the following fields: \n" + msg;
			alert(msg);
			return false;
		}
	}
	function validateRegistery()
	{
		var msg="";
		if((DoTrim(document.getElementById("txtregistry").value).length == 0) || (DoTrim(document.getElementById("txtregistry").value) == "Enter by Last Name"))
		{
			msg="-User's Last Name\n";
		}		
		if ( msg == "")
		{
			return true;
		}
		else
		{
			msg= "Please fill in the following fields: \n" + msg;
			alert(msg);
			return false;
		}
	}
function ChangeText(obj)
		{
			if (obj == '1')
			{
				if((DoTrim(document.getElementById("txt_UserName").value) == "Email Address"))
				{
					document.getElementById("txt_UserName").value="";
				}
			}
			if (obj == '2')
			{
				if((DoTrim(document.getElementById("txtregistry").value) == "Enter by Last Name"))
				{
					document.getElementById("txtregistry").value="";
				}
			}
						
		}
		function ReplaceText(obj)
		{
			if (obj == '1')
			{
				if((DoTrim(document.getElementById("txt_UserName").value)==""))
				{
					document.getElementById("txt_UserName").value="Email Address";
				}
			}			
			if (obj == '2')
			{
				if((DoTrim(document.getElementById("txtregistry").value)==""))
				{
					document.getElementById("txtregistry").value="Enter by Last Name";
				}
			}			
		}

function changeto(highlightcolor)
  {  
     source=window.event.srcElement
     if (source.tagName=="TR"||source.tagName=="TABLE")
     return
     while(source.tagName!="TD")
     source=source.parentElement
     if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
     source.style.backgroundColor=highlightcolor
  }

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];}}
}


nn=(document.layers)?true:false;
ie=(document.all)?true:false;
function keyDownLogin(e) {
	var evt=(e)?e:(window.event)?window.event:null;
	if(evt){
		var key=(evt.charCode)?evt.charCode:
			((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));
		if(key=="13") 
		{
			document.getElementById("btnLogin").click();
			try
			{event.returnValue = false;}
			catch(e) {}
			if (e.cancelable)
			{
				e.preventDefault();
			}
		}
	}
}

function keyDownSearch(e) {
	var evt=(e)?e:(window.event)?window.event:null;
	if(evt){
		var key=(evt.charCode)?evt.charCode:
			((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));
		if(key=="13") 
		{
			document.getElementById("btnRegistery").click();
			try
			{event.returnValue = false;}
			catch(e) {}
			if (e.cancelable)
			{
				e.preventDefault();
			}
		}
	}
}



