function addScript(jsPath) {
   var js = document.createElement("script"); 
   js.setAttribute("type", "text/javascript"); 
   js.setAttribute("language", "javascript"); 
   js.setAttribute("src", jsPath); 
   document.getElementsByTagName("body")[0].appendChild(js); 
   }
function addToPageInit() {
   var initialContents = pageInit; 
   var functionList = new String; 
   functionList[0] = initialContents; 
   for (var i = 1; i <= arguments.length; i++) {
      functionList[i] += arguments[i]; 
      }
   pageInit = functionList; 
   }
function setOnClickEvent(obj, eventFunction) {
   obj.onclick = Function(eventFunction); 
   }
function removeHref(obj) {
   obj.removeAttribute("href"); 
   }
function getElementsByClassName(className, tag, elm) {
   var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)"); 
   var tag = tag || "*"; 
   var elm = elm || document; 
   var elements = (tag == "*" && elm.all) ? elm.all : elm.getElementsByTagName(tag); 
   var returnElements = []; 
   var current; 
   var length = elements.length; 
   for(var i = 0; i < length; i++) {
      current = elements[i]; 
      if(testClass.test(current.className)) {
         returnElements.push(current); 
         }
      }
   return returnElements; 
   }
function callFlash(targetNode, swfFile, flashWidth, flashHeight, flashVars, flashName, flashVersion) {
   // The following variables are REQUIRED
   var targetNode = targetNode; 
   // The DOM node in which to insert the Flash object
   var swfFile = swfFile; 
   // The path and filename (without the extention) of the Flash object
   var flashWidth = flashWidth; 
   // The width of the flash object
   var flashHeight = flashHeight; 
   // The height of the flash object
   // The following variables are OPTIONAL
   var flashVars = flashVars || ""; 
   // Any external variables for the Flash object
   var flashName = flashName || "flashObject"; 
   // The ID or NAME attribute of the Flash object
   var flashVersion = flashVersion || "8,0,24,0"; 
   // Set a default version for required flash player
   if ((!targetNode) || (!swfFile) || (!flashWidth) || (!flashHeight)) {
      return false; 
      }
   else {
      AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + flashVersion, 'width', flashWidth, 'height', flashHeight, 'src', swfFile, 'quality', 'high', 'pluginspage', 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'showall', 'wmode', 'window', 'devicefont', 'false', 'id', flashName, 'name', flashName, 'menu', 'true', 'allowScriptAccess', 'sameDomain', 'allowFullScreen', 'false', 'movie', swfFile, 'salign', '', 'flashVars', flashVars, 'targetNode', targetNode); 
      // DOM node for the Flash content to be inserted into
      //end AC code
      // document.getElementById(flashName).style.width = flashWidth+"px";
      if (document.getElementById(flashName)) {
         document.getElementById(flashName).style.width = flashWidth + "px"; 
         document.getElementById(flashName).style.margin = "0 auto"; 
         document.getElementById(flashName).style.padding = "1em 0"; 
         }
      }
   }
function pageInit() {
   }
document.write("<script type=\"text/javascript\" language=\"javascript\" src=\"../js/AC_RunActiveContent.js\"></script>"); 


/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}


function getCookieforDisplayValueinTemp(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    cookieSet(name);
    return unescape(dc.substring(begin + prefix.length, end));
}



// For store the cookies into temporary folder.

function cookieSet(name)
{
    var cookieValue = getCookie(name); 
    if (document.cookie != document.cookie) 
    {
        index = document.cookie.indexOf(cookieValue);
    } else
    {
        index = -1;
    }
    if (index == -1) 
    {
        document.cookie= name + " = " + cookieValue+ ";expires=''";
    }
} 

