
function HideUnhideFrameSrc()
{

history.go(0);
  //document.getElementById('trTemplate').style.display=""
//  do/cument.getElementById('Divnvg').style.display=""
  //document.getElementById('tblEnd').style.display=""
  //document.getElementById('divIframe').style.display="none";
//  document.getElementById('iframeSub').src='../INVESTIGATOR/TermsAndConditions.aspx';
}

function doClick(buttonName,e)
    {
//the purpose of this function is to allow the enter key to 
//point to the correct button to click.
        var key;
		
         if(window.event)
              key = window.event.keyCode;     //IE
         else
              key = e.which;     //firefox
    
        if (key == 13)
        {
            //Get the button the user wants to have clicked
            var btn = document.getElementById(buttonName);
            if (btn != null)
            { //If we find the button click it
                btn.click();
                event.keyCode = 0
            }
        }
   }

function noPostBack(e)
{
	if(document.all)
	{
		event.returnValue = false;
	}
	else
	{
		e.preventDefault();
		event.returnValue = false;
	}

}
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

function validateLoginForm(e)
{

	if(trim(document.getElementById('txtLoginName').value) == "" || trim(document.getElementById('txtPassword').value) == "")
		{
			document.getElementById('lblmessage').innerHTML = "Invalid Login Name or Password. Please try again";
			document.getElementById('lblmessage').style.color = "red";
			noPostBack(e);
		}
	
}
function validateForgotPassword(e)
{

		if(document.getElementById('txtLoginName').value == "")
		{
		document.getElementById('lblmessage').style.color = "red";
		document.getElementById('lblmessage').innerHTML = "Enter login name";
		noPostBack(e);
		
		}
	
}

function fnCancel(e)
{
	
	document.getElementById('txtLoginName').value = "";
	document.getElementById('txtPassword').value = "";
	document.getElementById('lblmessage').innerHTML="";	
	noPostBack(e);
	
	
}


/*Terms and Condition page validation - pulak - 31/10/2007*/
function ValidateTermsAndConditions(e)
{
	var strError = '';
	if(document.getElementById('rdbAcceptYes').checked == false && document.getElementById('rdbAcceptNo').checked == false)
	{
		strError = strError + "Please select one of the options before submitting"; 
	}/*end if*/
	
	if(strError != '')
	{
		alert(strError);
		noPostBack(e);
	}
}/*end ValidateTermsAndConditions*/


function OpenWindowToPrint()
{
	window.open("TermsAndConditionsPrint.htm");
} 

function PrintTerms()
{
	//alert("Print");
	self.print();
}
function OpenWindowToPrintThankyou()
{
	window.open("Thankyou.htm");
} 
