function GetBrandFromCondition(condition)
{

	switch(condition.toLowerCase())
	{
		case "alzheimer's dementia":
			return("aricept");
			break;
		case "breast cancer":
			return("aromasin");
			break; 
		//case "arthritis": 
		//case "osteoarthritis": 
		//case "rheumatoid arthritis"
		case "rheumatic disorders":
			return("arthrotec");
			break; 
		case "aplastic anemia":
			return("atgam");
			break; 
		//case "dyslipidemia": 
		//case "hypercholesterolemia": 
		/*
		case "hypertension":
			return("caduet");
			break; 
		*/
		case "colorectal cancer":
			return("camptosar");
			break; 
		case "bph":
			return("cardura_xl");
			break; 
		/*
		case "erectile dysfunction":
			return("caverject_impulse");
			break; 
		*/
		//case "arthritis": 
		//case "osteoarthritis":
		//case "rheumatoid arthritis":
		case "acute pain": case "ankylosing spondylitis": case "dysmenorrhea": case "familial ademonatous polyposis": case "juvenile ra": 
			return("celebrex");
			break; 
/*			
		case "smoking cessation":
			return("chantix");
			break; 
*/
		case "serious infections":
			return("cleocin_phosphate");
			break; 
		//case "condition":
		//	return("cleocin_vaginal_cream");
		//	break; 
		case "bacterial vaginosis":
			return("cleocin_vaginal_ovules");
			break; 
		//case "condition":
		//	return("covera_hs");
		//	break; 
		/*
		case "glucocorticoid":
			return("depo_medrol");
			break; 
		*/
		case "contraception": case "pain management": case "prevention of pregnancy":
			return("depo_subq");
			break; 
		/*
		case "overactive bladder":
			return("detrol_la");
			break; 
		*/
		//case "condition":
		//	return("dilantin");
		//	break; 
		//case "condition":
		//	return("dostinex");
		//	break; 
		//case "condition":
		//	return("ellence");
		//	break; 
		/*
		case "serious fungal inf":
			return("eraxis");
			break; 
		*/
		case "postmenopausal atrophy": case "vaginal atrophy":
			return("estring");
			break; 
		/*
		case "condition":
			return("fragmin");
			break; 
		case "condition":
			return("gelfilm");
			break; 
		case "condition":
			return("gelfoam_powder");
			break; 
		case "condition":
			return("gelfoam_sponge");
			break;
		*/ 
		case "aghd": case "growth failure": case "pediatric ghd": case "prader-willi syndrome": case "sga": case "short stature": case "turner syndrome": case "hiv wasting":
			return("genotropin");
			break; 
		case "bipolar mania": case "schizophrenia":
			return("geodon");
			break; 
		case "chf": case "heart failure":		
			return("inspra");
			break; 
		//case "dyslipidemia": 
		//case "hypercholesterolemia": 
		//case "hypertension": 
		case "myocardial infarction": case "revascularization": case "stroke":
			return("lipitor");
			break; 
		case "dpn": case "epilepsy/seizures": case "fibromyalgia": case "partial onset seizures": case "postherpetic neuralgia":
			return("lyrica");
			break; 
//		case "condition":
//			return("neurontin");
//			break; 
//		case "condition":
//			return("nicotrol");
//			break;
/*
		case "smoking cessation":
			return("nicotrol_inhaler");
			break; 
*/			
		/*
		case "hypertension":
			return("norvasc");
			break; 
		*/
		case "multiple sclerosis":
			return("rebif");
			break; 
		case "migraine":
			return("relpax");
			break; 
		case "pah":
			return("revatio");
			break; 
		case "hiv infection":
			return("selzentry");
			break; 
		/*
		case "glucocorticoid":
			return("solu_medrol");
			break; 
		*/
		case "acromegaly":
			return("somavert");
			break; 
		case "copd":
			return("spiriva");
			break; 
		case "gist": case "kidney cancer": case "renal cell carcinoma":
			return("sutent");
			break; 
		case "arrhythmias":
			return("tikosyn");
			break; 
		/*
		case "overactive bladder":
			return("toviaz");
			break; 
		*/
		case "abdominal infections": case "gynecological infections": case "skin and skin structure infections":
			return("unasyn");
			break; 
		//case "candida infections": 
		//case "serious fungal inf":
		case "invasive aspergillosis": case "candida infections": 
			return("vfend");
			break; 
		/*
		case "erectile dysfunction":
			return("viagra");
			break; 
		*/
		//case "condition":
		//	return("viracept");
		//	break; 
		case "glaucoma":
			return("xalatan");
			break; 
		//case "panic disorder":
		case "anxiety disorder": case "gad": 
			return("xanax_xr");
			break; 
		//case "condition":
		//	return("xanax");
		//	break; 
		//case "condition":
		//	return("zithromax");
		//	break; 
		case "acute bact sinusitis":
			return("zmax");
			break; 
		//case "panic disorder": 
		case "depression": case "pmdd": case "ocd": case "ptsd":
			return("zoloft");
			break; 
		case "cap": case "comp skin/skin struct inf": case "diabetic foot infections": case "mrsa infections": case "nosocomial pneumonia": case "vent assoc pneum": case "vre":
			return("zyvox");
			break;
	}
	return("");
}


