function popOver(id) {
	if(document.getElementById(id).style.display == "block") {
		document.getElementById(id).style.display = "none";
	}
	else {
		document.getElementById(id).style.display = "block";
	}
	return false;
}

/* Segmentation*/
var herceptinFolder = "treating-her2-breast-cancer";
var herceptinURLs = new Array();
/* No Segment */
herceptinURLs[0] = new Array();
herceptinURLs[0][0] = "default.htm";
herceptinURLs[0][1] = "breast-cancer-101";
herceptinURLs[0][2] = "what-is-her2-breast-cancer";
herceptinURLs[0][3] = "treatment-her2-breast-cancer";
herceptinURLs[0][4] = "your-pathology-report-guide";
herceptinURLs[0][5] = "breast-cancer-glossary";
herceptinURLs[0][6] = "benefits-start-adjuvant-treatment";
herceptinURLs[0][7] = "possible-side-effects-of-treatment";
herceptinURLs[0][8] = "dr-que-adjuvant-recent";
herceptinURLs[0][9] = "what-to-expect-treatment";
herceptinURLs[0][10] = "benefits-add-adjuvant-treatment";
herceptinURLs[0][11] = "possible-side-effects-of-treatment-2";
herceptinURLs[0][12] = "dr-que-adjuvant-no-treatment";
herceptinURLs[0][13] = "benefits-staying-adjuvant-treatment";
herceptinURLs[0][14] = "possible-side-effects-of-treatment-3";
herceptinURLs[0][15] = "dr-que-adjuvant-on-treamtment";
herceptinURLs[0][16] = "adjuvant-video";
herceptinURLs[0][17] = "cardiac-monitoring";
herceptinURLs[0][18] = "benefits-treatment-metastatic";
herceptinURLs[0][19] = "possible-side-effects-of-treatment-4";
herceptinURLs[0][20] = "length-of-treatment";
herceptinURLs[0][21] = "dr-que-metastatic";
herceptinURLs[0][22] = "metastatic-video";
/* Segment 1 */
herceptinURLs[1] = new Array();
herceptinURLs[1][0] = "her2-status-unknown";
herceptinURLs[1][1] = "breast-cancer-101";
herceptinURLs[1][2] = "what-is-her2-breast-cancer";
herceptinURLs[1][3] = "treatment-her2-breast-cancer";
herceptinURLs[1][4] = "your-pathology-report-guide";
herceptinURLs[1][5] = "breast-cancer-glossary";
herceptinURLs[1][6] = "possible-side-effects-of-treatment";
/* Segment 2 */
herceptinURLs[2] = new Array();
herceptinURLs[2][0] = "metastatic";
herceptinURLs[2][1] = "treatment-her2-breast-cancer-5";
herceptinURLs[2][2] = "benefits-treatment-metastatic";
herceptinURLs[2][3] = "possible-side-effects-of-treatment-4";
herceptinURLs[2][4] = "length-of-treatment";
herceptinURLs[2][5] = "dr-que-metastatic";
herceptinURLs[2][6] = "possible-side-effects-of-treatment";
herceptinURLs[2][7] = "cardiac-monitoring-2";
herceptinURLs[2][8] = "metastatic-video";
herceptinURLs[2][9] = "breast-cancer-glossary-5";
/* Segment 3 */
herceptinURLs[3] = new Array();
herceptinURLs[3][0] = "adjuvant-on-treatment";
herceptinURLs[3][1] = "treatment-her2-breast-cancer-4";
herceptinURLs[3][2] = "benefits-staying-adjuvant-treatment";
herceptinURLs[3][3] = "possible-side-effects-of-treatment-4";
herceptinURLs[3][4] = "dr-que-adjuvant-on-treamtment";
herceptinURLs[3][5] = "adjuvant-video-3";
herceptinURLs[3][6] = "cardiac-monitoring";
herceptinURLs[3][7] = "breast-cancer-glossary-4";
/* Segment 4 */
herceptinURLs[4] = new Array();
herceptinURLs[4][0] = "adjuvant-new-diagnosis";
herceptinURLs[4][1] = "breast-cancer-101-2";
herceptinURLs[4][2] = "treatment-her2-breast-cancer-2";
herceptinURLs[4][3] = "benefits-start-adjuvant-treatment";
herceptinURLs[4][4] = "possible-side-effects-of-treatment-2";
herceptinURLs[4][5] = "dr-que-adjuvant-recent";
herceptinURLs[4][6] = "what-to-expect-treatment";
herceptinURLs[4][7] = "adjuvant-video";
herceptinURLs[4][8] = "breast-cancer-glossary-2";
/* Segment 5 */
herceptinURLs[5] = new Array();
herceptinURLs[5][0] = "adjuvant-previous-diagnosis";
herceptinURLs[5][1] = "treatment-her2-breast-cancer-3";
herceptinURLs[5][2] = "benefits-add-adjuvant-treatment";
herceptinURLs[5][3] = "possible-side-effects-of-treatment-3";
herceptinURLs[5][4] = "dr-que-adjuvant-no-treatment";
herceptinURLs[5][5] = "what-to-expect-treatment-2";
herceptinURLs[5][6] = "adjuvant-video-2";
herceptinURLs[5][7] = "breast-cancer-glossary-3";
herceptinURLs[3][8] = "cardiac-monitoring-3";

