/***************************************************** 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 = "other"; 
			// window.alert("browser :" + browser);
	}

GetBrowserType();
	
if (browser == "NS") 
	{
	    layersname = "document.layers.";
	}
	else 
	{
    	layersname = "document.all.";
}


	function	ShowObject(objName)
	{
			if (browser == null)
					return;

		obj = document.getElementById(objName); 
		//some debug: window.alert(obj);
				
		if (browser=="IE" || browser=="NS")
		{
			obj.style.visibility = 'visible';	
			obj.style.color = '#FF0000';	
		}		
		else
		{
			obj.visibility='show';
		}
	}

	function	HideObject(objName)
	{
		if (browser == null)
			return;

		obj = document.getElementById(objName); 
				
		// NS
		if (browser == "NS") {
			obj.style.visibility = 'hidden';
		}
		// IE
		else {
			obj.style.visibility = 'hidden';
		}
	}	



/******************************************************* General check scripts	
*/

	function CheckText(formname,id, Mid) {
		azon = eval("document.forms['" + formname +  "']." + id + ".value");
//		var aa = document.getElementById("subject");
		if ( azon=="" ) {
			// window.alert("ShowObj");
			ShowObject(Mid);
			return false; }
		else {
			// window.alert("HideObj");
			HideObject(Mid);
			return true;
		}
	}
	
	function CheckNumber(formname,id, Mid) {
		azon = eval("document.forms['" + formname +  "']." + id + ".value");
		if ( azon==""  || isNaN(x=parseInt(azon)) ) {
			ShowObject(Mid);
			return false; }
		else {
			HideObject(Mid);
			return true;
		}
	}

	function CheckDate(formname,idY,idM,idD, Mid) {
		allok = true;
		azonY = eval("document.forms['" + formname +  "']." + idY + ".value");
		azonM = eval("document.forms['" + formname +  "']." + idM + ".value");
		azonD = eval("document.forms['" + formname +  "']." + idD + ".value");
		y=parseInt(azonY);
		m=parseInt(azonM);
		d=parseInt(azonD);		
		if ( azonY=="" || isNaN(y) || y<1950 || y>2015 )			 { 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(formname,id, Mid) {
		azon = eval("document.forms['" + formname +  "']." + id + ".value");
		str = new String(azon);
		firstocc = str.indexOf("@");
		lastocc = str.lastIndexOf("@");
		
		if ( firstocc>1 && lastocc==firstocc && str.length>(firstocc+3) ) {
			HideObject(Mid);
			return true;
		}
		else {
			ShowObject(Mid);
			return false;
		}
	}
	
/********************************************* Specialized Check Scripts in html
*/
	






