function GetForm() { thisForm = document.forms[0] if (document.forms.length > 1) {thisForm = document.forms[1]} return thisForm } function GetParamNameAndValue(sGet) { thisForm = GetForm() var sParam = thisForm.Query_String.value var sName = "" if (sParam == "" || sGet == "") { return "" } sParam = sParam + "&" sName = "&" + sGet + "=" var nA = sParam.indexOf(sName) var nB = -1 if ( nA > -1) { nB = sParam.indexOf("&", nA+4) return sParam.substring(nA,nB) } else {return ""} } /* function toForm(sForm) { window.location.href="/COM.nsf/" + sForm + "" return false } */ function toForm(sForm) { var sLog = GetParamNameAndValue("LOG") var sPartner = GetParamNameAndValue("PARTNER") var sWeb = GetParamNameAndValue("WEB") var sText = sForm + "&" var nA = sText.indexOf("&") var nB = sText.lastIndexOf("&") var sHref = "/COM.nsf/" + sText.substring(0,nA) if (sForm.indexOf("&WEB=") > -1) { sWeb = "" } sHref = sHref + sWeb + sLog + sPartner + sText.substring(nA,nB) location.href= sHref return false } function toUsp(sForm) { var sLog = GetParamNameAndValue("LOG") var sPartner = GetParamNameAndValue("PARTNER") var sWeb = GetParamNameAndValue("WEB") var sHref = "" if (sForm.indexOf("&WEB=") > -1) { sWeb = "" } sHref = sForm+ sWeb + sLog + sPartner location.href= sHref return false } function validateLogin() { thisForm = GetForm() if (thisForm.AccessTimeOut.value == "Y") { var sLog = thisForm.Log.value var sWeb = GetParamNameAndValue("WEB") alert("Access time out, please sign in again") var LoginWindow = window.open("/COM.nsf/COMLoginAgain?OpenForm&" + sWeb + "LOG=" + sLog, "login", "width=600,height=500,left=" + ((screen.width - 600) / 2) + ",top=" + ((screen.height - 500) / 2) ) LoginWindow.focus() } else { if (thisForm.AccessTimeOut.value == "" && thisForm.Log.value != "" ) { alert("Incorrect login parameter, please sign in again") location.replace("/COM.nsf/COMLogin?OpenForm" + sWeb) } } } function validateNewOrg(myform) { if (myform.InputOrganisation.value == "") { alert("Please supply your organisation name.") return false} if (myform.InputGeneral.value == "") { alert("Please supply the general information about your organisation.") return false} if (myform.InputName_1.value == "") { alert("Please supply your main contact name.") return false} if (myform.InputAddress_1.value == "") { alert("Please supply your main contact name.") return false} if (myform.InputPostCode_1.value == "") { alert("Please supply your main contact postcode.") return false} if (myform.InputAddress_2.value != "" && myform.InputPostCode_2.value == "") { alert("Please supply your second contact postcode.") return false} if (myform.InputAddress_3.value != "" && myform.InputPostCode_3.value == "") { alert("Please supply your third contact postcode.") return false} if (myform.DataProtectionDeclaration.checked == false) { alert("Please verify the information you supplied is correct and make sure that you are aware of the Data Protection Delaration.") return false} myform.InputValidated.value = "Y" } /* this function is not used */ function goToPage(sUrl) { thisForm = GetForm() if (thisForm.Log.value != "") { sUrl = sUrl + "&LOG=" + thisForm.Log.value } location.href = sUrl } function LogParam() { thisForm = GetForm() if (thisForm.Log.value == "") { return "&LOG=AAAG1RAACAAAWDZABB" } else { return "&LOG=" + thisForm.Log.value } } function openWin(theUrl) { screenWidth = screen.width - 50; screenHeight = screen.height - 200; myWin=open(theUrl, "NewWin", "width=" + screenWidth + ",height=" + screenHeight + ",top=0,left=0,scrollbars=yes,location=yes,resizable=yes,status=yes,toolbar=yes,menubar=yes"); myWin.focus(); } function goTo(theUrl) { alert("You are leaving Durham County Council web site"); openWin(theUrl); } function Upper(dataField) { dataField.value = dataField.value.toUpperCase() } function openGIS(Layer, Param) { thisForm = GetForm() if (Layer.length<=1 || Param.length<=1 ) { alert("Please enter data") return } var siteURL=""; var showLocation="no"; var sServer = thisForm.Server_Name.value.toUpperCase(); if (sServer == "WEBDEV01a") { siteURL="http://duch-2128/"; showLocation="yes"; siteURL= siteURL + "website/community/viewer.htm"; } else { siteURL="http://gis.durham.gov.uk/" ; siteURL= siteURL + "website/community/viewer.htm"; } /*siteURL= siteURL + "website/community/viewer.htm"; */ /*siteURL= siteURL + "website/intermap/viewer.htm"; */ //Set the URL to zoom to a postcode. var theURL = siteURL + "?QUERYLAYER=" + Layer + "&GISQUERY=" + Param; //get screen resolution var screenWidth = screen.width; var screenHeight = screen.height; //check resolution of user machine is OK for GIS if (screenWidth < 640 || screenHeight < 480) { alert("To use the Interactive Mapping Service, your screen resolution should be set to 640 x 480 or greater"); } else { //set sizes for the GIS window, depending upon users screen resolution var windowWidth=screenWidth * 0.98; var windowHeight=screenHeight * 0.90; //open the GIS in a window myWin=open(theURL, "displaywindow", "width=" + windowWidth + ",height="+windowHeight+",top=0,left=0,resizable=no,status=no,toolbar=no,menubar=no,location="+showLocation); myWin.focus(); } }