function OpenGuide(GuideName) {
	sFeatures="location=no,menubar=no,resizable=no,status=no,toolbar=no,width=640,height=500,scrollbars=yes";
	window.open("../TVGuide/guide.asp?gn="+GuideName,"guide",sFeatures);
}

function OpenNewGuide(GuideSelect) {
	var chCode = "" + GuideSelect.options[GuideSelect.selectedIndex].value;
	if (chCode!="") { 
		chCode = chCode + ":" + GuideSelect.networkname + " - " + GuideSelect.options[GuideSelect.selectedIndex].innerText;
		sFeatures="location=no,menubar=no,resizable=no,status=no,toolbar=no,width=700,height=500,scrollbars=yes";
		var myWin = window.open("../TVGuide/eguide.asp?ch="+chCode,"guide",sFeatures);
		myWin.focus();
		GuideSelect.selectedIndex=0;
	}
}

function setButtonStyle(iElem) {
	if (iElem.nextSibling.innerText=="text/graphic") {
		iElem.innerHTML = "<img src='" + iElem.icon + "' width=16 height=16 align=absmiddle>&nbsp;" + iElem.text;
	} else {
		if (iElem.nextSibling.innerText=="graphic") {
			iElem.innerHTML = "<img src='" + iElem.icon + "' width=16 height=16 align=absmiddle>";
		} else {
			if (iElem.nextSibling.innerText=="text") {
				iElem.innerHTML = iElem.text;
			}
		}
	}
}

function positionDIV() {
	var oDimensions=getObjectDimensions(frameBox);
	tblDIV.style.top=parseInt(oDimensions[0])+4;
	tblDIV.style.left=parseInt(oDimensions[1])+4;
	tblDIV.zIndex=999;
}

function enumSelections() {
	if (enumSelections.arguments.length<2) return "";
	var bAllInList=0;
	var fElem = enumSelections.arguments[0];
	var labelElem = enumSelections.arguments[1];
	if (enumSelections.arguments.length==3) var bAllInList = enumSelections.arguments[2];
	var selCount=0;
	var sSelections = "";
	var sSelectionsTitle = "";

	for (var rIndex=0;rIndex<fElem.options.length;rIndex++) {
		if (fElem.options[rIndex].selected) {
			selCount++;
			sSelections += fElem.options[rIndex].innerText + ", ";
			sSelectionsTitle += fElem.options[rIndex].innerText + ",\r";
		}
	}
	if (sSelections.length>0) {
		sSelections=sSelections.substr(0,sSelections.length-2);
	} else { sSelections = ((bAllInList==0) ? "[None Selected]" : "All in List"); }
	if (sSelectionsTitle.length>0) {
		sSelectionsTitle=sSelectionsTitle.substr(0,sSelectionsTitle.length-2);
	} else { sSelectionsTitle = ((bAllInList==0) ? "[None Selected]" : "All in List"); }
	//labelElem.value = selCount + " Selections."
	labelElem.value=sSelections;
	labelElem.title=sSelectionsTitle;
}

function clearFormData(sFormName) {
	var oForm = eval(sFormName);
	for (var fIndex=0;fIndex<oForm.all.length;fIndex++) {
		var fElem=oForm.all[fIndex];
		if ((fElem.tagName=="INPUT") && (!fElem.disabled)) {
			if (fElem.type=="checkbox") { fElem.checked=false; fElem.fireEvent("onchange"); }
		}
	}
}

function loadFormData(sFormName, sFormField, sFieldData) {
	var oForm = eval(sFormName);
	for (var fIndex=0;fIndex<oForm.all.length;fIndex++) {
		var fElem=oForm.all[fIndex];
		if ((fElem.name==sFormField) && (!fElem.disabled)) {
			switch (fElem.tagName) {
				case "INPUT":
					switch (fElem.type)  {
						case "checkbox":
			 				if (fElem.value==sFieldData) { fElem.checked=true; fElem.fireEvent("onchange"); return true; }
			 				break;
						case "radio":
							if (fElem.value==sFieldData) { fElem.click();fElem.fireEvent("onchange"); return true; }
							break;
						case "text":
				 			fElem.value=sFieldData;
				 			fElem.fireEvent("onchange");
				 			return true;
				 			break;
						default:
							break;
							// Do Nothing
					}
				case "TEXTAREA":
					fElem.innerText = sFieldData;
					fElem.fireEvent("onchange");
					return true;
					break;
				case "SELECT":
					switch (fElem.type) {
						case "select-one":
							for (var rIndex=0;rIndex<fElem.options.length;rIndex++) {
								if (fElem.options[rIndex].value==sFieldData) fElem.selectedIndex=rIndex;
							}
							fElem.fireEvent("onchange");
							return true;
							break;
						case "select-multiple":
							for (var rIndex=0;rIndex<fElem.options.length;rIndex++) {
								if (fElem.options[rIndex].value==sFieldData) fElem.options[rIndex].selected=true;
							}
							fElem.fireEvent("onchange");
							return true;
							break;
						default:
							break;
							// Do Nothing
					}
				default:
					break;
					// Do Nothing
			}
		}
	}
}