var page_url = "";
page_url = document.location.href + "";
if(page_url.indexOf("vmEnroll.aspx")<0)
{   
    document.cookie = "SubmitedYN=";	
} 
if(page_url.indexOf("vmSignup.aspx")<0)
{   
    document.cookie = "SubmitedYN=";	
}  
function GoToUrl(urlID, link) {
   url = null; 
   switch(urlID) {
      case 1 : {
         url = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"; 
         PartnerLinkClicked('www.adobe.com', link); 
         break; 
         }
      case 2 : {
         url = "http://aao.org/aao/eyemd_disclaimer.cfm"; 
         PartnerLinkClicked('aao.org', link); 
         break; 
         }
      case 3 : {
         url = "http://doctor.webmd.com/physician_finder/home.aspx?sponsor=core"; 
         PartnerLinkClicked('doctor.webmd.com', link); 
         break; 
         }
      case 4 : {
         url = "http://www.aoa.org/x5428.xml";
         PartnerLinkClicked('www.aoa.org', link);   
         break; 
         }
      case 5 : {
         url = "http://www.medicare.gov/health/glaucoma_info.asp"; 
         PartnerLinkClicked('www.medicare.gov', link);  
         break; 
         }
      case 6 : {
         url = "http://www.adobe.com/products/acrobat/readstep2.html"; 
         PartnerLinkClicked('www.adobe.com', link);   
         break; 
         }
      case 7 : {     
         url = "http://www.glaucomafoundation.org";
         PartnerLinkClicked('www.glaucomafoundation.org', link);     
         break; 
         }
      case 8 : {
         url = "http://www.pfizer.com"; 
         PartnerLinkClicked('www.pfizer.com', link);   
         break; 
         }        
      case 9 : {
         url = "http://www.pfizer.com/pfizer/privacy/mn_privacy_truste.jsp"; 
         PartnerLinkClicked('www.pfizer.com', link); 
         break; 
         }
      case 10 : {
         url = "http://www.glaucoma.org/index.php"; 
         PartnerLinkClicked('www.glaucoma.org', link); 
         break; 
         }
      case 11 : {
         url = "http://www.pfizerhelpfulanswers.com/"; 
         PartnerLinkClicked('www.pfizerhelpfulanswers.com', link); 
         break; 
         }
         case 12 : {
         url = "http://www.nei.nih.gov/nehep/glaucoma.asp"; 
         PartnerLinkClicked('www.nei.nih.gov', link); 
         break; 
         }
         case 13 : {
         url = "http://www.lighthouse.org"; 
         PartnerLinkClicked('www.lighthouse.org', link); 
         break; 
         }
         case 14 : {
         url = "http://www.preventblindness.org/news/releases/glaucoma_learning_center.html"; 
         PartnerLinkClicked('www.preventblindness.org', link);
         break; 
         }
         case 15 : {
         url = "http://www.blindness.org/content.asp?id=9"; 
         PartnerLinkClicked('www.preventblindness.org', link);
         break; 
         }
         case 16 : {
         url = "http://alleyesonglaucoma.com"; 
         PartnerLinkClicked('alleyesonglaucoma.com', link);
         break; 
         }         
      }
   if(url) {
      window.location = url;    
      }
   }

function GoToPartnerUrl(urlId, name, link) {
   PartnerLinkClicked(name,link); 
   url = null; 
   switch(urlId) {
      case '1' : {
         url = "http://www.pfizer.com/privacy"; 
         break; 
         }
      case '2' : {
         url = "http://www.pfizer.com/contact"; 
         break; 
         }
     case '3' : {
         url = "http://pfizer.com/home"; 
          break; 
         }        
      }
  if(url) {
      window.location = url; 
      }
 }
 
  var resultpage = false;
   function checkClassName(){
    myDiv = document.getElementsByTagName('div');
       for (i=0; i<myDiv.length; i++)
        {
          if(myDiv[i].className == "SearchDesp")
             {
              myDiv[i].className = "SearchDespMessage";          
                break;
             }   
                      
        }
   }
   
    function checkClassName2(){
    myDiv = document.getElementsByTagName('div');
    
       for (i=0; i<myDiv.length; i++)
        {
          if(myDiv[i].className == "SearchSummary")
             {
              myDiv[i].className = "SearchSummaryMessage";          
                break;
             }   
                      
        }
   }
   
   function checkresultpage()
   {
    myDiv = document.getElementsByTagName('div');
    for (i=0; i<myDiv.length; i++)
        {
          if(myDiv[i].className == "SearchResultLink")
             {             
             resultpage = true;  
                         
             }                        
        }
       
        if(resultpage==false)
        {
            checkClassName();
            checkClassName2();
        }
   }