function AddProductSuite(brand)
{
	if((brand != '') && (location.href.toLowerCase().indexOf("marketingweb.pfizer.com") < 0))
	{
		if(sc_rsuite_id.indexOf(",pfizerpc") >= 0)
		{
			sc_rsuite_id = sc_rsuite_id.replace(/[,][p][f][i][z][e][r][p][c][^,]*/,"");
		}
		
		sc_rsuite_id = sc_rsuite_id + ",pfizerpc" + brand.toLowerCase();
	}
}

function RemoveProductSuite(brand)
{
	if(brand != '')
	{
		if(sc_rsuite_id.indexOf(",pfizerpc") >= 0)
		{
			sc_rsuite_id = sc_rsuite_id.replace(/[,][p][f][i][z][e][r][p][c][^,]*/,"");
		}
	}
}


function onClickPartnerLink(obj, friendlyName){
	var s = s_gi(sc_rsuite_id);

	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar7 = '';
	s.events = '';


	s.linkTrackVars = 'events,eVar6';
	s.linkTrackEvents = 'event6';
	s.eVar6 = friendlyName;
	s.events = 'event6';

	s.tl(obj, 'e', friendlyName);

	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar6 = '';
	s.events = '';
}
function PartnerLinkClicked(friendlyName, obj){
}
function PartnerLinkClicked2(friendlyName, obj){
onClickPartnerLink(obj, friendlyName);

}

function PartnerLinkInquiryClicked(friendlyName, obj){
	
	var s = s_gi(sc_rsuite_id);
	
	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar3 = '';
	s.eVar6 = '';
	s.eVar7 = '';
	s.events = '';
	s.apl(s.events, "", ",", 2); 
	
	s.linkTrackVars = 'eVar3,eVar6,events,pageName';
	s.linkTrackEvents = 'event3,event6';
	
	s.eVar3 = s.prop3;
	
	if(friendlyName.toLowerCase().indexOf("contact_us") >= 0){
		s.eVar6 = "pmi:submitmedinq";
	}else{
		s.eVar6 = s.pageName;
	}
	s.events = 'event3,event6';

	s.tl(this, 'e', friendlyName);
	
	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar3 = '';
	s.eVar6 = '';
	s.events = '';
	
}

var tmpEvarPE1 = "";
var tmpEvarPE2 = "";
function _scHiValueContentForMostViewed(obj, goal_content, linkos, hivalue_content, article_name){
	if(document.location.href.indexOf("patient_education.aspx") >= 0)
	{
		tmpEvarPE1 = hivalue_content;
		tmpEvarPE2 = article_name;
		
	}else{
		var s = s_gi(sc_rsuite_id);
		s.linkTrackVars = 'eVar40,eVar41,events';
		s.linkTrackEvents = 'event16';
		s.eVar40 = hivalue_content;
		s.eVar41 = article_name;
		s.events = 'event16'
		
		s.tl(obj, 'o', goal_content);
		
		s.linkTrackVars = 'None';
		s.linkTrackEvents = 'None';
		s.eVar40 = '';
		s.eVar41 = '';
		s.events = '';
	}		
}


