
function ShowImage()
{
	  if(navigator.appName  == "Netscape" )
	   {
		document.getElementById("divExcel").style.visibility="visible";
		document.getElementById("divExcel").style.display="block";
		document.getElementById("tblWholePage").style.visibility="hidden";
	   }
	  else
	   {
		divExcel.style.visibility="visible";
		divExcel.style.display="block"; 
		tblWholePage.style.visibility="hidden";
	   }

}

function ShowTbl()
{
	 if(navigator.appName  == "Netscape" )
	  {
  		document.getElementById("tblWholePage").style.visibility="visible";
		document.getElementById("divExcel").style.display="none";
  		document.getElementById("divExcel").style.visibility="hidden";
      }
  	 else
  	  {
  		  tblWholePage.style.visibility="visible";
		  divExcel.style.display="none"; 
		  divExcel.style.visibility="hidden";
  	  }

}

function show_image()
{
	var screen_width =screen.width;
	var screen_height=screen.height;
	var browser =navigator.appName;

	 if(browser == "Netscape" )
	 {
		if((screen_width >=1280) && (screen_height>=960))
		{
			document.Img1.style.position="relative";
			document.Img1.style.left="-22px";
			document.Img1.style.top="3px";


			document.Img2.style.position ="relative";
			document.Img2.style.left="-25px";
			document.Img2.style.top="3px";

			document.Img3.style.position ="relative";
			document.Img3.style.left="-25px";
			document.Img3.style.top="3px";
		 }

		 if((screen_width ==1152) && (screen_height ==864))
		{

			document.Img1.style.position="relative";
			document.Img1.style.left="0px";
			document.Img1.style.top="3px";


			document.Img2.style.position ="relative";
			document.Img2.style.left="-5px";
			document.Img2.style.top="3px";

			document.Img3.style.position ="relative";
			document.Img3.style.left="-5px";
			document.Img3.style.top="3px";

		}

	   }
	  else
	  {

		Img1.style.position ="relative";
		Img1.style.left="-2px";
		Img1.style.top="3px";

		Img2.style.position ="relative";
		Img2.style.left="-5px";
		Img2.style.top="3px";
		Img3.style.position ="relative";
		Img3.style.left="-5px";
		Img3.style.top="3px";
	}


	if(document.getElementById("blinker"))
	{
		 setInterval("makeblink()",1000);
	}
}


function makeblink()
{
	  if(navigator.appName =="Netscape")
		  {
		  	if(document.getElementById("blinker").style.visibility=="hidden")
			  	{
		  	  	  document.getElementById("blinker").style.visibility="visible";
			  	}
		    else
			    {
     			document.getElementById("blinker").style.visibility="hidden";
			    }


		  }
  	  else
  		  {
  				 if(blinker.style.visibility=="hidden")
   				 {
 					  blinker.style.visibility="visible";
 	    		 }
				   else
 		    	 {
  		   			blinker.style.visibility="hidden";
  		    	 }

  		 }
 }



function OpenWindow()
 {

	 if(navigator.appName =="Netscape")
  		{
 			if(document.getElementById("terms").style.visibility=="hidden")
				{
    				document.getElementById("terms").style.visibility="visible";
				}
  	 	}
  	else
   		{

			if(window.document.getElementById("terms").style.visibility =="hidden")
		 		{
		 			window.document.getElementById("terms").style.visibility="visible";
		 		}
	   }


  }


/*function WinClose()//code for netscpae has to be tested
	   if(navigator.appName =="Netscape")
	  	{
	  	   if(document.getElementById("terms").style.visibility=="visible")
	  		{

				window.document.FrmRegister.txtAgreement.checked  = radio1.checked ;

				document.getElementById("terms").style.visibility="hidden";
	  		}
	  	}
	  	else
	   	{
			if(terms.style.visibility=="visible")
 			{

				if(	radio1.checked)
				{

					window.document.FrmRegister.check.value = "yes"  ;
					window.document.FrmRegister.txtAgreement.checked  =true  ;
					terms.style.visibility="hidden";
				}
				else
				{

					window.document.FrmRegister.check.value = "no"  ;
					window.document.FrmRegister.txtAgreement.disabled= true;
					window.document.FrmRegister.txtAgreement.checked  =false;
					terms.style.visibility="hidden";
				}

	    	}

	 	}

}*/

function WinClose(strFormId, strDivId)
{

	if(window.document.getElementById(strDivId).style.visibility=="visible")
	{

		if(	window.document.getElementById("radio1").checked)
		{
			window.document.getElementById(strFormId).check.value;
			window.document.getElementById(strFormId).check.value = "yes"  ;
			window.document.getElementById(strFormId).txtAgreement.checked  =true  ;
			window.document.getElementById(strDivId).style.visibility="hidden";
		}
		else
		{
			window.document.getElementById(strFormId).check.value = "no"  ;
			window.document.getElementById(strFormId).txtAgreement.disabled  =true  ;
			window.document.getElementById(strFormId).txtAgreement.checked  =false  ;
			window.document.getElementById(strDivId).style.visibility="hidden";

		}

	}

}



function EnterValue(name)
{

	var Value_got = name;

		if(Value_got == "Btnreset")
		{

		}

		else
		{
			if(window.document.encryption.txtCode.value.length < 10)
			{
				window.document.encryption.txtCode.value+=Value_got;
			}

			else
			{
				alert("You have reached the max limit");

			}
		}
}


