startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;

    
 // This script is used to find out whether the client browser is IE or Firefox.  
   var agt=navigator.userAgent.toLowerCase();
   var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  
   function onMouseOverIE(element){
     if(is_ie) {
     	element.className='HPbtn-hoverIE';
     }
   }
   
   function onMouseOutIE(element){
     if(is_ie){
      	element.className = element.className.replace("HPbtn-hoverIE", "HPbtn");
     }
   }
   
	 
  var agt = navigator.userAgent.toLowerCase();
     var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

  function hPfaqNavOnMouseOverIE(element){
	if(is_ie){
    	element.style.background='#FFF';
    }
     }

  function hPfaqNavOnMouseOutIE(element){
	 if(is_ie){
	    	element.style.background='none';
	 }
  }

function peerAns(){
	document.getElementById('peers').style.display = 'block';
	document.getElementById('peers').style.visibility = 'visible';
}

function dosubmit(){
// validate poll radiobuttons
	pollOption = -1;
	var pollObj = document.forms['pollForm'].elements["poll.answer.id"];
	for (i=pollObj.length-1; i > -1; i--) 
	{	
		if (pollObj[i].checked) {
		pollOption = i; i = -1;
		}
	}	
	if (pollOption == -1) 
	{
	alert("You must select an answer for this poll.");
	return false;
	}
	else{	
 	 document.getElementById('pollForm').submit();
 	 return true;
 	 }
}

function submitForm1()
	{		
		if( document.unsubscribe.optInType[0].checked 
			&& document.unsubscribe.emailId.value != "" ) {

		    	document.unsubscribe.action = '/topamax/optOutEmail.do';
				document.unsubscribe.submit();
				
		} else if( document.unsubscribe.optInType[1].checked 
				&& document.unsubscribe.txtPhone1.value != ""
				&& document.unsubscribe.txtPhone2.value != ""
				&& document.unsubscribe.txtPhone3.value != ""	 ) {
		  	document.unsubscribe.action = '/topamax/optOutTxt.do';
			document.unsubscribe.submit();
		} 	
	}
	

	function submitForm2()
	{	
	
		if (document.registration.emailId.value == ""){
			alert("Please enter an email id");
			document.registration.emailId.focus();
			return false;
		}

		if (document.registration.emailIdConfirm.value == ""){
			alert("Please conrfirm the email id by entering it again");
			document.registration.emailIdConfirm.focus();
			return false;
		}
		if( String(document.registration.emailId.value) != String(document.registration.emailIdConfirm.value)) {
			alert("Email Id and Confirm Email Id does not match");
			return false;
		}
		if( document.registration.emailId.value != "" 
			&& document.registration.emailIdConfirm.value != "" 
			&& String(document.registration.emailId.value) == String(document.registration.emailIdConfirm.value) 			) {

		    	document.registration.action = '/topamax/topamax-support--reminders--register.do';
				document.registration.submit();
				
		}	

	}

function submitForm3()
	{	
	if(document.registration.tnc.checked == true)
	{
  		document.registration.action = '/topamax/textMsgRegisterconfirm.do';

		document.registration.submit();
	}else{
		alert("Please accept the terms and conditions.");
	}
	}

	function submitForm4()
	{	
		
  	document.registration.action = '/topamax/textMsgRegisterconfirm.do';

	document.registration.submit();
	}