function _scHiValueContentForMostViewed2(obj, goal_content, linkos, hivalue_content, article_name, brand){
	
	AddProductSuite(brand);

	_scHiValueContentForMostViewed(obj, goal_content, linkos, hivalue_content, article_name);
	
	RemoveProductSuite(brand);
}


function _scHiValueContent(obj, content, hivalue_content, article_name){
	var s = s_gi(sc_rsuite_id);
	s.linkTrackVars = 'eVar40,eVar41,events';
	s.linkTrackEvents = 'event16';
	s.events = 'event16';
	s.eVar40 = hivalue_content;
	s.eVar41 = article_name;
	s.tl(obj, 'o', content);
	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar40 = '';
	s.eVar41 = '';
	s.events = '';
}
function _scHiValueDownloads(obj, goal_content, linkos){
	var s = s_gi(sc_rsuite_id);
	s.linkTrackVars = 'prop23,prop40';
	s.prop23 = goal_content;
	s.prop40 = linkos;
	s.tl(obj,'o', goal_content);
	s.linkTrackVars = 'None';
	s.prop23 = '';
	s.prop40 = '';
}
function _scTop5Downloads(currURL, prevURL, link){
	var s = s_gi(sc_rsuite_id);
	var p3 = link;
	var p4 = "top5";
	s.prop23 = currURL;
	s.prop40 = prevURL;
	s.prop3 = p3;
	s.prop4 = p4;
	s.prop12 = p3;
	s.pageName = removeDoubleSlashes(s.prop4);
	s.t();
}

function _scExpandableLink(currURL, prevURL, link){
	var s = s_gi(sc_rsuite_id);
	var p3 = link;
	var p4 = "link";
	s.prop23 = currURL;
	s.prop40 = prevURL;
	s.prop3 = p3;
	s.prop4 = p4;
	s.prop12 = s.prop3;
	s.pageName = removeDoubleSlashes(s.prop4);
	s.t();
}

function TrackTabClick(friendlyName){
	if(typeof(sc_rsuite_id) == 'undefined')
	{
	 	var t=setTimeout("TrackTabClick('" + friendlyName + "')",100);
	}else{
	
		var s = s_gi(sc_rsuite_id);
		var otherprops = "";
		var arTmp;
		
		s.linkTrackVars = 'events,eVar7';
		s.linkTrackEvents = 'event7';
		s.eVar7 = friendlyName;
		s.events = 'event7';
	
		if(s.prop3.toLowerCase().indexOf("specialtycenter") >= 0)
		{
			arTmp = s.prop3.split("/");
			if(arTmp.length >= 3)
			{
				for(var i=3; i <= arTmp.length-1; i++)
				{
					if((arTmp[i].toLowerCase().indexOf("tab") < 0)
						&&(arTmp[i].toLowerCase().indexOf("prof res tab") < 0)
						&&(arTmp[i].toLowerCase().indexOf("sci lit tab") < 0)
						&&(arTmp[i].toLowerCase().indexOf("pat ed tab") < 0))
					{
						otherprops = otherprops  + "/" + arTmp[i];
					}
				}
				
			}
			
			if(friendlyName.toLowerCase().indexOf("professional resources") >= 0)
			{
				s.prop3 = s.prop2 + otherprops;
				s.prop4 = s.prop3.toLowerCase().replace("/resource","/resource/" + 'prof res tab');
			}
			if(friendlyName.toLowerCase().indexOf("scientific literature") >= 0)
			{
				
				s.prop3 = s.prop2 + otherprops;
				s.prop4 = s.prop3.toLowerCase().replace("/resource","/resource/" + 'sci lit tab');
			}
			if(friendlyName.toLowerCase().indexOf("patient education") >= 0)
			{
				s.prop3 = s.prop2 + otherprops;
				s.prop4 = s.prop3.toLowerCase().replace("/resource","/resource/" + 'pat ed tab');
			}
		}else{
			if(friendlyName.toLowerCase().indexOf("professional resources") >= 0)
			{
				s.prop3 = s.prop2 + "/" + 'prof res';
				s.prop4 = s.prop3 + "/" + 'tab';
			}
			if(friendlyName.toLowerCase().indexOf("scientific literature") >= 0)
			{
				
				s.prop3 = s.prop2 + "/" + 'sci lit';
				s.prop4 = s.prop3 + "/" + 'tab';
			}
			if(friendlyName.toLowerCase().indexOf("patient education") >= 0)
			{
				s.prop3 = s.prop2 + "/" + 'pat ed';
				s.prop4 = s.prop3 + "/" + 'tab';
			}
		}
		
		s.pageName = s.prop4;
		s.prop39 = s.pageName; //Current URL
		s.prop40 = s.getPreviousValue(s.prop39 , 'gpv_pageName', '');//Previous URL
		
		s.tl('', 'e', friendlyName);
		s.linkTrackVars = 'None';
		s.linkTrackEvents = 'None';
		s.eVar7 = '';
		s.events = '';
	}
}

