var imgPath = "/images/";
var loadedImages;

/*
Super Special Javascript Silent Error Handler. 
Ignore all javascript errors, especially those caused by mousing over images before they load.
*/
function silentErrorHandler() {
	return true;
}

function preloadImages(imgArray) {
	//takes an array of strings which are IDs of rollover state images

	if (document.images) {
		if (typeof(document.bc) == 'undefined') {
			document.bc = new Object();
		}
		document.bc.loadedImages = new Array();
		var imgLen = imgArray.length;
		for (var i=0; i<imgLen; i++) {
			document.bc.loadedImages[i] = new Image();
			document.bc.loadedImages[i].src = imgPath + imgArray[i] + ".gif";
		}
	}
}

function interstitial() {
	var newwin = window.open("interstitial.jsp", "newwin", "width=450, height=330");
	newwin.focus();
}

function passThisOn() {
	var newwin = window.open("passThisOn.jsp", "newwin", "width=450, height=600");
	newwin.focus();
}


/* The rollover function requires that the image's ID be the same as the filename.  The image's ID is then passed to the function as its argument.
*/

function turnOn(img) {
	image = getRawObject(img);
	image.src = imgPath + img + "_over.gif";
}

function turnOff(img) {
	image = getRawObject(img);
	image.src = imgPath + img + ".gif";
}

//The following few functions are for the stylesheet switcher
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

/**
 * If this is a Mac browser, display a warning; otherwise just window.print.
 * Borrowed the userAgent stuff from detectBrowserPlugins.js.
 */
function printWindow() {

    var agt = navigator.userAgent.toLowerCase();
    var ie  = ( agt.indexOf( "msie" ) != -1 );
    var ns  = ( navigator.appName.indexOf( "Netscape" ) != -1 );
    var win = ( (agt.indexOf( "win" ) != -1 ) || ( agt.indexOf( "32bit" ) != -1 ) );
    var mac = ( agt.indexOf( "mac" ) != -1 );

    if ( mac ) {
        alert( "Use the Print menu option to print the page." );
    } else {
        window.print();
    }
} // printWindow()





window.onload = function() {
	initDHTMLAPI();
	
	var globalNavImages = new Array();

	globalNavImages.push("pat_nav_jointPain_over");
	globalNavImages.push("pat_nav_treating_over");
	globalNavImages.push("pat_nav_dmCanHelp_over");
	globalNavImages.push("pat_nav_gettingYourShot_over");
	globalNavImages.push("button_login_over");
	globalNavImages.push("button_registerNow_over");

	preloadImages(globalNavImages);

}

function OpenPopup(urlId, name, link)
{
PartnerLinkClicked(name,link); 
url = null; 
    switch(urlId) {
    case '1' : {
         url = "http://www.pfizer.com"; 
         break; 
        }      
     case '2' : {
         url = "http://www.pfizer.com/general/terms.jsp"; 
         break; 
         }
     case '3' : {
         url = "http://www.pfizer.com/general/privacy.jsp"; 
         break; 
        }
      }
if(url) {
      window.open(url); 
      }
}
function GoToPartnerUrl(urlId, name, link) {
   PartnerLinkClicked(name,link); 
   url = null; 
   switch(urlId) {             
     case '1' : {
         url = "http://www.pfizer.com/contact/index.jsp";
         break; 
        }        
      }
  if(url) {
      window.location = url; 
      }
 }