// JavaScript Document
function change(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}
function MM_openBrWindow_(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openCrohnsAssessmentDefault() {
	MM_openBrWindow_( applicationRoot + '/CrohnsDisease/CrohnsAssessment/default.aspx','ChrohnsAssessment','scrollbars=yes,resizable=yes,width=777');
}

function openDisclaimer(url) {
	MM_openBrWindow_( applicationRoot + '/Leaving.aspx?url=' + url,'winDisclaimer','width=370,height=342');
}

function goToRequested(url) {
    window.open(url, "_newWin", 'toolbar,menubar,scrollbars,resizable,location');    
    window.close();
}

function openUses() {
      MM_openBrWindow_( applicationRoot + '/Utility/Uses.aspx','w','scrollbars=yes,resizable=no,width=575,height=516');
}

function openSafetyInfo() {
	MM_openBrWindow_( applicationRoot + '/Utility/SafetyInformation.aspx','win','scrollbars=yes,resizable=no,width=655,height=516');
}

function openVaccineInfo() {
	MM_openBrWindow_( applicationRoot + '/Utility/VaccineInfo.aspx','win','scrollbars=yes,resizable=no,width=555,height=516');
}

function openMedGuide() {
	MM_openBrWindow_( 'http://www.rxabbott.com/pdf/humira_medguide.pdf','win','scrollbars=yes,resizable=yes,width=620,height=516');
}
function openPresInfo() {
	MM_openBrWindow_( 'http://www.rxabbott.com/pdf/humira.pdf','win','scrollbars=yes,resizable=yes,width=620,height=516');
}

function openHumiraPen(){
	MM_openBrWindow_( applicationRoot + '/Utility/HumiraPenOpen.aspx','winDisclaimer','scrollbars=yes,resizable=no,width=800,height=262');
}

function openInjectionTranscript() {
	MM_openBrWindow_( applicationRoot + '/Utility/InjectionTranscript.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=516');
}

function openInjectionSyringeTranscript() {
	MM_openBrWindow_( applicationRoot + '/Utility/InjectionSyringeTranscript.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=516');
}

function openInjectionPenTranscript() {
	MM_openBrWindow_( applicationRoot + '/Utility/InjectionPenTranscript.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=516');
}

function openRaVideoTranscript(id) {
	MM_openBrWindow_( applicationRoot + '/RheumatoidArthritis/Transcripts/'+id+'.aspx','Transcript','scrollbars=yes,resizable=no,width=448,height=390');
}

//-ListControlRequired
// for checkboxlist and radiobuttonlist check if any option has been checked
function  IsListControlChecked(objid)
{
    var i=0;

    while (document.getElementById(objid+"_"+i) != null)
    {
      if (document.getElementById(objid+"_"+i).checked) return true;
      i++;
    }
    return false;
    
}

//
function IsChecked (objid)
{
  if (null != document.getElementById(objid))
  {
    if (document.getElementById(objid).checked) return true;
  }
  return false;
} 

//Uncheck all elements of a list.

function UnCheckListElements (objid)
{
  var i=0;

    while (document.getElementById(objid+"_"+i) != null)
    {
      document.getElementById(objid+"_"+i).checked=false;
      i++;
    }
    return false;
} 

function disablePaste(e){

    var pressedKey;

    if(window.event) // IE
    {
    pressedKey = String.fromCharCode(e.keyCode).toLowerCase();
          if (e.ctrlKey && pressedKey == "v") {
            e.returnValue = false;
          }
    }
    else if(e.which) // Netscape/Firefox/Opera
    { 
        
    }
}

function rightclickcheck(keyp){ 
    if (navigator.appName == "Netscape" && keyp.which == 3){return false; } 
    if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {alert("Please type your E-mail Address");return false; } 
}

function Showquestion1(){
    
    if  (document.getElementById("q1").style.display == "none")
     { 
     document.getElementById("q1").style.display="block";
     }
    else 
      {
      document.getElementById("q1").style.display="none";
       }
      return false;
   }
   
function Showquestion2(){
    if  (document.getElementById("q2").style.display == "none")
     { 
     document.getElementById("q2").style.display="block";
     }
    else 
      {
      document.getElementById("q2").style.display="none";
       }
      return false;
   }
   
function Showquestion3(){
    if  (document.getElementById("q3").style.display == "none")
     { 
     document.getElementById("q3").style.display="block";
     }
    else 
      {
      document.getElementById("q3").style.display="none";
       }
      return false;
   }
   
function Showquestion4(){
    if  (document.getElementById("q4").style.display == "none")
     { 
     document.getElementById("q4").style.display="block";
     }
    else 
      {
      document.getElementById("q4").style.display="none";
       }
      return false;
   }
   
function ShowLearnMore1(){
    if  (document.getElementById("LearnMore1").style.display == "none")
     { 
     document.getElementById("LearnMore1").style.display="block";
     }
    else 
      {
      document.getElementById("LearnMore1").style.display="none";
       }
      return false;
   }
   
   function ShowLearnMore2(){
    if  (document.getElementById("LearnMore2").style.display == "none")
     { 
     document.getElementById("LearnMore2").style.display="block";
     }
    else 
      {
      document.getElementById("LearnMore2").style.display="none";
       }
      return false;
   }

function CheckOne(obj){
 var str=obj.name;
 var chk=document.getElementsByName(str);
for (i = 0; i < chk.length; i++)
chk[i].checked = false ;
obj.checked = true ;
}

function DisbaleRadio()
{
  document.getElementById("Select20").checked = "false";
}

function DisbaleDropDown()
{
}


// maps


    function ValidateFriendName(source, args)
    {         
        if (document.getElementById('ctl00_ContentPlaceHolder1_txtEmail2').value=="")
        {
            args.IsValid = true;
        }
        else
        {
            if (document.getElementById('ctl00_ContentPlaceHolder1_txtName2').value=="")
                args.IsValid = false;
            else
                args.IsValid = true;                
        }        
    }      
    
    function ValidateFriendEmail(source, args)
    {         
        if (document.getElementById('ctl00_ContentPlaceHolder1_txtName2').value=="")
        {
            args.IsValid = true;
        }
        else
        {
            if (document.getElementById('ctl00_ContentPlaceHolder1_txtEmail2').value=="")
                args.IsValid = false;
            else
                args.IsValid = true;                
        }        
    }
    
    //Crohns Assessment
    
    function checkEmail()
{
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;


          if (document.GenericRegForm1.recip1.value == "")
          {
            alert("Please enter a valid recipient e-mail address.");
            return(false);
          }
          var str = document.GenericRegForm1.recip1.value;
          if (filter.test(str))
          return(true);
          else
          {
            alert("Please enter a valid recipient e-mail address.");
           }

    return(false);
}

// JavaScript Document
var ua = navigator.userAgent.toLowerCase(); 
this.ua= ua;
this.isIE        = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); 
this.versionMinor = parseFloat(navigator.appVersion); 