function labelClick() {
	var oElem = window.event.srcElement;
	try {
		oElem.previousSibling.click();
	} catch(e) {
		window.alert(oElem.tagName);
		window.alert(oElem.previousSibling.tagName);
	}
}

function setDropDown(oDropDown, sValue) {
	var rIndex=0;

	for (rIndex=0;rIndex<oDropDown.options.length;rIndex++) {
		if (sValue==oDropDown[rIndex].value) { oDropDown.selectedIndex=rIndex; rIndex=99999; }
	}
}

function getObjectDimensions(oObject) {
	var xOffset=0;
	var yOffset=0;
	while (oObject.tagName!="BODY") {
		xOffset = xOffset + oObject.offsetLeft;
		yOffset = yOffset + oObject.offsetTop;
		oObject = oObject.offsetParent;
	}
	var dimensions = new Array(yOffset, xOffset, yOffset + oObject.offsetHeight, xOffset + oObject.offsetWidth);
	return dimensions;
}

function rePositionDIV(sDIV, sFrame) {
	var oDIV = null;
	var oFrame = null;
	for (var rIndex=0;rIndex<document.all.length;rIndex++) {
		if ((document.all[rIndex].tagName=="DIV") && ((document.all[rIndex].id==sDIV) || (document.all[rIndex].name==sDIV))) {
			oDIV=document.all[rIndex];
			rIndex=99999;
		}
	}
	for (var rIndex=0;rIndex<document.all.length;rIndex++) {
		if ((document.all[rIndex].tagName=="IFRAME") && ((document.all[rIndex].id==sFrame) || (document.all[rIndex].name==sFrame))) {
			oFrame=document.all[rIndex];
			rIndex=99999;
		}
	}
	if (oFrame==null) {
		for (var rIndex=0;rIndex<document.all.length;rIndex++) {
			if ((document.all[rIndex].tagName=="DIV") && ((document.all[rIndex].id==sFrame) || (document.all[rIndex].name==sFrame))) {
				var oFrame=document.all[rIndex];
				rIndex=99999;
			}
		}
	}
	if ((oDIV==null) || (oFrame==null)) {
		window.status = "ERROR:  oDIV or oFrame are null";
		return false;
	}

	var dimArr = getObjectDimensions(oFrame);
	oDIV.style.top = parseInt(dimArr[0]) + 2;
	oDIV.style.left = parseInt(dimArr[1]) + 2;
}

function getIBMSDataDialog(sPageName) {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/" + sPageName,0,sFeatures);
	return sReturnValue;
}

function getIBMSSalesRep() {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSSalesRep.asp",0,sFeatures);
	return sReturnValue;
}

function getIBMSSalesGroup() {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSSalesGroup.asp",0,sFeatures);
	return sReturnValue;
}

function getIBMSRevenueType() {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSRevenueType.asp",0,sFeatures);
	return sReturnValue;
}

function getIBMSSalesChannel() {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSSalesChannels.asp",0,sFeatures);
	return sReturnValue;
}

function getIBMSSalesReps() {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSSalesReps.asp",0,sFeatures);
	return sReturnValue;
}

function getIBMSOrg() {
	var sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSOrgsMain.asp",0,sFeatures);
	return sReturnValue;
}

function getIBMSCampaign() {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSCampaignReference.asp",0,sFeatures);
	return sReturnValue;
}

function getIBMSOrgProduct(orgID) {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSCusProductReference.asp?orgID=" + orgID,0,sFeatures);
	return sReturnValue;
}

function getIBMSOrgCampaign(cusID) {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSCusCampaignReference.asp?cusID=" + cusID,0,sFeatures);
	return sReturnValue;
}

function getIBMSScheduleGroup() {
	sFeatures = "dialogHeight:400px;dialogWidth:500px;center:yes;edge:raised;resizable:no;scroll:no;status:no";
	var sReturnValue = window.showModalDialog("http://intranet/_common/Dialogs/IBMSScheduleGroupRef.asp",0,sFeatures);
	return sReturnValue;
}