function TrackHPFExternal(URLname, URLdestination, newwin, brand)
{
	AddProductSuite(brand);
	
	var s = s_gi(sc_rsuite_id);
	
	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar7 = '';
	s.events = "";
	s.apl(s.events, "", ",", 2); 


	s.linkTrackVars = "events,eVar6";
	s.linkTrackEvents = 'event6';
	s.eVar6 = URLname;
    s.events = "event6";
    
	s.tl(true, 'e', URLname);
	
	//clear the variables
	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar6 = '';
	s.events = '';
	
	if(newwin >= 0){
		var pop = window.open(URLdestination,'HPFExternalLink');
	}else{
		document.location.href = URLdestination;
	}
	
	RemoveProductSuite(brand);
}
/*
function TrackHPFInternal(URLname, URLdestination, newwin, brand)
{
	AddProductSuite(brand);
	
	var s = s_gi(sc_rsuite_id);
	
	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar7 = '';
	s.events = "";
	s.apl(s.events, "", ",", 2); 


	s.linkTrackVars = "events,eVar6";
	s.linkTrackEvents = 'event6';
	s.eVar6 = URLname;
    s.events = "event6";
    
	s.tl(true, 'e', URLname);
	
	//clear the variables
	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar6 = '';
	s.events = '';
	
	if(URLdestination != '')
	{
		if(newwin >= 0){
			var pop = window.open(URLdestination,'HPFInternalLink');
		}else{
			document.location.href = URLdestination;
		}
	}
	
	RemoveProductSuite(brand);
}
*/


function TrackProductCenter(lnk, newwin, brand)
{
	AddProductSuite(brand);
	
	var s = s_gi(sc_rsuite_id);
	
	s.linkTrackVars = "eVar7,prop7,prop8,events"; 
	s.linkTrackEvents = "event4";
	s.events = 'event4';
	s.eVar7 = s.prop7 = lnk.substring(lnk.lastIndexOf("/") + 1, lnk.length); 
	s.prop8 = s.pageName; 
	s.tl(this, "o", lnk);
	s.linkTrackVars = "None";
	s.linkTrackEvents = "None";
	s.eVar7 = "";
	s.prop7 = "";
	s.prop8 = "";
	s.events = "";
	
	if(newwin >= 0){
		var pop = window.open(lnk,'ProductCenterLink');
	}else{
		document.location.href = lnk;
	}
	
	RemoveProductSuite(brand);
}


function TrackSurvey(val, url)
{
	var s = s_gi(sc_rsuite_id);
	
	s.linkTrackVars = "events,eVar8,prop0,prop1";

	//s.prop0 = s.channel + "/feedback";
	
	switch(val.toLowerCase()){
		case "start":
			s.linkTrackVars = "events,eVar8,prop0,prop1";
			s.linkTrackEvents = 'event10';
			s.events = "event10";
			//s.prop1 =  s.prop0 + "/start"; 
		case "finish":
			s.linkTrackVars = "events,eVar8,prop0,prop1";
			s.linkTrackEvents = 'event11';
			s.events = "event11";
			//s.prop1 = s.prop0 + "/complete"; 
		break;
	}
	
	s.eVar8 = url;
	s.tl('', 'e', url);
	
	//clear the variables
	s.linkTrackVars = 'None';
	s.linkTrackEvents = 'None';
	s.eVar8 = '';
	s.events = '';

}


function isPatientEducation(str) {
	if (str.indexOf("/patient_education.aspx") >= 0) return true;
	return false;
}
function isDefaultURL(str) {
	if (str.indexOf("/home.aspx") >= 0) return true;
	return false;
}

