///////////////////////////////////////////////////////////////////////////////////////
var _bpDev = new BpDev();


///////////////////////////////////////////////////////////////////////////////////////
function BpDev() {
	this._debug = true;
	this.isDebug = __isDebug;

	function __isDebug() {
		return this._debug;
	}


}
function printerfriendly(theURL,winName,features) {
var newwin = window.open(theURL,winName,features);
newwin.focus();
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Toggels images
// parm: targetImageName : String - the name of the image to replace
// parm: newImgSource : String - the name and path of the image to replate the target image with
//
// return: void
function toggleImage(targetImageName, newImgSource) {
	
	if (_bpDev.isDebug()) {
		if (targetImageName == null || newImgSource == null || targetImageName == "" || 
			newImgSource == "") {
			alert("Error : toggleImage : targetImageName parm or newImgSource parm is null or empty.");
		}
	}
	document.images[targetImageName].src = newImgSource;
}


//Begin Navigation Hash Table

/*
The theory below shows how to define an element in the hash table:
myHashTable['/relative_path_to_file.jsp'] = 'reqNavID';
 
To put the theory in practice, you may have an element which looks like the following:
myHashTable['/disease_information/disease_information.jsp'] = '1';

Common pages or pages which do not have a left-hand link can have a null value for the reqNavID:
myHashTable['/common_pages/common_file.jsp'] = '';

Refer to existing sites' hash tables for additional reference.
*/

var myHashTable = new Object();

// a portion has been started below:
//about cialis
myHashTable['/about_cialis/02.jsp'] = '1.0';
myHashTable['/about_cialis/02_01.jsp'] = '1.2';
myHashTable['/about_cialis/02_02.jsp'] = '1.3';
myHashTable['/about_cialis/02_03.jsp'] = '1.4';
myHashTable['/about_cialis/02_04.jsp'] = '1.5';
myHashTable['/about_cialis/02_05.jsp'] = '1.6';
myHashTable['/about_cialis/02_08.jsp'] = '1.6.1';
myHashTable['/about_cialis/02_06.jsp'] = '1.7';

//about ed
myHashTable['/about_ed/03.jsp'] = '2.0';
myHashTable['/about_ed/03_01.jsp'] = '2.2';
myHashTable['/about_ed/03_02.jsp'] = '2.3';
myHashTable['/about_ed/03_03.jsp'] = '2.4';
myHashTable['/about_ed/03_03A.jsp'] = '2.4.1';
myHashTable['/about_ed/03_03B.jsp'] = '2.4.2';
myHashTable['/about_ed/03_03C.jsp'] = '2.4.3';
myHashTable['/about_ed/03_03D.jsp'] = '2.4.4';
myHashTable['/about_ed/03_04.jsp'] = '2.5';
myHashTable['/about_ed/03_04A.jsp'] = '2.5.1';
myHashTable['/about_ed/03_04B.jsp'] = '2.5.2';
myHashTable['/about_ed/03_05.jsp'] = '2.6';

//talking to your doctor
myHashTable['/talking_to_your_doctor/04.jsp'] = '3.0';
myHashTable['/talking_to_your_doctor/04_01.jsp'] = '3.2';
myHashTable['/talking_to_your_doctor/04_02.jsp'] = '3.3';
myHashTable['/talking_to_your_doctor/04_02A.jsp'] = '3.3.1';
myHashTable['/talking_to_your_doctor/04_02B.jsp'] = '3.3.2';
myHashTable['/talking_to_your_doctor/04_02C.jsp'] = '3.3.3';
myHashTable['/talking_to_your_doctor/04_03.jsp'] = '3.4';

//help for partners
myHashTable['/help_for_partners/05.jsp'] = '4.0';
myHashTable['/help_for_partners/05_01.jsp'] = '4.2';
myHashTable['/help_for_partners/05_02.jsp'] = '4.3';
myHashTable['/help_for_partners/05_03.jsp'] = '4.4';
myHashTable['/help_for_partners/05_03A.jsp'] = '4.4.1';
myHashTable['/help_for_partners/05_03B.jsp'] = '4.4.2';
myHashTable['/help_for_partners/05_03C.jsp'] = '4.4.3';
myHashTable['/help_for_partners/05_04.jsp'] = '4.5';
myHashTable['/help_for_partners/05_05.jsp'] = '4.6';
myHashTable['/help_for_partners/05_06.jsp'] = '4.7';
myHashTable['/help_for_partners/05_07.jsp'] = '4.8';

//sexual health
myHashTable['/sexual_health/06.jsp'] = '5.0';
myHashTable['/sexual_health/06_01.jsp'] = '5.2';
myHashTable['/sexual_health/06_02.jsp'] = '5.3';
myHashTable['/sexual_health/06_03.jsp'] = '5.4';
myHashTable['/sexual_health/06_04.jsp'] = '5.5';
myHashTable['/sexual_health/06_05.jsp'] = '5.6';

//function name: getNavId
//function: called from getID, takes in page name, returns pageNavId	
//function name: getNavId
//function: called from getID, takes in page name, returns pageNavId	
function getNavId (whatPage) {
	var myNavId = myHashTable[whatPage];
	return myNavId;
}
//function name: getID
//function: is called from the links in order to call getNavId function and determine the links navigation ID
function getID(pageName) {
	//only capture up to the .jsp", and do not capture characters after
	//getDot returns the number where the dot hits
	var getDot = pageName.indexOf('.');
	//add 4 to get dot to get the first char after the dot
	getDot+=4;
	var newString = pageName.substring(0,getDot);
	var appendMe = getNavId(newString);
	if(appendMe!=''){
		var finalURL = pageName + "?reqNavId=" + appendMe;
	}else{
		var finalURL = pageName;
	}
	window.location.href = finalURL;
}
//End Navigation Hash Table



