/***************************************************** General Hide/Show scripts
*/

	var browser;
	var layersname;
	var shownLayer = null;

	function	GetBrowserType()
	{
		bName	= navigator.appName;
		bVer	= parseInt(navigator.appVersion);

		if(bName == "Netscape" && bVer >=4 )
			browser = "NS";
		else if(bName == "Microsoft Internet Explorer" &&
				bVer	>= 4) 
				{
					browser = "IE";
				}
			else
				browser = null;
	}

	GetBrowserType();
	if (browser == "NS") 
	{
	    layersname = "document.layers.";
	}
	else 
	{
    	layersname = "document.all.";
	}

	function	ShowObject(objName)
	{
		if (browser == null)
			return;

		obj = eval(layersname+objName);
		//some debug: window.alert(obj);		
		if (browser=="IE")
		{
			obj.style.visibility = 'visible';	
		}
		else
		{
			obj.visibility='show';
		}
	}

	function	HideObject(objName)
	{
		if (browser == null)
			return;

		// NS
		if (browser == "NS") {
			obj = eval("document.layers." + objName);
			obj.visibility = 'hide';
		}
		// IE
		else {
			obj = eval("document.all." + objName);
			obj.style.visibility = 'hidden';
		}
	}	


/******************************************************* General check scripts	
*/

	function CheckText(id, Mid) {
		azon = eval("document.forms[0]." + id + ".value");
		if ( azon=="" ) {
			ShowObject(Mid);
			return false; }
		else {
			HideObject(Mid);
			return true;
		}
	}
	
	function CheckNumber(id, Mid) {
		azon = eval("document.forms[0]." + id + ".value");
		if ( azon=="" || isNaN(x=parseInt(azon)) ) {
			ShowObject(Mid);
			return false; }
		else {
			HideObject(Mid);
			return true;
		}
	}

	function CheckDate(idY,idM,idD, Mid) {
		allok = true;
		azonY = eval("document.forms[0]." + idY + ".value");
		azonM = eval("document.forms[0]." + idM + ".value");
		azonD = eval("document.forms[0]." + idD + ".value");
		y=parseInt(azonY);
		m=parseInt(azonM);
		d=parseInt(azonD);		
		if ( azonY=="" || isNaN(y) || y<1950 || y>2005 )			 { allok=false;  }
		if ( azonM=="" || isNaN(m) || m<1 || m>12 )					 { allok=false;  }
		if ( azonD=="" || isNaN(d) || d<1 || d>31 )		 			 { allok=false;  }
			
		if ( allok ) {
			HideObject(Mid);
			return true;
		}
		else {
			ShowObject(Mid);
			return false;
		}
	}


	function CheckOneEmail(id, Mid) {
		azon = eval("document.forms[0]." + id + ".value");		
	  str = new String(azon);
		firstocc = str.indexOf("@");
		lastocc = str.lastIndexOf("@");
		
		if ( firstocc>0 && lastocc==firstocc && str.length>(firstocc+2) ) {
			HideObject(Mid);
			return true;
		}
		else {
			ShowObject(Mid);
			return false;
		}
	}
	
/********************************************* Specialized Check Scripts in html
*/
	




