//smartsite site root: equivalent to ~/
var siteroot = (typeof(fullsiteroot) == "function") && (typeof(sitehost) == "function") ? fullsiteroot().replace(sitehost(), "") : "/";
//language
var lang = (location.href.indexOf("/en/") > - 1 || location.href.indexOf("/animalhealth/") > - 1) ? "en" : "fr";
//fixes double slash in URLs
var normalizePath = function(string) {return string.replace(/(\/+)|\\+/g, "/");}
//escapes <, > & and " into corresponding html entities
var escapeHTML = function(string) {return string.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");}
//rounds a number to two decimals places. Returns a string"
var toCurrency = function(number) {return number.toFixed(2);}

var NEEDS_GA_PARAMS=["morethanmedication.ca","www.pfizeranimalhealth.com","www.dogsinmotion.ca","www.ismydogoverweight.ca","plusquedesmedicaments.ca","monchienestilgras.ca","chienquiroule.ca"];
//IE background image cache script
//@cc_on document.execCommand("BackgroundImageCache", false, true);

// xDocSize r1, Copyright 2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
function xDocSize(){
var b=document.body, e=document.documentElement;var esw=0, eow=0, bsw=0, bow=0, esh=0, eoh=0, bsh=0, boh=0;
if (e) {esw = e.scrollWidth;eow = e.offsetWidth;esh = e.scrollHeight;eoh = e.offsetHeight;}
if (b) {bsw = b.scrollWidth;bow = b.offsetWidth;bsh = b.scrollHeight;boh = b.offsetHeight;}
return {w:Math.max(esw,eow,bsw,bow),h:Math.max(esh,eoh,bsh,boh)};
}

var insertFlash = function(flvcontent, flashPlayer, playerWidth, playerHeight){ // options taken from the modal.open statement on the page that opens the flash
	var so = new SWFObject(siteroot + flashPlayer, "flashcontentvideo", playerWidth, playerHeight, "9", "#FFFFFF"); // most items are now variable controlled below
	so.addVariable("markPath", flvcontent);
	so.addParam("wmode", "transparent");
	so.write("videovideotest");
}
//Modal mask
/* modal mask */
var Modal = {
	openMask : function(options) {
		this.close();//close if open
		var hasMask, maskStyle;
		if (options){
			hasMask = options.hasMask;
		}
		maskStyle = (hasMask) ? "modalDark" : "modalLight";
		var modalcontainer = $("modalcontainer");
		var modalmask = $("modalmask")
		if (modalcontainer.hasClassName("hidden")) modalcontainer.removeClassName("hidden");
		modalcontainer.setStyle({top : "0", left: "0"})
		var pageDimensions = xDocSize();
		modalmask.className = "modalmask";
		modalmask.addClassName(maskStyle);
		modalmask.setStyle ({
			height : pageDimensions["h"] + "px",
			width : pageDimensions["w"] + "px"
		})
	},
	close : function() {
		var modalcontainer = $("modalcontainer");
		if (!modalcontainer.hasClassName("hidden")) modalcontainer.addClassName("hidden");
		var modalcontent = $("modalcontent");
		if(modalcontent.innerHTML != "") modalcontent.innerHTML = "";
	},
	resizeHandler : function(){
		var modalcontainer = $("modalcontainer");
		var modalmask = $("modalmask")
		if (!modalcontainer.hasClassName("hidden")){
			Modal.close();
			Modal.openMask();
		}
	},
	open :function(options){
		var width, url, contentEl, hasMask, flashcontent, flashPlayer, playerWidth, playerHeight; // collection of parameters in the modal.open statement
		var modalbody = $("modalbody");
		var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		if (options){
			width = options.width || 400;
			url = options.url || "";
			contentEl = options.contentEl || "";
			hasMask = options.hasMask;
			flashcontent = options.flashcontent || "";
			flashPlayer = options.flashPlayer || "local/flash/player_EN_480x291.swf"; // flashPlayer is now a parameter but it has a default player
			playerWidth = options.playerWidth || "480"; // whatever player is used, width is variable but the default size is 480
			playerHeight = options.playerHeight || "291"; // whatever player is used, height is variable but the default size is 291
		}
		Modal.openMask({hasMask: hasMask});
		modalbody.setStyle({
			width: width + "px",
			top:(scrollTop + 100) + "px",
			left:(document.body.offsetWidth / 2) - (width / 2) + "px"
		});


		if (url != ""){
			new Ajax.Updater("modalcontent",options.url)
		}
		else if (contentEl != ""){
			$("modalcontent").innerHTML = $(contentEl).innerHTML;
			$$(".modalcontent div").each(function(el){
				if(el.id == "flashcontent"){
					el.id = "videovideotest";
					//pageTracker._trackPageview(flashcontent);
					flash_video_event(flashcontent);
					insertFlash(flashcontent, flashPlayer, playerWidth, playerHeight);
				}
			})
		}
	}
}
Event.observe (window,"resize",Modal.resizeHandler);
Event.observe(window,"load",function(){
	if ($("modalcloser"))Event.observe ("modalcloser","click",Modal.close);
})


/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;


//products letter selector
function showLetter(ContentElementPrefix, Number) {

		var i=0;
		while ($(ContentElementPrefix + i))
			$(ContentElementPrefix + i++).className="hidden"

		//this let you toggle the display of an element
		//it will flip the state each time it is called

		$(ContentElementPrefix + Number).className = 'showy' ;


}

	function showAllLetters(ContentElementPrefix) {
		var i=0;
		while ($(ContentElementPrefix + i))
			$(ContentElementPrefix + i++).className="showy"
}
//end products letter selector

//tab selector
function showTab(Number) {

		var i=0;
		while ($("ourProductsMatrixTab" + i))
			$("ourProductsMatrixTab" + i++).className=""

		i=0;
		while ($("ourProductsMatrixBody" + i))
			$("ourProductsMatrixBody" + i++).className="hidden"

		//this let you toggle the display of an element
		//it will flip the state each time it is called

		$("ourProductsMatrixTab" + Number).className = 'tabSelected' ;
		$("ourProductsMatrixBody" + Number).className = 'showy' ;
}
//end tab selector

// consumer materials selector
var consumerEndCap=3

function showCondition(currValue) {

		for (var i=1; i<consumerEndCap; i++)
		{
			$("consumerMaterials" + i).addClassName("hidden");
		}

		//this let you toggle the display of an element
		//it will flip the state each time it is called



		if (currValue == "consumerMaterials0") {

			for (var i=1; i<consumerEndCap; i++)
			{
				$("consumerMaterials" + i).removeClassName("hidden");
			}

		}
		else {
			$(currValue).removeClassName("hidden");
		}





}

// end consumer materials selector


// 'Email this page' tool
function showEmailTool(url) {
	var baseurl=String(top.location.pathname).replace(".ssx","");
	if (String(document.location).indexOf("?")>=0)
		baseurl+=String(document.location).substr(String(document.location).indexOf("?"));
	baseurl += "/emailthispage/"
	pageTracker._trackPageview(baseurl.replace("//","/"));
	Modal.open({
		width:500,
		url: siteroot + lang + '/emailthispage/',
		hasMask:false
	});
}

submitEmailThisPage = function()
{
	$('emailUrl').value = document.location;
	submitAjaxForm($('frmEmailThisPage'), $('frmEmailThisPage').parentNode);
}

submitAjaxForm = function(form, targetElement)
{
	try {document.body.style.cursor='progress';}
	catch (e) {document.body.style.cursor='wait';}

	new Ajax.Updater(targetElement, form.action,
		{
			onComplete:function(data)
			{
				if (document.body != null)
					document.body.style.cursor = 'default';
			},
			parameters:Form.serialize(form),
			method:"POST",
			asynchronous:true,
			evalScripts:true
		}
	);
}

// Converts all external links to use the Leaving the Page popup
Event.observe(window, "load", function() {
	$$('a[href^=mailto]').each(function(el){
			Event.observe(el,"click",function()
			{
				pageTracker._trackEvent(sectionName()+" Mailto Links", "Mailto", String(el.href).replace("mailto:","").replace(/\?.*/,""));
			});
		});
	// Look for all anchor tags that have an href that starts with 'http'
	$$('a[href^=http]').each(function(el){
		// Check if this link takes the user to another host, if so we need to use the popup
		var currentHost = document.location.host;
		var anchorHost = el.href.substring(el.href.indexOf('://') + 3, el.href.indexOf('/', el.href.indexOf('://') + 3));
		var linkAddress = el.href;
		var linkTitle = (el.innerHTML ? el.innerHTML : "").replace(/<.*?>/gi,"").replace(/&nbsp;/gi,"");
		if (currentHost == anchorHost)			//local link - ignore
			return;
		if (pfizerOwnedHost(anchorHost))		//link to other pfizer owned site - no CONFIRM
		{
			Event.observe(el, "click", function() {
					pageTracker._trackEvent(sectionName()+" Exit Links", linkTitle, linkAddress);
					if ((anchorHost.indexOf("pfizer.ca")<0 && anchorHost.indexOf("klick")<0) || linkAddress.indexOf(".pdf")>0)
					{	window.open(addGAExitCodes(linkAddress));
					}else
					{	document.location=addGAExitCodes(linkAddress);
					}
				});
			el.title=el.href;
			el.href="javascript:void(0);"; //addGAExitCodes(linkAddress);
		}else if (currentHost != anchorHost)	//link to external site - needs ARE YOU SURE confirmation
		{
			// Rewrite the onclick event of the anchor
			Event.observe(el, "click", function() {
				Modal.open({width:500,contentEl:'leavingSite',hasMask:false});
				// Update the url for the continue button
				window.setTimeout(function() {
					$("modalcontent").down('button.leavingSubmit').onclick = function() {
						Modal.close();
						pageTracker._trackEvent(sectionName()+" Exit Links", linkTitle, linkAddress);
						window.open(addGAExitCodes(linkAddress));
					};
				}, 100);
			});
			el.title=el.href;
			el.href = 'javascript:void(0);';
		}
	});
	$$("#rightBarContent a").each(function(el)
		{
			Event.observe(el,"click",function()
				{
					var myElement=this;
					var href=(this.href.indexOf("javascript")>=0 ? this.title : this.href);
					var title=(this.innerHTML ? this.innerHTML : "").replace(/<.*?>/gi,"").replace(/&nbsp;/gi,"");
					var keepGoing=true;
					var elNum=1;
					$$("#rightBarContent a").each(function(a)
													{
														if (keepGoing)
														{
															if (a==myElement)
															{	keepGoing=false;
															}else
															{	elNum++;
															}
														}
													});
					var isHomepage=String(document.location).indexOf("/home/")>=0;
					pageTracker._trackEvent(sectionName()+(isHomepage ? " HP WhatsNew" : " Right Rail"), (isHomepage ? "" : elNum+"_")+title, href);
				})
		});
});
var openGranstream=function()
{
	var linkTitle=(lang=="en" ? "Apply online" : "Demande de soutien");
	var windowTitle=(lang=="en" ? "2" : "16");
	var linkAddress=(lang=="en" ? "https://grant.grantstream.ca/frames/pfizer" : "https://grant.grantstream.ca/frames/pfizer/fr");
	pageTracker._trackEvent(sectionName()+" Exit Links", linkTitle, linkAddress);
	addGAExitCodes(linkAddress);
	window.open(linkAddress,windowTitle,"dependent=no,menubar=no,toolbar=no,resizable=1,scrollbars=no,top=10,left=10,status=no,width=820,height=650");
}
var addGAExitCodes=function(linkAddress)
{
	var params="";
	for (var i=0;i<NEEDS_GA_PARAMS.length;i++)
	{
		if (linkAddress.indexOf(NEEDS_GA_PARAMS[i])>=0)
		{
			if (linkAddress.indexOf("?")>=0)
				params="&";
			else
				params="?";
			var thisUrl=String(top.location.pathname).replace(".ssx","");
			params+="utm_campaign=pfizer_ca&utm_medium=corporate_site&utm_source="+sectionCode()+"&utm_content="+linkAddress.replace(/\?.*/,"").replace("https://","").replace("http://","");
			i=NEEDS_GA_PARAMS.length+1;
			pageTracker._trackPageview("/outboundlink"+thisUrl+linkAddress);
		}
	}
	return linkAddress+params;
}
var flash_trackPageview = function(opt_pageURL){
	pageTracker._trackPageview(opt_pageURL);
}

var flash_trackEvent = function(category, action, opt_label){
	pageTracker._trackEvent(category, action, opt_label)
}
pfizerOwnedHost = function (destHost)
{
	var pfizerHosts=[document.location.host,"pfizer.com","grantstream.ca","pfizer.ca","pfizercanen.naccvp.com","pfizercanfr.naccvp.com","plusquedesmedicaments.ca","morethanmedication.ca","ismydogoverweight.ca","dogsinmotion.ca","monchienestilgras.ca","chienquiroule.ca"];
	for (var i=0;i<pfizerHosts.length;i++)
	{
		if (destHost.indexOf(pfizerHosts[i])>=0)
			return true;
	}
	return false;
}

// FAQ page question opener
questionOpener = function(theAnswer,theQuestion) {
	$(theAnswer).toggleClassName("hidden"); // toggle hidden on or not $() is like gebi and toggleclassname is doing as it says
	$(theQuestion).toggleClassName("faqOn"); // toggle the onstate for the question area of the faq
}


// back to top depending on height of the content
function backToTopLauncher() {
	if ($("internalContent").getHeight() > 430) { // if the height in pixels of container 'internalContent' is more than 430 pixels
		$("layoutBackToTop").toggleClassName("hidden"); // toggle the class "hidden" off (it starts off programmed as hidden in the layout code)
	}
}


// animal disease info activator
diAnswerOpener = function(diAnswer,diQuestion) {
	$(diAnswer).toggleClassName("hidden"); // toggle hidden on or not $() is like gebi and toggleclassname is doing as it says
	$(diQuestion).toggleClassName("diQuestionOn"); // toggle the onstate for the question area of the document
	pageTracker._trackEvent("Animal Disease Info", "Click", $(diQuestion).innerHTML.replace(/<.*?>/gi,"").replace(/&nbsp;/gi," "))
}


// home page background change

function theBackground() {
	if (String(document.location).toLowerCase().indexOf("/en/home/")>=0 ||
		String(document.location).toLowerCase().indexOf("/fr/home/")>=0)
	{
		random_number= Math.floor(Math.random()* 3+1 ); // Loads the appropriate class based on random number which will get a background image via css
		if (random_number==1) {
			$('theContent').addClassName('homeBackImg1');
		}
		if (random_number==2) {
			$('theContent').addClassName('homeBackImg2');
		}
		if (random_number==3) {
			$('theContent').addClassName('homeBackImg3');
		}
	}else if (String(document.location).toLowerCase().indexOf("/animalhealth/home/") || String(document.location).toLowerCase().indexOf("/santeanimale/home/")>=0)
	{
		$('theContent').addClassName('homeBackImg4');
	}
}


// home banner locations
// all of these destinations below will be determined by the variable 'sectionLanguage' which is established in the layout and directed by a config
var healthyEnterprise = function() {}


var breathe = function()
{
	pageTracker._trackEvent(sectionName()+" HP Carousel", "Sit. Watch. Breathe.", "http://morethanmedication.ca/"+lang+"/article/index/breathe?ShowVideo=true");
	pageTracker._trackEvent(sectionName()+" Exit Links", "Sit. Watch. Breathe.", "http://morethanmedication.ca/"+lang+"/article/index/breathe?ShowVideo=true");
}

var moreInfo = function()
{
		pageTracker._trackEvent(sectionName()+" HP Carousel", "For more info on the merger, please click here.", siteroot + sectionLanguage + "/media_centre/news_releases/article?year=2009&article=295");
		location.href = siteroot + sectionLanguage + "/media_centre/news_releases/article?year=2009&article=295";
}
var wyethCanada = function()
{
				Modal.open({width:500,contentEl:'leavingSite',hasMask:false});
				// Update the url for the continue button
				window.setTimeout(function() {
					$("modalcontent").down('button.leavingSubmit').onclick = function() {
						Modal.close();
						if (sectionLanguage == 'santeanimale' || sectionLanguage == 'fr') {  // base where it goes on language despite human or animal health - only language is relevant here
							pageTracker._trackEvent(sectionName()+" HP Carousel", "To visit the Wyeth Canada corporate website, please click here..", "http://www.wyeth.ca/en/");
							window.open("http://www.wyeth.ca/fr/");
						} else
						{
							pageTracker._trackEvent(sectionName()+" HP Carousel", "To visit the Wyeth Canada corporate website, please click here.", "http://www.wyeth.ca/en/");
							window.open("http://www.wyeth.ca/en/");
						}
					};
				}, 100);
}

var smidge = function()
{
	if (sectionLanguage == 'santeanimale' || sectionLanguage == 'fr') {  // base where it goes on language despite human or animal health - only language is relevant here
		window.open("http://morethanmedication.ca/fr/smidge/");
	} else
	{
		window.open("http://morethanmedication.ca/en/smidge/");
	}
}




var innovation = function()
{
	pageTracker._trackEvent(sectionName()+" HP Carousel", "Innovation", siteroot + sectionLanguage + "/advancing_medicine/partnerships/");
	document.location = siteroot + sectionLanguage + "/advancing_medicine/partnerships/";
}

var cafe = function() {}

var didYouKnow = function()
{
	pageTracker._trackEvent(sectionName()+" HP Carousel", "Did You Know", siteroot + sectionLanguage + "/about_pfizer/our_beliefs/");
	document.location = siteroot + sectionLanguage + "/about_pfizer/our_beliefs/";
}
var conHealthcare = function(){
	var category = "Human";
	if (sectionLanguage == "animalhealth" || sectionLanguage == "santeanimale") {
		category = "Animal";
	}
	pageTracker._trackEvent(category + " Home Banner", "Our Products", siteroot + lang + "/our_products/nonprescription/");
	document.location = siteroot + lang + "/our_products/nonprescription/";
}

var licensingAndAlliances = function(){
	var category = "Human";
	if (sectionLanguage == "animalhealth" || sectionLanguage == "santeanimale") {
		category = "Animal";
	}
	pageTracker._trackEvent(category + " Home Banner", "Licensing and Alliances", siteroot + lang + "/about_pfizer/licensing/");
	document.location = siteroot + lang + "/about_pfizer/licensing/";
}

var sectionName = function()
{
	var url=String(document.location);
	return (url.indexOf("animalhealth")>0 || url.indexOf("santeanimale")>0) ? "Animal" : "Human";
}
var sectionCode = function()
{
	var url=String(document.location);
	return (url.indexOf("animalhealth")>0 || url.indexOf("santeanimale")>0) ? "animal_health" : "human_health";
}

var licensing = function()
{
	document.location = siteroot + sectionLanguage + "/about_pfizer/licensing/";
}

var employer = function()
{
	document.location = siteroot + sectionLanguage + "/careers/";
}

var regnow = function()
{
				Modal.open({width:500,contentEl:'leavingSite',hasMask:false});
				// Update the url for the continue button
				window.setTimeout(function() {
					$("modalcontent").down('button.leavingSubmit').onclick = function() {
						Modal.close();
						if (sectionLanguage == 'santeanimale' || sectionLanguage == 'fr') {  // base where it goes on language despite human or animal health - only language is relevant here
							//pageTracker._trackEvent(sectionName()+" HP Carousel", "To visit the Wyeth Canada corporate website, please click here..", "http://www.wyeth.ca/en/");
							window.open("https://www.rxhelp.ca/FR/Programs/Default.aspx");
						} else
						{
							//pageTracker._trackEvent(sectionName()+" HP Carousel", "To visit the Wyeth Canada corporate website, please click here.", "http://www.wyeth.ca/en/");
							window.open("https://www.rxhelp.ca/EN/Programs/Default.aspx");
						}
					};
				}, 100);
}










// end home barrier locations"

var flash_video_event = function(path,event)
{
	///$containingpage/video/$filename/
	var loc=String(top.location.pathname).replace(".ssx","")+"video/"+path.replace(/.*\//gi,"");
	if (event)
		loc+="/"+event;
	pageTracker._trackPageview(loc);
}


// jquery stuff
$j(document).ready(function() { // jquery on ready statement


	// manufacturing map loader for corporate backgrounder
	$j('.manufacturingMap').fadeIn(3000); // fade in the actual map
	$j('.manufacturingLocation').fadeIn("slow"); // fade in the manufacturing locations
	$j('#manufacturingMapLines').fadeIn(4000); // fade in the lines that are over the map
	//$j('.programsTabs li').slideDown("slow"); // fade in for tabs in 'healthier communities and partnerships'


});
// end jquery stuff










function init()
{
    backToTopLauncher(); // launch the back to top link function that bases link on size of container
    theBackground(); // launch function that radomizes which background image gets loaded on home page
//	theBannerNumber();
}

window.onload=init;