function rollOverRow() {
	window.status="Over - ";
	trElem = window.event.srcElement.parentElement;
	while (trElem.tagName!="TR") {
		window.status+=trElem.tagName;
		if (trElem.tagName=="BODY") return false;
		trElem = trElem.parentElement;
	}
	trElem.oldBGColor = trElem.currentStyle.backgroundColor;
	trElem.style.backgroundColor = "#FFCC00"
}

function rollOffRow() {
	window.status="Off - ";
	trElem = window.event.srcElement.parentElement;
	while (trElem.tagName!="TR") {
		window.status+=trElem.tagName;
		if (trElem.tagName=="BODY") return false;
		trElem = trElem.parentElement;
	}
	trElem.style.backgroundColor = trElem.oldBGColor
}

function MM_findObj(n, d) { //v3.0
  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); 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_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_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 winPopUp(URL) {
	sFeatures = "location=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no";
	var nWin = window.open(URL, "_blank", sFeatures,false);
	nWin.focus();
}

function loadFrame() {
	mainPanel.innerHTML = document.frames("inFrame").document.all.item("mainPanel").innerHTML;
}

function collapseAll() {
	for (i=0;i<document.all.length;i++) {
		if (document.all.item(i).tagName=="DIV") {
			if ((document.all.item(i).id.substr(0,2)=="dv") && (document.all.item(i).id!="dvMainPanel")) {
				dvElem = document.all(i);
				imgElem = document.all.item("img"+dvElem.id.substr(2,dvElem.id.length-2));
				dvElem.style.display="none";
				imgElem.src="/images/bullet_bracket.gif"
			}
		}
	}
	alert("Your Menu has been collapsed");
}

function loadDIV(elemName) {
	dvElem = document.all.item("dv"+elemName);
	dvElem.innerHTML = document.frames("inFrame").frames.document.all.item("mainPanel").innerHTML;
	dvElem.style.display="inline";
	if (navIndex!=1) navTo();
}

function DELETE_menuSelected() {
	window.status="";
	var myElem = window.event.srcElement;
	myElemName = myElem.id.substr(2,myElem.id.length-2)
	spElem = document.all.item("sp"+myElemName);
	dvElem = document.all.item("dv"+myElemName);
	imgElem = document.all.item("im"+myElemName);
	// Check to make sure there is a submenu to be loaded
	if (dvElem!=null) {
		// Check if submenu has already been loaded
		if ((dvElem.innerText=="") && (spElem.iFrameURL!="")) {
			// Check if menu is currently selected
			document.all.item("dv"+myElemName).innerHTML = "<span style='color:#666666;font-family:verdana;font-size:10px'>Loading...</span>";
			inFrame.location = "load_toc.asp?path="+spElem.iFrameURL+"&DV="+myElemName;
			window.status = "Loading Sub Menu...["+replaceText(replaceText(spElem.iFrameURL,"%5C","\\"),"+"," ")+"]   ";
		} else {
			dvElem.style.display = (dvElem.style.display=="none") ? "block" : ((cMenuID.id!=spElem.id) ? "block" : "none") ;
		}
		imgElem.src = (dvElem.style.display=="none") ? "images/bullet_bracket.gif" : "images/bullet_bracket_f2_anim.gif";
	}
	if (spElem.loadPAGE!="") {
		if (spElem.loadTARGET=="") {
			//if (spElem.className!="MenuItemSel") { parent.mainFrame.location=spElem.loadPAGE; }
			parent.mainFrame.location=spElem.loadPAGE;
			window.status=window.status + "Loading Page [" + spElem.loadPAGE + "]";
		} else {
			var newWin = window.open(spElem.loadPAGE,"newWin");
			newWin.focus();
		}
	}
	if (cMenuID!=null) {
		cMenuID.className="MenuItem";
		if (cMenuID.id !=spElem.id) {
			imgElem = document.all.item("im"+cMenuID.id.substr(2,cMenuID.id.length-2));
			if (imgElem.src.substr(imgElem.src.length-8,8)=="anim.gif") imgElem.src = "images/bullet_bracket_f2.gif";
		}
	}
	spElem.className="MenuItemSel"
	cMenuID=spElem;
}