/* CTA URLS */

var ctaNav = new Array();
ctaNav[0] = new Array();
ctaNav[0][0] = "What Is HER2+?|/treating-her2-breast-cancer/what-is-her2-breast-cancer";
ctaNav[0][1] = "Explore Herceptin (trastuzumab) Treatment|/treating-her2-breast-cancer/benefits-start-adjuvant-treatment";
ctaNav[0][2] = "Learn about Herceptin|/treating-her2-breast-cancer/treatment-her2-breast-cancer";
ctaNav[1] = new Array();
ctaNav[1][0] = "Learn about Herceptin (trastuzumab)|/treating-her2-breast-cancer/treatment-her2-breast-cancer";
ctaNav[1][1] = "Know Your HER2 Status|/treating-her2-breast-cancer/what-is-her2-breast-cancer";
ctaNav[1][2] = "Explore the Breast Cancer Glossary|/treating-her2-breast-cancer/breast-cancer-glossary";
ctaNav[2] = new Array();
ctaNav[2][0] = "Learn about Herceptin (trastuzumab)|/treating-her2-breast-cancer/treatment-her2-breast-cancer";
ctaNav[2][1] = "Ask Your Doctor the Right Questions|/treating-her2-breast-cancer/dr-que-metastatic";
ctaNav[2][2] = "Explore the Breast Cancer Glossary|/treating-her2-breast-cancer/breast-cancer-glossary";
ctaNav[3] = new Array();
ctaNav[3][0] = "Explore Herceptin (trastuzumab) Treatment|/treating-her2-breast-cancer/benefits-staying-adjuvant-treatment";
ctaNav[3][1] = "Ask Your Doctor the Right Questions|/treating-her2-breast-cancer/dr-que-adjuvant-on-treamtment";
ctaNav[3][2] = "Learn from Other Patients|/treating-her2-breast-cancer/adjuvant-video";
ctaNav[4] = new Array();
ctaNav[4][0] = "Learn about Herceptin|/treating-her2-breast-cancer/treatment-her2-breast-cancer";
ctaNav[4][1] = "Ask Your Doctor the Right Questions|/treating-her2-breast-cancer/dr-que-adjuvant-recent";
ctaNav[4][2] = "Explore Herceptin (trastuzumab) Treatment|/treating-her2-breast-cancer/benefits-start-adjuvant-treatment";
ctaNav[5] = new Array();
ctaNav[5][0] = "Learn about Herceptin|/treating-her2-breast-cancer/treatment-her2-breast-cancer";
ctaNav[5][1] = "Explore Herceptin (trastuzumab) Treatment|/treating-her2-breast-cancer/benefits-add-adjuvant-treatment";
ctaNav[5][2] = "Ask Your Doctor the Right Questions|/treating-her2-breast-cancer/dr-que-adjuvant-no-treatment";