var p_fil="";
var p_fila="";

function _scTabsAndFilterTracking(currURL, prevURL, tabOrFilter){
	var p2 = "";
	var p3 = "";
	var p4 = "";
	var prod = getProduct(currURL.substring(0, (currURL.indexOf(".aspx") + 4)));
	
	var brand = GetBrandFromCondition(tabOrFilter.replace("_"," "));
	//alert(brand);
	if(brand == "")
	{
		for(var p=0; p <= products_list.length-1;p++)
		{
		  if(products_list[p] == tabOrFilter) brand = tabOrFilter;
		}
	
	}

	AddProductSuite(brand);
	
	var s = s_gi(sc_rsuite_id);

	if (prod != null) {
		p3 = getSCContentType(tabOrFilter);
		p4 = "tab";
	} else if (isPatientEducation(currURL)) {
		var tabname = getSCPatientEdTab(tabOrFilter);
		if (tabname != null)  {
			p3 = tabname;
			if (p_fil == ""){
				p4 = "tab";
			}else {
				p4 = p_fil;
			}

			if (p_fila != ""){
				p2 = p_fila;
			}
		} else {
			
			p3 = getPeTabName();
			p4 = tabOrFilter.toLowerCase();
			var prod2 = getProduct(p4);
			if (prod2 == null) {
				p4 = p4.replace("'", "");
				p2 = "pfp/patientedmat/condition";
				p_fil = p4;

			} else {
				p2 = "pfp/patientedmat/product";
			}
			
			if((currURL.toLowerCase().indexOf("product=") >= 0)||(currURL.toLowerCase().indexOf("condition=") >= 0))
		    {
		        var tmp3 = '';
		        var tmpAr3;
		        
		        
		    	
				if (currURL.toLowerCase().indexOf("condition=") >= 0) {
					tmpAr3 = currURL.match(/[c][o][n][d][i][t][i][o][n][=][^&]*/);
		         	for(var i =0; i < tmpAr3.length; i++)
				    {
		         		if(tmpAr3[i].indexOf("condition=") >= 0)
		         		{
		         			tmp3 = tmpAr3[i].replace('condition=','').replace(' ','_');
		         		}
		         	}
		
				} else {
					tmpAr3 = currURL.match(/[p][r][o][d][u][c][t][=][^&]*/);
		         	for(var i =0; i < tmpAr3.length; i++)
				    {
		         		if(tmpAr3[i].indexOf("product=") >= 0)
		         		{
		         			tmp3 = tmpAr3[i].replace('product=','').replace(' ','_');
		         		}
		         	}
		
				}
				if(tmp3 != '')
				{
					if(tabOrFilter.toLowerCase().replace(' ','_') == tmp3){
						p2 = p2 + '/' + tmp3;
					}
				}
			}	
			
			p_fil = p4;
			p_fila = p2;
		}
	} else if (currURL.indexOf("/pfizer_helpful_answers.aspx") > 0)  {
		p3 = getSCContentType(tabOrFilter);
		p4 = "tab";
	} else if (currURL.indexOf("/psites.aspx") > 0)  {
		p3 = tabOrFilter.toLowerCase();
		p4 = "tab";
	} else if (currURL.indexOf("/pi_brand.aspx") > 0) {
		p2 = "pfp/pc/" + tabOrFilter.toLowerCase();
		p4 = "general";
	} else if (isDefaultURL(currURL))  {
		p3 = getSCHomeTab(tabOrFilter);
		p4 = "tab";
	}
	
	var preProp4 = s.getPreviousValue(s.prop4 , 'gpv_pageName', '');//Previous URL

	p12 = p3;
	if (p2 != "")  s.prop2 = p2;
	s.prop23 = currURL;
	
	s.prop3 = removeDoubleSlashes(s.prop2 + "/" + p3);
	s.prop4 = removeDoubleSlashes(s.prop3 + "/" + p4);
	s.prop12 = p12;
	

	s.prop39 = s.prop4; //Current URL
	s.prop40 = s.getPreviousValue(s.prop39 , 'gpv_pageName', '');//Previous URL

	
    s.pageName = removeDoubleSlashes(s.prop4);
    
    //alert('s.eVar4=' + s.eVar4);
    
    if((!s.eVar4) || (s.eVar4 != s.getQueryParam('intcmp'))){
      
      s.eVar4 = s.getQueryParam('intcmp'); 
    }
    
	if(preProp4 != s.prop4)
	{
		//alert(s.prop2);
		s.t();
	}
	
	RemoveProductSuite(brand);
}
function configureTab(link){
	var k = link.id;
	if (k != null){
		var i = k.indexOf("_ctl00_lbtn");
		if (i > 0){
			k = k.substring(i + 11);
			switch(k){
				case 'ConditionEducation': { updateHitboxForTabClicks('condition_information');break;}
				case 'TreatmentInformation': { updateHitboxForTabClicks('treatment_information');break;}
				case 'AdherenceSupport': { updateHitboxForTabClicks('adherence_support');break;}
				case 'ConsumerAdvertising': { updateHitboxForTabClicks('consumer_advertising');break;}
			}
		}
		i = k.indexOf("_ctl00_Tab4");
		if (i > 0){
			k = k.substring(i + 11);
			switch(k){
				case '1': { updateHitboxForTabClicks('pfizer sites');break;}
				case '2': { updateHitboxForTabClicks('other sites');break;}
			}
		}
		i = k.indexOf("_ctl00_Tab2");
		if (i > 0){
			k = k.substring(i + 11);

			switch(k){
				case '1': { updateHitboxForTabClicks('bybrand');break;}
				case '2': { updateHitboxForTabClicks('byname');break;}
				case '3': { updateHitboxForTabClicks('bycondition');break;}
			}
		}
	}
}
function endsWith(txt, str){
    var i = txt.indexOf(str);
    if (i >= 0)  return str.length + i == txt.length;
    else  return false;
}
function _scPageView(path){
	var s = s_gi(sc_rsuite_id);
	s.pageName = path;
	s.t();
}
function getSCHomeTab(tabname) {
	if (tabname == "product_centers" || tabname == "Product Centers") return "pc";
	else if (tabname == "patient_education" || tabname == "Patient Education") return "pat ed";
	else if (tabname == "scientific_literature" || tabname == "Scientific Literature") return "sci lit";
	else return "updates";
}