function DELETE_menuHit(URL, newWindow) {
	for (sIndex=0;sIndex<document.all.length;sIndex++) { if (document.all[sIndex].className=="mnuItemOn") { document.all[sIndex].className="mnuItem" } }
	window.status = "";
	var myElem = window.event.srcElement;
	myElemID = myElem.id.substr(2,myElem.id.length-2);
	var spElem = document.all.item("sp"+myElemID);
	document.all.item("sp"+myElemID).className="mnuItemOn";
	if (spElem.url!="") {
		if (spElem.newwindow=="1") {
			var newWin = window.open(spElem.url,"newWin");
			newWin.focus();
		} else {
			var cPage = parent.mainFrame.location + "";
			if (cPage.indexOf(spElem.url)==-1) {
				parent.mainFrame.location=spElem.url;
				//window.status=window.status + "Loading Page [" + spElem.url + "]";
			}
			//window.status = parent.mainFrame.location + ", " + spElem.url;
		}
	}
	cMenuID=myElemID;
}

function expandTOC(iFrameURL, checkCurrMenu) {
	//window.status = "";
	var myElem = window.event.srcElement;
	myElemID = myElem.id.substr(2,myElem.id.length-2);
	checkCurrMenu = (myElem.id==document.all.item("im"+myElemID).id) ? true : false;
	dvElem = document.all.item("dv"+myElemID);
	spElem = document.all.item("sp"+myElemID);
	//if (cMenuID!=null) { alert("[" + cMenuID + "], [" + myElemID+"], ["+cMenuID.substr(0,myElemID.length)+"], "+checkCurrMenu+", " + dvElem.style.display); }
	if ((checkCurrMenu) && (dvElem.style.display!="none") && (cMenuID!=null)) {
		if (cMenuID.substr(0,myElemID.length)==myElemID) { document.all.item("sp"+myElemID).click(); return true; }
	}
	dvElem.style.display=(dvElem.style.display=="none") ? "block" : "none";
	document.all.item("tr"+myElemID).style.display = dvElem.style.display;
	document.all.item("im"+myElemID).src = (dvElem.style.display=="none") ? "images/toc_plus.gif" : "images/toc_minus.gif";
	if (dvElem.innerText.substr(0,7)=="Loading") {
		inFrame.location = "toc_loader.asp?path="+spElem.path+"&DV="+myElemID;
		//window.status = "Loading Sub Menu...[" + replaceText(replaceText(spElem.path,"%5C","\\"),"+"," ") + "]  ";
	}
}

function navTo() {
	var mapPath = cMenuID;
	//alert("Current path is : " + mapPath);
	sIndex = mapPath.indexOf("|",navIndex);
	if (sIndex>0) {
		//alert("Element is : im" +mapPath.substr(0,sIndex));
		imElem = document.all.item("im"+mapPath.substr(0,sIndex));
		if (imElem!=undefined) { imElem.click(); }
		sIndex = mapPath.indexOf("|",sIndex+1);
		navIndex=sIndex
	} else {
		spElem = document.all.item("sp"+mapPath);
		if (spElem!=undefined) { spElem.click(); }
		sIndex = mapPath.indexOf("|",sIndex+1);
		navIndex=1;
	}
}

function replaceText(p_TextString, p_FindString, p_ReplaceString) {
  p_TextString+="";
  p_FindString+="";
  p_ReplaceString+="";
  n_Index = p_TextString.indexOf(p_FindString,0)
  lPortion="";
  while (n_Index>=0) {
    lPortion += p_TextString.substr(0,n_Index)+p_ReplaceString;
    rIndex = n_Index+p_FindString.length;
    rPortion = p_TextString.substr(rIndex,p_TextString.length-rIndex)
    p_TextString = rPortion;
    n_Index = p_TextString.indexOf(p_FindString,0)
  }
  lPortion+=p_TextString;
  return lPortion;
}