/* Retrieve and process querystring */
function QueryString(key){
  var value = null;
  for (var i=0;i<QueryString.keys.length;i++)  {
    if (QueryString.keys[i]==key)    {
      value = QueryString.values[i];
      break;
    }
  }
  return value;
}
QueryString.keys = new Array();
QueryString.values = new Array();
function QueryString_Parse() {
  var query = window.location.search.substring(1);
  var pairs = query.split("&");

  for (var i=0;i<pairs.length;i++)  {
    var pos = pairs[i].indexOf('=');
    if (pos >= 0)    {
      var argname = pairs[i].substring(0,pos);
      var value = pairs[i].substring(pos+1);
      QueryString.keys[QueryString.keys.length] = argname;
      QueryString.values[QueryString.values.length] = value;
    }
  }
}
QueryString_Parse();
var qs_segment =  Number(QueryString("segment"));
var qs_segment_string = '';
if (qs_segment) {
	qs_segment_string = '?segment=' + qs_segment;
}

/* Change current page if landing page */
var curURL = window.location.toString().split("?")[0];
if (qs_segment) { /* If there is a segment */
	if (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == "default.htm") { /* Segment & Default page, change to correct landing page */
		window.location = herceptinURLs[qs_segment][0] + qs_segment_string;
	}
	else if (((curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[1][0]) || (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[2][0]) || (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[3][0]) || (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[4][0]) || (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[5][0])) && curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) != herceptinURLs[qs_segment][0]) {
		window.location = herceptinURLs[qs_segment][0] + qs_segment_string;
	}
}
else { /* If there is no segment, go to each segment's first page */
	if (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[1][0]) {
		window.location = herceptinURLs[1][1];
	}
	else if (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[2][0]) {
		window.location = herceptinURLs[2][1];
	}
	else if (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[3][0]) {
		window.location = herceptinURLs[3][1];
	}
	else if (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[4][0]) {
		window.location = herceptinURLs[4][1];
	}
	else if (curURL.substring((curURL.lastIndexOf("/")+1),curURL.length) == herceptinURLs[5][0]) {
		window.location = herceptinURLs[5][1];
	}
}