function getSCContentType(contentTypeValue) {
	if (contentTypeValue == "scientific_literature" || contentTypeValue == "Scientific Literature") return "sci lit";
	else if (contentTypeValue == "professional_resources" || contentTypeValue == "Professional Resources") return "prof res";
	else if (contentTypeValue == "patient_education" || contentTypeValue == "Patient Education") return "pat ed";
	else if (contentTypeValue == "condition_information" || contentTypeValue == "Condition Information") return "cond info";
	else if (contentTypeValue == "indication" || contentTypeValue == "Indication") return "indication";
	else return "prod sum";
}

function getSCPatientEdTab(tabname) {
	if (tabname == "consumer_advertising" || tabname == "Consumer Advertising") return "consumer ad";
	else if (tabname == "adherence_support" || tabname == "Adherence Support") return "adhere support";
	else if (tabname == "treatment_information" || tabname == "Treatment Information") return "treatment info";
	else if (tabname == "condition_information" || tabname == "Condition Information") return "cond info";
	else return null;
}

function selectedTabs() {
	var tabs = new Array();
	tabs[0] = "FirstToggle";
	tabs[1] = "SecondToggle";
	tabs[2] = "ThirdToggle";

	var tabs_val = new Array();
	tabs_val[0] = "product";
	tabs_val[1] = "sci lit";
	tabs_val[2] = "pat ed";

	var selected_tabs = "";
	for (var i = 0; i < tabs.length; i++) {
		if (document.getElementById(tabs[i]).style.display != "none") {
			if (selected_tabs == "") {
				selected_tabs = tabs_val[i];
			} else {
				selected_tabs = selected_tabs + "/" + tabs_val[i];
			}
		}
	}
	return selected_tabs;
}