function Check(id)
{
	if(document.myform.level[id].checked)
		{
			alert("checked");
		}
	else
		{
			alert("unchecked");
		}
}

function click_open()
{
		window.open("Professional.htm",null,"height=500,width=750,status=yes,resizable=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,top=0");

}


//////////////////////////////////////////
////// Generic Validation Functions //////
//////////////////////////////////////////


function CheckFieldForInteger(strFormId, strTextBoxId, strLabelId)
{
	var bRetVal = CheckFieldForNumericPlus(strFormId, strTextBoxId, strLabelId, "") ;
	if (bRetVal)
	{
		window.document.getElementById(strLabelId).style.color = "#000000" ;
		return true ;
	}
	else
	{
		window.document.getElementById(strLabelId).style.color = "#DE0000" ;
		return false ;
	}
}


function CheckFieldForNumericStrict(strFormId, strTextBoxId, strLabelId)
{
	var bRetVal = CheckFieldForNumericPlus(strFormId, strTextBoxId, strLabelId, ".") ;
	if (bRetVal)
	{
		// Additionally, check that we have not more than one decimal point.
		// Also, check that the string is not "."
		var nArrLength = window.document.getElementById(strTextBoxId).value.split(".").length ;
		bRetVal = ( (nArrLength == 1) || ( (nArrLength == 2) && (window.document.getElementById(strTextBoxId).value.length > 1) ) ) ;

	}

	if (bRetVal)
	{
		window.document.getElementById(strLabelId).style.color = "#000000" ;
		return true ;
	}
	else
	{
		window.document.getElementById(strLabelId).style.color = "#DE0000" ;
		return false ;
	}
}



function CheckFieldForNumericPlus(strFormId, strTextBoxId, strLabelId, strAllowedExtraCharacters)
{
	var strAllowedCharacters = "0123456789" + strAllowedExtraCharacters ;
	var bRetVal = true ;

	if (window.document.getElementById(strTextBoxId).value != "")
	{

		var strToCheck = window.document.getElementById(strTextBoxId).value ;
		var nLength = strToCheck.length ;

		for (i = 0 ; i < nLength ; i++)
		{
			var ch = strToCheck.charAt(i) ;
			if (strAllowedCharacters.indexOf(ch) < 0 )
				{
					bRetVal = false ;

				}
		}
	}
	else
	{

		bRetVal = false ;
	}

	if (bRetVal)
	{
		window.document.getElementById(strLabelId).style.color = "#000000" ;
	}
	else
	{
		window.document.getElementById(strLabelId).style.color = "#DE0000" ;
	}

	return bRetVal ;
}



function CheckFieldForEmptyString(strFormId, strTextBoxId, strLabelId)
{
	if (window.document.getElementById(strTextBoxId).value != "")
	{
		window.document.getElementById(strLabelId).style.color = "#000000" ;
		return true ;
	}
	else
	{
		window.document.getElementById(strLabelId).style.color = "#DE0000" ;
		return false ;
	}
}


function isEmailValid(strFormId, strTextBoxId, strLabelId)
{


	EmailAddress = window.document.getElementById(strTextBoxId).value;
	var Eindex = EmailAddress.indexOf("@");
	str_value = EmailAddress.slice(Eindex+1);
    str_dot   = str_value.indexOf(".");
	str_symbol = str_value.indexOf("@");

     if((Eindex != -1 && Eindex != 0) && (str_dot != -1 && str_dot != 0)&&(str_symbol == -1))
		{

			window.document.getElementById(strLabelId).style.color = "#000000";
			return true;

			}

		else
		{

			window.document.getElementById(strLabelId).style.color = "#DE0000";
			return false;
		}
}


function IsAnyRadioButtonSelected(strFormId, strObjectId, strLabelId)
{
	return IsAnyCheckBoxChecked(strFormId, strObjectId, strLabelId) ;
}



function IsAnyCheckBoxChecked(strFormId, strObjectId, strLabelId)
{
	var nCheckBoxes = window.document.getElementsByName(strObjectId).length ;
	var bRetVal = false ;
	for(i = 0 ; i < nCheckBoxes ; i++)
		if (window.document.getElementsByName(strObjectId)[i].checked == true)
			bRetVal = true;


	if (bRetVal)
	{
		window.document.getElementById(strLabelId).style.color = "#000000" ;
	}
	else
	{
		window.document.getElementById(strLabelId).style.color = "#DE0000" ;
	}

	return bRetVal ;
}






function isDateInFuture()
{
	Selected_Month_index = window.document.FrmRegister.selectmonth.selectedIndex;
	nMonth               = parseInt(window.document.FrmRegister.selectmonth.options[Selected_Month_index].value) ;

	Selected_Year_index  = window.document.FrmRegister.selectyear.selectedIndex;
	nYear                = parseInt(window.document.FrmRegister.selectyear.options[Selected_Year_index].value) ;


	NewDate = new Date();
	cMonth  = NewDate.getMonth();
	cYear   = NewDate.getYear();

	if ( (nYear > cYear) || ( (nYear = cYear) && (nMonth >= cMonth) ) )
	{
		lblExpDate.style.color = "#000000";
		return true;
	}
	else
	{
		lblExpDate.style.color = "#DE0000";
		return false;
	}
}