document.write ("<style>")

if (this.isIE && this.versionMinor >= 4) {
	
	
	document.write ("#fastfacts_callout {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ applicationRoot + "/common/images/JRA/callout_fastfacts.png',sizingMethod='scale'); width:212px; height: 435px; float:right; margin:0 0 22px 20px;}")
	
}	
else{


	document.write ("#fastfacts_callout { background: transparent url("+ applicationRoot + "/common/images/JRA/callout_fastfacts.png) no-repeat top left; width:212px; height: 435px; float:right; margin:0 0 22px 20px;}") 
	
}	
document.write ("</style>")





  function hideShowCallout()
 {
 	 	
 	var di = document.getElementById('FAQanswer');
 	if(di.style.display != 'block')
 	{
 		di.style.display = 'block';
 	}else{
 		di.style.display = 'none';
 	}
 	return;
  
 }

  function hideShowCallout2()
 {
 	 	
 	var di = document.getElementById('FAQanswer2');
 	if(di.style.display != 'block')
 	{
 		di.style.display = 'block';
 	}else{
 		di.style.display = 'none';
 	}
 	return;
  
 }
 
   function hideShowCallout3()
 {
 	 	
 	var di = document.getElementById('FAQanswer3');
 	if(di.style.display != 'block')
 	{
 		di.style.display = 'block';
 	}else{
 		di.style.display = 'none';
 	}
 	return;
  
 }
 
   function hideShowCallout4()
 {
 	 	
 	var di = document.getElementById('FAQanswer4');
 	if(di.style.display != 'block')
 	{
 		di.style.display = 'block';
 	}else{
 		di.style.display = 'none';
 	}
 	return;
  
 }
 
   function hideShowCallout5()
 {
 	 	
 	var di = document.getElementById('FAQanswer5');
 	if(di.style.display != 'block')
 	{
 		di.style.display = 'block';
 	}else{
 		di.style.display = 'none';
 	}
 	return;
  
 }
 
   function hideShowCallout6()
 {
 	 	
 	var di = document.getElementById('FAQanswer6');
 	if(di.style.display != 'block')
 	{
 		di.style.display = 'block';
 	}else{
 		di.style.display = 'none';
 	}
 	return;
  
 }
 
   function hideShowCallout7()
 {
 	 	
 	var di = document.getElementById('FAQanswer7');
 	if(di.style.display != 'block')
 	{
 		di.style.display = 'block';
 	}else{
 		di.style.display = 'none';
 	}
 	return;
  
 }


function MM_swapImageFaq(id) 
   {
   
 	if (document.getElementById(id).src.indexOf('hide_btn.gif') != -1) 
 	    MM_swapImage(id,'',applicationRoot+'/common/images/expand_btn.gif',1);
 	else
 	    MM_swapImage(id,'',applicationRoot+'/common/images/hide_btn.gif',1);
   return(false);
   }


function clearOptionsQ2bpre(qid, oid)
{
    var i;
    
    if (oid == 'ctl00_ContentPlaceHolder1_Registration1_q2b_pre_8')
    {
        for (i = 0; i<8; i++)
            document.getElementById(qid+'_'+i).checked = false;
    }
   
    else if (oid == 'ctl00_ContentPlaceHolder1_Registration1_q2b_pre_7')
    {
        for (i = 0; i<7; i++)
            document.getElementById(qid+'_'+i).checked = false;
        document.getElementById(qid+'_8').checked = false;
    }    
    else
    {
        for (i = 7; i<9; i++)
            document.getElementById(qid+'_'+i).checked = false;
    }            
}

function clearOptionsQ2bcur(qid, oid)
{
    var i;
    
    if (oid == 'ctl00_ContentPlaceHolder1_Registration1_q2b_cur_8')
    {
        for (i = 0; i<8; i++)
            document.getElementById(qid+'_'+i).checked = false;
    }
   
    else if (oid == 'ctl00_ContentPlaceHolder1_Registration1_q2b_cur_7')
    {
        for (i = 0; i<7; i++)
            document.getElementById(qid+'_'+i).checked = false;
        document.getElementById(qid+'_8').checked = false;
    }    
    else
    {
        for (i = 7; i<9; i++)
            document.getElementById(qid+'_'+i).checked = false;
    }   
    if (document.getElementById(qid+'_'+'4').checked)
        document.getElementById('2c_hidden').style.display = "block";
    if (document.getElementById(qid+'_'+'4').checked == false)
        document.getElementById('2c_hidden').style.display = "none";
          
}

function clearOptionsQ2(id)
{
    if (id == 'ctl00_ContentPlaceHolder1_Registration1_Question2_0')
    {
        document.getElementById('ctl00_ContentPlaceHolder1_Registration1_Question2_1').checked = false;
    }   
    if (id == 'ctl00_ContentPlaceHolder1_Registration1_Question2_1')
    {
        document.getElementById('ctl00_ContentPlaceHolder1_Registration1_Question2_0').checked = false;
        document.getElementById('2a_hidden').style.display = "none";
        document.getElementById('2bq_hidden').style.display = "none";
        document.getElementById('2b_hidden').style.display = "none";
        document.getElementById('2c_hidden').style.display = "none";
    }
  
    if (document.getElementById('ctl00_ContentPlaceHolder1_Registration1_Question2_0').checked == false)
    {
        document.getElementById('2a_hidden').style.display = "none";
        document.getElementById('2bq_hidden').style.display = "none";
        document.getElementById('2b_hidden').style.display = "none";
        document.getElementById('2c_hidden').style.display = "none";
    }
    
    if (document.getElementById('ctl00_ContentPlaceHolder1_Registration1_Question2_0').checked)
    {
        document.getElementById('2a_hidden').style.display = "block";
        document.getElementById('2bq_hidden').style.display = "block";
        document.getElementById('2b_hidden').style.display = "block";
    }
}

function clearOptionsQ4(id)
{
   if (id == 'ctl00_ContentPlaceHolder1_Registration1_Question4_0' || id == 'ctl00_ContentPlaceHolder1_Registration1_Question4_1' || id == 'ctl00_ContentPlaceHolder1_Registration1_Question4_2')
    {
        document.getElementById('ctl00_ContentPlaceHolder1_Registration1_Question4_3').checked = false; 
    }   
    if (id == 'ctl00_ContentPlaceHolder1_Registration1_Question4_3')
    {
        document.getElementById('ctl00_ContentPlaceHolder1_Registration1_Question4_0').checked = false; document.getElementById('ctl00_ContentPlaceHolder1_Registration1_Question4_1').checked = false; document.getElementById('ctl00_ContentPlaceHolder1_Registration1_Question4_2').checked = false;
    }             
}

function gotoReg()
{    
    window.location.href=applicationRoot+'/CrohnsDisease/Register.aspx';    
}

function clearOptionsQ5pre(qid, oid)
{
    var i;
    
    if (oid == 'ctl00_ContentPlaceHolder1_ProtectionPlanReg_q5_pre_9')
    {
        for (i = 0; i<9; i++)
            document.getElementById(qid+'_'+i).checked = false;
    }
    else
    {
        for (i = 9; i<10; i++)
            document.getElementById(qid+'_'+i).checked = false;
    }            
}

function clearOptionsQ5cur(qid, oid)
{
    var i;
    
    if (oid == 'ctl00_ContentPlaceHolder1_ProtectionPlanReg_q5_cur_9')
    {
        for (i = 0; i<9; i++)
            document.getElementById(qid+'_'+i).checked = false;
    }
    else
    {
        for (i = 9; i<10; i++)
            document.getElementById(qid+'_'+i).checked = false;
    }   
        
}