function showingHomeContent(obj) {
	var s = s_gi(sc_rsuite_id);
	s.prop1 = "pfp/home";
	s.prop2 = "pfp/home/" + selectedTabs();
	
	s.pageName = s.prop2;

	s.prop39 = s.pageName; //Current URL
	s.prop40 = s.getPreviousValue(s.prop39 , 'gpv_pageName', '');//Previous URL

	s.t();
}
function hidingingHomeContent(obj) {
	var s = s_gi(sc_rsuite_id);
	var selected_tabs = selectedTabs();
	s.prop1 = "pfp/home";
	if (selected_tabs == "") s.prop2 = "pfp/home";
	else s.prop2 = "pfp/home/" + selected_tabs;
	s.pageName = s.prop2;
	s.eVar3 = s.pageName;
	
	s.prop39 = s.pageName; //Current URL
	s.prop40 = s.getPreviousValue(s.prop39 , 'gpv_pageName', '');//Previous URL
	
	s.t();
}

function showingSpecialtyContent(obj) {
	var s = s_gi(sc_rsuite_id);
	s.linkTrackVars = 'prop1,prop2,prop3,prop4,eVar3,events,pageName';
	s.prop3 = s.prop2 + "/" + selectedSpecialtyTabs();
	if(s.prop3.toLowerCase().indexOf("specialtycenter") >= 0)
	{
		s.prop4 = s.prop3.replace("/resource","/resource" + selectedSpecialtySubTabs(s.prop3));
	}else{
		s.prop4 = s.prop3 + "/tab";
	}
	s.pageName = s.prop4;
	s.eVar3 = s.pageName;
	
	s.prop39 = s.pageName; //Current URL
	s.prop40 = s.getPreviousValue(s.prop39 , 'gpv_pageName', '');//Previous URL

	s.t();
}
function hidingingSpecialtyContent(obj) {
	var s = s_gi(sc_rsuite_id);
	var selected_tabs = selectedSpecialtyTabs();
	s.linkTrackVars = 'prop1,prop2,prop3,prop4,eVar3,events,pageName';
	if (selected_tabs == ""){ 
		s.prop3 = s.prop2;
		s.prop4 = s.prop3;
	}
	else 
	{
		s.prop3 = s.prop2 + "/" + selected_tabs;
		if(s.prop3.toLowerCase().indexOf("specialtycenter") >= 0)
		{
			s.prop4 = s.prop3.replace("/resource","/resource" + selectedSpecialtySubTabs(s.prop3));
		}else{
			s.prop4 = s.prop3 + "/tab";
		}
	}
	s.pageName = s.prop4;
	s.eVar3 = s.pageName;
	
	s.prop39 = s.pageName; //Current URL
	s.prop40 = s.getPreviousValue(s.prop39 , 'gpv_pageName', '');//Previous URL
	
	s.t();
}
function selectedSpecialtyTabs() {
	var tabs = new Array();
	tabs[0] = "FirstToggle";
	tabs[1] = "SecondToggle";
	tabs[2] = "ThirdToggle";
	tabs[3] = "FourthToggle";
	
	var tabs_val = new Array();
	tabs_val[0] = "news";
	tabs_val[1] = "resource";
	tabs_val[2] = "clinical";
	tabs_val[3] = "events";
	
	var selected_tabs = "";
	for (var i = 0; i < tabs.length; i++) {
		if (document.getElementById(tabs[i]).style.display != "none") {
			if (selected_tabs == "") {
				selected_tabs = tabs_val[i];
			} else {
				selected_tabs = selected_tabs + "/" + tabs_val[i];
			}
			
		}
	}
	return selected_tabs;
}

function selectedSpecialtySubTabs(tabs_val){
	var strCategories = document.getElementById('hdnCategories').value;
    var Categories = strCategories.split("|");

	var selected_tabs = "";

	
	for (var j = 0; j < Categories.length; j++) {
		if(Categories[j] == document.getElementById("divCategory").innerHTML)				
		{
			selected_tabs = selected_tabs + "/" + getSCContentType(Categories[j]) + " tab";
		}
	}
	
	return selected_tabs;
}

