function pageDomain() {
var urlArray = document.URL.split("/");
if (svcIndex = document.URL.indexOf("wssIV/") > 0) { return("www.test.ccstpa.com"); } // dev
return(urlArray[2]);
}

//function svcInd() {
//var svcIndex = document.URL.indexOf("/servicecenter/");
//if (svcIndex < 0) { svcIndex = document.URL.indexOf("elinktpamn.com/"); }

//svcIndex += 15;

//return (svcIndex);
//}

function pageBrand() {
return("servicecenter");
}

function pageID() {
return("bluelinktpa");
}

function pagePrt() {
var thePrt = "";
var prtIndex = document.URL.indexOf("?testPort=");

if (prtIndex >= 0) { thePrt = document.URL.substring(prtIndex+10); }

return(thePrt);
}

var urlDomain = pageDomain();
var urlBrand = pageBrand();
var urlID = pageID();
var urlPrt = pagePrt();

//var findADoctorURL = "http://" + urlDomain + "/eConsumer" + urlPrt + "/landing/landingFindADoctorFrame.action?id=" + urlBrand;
var registerURL = "https://" + urlDomain + "/oca/eConsumer/portal/ccs/SignIn/SelfRegistration";
var forgotPasswordURL = "https://" + urlDomain + "/oca/eConsumer/portal/ccs/SignIn/PasswordHelp";
var signInURL = "https://" + urlDomain + "/oca/eConsumer/portal/ccs";

//function findADoctor() {
//window.location = findADoctorURL;
//}

function register() {
window.location = registerURL;
}

function forgotPassword() {
window.location = forgotPasswordURL;
}

function signIn() {
window.location = signInURL;
}

//--- Pop up window and support routines

function newWindow(theURL) {
window.open(theURL,"","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1");
}

var popWindow;

function confirmWindow_WH(popupURL, wid, ht) {
	if (popWindow) {
		if (popWindow.closed == false) {
			popWindow.focus();
		}
	}
	popWindow = window.open(popupURL,"BCBSMN2","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=" + wid + ",height=" + ht);
}

function confirmWindow(popupURL) {
	confirmWindow_WH(popupURL, 500, 300);
}

function confirmPopup(popupURL) {
	confirmWindow("../public/popup/generalConfirm.html?loc=" + popupURL);
}

function confirmPopupSAM(whichLocation)	{
	confirmWindow("../landing_shared/confirmPopupSA.html?loc=" + whichLocation);
}

function confirmPopupG(htmlPage, whichLocation)	{
	confirmWindow(htmlPage + "?loc=" + whichLocation);
}

function printPage() {
	if (window.print) {
		window.print();
	}
	else if(navigator.appVersion.indexOf("Mac")!=-1)	{
		alert('Your system does not support this function. Use the "print" button from your browser.');
	}
}