<!-- Begin
// These are multi use functions
function giveFocus(thisPageName) {
if (document.forms.length > 0) {
var field = document.forms[0];
if (thisPageName != "answerQuestion") {
	for (i = 0; i < field.length; i++) {
	if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
	document.forms[0].elements[i].focus();
	break;
			 }
		  } // end here
	  } else {
				/*for (i = 0; i < field.length; i++) {
					fieldName = field.elements[i].name;
					alert("!!** " + fieldName);
					if (fieldName == "searchByText") {
						alert("***** " + fieldName + " matches with " + field.length + " elements");
					}
					if (((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) && fieldName == "questionAnswer") {
						alert("It matches");
					document.forms[0].elements[i].focus();
					break;
							 }
						  }*/ 
		  window.document.questForm.questionAnswer.focus();
	  }
   }
}

function verifySecure() {
var myUrl = document.URL;
var removechars = ":";
//alert(myUrl);
var urlBase = "https" + myUrl.substring(4);
var serverPort = "<%=serverType%>";
if (myUrl.indexOf("https") < 0) {
	// this means it is not secure so forward it.
	dec = myUrl.indexOf(removechars);
	urlBaseA = myUrl.substring(dec+1);
	urlBaseB = urlBaseA;
	if (serverPort != "") {
	decPlus = urlBaseA.indexOf(removechars);
	urlBaseC = urlBaseA.substring(0,decPlus) + "<%=serverType%>" + urlBaseA.substring(decPlus+5);
	} else {
	urlBaseC = urlBaseA;
	}
	urlBase = "https:" + urlBaseC;
	window.location.href = urlBase;
	//alert(urlBaseA + "\n" + urlBaseB + "\n" +urlBaseC );
}
}

function getSelectedValue(selectObject) {
	return selectObject.options[selectObject.selectedIndex].value
	}

function getSelectedIndex(selectObject) {
	return selectObject.options[selectObject.selectedIndex]
	}

function openPop(url) {
	var page=url;
	var thisURL="referer=" + document.URL;
	
	tourWindow = window.open(page, "", "width=740,height=500,top=5,left=150,location=no,menubar=yes,directories=no,toolbar=yes,scrollbars=yes,resizable=yes,status=yes");
}

function openBiblePop(url) {
	var pgBase="http://www.biblegateway.com/bible?passage=";
	var page=pgBase+url;
	var thisURL="referer=" + document.URL;
	var myPop=1;
	//alert("The url is: " + page);
				
	/*if(url.indexOf("medcohealth")==-1) {
		isMerck=0;
	}
		if(isMerck==1) {
		page="/provider/providerUrl.jsp?ppoUrl=" + url + "&pharmCd=MerckPharmacy&referer=<%= request.getRequestURI() %>" ;		
		}*/
	if (myPop==1) {
	userWindow = window.open(page, "", "width=640,height=450,top=5,left=150,location=no,menubar=no,directories=no,toolbar=yes,scrollbars=yes,resizable=yes,status=yes");
	} else {		
		window.location.href = page;
	}
}
function openSzd(url,ht,wt) {
	var page=url;
	var pgHt = ht;
	var pgWt = wt;
	var thisURL="referer=" + document.URL;
	var myPop=1;	
	if (myPop==1) {
	sizedWindow = window.open(page, "", "width=" + pgHt + ",height=" + pgWt + ",top=5,left=150,location=no,menubar=yes,directories=no,toolbar=yes,scrollbars=yes,resizable=yes,status=yes");
	} else {		
		window.location.href = page;
	}
}


/*function doSearch() {
	alert("i got there");
	clearForm();
	var searchField = "termNames";
	if (window.document.form.searchByText.value == null || window.document.form.searchByText.value == "") {
		alert("Please enter your search criteria before continuing.") 
	} else { 
		window.parent.findTerms(searchField, window.document.form.searchByText.value);
	}
}
function clearForm() {
	//window.parent.resultForm.document.open();
	//window.parent.resultForm.document.close();	
	//resultForm.close();
}*/
//  End -->
