function ValidateForm()
{
    //To read the username password values
	var uname = document.getElementById('txtUsername');
	var pwd1 = document.getElementById('Pwd');
	
	//To display error msg if the field is left blank
	if(uname.value=='')
	{
	document.getElementById('spantxtUsername').style.visibility='visible';
	}
	else
	{
	document.getElementById('spantxtUsername').style.visibility='hidden';
	}
	//To display error msg if the field is left blank
	if(pwd1.value=='')
	{
	document.getElementById('spanPwd').style.visibility='visible';
	}
	else
	{
	document.getElementById('spanPwd').style.visibility='hidden';
	}
	
		
	return true;
 }
 function setHiddenField(obj1,obj2)
{
    if(document.getElementById(obj1).checked)
    {
       document.getElementById(obj2).value =document.getElementById(obj1).value;
    }
    else
    {
        document.getElementById(obj2).value ="";
    }
   
}
function setRadioHiddenField(obj1,obj2)
{
    document.getElementById(obj2).value = obj1 + "|" + document.getElementById(obj1).value;
}

function RE_validate(ctrl,regexp)
{
if(regularExpression_validate(ctrl.id,regexp))
{document.getElementById('span'+ ctrl.id).style.visibility='visible';
}
else
{
document.getElementById('span'+ ctrl.id).style.visibility='hidden';
}
}

function  regularExpression_validate(ctrl,re)
{
var regex="";
var teststr="";

if(document.getElementById(ctrl).value != "")
{
    regex=re;
	teststr=document.getElementById(ctrl).value;

	if (!regex.test(teststr))
	{
	return true;
	}
	return false;
}
}

function RF_validate(ctrl)
{
if(document.getElementById(ctrl.id).value=="")
{
document.getElementById('span'+ ctrl.id).style.visibility='visible';
}
else
{
document.getElementById('span'+ ctrl.id).style.visibility='hidden';
}
}

function ddl_RF_validate(ctrl)
{
//alert(document.getElementById(ctrl.id).selectedIndex);
if(document.getElementById(ctrl.id).selectedIndex==0)
{
document.getElementById('span'+ ctrl.id).style.visibility='visible';
}
else
{
document.getElementById('span'+ ctrl.id).style.visibility='hidden';
}
}

function ShowPopup(url)
{      
window.open(url);
}

function limiter(obj1,obj2,obj3)
{
var count = obj3;
var tex = document.getElementById(obj1).value;
var len = tex.length;
    if(len > count)
    {
        tex = tex.substring(0,count);
       document.getElementById(obj1).value =tex;
        return false;
    }
    var temp=count-len;
document.getElementById(obj2).innerHTML = temp;
document.getElementById(obj2).style.visibility="visible";


}

function setrdoHidden(rdoctrl,hdnctrl)
    {
    
    
    document.getElementById(hdnctrl).value=rdoctrl.id + "|" + rdoctrl.value;   
    }
    
    
    function passwordcheck(ctrl)
{

if((document.getElementById('PasswordConfirm').value != "") && (document.getElementById('Password').value != ""))
{
if(document.getElementById('PasswordConfirm').value !=document.getElementById('Password').value )
{
document.getElementById('span'+ ctrl.id).style.visibility='visible';

}
else
{
document.getElementById('span'+ ctrl.id).style.visibility='hidden';
}

}

//alert(document.getElementById('span'+ ctrl.id).style.visibility);

}
   

function LengthofPassword(ctrl)
{
if((ctrl.value.length < 3) && (ctrl.value!=""))
{

document.getElementById('span'+ ctrl.id).style.visibility='visible';
}


}
// For Site Catalyst
function GoToPartnerUrl(urlId, name, link) {

   PartnerLinkClicked(name,link); 

   url = null; 

   switch(urlId) {

      case '1' : {

         url = "http://www.pfizer.com/general/terms.jsp"; 

         break; 

         }

      case '2' : {

         url = "http://www.pfizer.com/general/privacy.jsp"; 

         break; 
         }


      }

  if(url) {

      window.location = url; 

      }

 }


//For Login Form
function CheckKey() 
                            {
                                //capture ENTER key
                                if (typeof(event)=="object" && event.keyCode == 13) 
                                {
                                SubmitLoginForm();
                                }
                              }  
function SubmitLoginForm()
{


var count=0;
if(document.getElementById('txtUsername').value == "")
{
document.getElementById('spantxtUsername').style.visibility="visible";  
count= count+1;
}
else
{

document.getElementById('spantxtUsername').style.visibility="hidden";
}

if(document.getElementById('Pwd').value == "")
{
document.getElementById('spanPwd').style.visibility="visible";  
count= count+1;
}
else
{
document.getElementById('spanPwd').style.visibility="hidden";
}

if(count == 0)
{
FormSubmit();
document.forms[0].submit(); 
}

}

function IsPreviousURLExist()
{
history.go(-1);
}

//For BestPractices
 
//For Disclaimer Page
     
//For Navigator Search

 // For Navigator_ShowSearchResults
 
 
 
 
 
 
 //For Login Page js includes
   function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}
    function Login_loadcookies()
    {
   
   
   
  var username=getCookie('PNUserIDCookie');
if (username!=null && username!="")
{
 document.getElementById("txtUsername").value=username;
}


  var pwd=getCookie('PNPasswordCookie');
if (pwd!=null && pwd!="")
{
 document.getElementById("Pwd").value=pwd;
}


  var rem=getCookie('RememberPNCookie');

if (rem!=null && rem!="")
{

 document.getElementById("chkRememberMe").checked=rem;
}   
   
 }
    
    
 //For Login Page js includes
 //For Bind Session
 var SessionValue ="";   

        

function GetSessionValue(key) 

{

   try {

      xmlHttp = new XMLHttpRequest(); 

      }

   catch (e) {

      try {

         xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); 

         }

      catch (e) {

         try {

            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 

            }

         catch (e) {

            alert("Your browser does not support AJAX!"); 

            return false; 

            }

         }

      }

   url = "../GetSessionValue.aspx?key=" + key + "&dummy=" + new Date().getTime(); 

   xmlHttp.open("GET", url, false); 

   xmlHttp.send(null); 

      if(xmlHttp.status == 200)

      {

         SessionValue = xmlHttp.responseText; 

      }

     return SessionValue;

}

 



//End for Session