function popUp() {
	if (popUp.arguments.length>0) {
		url = popUp.arguments[0];
		var width=""; var height=""; var scrollable=",scrollbars=no"; var resizable=",resizable=no"; var winName="myWinPopUp";wtop="";wleft="";
		if (popUp.arguments.length>=2) {
			if (popUp.arguments[1]!=null) {
				width=",width="+popUp.arguments[1];
				wleft=",left="+((screen.availWidth - parseInt(popUp.arguments[1]))/2)
			}
		}
		if (popUp.arguments.length>=3) {
			if (popUp.arguments[2]!=null) {
				height=",height="+popUp.arguments[2];
				wtop=",top="+((screen.availHeight-parseInt(popUp.arguments[2]))/2)
			}
		}
		if (popUp.arguments.length>=4) scrollable=",scrollbars="+((popUp.arguments[3]) ? "yes" : "no");
		if (popUp.arguments.length>=5) resizable=",resizable="+((popUp.arguments[4]) ? "yes" : "no");
		if (popUp.arguments.length>=6) winName=popUp.arguments[5];
		var path = window.location.pathname.toLowerCase();
		//alert("The Path is " + path);
		if (path.substr(1,8)=="intranet") {
			var pathSep = String.fromCharCode(47) + "intranet" + String.fromCharCode(47) }
		else {
			var pathSep = String.fromCharCode(47) }
		//window.status = "Opening : " + window.location.protocol + pathSep + pathSep + window.location.host + pathSep + window.location.pathname;
		//alert("Protocol is : " + window.location.protocol);
		var winUp = window.open(url,winName,"fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,"+scrollable+resizable+width+height+wtop+wleft,false)
		winUp.focus();
		return winUp;
	}
}

function checkSize() {
	//window.status = reSizeDIV + ", " + reSizeTABLE;
	var dvCheckSizeDIV = document.all.item(reSizeDIV)
	var tblCheckSizeTABLE = document.all.item(reSizeTABLE)
	if (tblCheckSizeTABLE.rows.length>0) {
		if (tblCheckSizeTABLE.rows(0).cells.length>0) {
		numCols = parseInt((dvCheckSizeDIV.style.pixelWidth-1)/reSizeWidth);
		numCols = (numCols==0) ? 1 : numCols;
		//window.status = "width: " + dvCheckSizeDIV.style.pixelWidth + " cols: " + numCols;
		if (tblCheckSizeTABLE.rows(0).cells.length!=numCols) {
			//window.status += " cells: " + tblCheckSizeTABLE.rows(0).cells.length;
			var cCells = new Array();
			var aIndex=0;
			for (rIndex=0;rIndex<tblCheckSizeTABLE.rows.length;rIndex++) {
				for (cIndex=0;cIndex<tblCheckSizeTABLE.rows(rIndex).cells.length;cIndex++) {
					cCells[aIndex] = tblCheckSizeTABLE.rows(rIndex).cells(cIndex).innerHTML;
					aIndex++;
				}
			}
			var origRows = tblCheckSizeTABLE.rows.length;
			for (count=0;count<aIndex;count++) {
				if ((count % numCols)==0) { var cRow = tblCheckSizeTABLE.insertRow(); }
				var cCell = cRow.insertCell();
				cCell.innerHTML = cCells[count];
				cCell.style.textAlign="center";
			}
			for (rIndex=0;rIndex<origRows;rIndex++) { tblCheckSizeTABLE.deleteRow(0); }
			//window.onresize=null;
			tblWidth = reSizeWidth * parseInt((numCols>tblCheckSizeTABLE.rows(0).cells.length) ? tblCheckSizeTABLE.rows(0).cells.length : numCols);
			tblCheckSizeTABLE.style.width=tblWidth;
			//window.status += " table: " + tblWidth;
		}
		}
	}
}

function CheckDocumentLevel() {
	if (top.location==self.location) {
		var sURL = "" + self.location;
		sBaseURL = "http://www.scbnetwork.com.au/";
		var iIndex1 = sURL.indexOf("//");
		var iIndex2 = sURL.indexOf("/",iIndex1+2);
		sBaseURL = sURL.substr(0,iIndex2);
		//window.alert(sBaseURL);
		//window.status=iIndex1 + "," + iIndex2 + ", " + sBaseURL;
		sURL = sURL.substr(sBaseURL.length,sURL.length-sBaseURL.length);
		top.location = sBaseURL + "?redirect=" + sURL;
	}
}

function GetBaseURL() {
	var myBaseURL = window.location.href + "";
	sPos=myBaseURL.indexOf("/localhost/scbnetwork/")+22;
	if (sPos>22) { myBaseURL = myBaseURL.substr(0,sPos);
	} else {
		sPos=myBaseURL.indexOf("/vpn/")+5;
		if (sPos>5) { myBaseURL = myBaseURL.substr(0,sPos);
		} else {
			sPos=myBaseURL.indexOf(".com.au/")+8;
			if (sPos>7) { myBaseURL = myBaseURL.substr(0,sPos);
			} else {
				sPos = myBaseURL.indexOf(".intranet/")+10;
				if (sPos>9) myBaseURL=myBaseURL.substr(0,sPos);
			}
		}
	}
	return myBaseURL;
}

var baseURL = GetBaseURL()