function toggleDiv(divID, title){
	updateHitboxForExpandable(title);
    if(document.getElementById(divID).style.display == 'block'){
        document.getElementById(divID).style.display = 'none';
        document.getElementById('img'+divID).src='../../sitecollectionimages/icon_plus.gif';
    }
    else if(document.getElementById(divID).style.display == 'none'){
        document.getElementById(divID).style.display = 'block';
        document.getElementById('img'+divID).src='../../sitecollectionimages/icon_minus.gif';
    }
}
previousFunction = window.onload;

function setProductCenter() {
    if(document.location.search.indexOf('tab') >= 0) {
    
    // var selectedTab=document.location.search.toLowerCase().substring(document.location.search.toLowerCase().indexOf('tab') + 4).split('&')[0]
    // selectedTab=IsTabDeactivated(selectedTab)

      switch(document.location.search.toLowerCase().substring(document.location.search.toLowerCase().indexOf('tab') + 4).split('&')[0]) {
         case 'scientific_literature': case 'scientific literature': {
            saveState('ScientificLiterature');
          //  window.location.href =window.location.pathname;
            __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnScientificLiterature',''); 
            break; 
            }
         case 'patient_education': case 'patient education': {
            saveState('PatientEducation');
           __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnPatientEducation',''); 
          //   window.location.href =window.location.pathname;

            break; 
            }
        
         case 'professional_resources': case 'professional resources': {
            saveState('ProfessionalResources');
           __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnProfessionalResources',''); 
         //  window.location.href =window.location.pathname;

            break; 
            }
          
       }
   }
}





var arrCookie = new Array(); 
function configureTab(link)
{
   switch(link.id)
   {
   case 'ctl00_WebPartManager_g_ff921c11_9c2d_4af7_99c2_29c092eb81a9_ctl00_lbtnIndication': {updateHitboxForHighValueTabClicks('indication'); saveState('Indication');  break;}
   case 'ctl00_WebPartManager_g_ff921c11_9c2d_4af7_99c2_29c092eb81a9_ctl00_lbtnScientificLiterature': {updateHitboxForTabClicks('sci lit'); saveState('ScientificLiterature');  break;}
   case 'ctl00_WebPartManager_g_ff921c11_9c2d_4af7_99c2_29c092eb81a9_ctl00_lbtnProfessionalResources': {updateHitboxForTabClicks('prof res'); saveState('ProfessionalResources');  break;}
   case 'ctl00_WebPartManager_g_ff921c11_9c2d_4af7_99c2_29c092eb81a9_ctl00_lbtnPatientEducation': {updateHitboxForTabClicks('pat ed'); saveState('PatientEducation');  break;}
   case 'ctl00_WebPartManager_g_ff921c11_9c2d_4af7_99c2_29c092eb81a9_ctl00_lbtnConditionInformation': {updateHitboxForHighValueTabClicks('cond info'); saveState('ConditionInformation');  break;}
   case 'ctl00_WebPartManager_g_ff921c11_9c2d_4af7_99c2_29c092eb81a9_ctl00_lbtnProductSummary': {updateHitboxForTabClicks('prod sum'); saveState('ProductSummary');  break;}
    }
}
var url = window.location.pathname; 
var ProductName = url.substring(url.lastIndexOf('/')); 
ProductName = ProductName.substring(1, ProductName.indexOf('.')); 
function setTab() {
   if(document.location.search.toLowerCase().indexOf('tab') >= 0){
        setProductCenter();
        return;
    }
   try {
      var cookieValues = GetPCCookie(ProductName); 
      arrCookie = cookieValues.split('~'); 
      if(arrCookie.length > 1) {
         if(arrCookie[1] == url) {
            switch(arrCookie[0]) {
               case 'Indication': case 'Indication': {
                    __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnIndication',''); 
                    break;}
                    case 'ScientificLiterature': case 'ScientificLiterature': {
                    __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnScientificLiterature',''); 
                    break;}
                    case 'ProfessionalResources': case 'ProfessionalResources': {
                    __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnProfessionalResources',''); 
                    break;}
                    case 'PatientEducation': case 'PatientEducation': {
                    __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnPatientEducation',''); 
                    break;}
                    case 'ConditionInformation': case 'ConditionInformation': {
                    __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnConditionInformation',''); 
                    break;}
                    case 'ProductSummary': case 'ProductSummary': {
                    __doPostBack('ctl00$WebPartManager$g_ff921c11_9c2d_4af7_99c2_29c092eb81a9$ctl00$lbtnProductSummary',''); 
                    break; 
                  }
               }
            }
         }
      }
   catch(e) {
      }
      if(previousFunction) previousFunction();
      window.onload = previousFunction;
   }
window.onload = setTab; 
function saveState(tabName) {
   SetPCCookie(ProductName, tabName + "~" + url, '', '/', '', '');
   }
function SetPCCookie( name, value, expires, path, domain, secure ) {
   var today = new Date(); 
   today.setTime( today.getTime() ); 
   if ( expires ) {
      expires = expires * 1000 * 60 * 60 * 24; 
      }
   var expires_date = new Date( today.getTime() + (expires) ); 
   document.cookie = name + "=" + escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); 
   }
function GetPCCookie( check_name ) {
   var a_all_cookies = document.cookie.split( ';' ); 
   var a_temp_cookie = ''; 
   var cookie_name = ''; 
   var cookie_value = ''; 
   var b_cookie_found = false; 
   for ( i = 0; i < a_all_cookies.length; i++ ) {
        a_temp_cookie = a_all_cookies[i].split( '=' );
        cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
        if ( cookie_name == check_name ) {
            b_cookie_found = true; 
            if ( a_temp_cookie.length > 1 ) {
                cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
            }
            return cookie_value; 
            break; 
        }
        a_temp_cookie = null; 
        cookie_name = ''; 
    }
    if ( !b_cookie_found ) {
        return null; 
    }
}