function herceptinSeg() {
	if (qs_segment) { /* If a segment is set */
		/* Left Navigation Adjustments */
		var leftNav = document.getElementById('colSn_rdr').getElementsByTagName('A');
		for (var i=0; i<leftNav.length; i++) {
			if (leftNav[i].href.substring((leftNav[i].href.lastIndexOf("/")+1),leftNav[i].href.length) == herceptinURLs[1][0]) {
				leftNav[i].href = herceptinURLs[1][1];
			}
			else if (leftNav[i].href.substring((leftNav[i].href.lastIndexOf("/")+1),leftNav[i].href.length) == herceptinURLs[2][0]) {
				leftNav[i].href = herceptinURLs[2][1];
			}
			else if (leftNav[i].href.substring((leftNav[i].href.lastIndexOf("/")+1),leftNav[i].href.length) == herceptinURLs[3][0]) {
				leftNav[i].href = herceptinURLs[3][1];
			}
			else if (leftNav[i].href.substring((leftNav[i].href.lastIndexOf("/")+1),leftNav[i].href.length) == herceptinURLs[4][0]) {
				leftNav[i].href = herceptinURLs[4][1];
			}
			else if (leftNav[i].href.substring((leftNav[i].href.lastIndexOf("/")+1),leftNav[i].href.length) == herceptinURLs[5][0]) {
				leftNav[i].href = herceptinURLs[5][1];
			}
			leftNav[i].href = leftNav[i].href + qs_segment_string;
		}
		/* Next Navigation Adjustments */
		var nextNav = document.getElementById('NextPulldown').getElementsByTagName('OPTION');
		for (var i=0; i<nextNav.length; i++) {
			nextNav[i].value = nextNav[i].value + qs_segment_string;
			if (s_furl.substring((s_furl.lastIndexOf("/")+1),s_furl.length) == nextNav[i].value.split("?")[0].substring((nextNav[i].value.lastIndexOf("/")+1),nextNav[i].value.length)) {
				nextNav[i+1].selected = true;
			}
		}
		/* CTA Adjustments 
		var rightRail = document.getElementById('cta_nav_rdr').getElementsByTagName('A');
		for (var i=0; i<rightRail.length; i++) {
			if (rightRail[i].href.indexOf(herceptinFolder) != -1 && ctaNav[qs_segment][i]) {
				rightRail[i].innerHTML = ctaNav[qs_segment][i].split("|")[0];
				rightRail[i].href = ctaNav[qs_segment][i].split("|")[1];
			}
		}
		highlightNav("cta_nav_rdr",s_pn);*/
		/* Right Rail Adjustments */
		var rightRail = document.getElementById('thirdCol_ctr').getElementsByTagName('A');
		for (var i=0; i<rightRail.length; i++) {
			if (rightRail[i].href.indexOf(herceptinFolder) != -1 && rightRail[i].href.indexOf("#") == -1) {
				rightRail[i].href = rightRail[i].href + qs_segment_string;
			}
		}
		/* Poll Modification */
		var divs = document.getElementById('ContentPane24').getElementsByTagName('div');
		if(divs.length > 0 && curURL.indexOf("-poll") == -1) {
			var polls = new Array;
			var pollbtm = new Array;
			var p = 0;
			var b = 0;
			for(var i=0; i<divs.length; i++) {
				if(divs[i].className == "poll_rdr") { polls[p] = divs[i]; p++; }
				else if(divs[i].className == "poll_bottom_fmt") { pollbtm[b] = divs[i]; b++; }
			}
			polls[(qs_segment-1)].style.display = "block";
			pollbtm[(qs_segment-1)].style.display = "block";
			divs[(divs.length-1)].style.display = "block";
			var inputItems = document.getElementById('thirdCol_ctr').getElementsByTagName('input');
			for (var i=0; i<inputItems.length; i++) {
				if (inputItems[i].value.indexOf(herceptinFolder) != -1) {
					inputItems[i].value = inputItems[i].value + qs_segment_string;
				}
			}
		}
		/* Page Link Adjustments */
		if (document.getElementById('middleContent_fmt')) {
			var pageLinkURLs = document.getElementById('middleContent_fmt').getElementsByTagName('A');
			for (var i=0; i<pageLinkURLs.length; i++) {
				var curLink = pageLinkURLs[i].href.split("?")[0];
				if (pageLinkURLs[i].href.indexOf(herceptinFolder) != -1 && pageLinkURLs[i].href.indexOf("segment") == -1) {
					pageLinkURLs[i].href = curLink + qs_segment_string;
				}
			}
			if(document.getElementById('start_over')) {
				document.getElementById('start_over').href = document.getElementById('start_over').href.split("?")[0];
			}
		}
	}
	else {
		var divs = document.getElementById('ContentPane24').getElementsByTagName('div');
		var polls = new Array;
		var pollbtm = new Array;
		var p = 0;
		var b = 0;
		for(var i=0; i<divs.length; i++) {
			if(divs[i].className == "poll_rdr") { polls[p] = divs[i]; p++; }
			else if(divs[i].className == "poll_bottom_fmt") { pollbtm[b] = divs[i]; b++; }
		}
		polls[0].style.display = "block";
		pollbtm[0].style.display = "block";
		divs[(divs.length-1)].style.display = "block";
	}
}
/*===================================================*/
/* Rotating Tips */
var tipsHer = new Array();
tipsHer[1] = new Array();
tipsHer[1][0] = "HER2+ breast cancer is aggressive, so it is important to find out your cancer's HER2 status.";
tipsHer[1][1] = "Too much HER2 protein is thought to cause cancer cells to grow and divide more quickly. This is why HER2+ breast cancer is aggressive.";
tipsHer[1][2] = "A tumor's HER2 status is not hereditary.";
tipsHer[1][3] = "/treating-her2-breast-cancer/what-is-her2-breast-cancer";

tipsHer[2] = new Array();
tipsHer[2][0] = "Herceptin has over a decade of clinical experience in over 562,000 patients with HER2+ breast cancer.";
tipsHer[2][1] = "Weekly treatments with Herceptin helped reduce the size of HER2+ breast cancer tumors that had spread to other parts of the body.";
tipsHer[2][2] = "Approximately 25 % of women with breast cancer have a genetic alteration in the HER2 gene.";
tipsHer[2][3] = "/treating-her2-breast-cancer/dr-que-metastatic";

tipsHer[3] = new Array();
tipsHer[3][0] = "Women with HER2+ breast cancer may be more likely to have a recurrence of their cancer.";
tipsHer[3][1] = "It is recommended that Herceptin be taken for 1 year.";
tipsHer[3][2] = "HER2+ breast cancer with Herceptin plus chemotherapy can increase the chance of living longer.";
tipsHer[3][3] = "/treating-her2-breast-cancer/dr-que-adjuvant-on-treamtment";