function onlineRequestTracking(obj, articles) {
	var s = s_gi(sc_rsuite_id);
	var s_prod = "";
	if (articles.indexOf(",") > 0){
		var ca = articles.split(",");
		s_prod = ";" + ca[0];
		for (var i = 1; i < ca.length; i++) s_prod = s_prod + ",;" + ca[i];
	} else s_prod = ";" + articles;
	s.linkTrackVars = 'products,prop14,prop46,eVar14,eVar23,eVar46,events';
	s.linkTrackEvents = 'event14';
	s.eVar14 = s.prop14 = selectedControl("lstCategory").toLowerCase();
	s.eVar46 = s.prop46 = getContentType(selectedControl("lstType")).toLowerCase();
	s.events = 'event14';
	s.products = s_prod;
	s.eVar23 = "online lit req save";
	s.tl(obj, "o", "online lit req save");
	s.linkTrackVars = "None";
	s.linkTrackEvents = "None";
	s.eVar14 = "";
	s.eVar23 = "";
	s.eVar46 = "";
	s.events = "";
	s.prop14 = "";
	s.prop46 = "";
	s.products = "";
	sleep(500);
}

function customLinkDownload(lnk){
	var s = s_gi(sc_rsuite_id);
	s.linkTrackVars = "eVar7,prop7,prop8,events"; 
	s.linkTrackEvents = "event4";
	s.events = 'event4';
	s.eVar7 = s.prop7 = lnk.substring(lnk.lastIndexOf("/") + 1, lnk.length); 
	s.prop8 = s.pageName; 
	s.tl(this, "o", lnk);
	s.linkTrackVars = "None";
	s.linkTrackEvents = "None";
	s.eVar7 = "";
	s.prop7 = "";
	s.prop8 = "";
	s.events = "";
}

function patientEducationTracking(obj) {
	var chkPatEdu = document.getElementsByName("chkPatEdu");
	var s_prod = "";
	for (var i = 0; i < chkPatEdu.length; i++){
		if (chkPatEdu[i].checked){
			if (s_prod == "") s_prod = ";" + chkPatEdu[i].value;
			else s_prod = s_prod + ",;" + chkPatEdu[i].value;
		}
	}
	if (s_prod != ""){
		var tmpSaccount = "";
		var v = document.getElementById("ddlProducts").value;
		if (v == "Select a Product"){ 
			v = document.getElementById("ddlCondition").value;
			tmpSaccount = GetBrandFromCondition(v);
			//alert(tmpSaccount);
		}else{
			tmpSaccount = document.getElementById("ddlProducts").value.toLowerCase();
		}
		
//		var localSuite = sc_rsuite_id;
		var localSuite = "";
		if(location.href.toLowerCase().indexOf("marketingweb.pfizer.com") < 0) 
	    {
	    	if(localSuite.indexOf(",pfizerpc") >= 0)
			{
				localSuite = localSuite.replace(/[,][p][f][i][z][e][r][p][c][^,]*/,"");
			}
	    
			if((tmpSaccount != "") && (localSuite.indexOf(",pfizerpc" + tmpSaccount) < 0)) 
			{
				localSuite = localSuite + ",pfizerpc" + tmpSaccount;
			}
		}
		
//		var s = s_gi(localSuite);
//		s.linkTrackVars = 'products,prop7,eVar7,prop14,eVar14,prop8,events';
//		s.linkTrackEvents = 'event4';
//		s.prop8 = s.pageName;
//		s.prop14 = s.eVar14 = v;
//		s.events = 'event4';
//		s.products = s_prod;
//		s.prop7 = s.eVar7 = "patient materials multi-file download";
//		s.tl(obj, "o", "customize patient education");

//		s.linkTrackVars = "None";
//		s.linkTrackEvents = "None";
//		s.prop7 = s.eVar7 = "";
//		s.prop14 = s.eVar14 = "";
//		s.prop8 = "";
//		s.events = "";
//		s.products = "";
		sleep(500);
	}
}
function pollEventTracking() {
//		var s = s_gi(sc_rsuite_id);
//		s.linkTrackVars = 'events';
//		s.linkTrackEvents = 'event20';
//		s.events = 'event20';
//		s.tl(this, "o", "poll tracking");
//		s.linkTrackVars = "None";
//		s.linkTrackEvents = "None";
//		s.events = "";
//		sleep(500);
}
function selectedControl(ctrlId) {
	for(i = 0; i < document.getElementById(ctrlId).childNodes.length; i++) {
		if (document.getElementById(ctrlId).childNodes[i].className == "navigationListSelected") 
			return document.getElementById(ctrlId).childNodes[i].innerHTML;
	}
	return "";
}


function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > milliseconds){
      break;
    }
  }
}