tipsHer[4] = new Array();
tipsHer[4][0] = "Women who received Herceptin with chemotherapy had a lower risk of breast cancer returning compared with those who received chemotherapy alone.";
tipsHer[4][1] = "Herceptin Is the First FDA-Approved Targeted Biologic for HER2+ Breast Cancer";
tipsHer[4][2] = "Treating HER2+ breast cancer with Herceptin plus chemotherapy can increase the chance of living longer.";
tipsHer[4][3] = "/treating-her2-breast-cancer/dr-que-adjuvant-recent";

tipsHer[5] = new Array();
tipsHer[5][0] = "To help prevent cancer from coming back, patients may be given adjuvant therapy. Adjuvant means \"in addition to.\"";
tipsHer[5][1] = "Women who received 1 year of Herceptin had a lower risk of cancer returning than women who did not receive Herceptin.";
tipsHer[5][2] = "HER2+ breast cancer with Herceptin plus chemotherapy can increase the chance of living longer.";
tipsHer[5][3] = "/treating-her2-breast-cancer/dr-que-adjuvant-no-treatment";

function rotateTips() {
	var l = (qs_segment) ? qs_segment : 1;
	var b = Math.round(Math.random()*2);
	var tipTxt = document.getElementById('rotate').getElementsByTagName('A')[0];
	tipTxt.href = tipsHer[l][3];
	tipTxt.innerHTML = tipsHer[l][b];
}

/* Doctor Discussion Pages */
var strCookieString = new String();
function AddCookieString(strName, strValue) {
	if (strCookieString.indexOf(strName) != -1) {
		var oldval = getValue(strName, strCookieString);
		var s = strName + '|' + oldval + '|';
		strCookieString = strCookieString.replace(s, strName + "|" + strValue + "|");
	}
	else {
		strCookieString += ( strName + "|" + strValue + "|" );
	}
}
function setCookie(theName, theValue) {
  var theCookie = theName + "=" + escape(theValue) + ";";
  //theCookie += ";secure";
  document.cookie = theCookie;
}
function getCookie(cookieName) {
  var strResults = new String();
  var offset = 0;
  var end = 0;
  var strSearch = new String(cookieName) + "="; 
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf( strSearch);
    if (offset != -1) {
      offset += strSearch.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) {
        end = document.cookie.length;
      }
      strResults = unescape(document.cookie.substring(offset, end));
    }
  }
  return strResults;
}
function getValue(strName, strCookieString) {
  var strResults = new String( "" );
  var offset = 0;
  var end = 0;
  var strSearch = new String( strName + "|" );
  if ( strCookieString.length > 0 ) { 
    offset = strCookieString.indexOf( strSearch );
    if ( offset != -1 ) { 
      offset += strSearch.length;
      end = strCookieString.indexOf( "|", offset );
      if ( end == -1 ) {
        end = strCookieString.length;
      }
      strResults = strCookieString.substring( offset, end );
    }
  }
  return strResults;
}
function deleteCookie(name,path) { 
	if(getCookie(name)) { 
		document.cookie = name+"="+((path)?"; path="+path:"") + ";secure"  //+"; expires=Thu, 01-Jan-70 00:00:01 GMT"; 
	} 
}
function ClearGUID() {
	deleteCookie("sdc_strattera_guid", "/");
}
function isNothing(x) {
  if ( typeof(x) == "undefined" || x == null || x == "" || x == "undefined" ) {
    return true;
  }
  else {
    return false;
  }
}
function launchPrintFriendly(f) {
	if (!isNothing(f.doctor_q.value)) {
		AddCookieString("doctor_q",f.doctor_q.value);
	}
	if (!isNothing(f.nurse_q.value)) {
		AddCookieString("nurse_q",f.nurse_q.value);
	}
	setCookie("herceptin_" + f.name,strCookieString);
	window.open('?print=true', 'subWin', 'resizable=yes,scrollbars=yes,width=620,height=700');
	return false;
}
function printFriendly(name) {
	if (pf_param == "true") {
		window.print();
		return sl(this,'','prnt');
	}
	else {
		launchPrintFriendly(document.forms[name]);
	}
}