var lastFormUpdate;var gAlerted="";var gChanged="";var charLT="<";var charGT=">";var charSQ="'";var charDQ='"';var blank="";var gPopUpWindow=null;var windowURL=null;var windowx=null;var windowy=null;var windoww=null;var windowh=null;var newx="";var newy="";var current_session="";var isBirdseye=false;var mapType="H";var ezoom=99;var panelUsed="false";var calDate;var dateFormat="EU";var markerFeature;var kmlUrl;var clickNumber=0;function setCookie(b,d,a,f,c,e){document.cookie=b+"="+escape(d)+((a)?"; expires="+a.toGMTString():"")+((f)?"; path="+f:"")+((c)?"; domain="+c:"")+((e)?"; secure":"")}function getCookie(c){var b=document.cookie;var e=c+"=";var d=b.indexOf("; "+e);if(d==-1){d=b.indexOf(e);if(d!=0){return null}}else{d+=2}var a=document.cookie.indexOf(";",d);if(a==-1){a=b.length}return unescape(b.substring(d+e.length,a))}function deleteCookie(a,c,b){if(getCookie(a)){document.cookie=a+"="+((c)?"; path="+c:"")+((b)?"; domain="+b:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}isNav=(navigator.appName.indexOf("Netscape")!=-1)?true:false;isIE=(navigator.appName.indexOf("Microsoft")!=-1)?true:false;isOpera=(navigator.appName.indexOf("Opera")!=-1)?true:false;function doAlert(b,c,a){if(a!=true){return}if((gAlerted!="")&&(gAlerted!=b.name)){return}if((isNav==true)&&(gChanged!="")){return}gAlerted=b.name;gChanged=b.name;b.select();alert(c);b.focus()}function doMessage(a,b){if((gAlerted!="")&&(gAlerted!=a.name)){return}if((isNav==true)&&(gChanged!="")){return}gAlerted=a.name;gChanged=a.name;alert(b)}function resetAlert(){gAlerted="";gChanged=""}function isBeforeToday(c){var e;var g;var d;var b;var f;var a;targetDate=isValidDate(c);if(targetDate!=null){b=new Date();e=b.getDate();g=b.getMonth();if(g<12){g=g+1}d=b.getFullYear();f=getDaysFromValue(e,g,d);e=targetDate.substr(0,2);g=targetDate.substr(3,2);d=targetDate.substr(6);a=getDaysFromValue(e,g,d);if(a<f){return true}else{return false}}else{return false}}function isNotAfterToday(c){var e;var g;var d;var b;var f;var a;targetDate=isValidDate(c);if(targetDate!=null){b=new Date();e=b.getDate();g=b.getMonth();if(g<12){g=g+1}d=b.getFullYear();f=getDaysFromValue(e,g,d);e=targetDate.substr(0,2);g=targetDate.substr(3,2);d=targetDate.substr(6);a=getDaysFromValue(e,g,d);if(a<=f){return true}else{return false}}else{return false}}function getDaysFromValue(d,e,c){var a=0;if(e>0){e=e-1}var b=new Date(Date.UTC(c,e,d));a=Math.floor(b.getTime()/(1000*60*60*24));return a}function validateMultiLine(e,d,a){var b=e;var c=null;if(d==true){if(isBlank(b.value)==true){return false}}if(isBlank(b.value)==true){return true}if(isBlank(a)==false){if(isValidLength(b.value,a)==false){doAlert(b,"Length must be less than or equal to "+a,true);return false}}return true}function doCount(){var b=0;var a;for(a=0;a<arguments.length;a++){if(arguments[a].value!=""){b++}}return b}function doSum(){var c=0;var b=0;var d=0;var a;for(a=0;a<arguments.length;a++){b=arguments[a].value.replace(/,/g,"");d=parseFloat(b);if(d==b){c=c+d}}return parseNumber(c)}function doAvg(){var d=0;var c=0;var f=0;var b=0;var e=0;var a;for(a=0;a<arguments.length;a++){if(arguments[a].value!=""){d++}b=arguments[a].value.replace(/,/g,"");e=parseFloat(b);if(e==b){c=c+e}}if(d>0){f=c/d}return parseNumber(f)}function validateField(n,m,f,c,j,d,g,h,e){var b=n;var a=null;if(arguments.length<9){e=""}if(arguments.length<8){h=""}if(arguments.length<7){g=""}if(arguments.length<6){d=""}if(arguments.length<5){j=""}if(arguments.length<4){c=true}if(f==true){if(isBlank(b.value)==true){return false}}if(isBlank(b.value)==true){return true}if(m=="DATE"){a=isValidDate(b.value);if(a==null){doAlert(b,"Invalid date specified. Please specify date in format dd/mm/yyyy.",c);return false}else{n.value=a;return true}}else{if(m=="PASTDATE"){a=isValidDate(b.value);if(a==null){doAlert(b,"Invalid date specified. Please specify date in format dd/mm/yyyy.",c);return false}else{if(isNotAfterToday(a)){n.value=a;return true}else{doAlert(b,"Date cannot be in the future.",c);return false}}}else{if(m=="TIME"){a=b.value;if(c&&a.length<3){a=a+":00"}else{if(c&&a.indexOf(":")==-1){a=a.substr(0,a.length-2)+":"+a.substr(a.length-2,a.length)}else{if(a.indexOf(":")==-1){a=toTime(a)}}}if(isValidTime(a)==false){doAlert(b,"Invalid time specified. Please specify times in format hh:mm.",c);return false}n.value=a;return true}else{if(m=="EMAIL"){if(isValidEmail(b.value)==false){doAlert(b,"Invalid email address specified. Please try again.",c);return false}}else{if(m=="URL"){if(isValidURL(b.value)==false){doAlert(b,"Invalid URL specified. Please try again.",c);return false}}else{if(m=="UPPER"){a=b.value.toUpperCase();n.value=a;return true}else{if(m=="INTEGER"){a=isValidInteger(b.value.replace(/,/,""),e);if(a==null){doAlert(b,"Invalid number specified. Please enter a whole number.",c);return false}else{n.value=a}}else{if(m=="NUMBER"){a=isValidNumber(b.value.replace(/,/,""),2);if(a==null){doAlert(b,"Invalid number specified. Please try again.",c);return false}else{n.value=a}}else{if(m=="MONEY"){a=isValidMoney(b.value.replace(/,/,""));if(a==null){doAlert(b,"Invalid money format specified. Please specify money in format 2500, 2,500, or 2.50.",c);return false}else{if((a<0)||(a.indexOf("-")==0)){doAlert(b,"Amounts of money may not be less than zero. Please try again.",c);n.value=a;return false}else{n.value=a}}}else{if(m=="PATTERN"){if(isValidPattern(b.value,g)==false){doAlert(b,h,c);return false}}}}}}}}}}}if(isBlank(j)==false){if(checkMin(b.value.replace(/,/,""),j.replace(/,/,""))==false){doAlert(b,"Value must be greater than or equal to "+j,c);return false}}if(isBlank(d)==false){if(checkMax(b.value.replace(/,/,""),d.replace(/,/,""))==false){doAlert(b,"Value must be less than or equal to "+d,c);return false}}return true}function isBlank(a){if((a==null)||(a=="")){return true}for(i=0;i<a.length;i++){if(a.charAt(i)!=" "){return false}}return true}function isValidLength(b,a){if(b.length>a){return false}else{return true}}function isValidInteger(d,c){var b;var e;var a;var f;if(arguments.length<2){c=""}if((c!="U")&&(c!="u")&&(c!="D")&&(c!="d")){c=""}b=d.replace(/,/g,"");e=parseFloat(b);if(e!=b){return null}if((c=="U")||(c=="u")){e=Math.ceil(e)}else{if((c=="D")||(c=="d")){e=Math.floor(e)}else{e=Math.round(e)}}a=new String(e);f=a.indexOf(".");if(f!=-1){a=a.substr(0,f)}return a}function isValidNumber(d,a){var c;var f;var b;var g;var e;if(arguments.length<2){a=2}c=d.replace(/,/g,"");f=parseFloat(c);if(f!=c){return null}e=Math.pow(10,a);b=new String((Math.round(c*e))/e);g=b.indexOf(".");if(g==-1){b=b+".0000000000".substr(0,a+1)}else{if(g>=(b.length-a)){b=b+"0000000000".substr(0,a+1+g-b.length)}}return b}function isValidMoney(c){var b;var d;var a;var e;b=c.replace(/,/g,"");d=parseFloat(b);if(d!=b){return null}e=c.indexOf(".");if(e==0){c="0"+c;e+=1}if(e==-1){return c+".00"}else{if(e==(c.length-1)){return c+"00"}else{if(e==(c.length-2)){return c+"0"}else{if(e==(c.length-3)){return c}else{a=new String((Math.round(b*100))/100);return a}}}}}function parseNumber(d,a){var c=d;var f;var b;var g;var e;if(arguments.length<2){a=2}f=parseFloat(c);if(f!=c){c="0"}e=Math.pow(10,a);b=new String((Math.round(c*e))/e);g=b.indexOf(".");if(g==-1){b=b+".0000000000".substr(0,a+1)}else{if(g>=(b.length-a)){b=b+"0000000000".substr(0,a+1+g-b.length)}}return b}function checkMin(c,a){var b;b=parseFloat(a);if((!a&&a!=0)||b!=a){a=-(1/0)}if(Math.max(a,c)!=c){return false}else{return true}}function checkMax(c,a){var b;b=parseFloat(a);if((!a&&a!=0)||b!=a){a=(1/0)}if(Math.min(a,c)!=c){return false}else{return true}}function isValidPattern(c,b){var a=new RegExp(b,"");return a.test(c)}function isValidURL(a){return true}function isValidEmail(a){a=trimString(a);if(a.indexOf("@")<1){return false}var b=a.substring(0,a.indexOf("@"));var c=a.substring(a.indexOf("@")+1);if(isBlank(c)==true){return false}if(b.indexOf("(")!=-1||b.indexOf(")")!=-1||b.indexOf("<")!=-1||b.indexOf(">")!=-1||b.indexOf(",")!=-1||b.indexOf(";")!=-1||b.indexOf(":")!=-1||b.indexOf("\\")!=-1||b.indexOf('"')!=-1||b.indexOf("[")!=-1||b.indexOf("]")!=-1||b.indexOf(" ")!=-1){return false}if(c.indexOf("(")!=-1||c.indexOf(")")!=-1||c.indexOf("<")!=-1||c.indexOf(">")!=-1||c.indexOf(",")!=-1||c.indexOf(";")!=-1||c.indexOf(":")!=-1||c.indexOf("\\")!=-1||c.indexOf('"')!=-1||c.indexOf("[")!=-1||c.indexOf("]")!=-1||c.indexOf(" ")!=-1){return false}return true}function fromTime(c){if(c==null){return 0}if(c==0){return 0}var a=/^(\d{1,2}):(\d{2})$/;var b=c.match(a);if(b==null){return 0}return parseInt(isValidInteger(b[1],"")*60)+parseInt(b[2])}function toTime(b){var c=isValidInteger(""+b);if(c==null||c<0){return""}c=c%1440;var a=""+isValidInteger(""+c/60,"D");if(a.length==1){a="0"+a}c=""+c%60;if(c.length==1){c="0"+c}return a+":"+c}function isValidTime(c){var a=/^(\d{1,2}):(\d{2})$/;var b=c.match(a);if(b==null){return false}hour=b[1];minute=b[2];if(hour<0||hour>23){return false}if(minute<0||minute>59){return false}return true}function trimString(b){var a;a=b;while(a.charAt(0)==" "){a=a.substr(1)}while(a.charAt(a.length-1)==" "){a=a.substr(0,a.length-1)}return a}function isValidDate(f){var h=dateFormat;var p;var o;var d="";var n="";var e="";var b;var r;var m;var g=false;var j=new Array("-","/","."," ");var c;p=trimString(f);for(c=0;c<j.length;c++){if(g&&j[c]==" "){}else{if(p.indexOf(j[c])!=-1){o=p.split(j[c]);if(o.length!=3){return null}else{if(h=="EU"){d=trimString(o[0]);n=trimString(o[1]);e=trimString(o[2])}else{d=trimString(o[1]);n=trimString(o[0]);e=trimString(o[2])}}g=true}}}if(g==false){if(p.length>5){if(h=="EU"){d=p.substr(0,2);n=p.substr(2,2);e=p.substr(4)}else{n=p.substr(0,2);d=p.substr(2,2);e=p.substr(4)}}}if(d.length==1){d="0"+d}if(n.length==1){n="0"+n}var a;var q;if(d.charAt(0)=="0"){a=d.substr(1)}else{a=d}if(n.charAt(0)=="0"){q=n.substr(1)}else{q=n}if(isValidInteger(a)==null){return null}if(isValidInteger(q)==null){return null}if(isValidInteger(e)==null){return null}b=parseInt(d,10);r=parseInt(n,10);m=parseInt(e,10);if(m<100){if(m>=30){m=m+1900}else{m=m+2000}}if(r>12||r<1){return null}if((r==1||r==3||r==5||r==7||r==8||r==10||r==12)&&(b>31||b<1)){return null}if((r==4||r==6||r==9||r==11)&&(b>30||b<1)){return null}if(r==2){if(b<1){return null}if(LeapYear(m)==true){if(b>29){return null}}else{if(b>28){return null}}}if(h=="US"){return n+"/"+d+"/"+m}else{return d+"/"+n+"/"+m}}function LeapYear(a){if(a%100==0){if(a%400==0){return true}}else{if((a%4)==0){return true}}return false}function show_help(a){alert(a)}function getCheckboxValue(b,a,f){if(arguments.length<3){f="No"}if(arguments.length<2){return null}if(b==null||b==""){b="NonStopGov"}var d=document.forms[b][a];var e;if(d==null){e=f}else{var c=d.value;if(d.checked){e=c}else{e=f}}return e}function getRadioValue(c,a){if(arguments.length<2){return null}if(c==null||c==""){c="NonStopGov"}var d=document.forms[c][a];var e="";if(d==null){return e}for(var b=0;b<d.length;b++){if(d[b].checked){e=d[b].value}}return e}function getItemValue(b,e,d){if(d==null||d==""){d="No"}if(b==null||b==""){b="NonStopGov"}var a=document.getElementById("p_"+e);if(a==null){a=document.getElementById("p_"+e+"_0")}var c=a.type;if(c=="checkbox"){return getCheckboxValue(b,"p_"+e,d)}else{if(c=="radio"){return getRadioValue(b,"p_"+e)}else{return document.getElementById("p_"+e).value}}}function getDays(g){var b=g.value;var e;var f;var d;var a=0;if((isBlank(b)==true)||(b.length<=7)){return a}e=b.substr(0,2);f=b.substr(3,2);d=b.substr(6);if(f>0){f=f-1}var c=new Date(Date.UTC(d,f,e));a=Math.floor(c.getTime()/(1000*60*60*24));return a}function getModifiedDate(b,e){var j=b;var c;var h;var d;var a=0;var m;var n="";var g;var f="-/. ";e=e.toUpperCase();if(e=="ISNULL"){if((j==null)||(j=="")){return true}else{return false}}if(e=="ISNOTNULL"){if((j==null)||(j=="")){return false}else{return true}}if((isBlank(j)==true)||(j.length<=7)){return 0}j=isValidDate(j);if(j==null){return 0}c=j.substr(0,2);h=j.substr(3,2);d=j.substr(6);if(h>0){h=h-1}m=new Date(Date.UTC(d,h,c));if((arguments.length<2)||(e==null)){a=Math.floor(m.getTime()/86400000)}else{a="";for(g=0;g<e.length;g++){if(f.indexOf(e.substr(g,1))==-1){n=n+e.substr(g,1)}else{a=a+actOnModifier(m,n)+e.substr(g,1);n=""}}if(n.length>0){a=a+actOnModifier(m,n)}}if(a==""){a=0}return a}function actOnModifier(b,a){var d="";var c;if((arguments.length<2)||(a==null)){return""}a=a.toUpperCase();if(a=="ISNULL"){if(b==null){return true}else{return false}}if(!b){return 0}switch(a){case"DD":case"D":d=b.getDate();break;case"MM":case"M":d=b.getMonth()+1;break;case"YYYY":case"Y":d=b.getFullYear();break;case"YY":d=b.getFullYear();d=d.toString();d=d.substr(2);break;case"DAYS":d=Math.floor(b.getTime()/86400000);break;case"AGE":c=new Date();if(Math.floor(c.getTime()/86400000)<=Math.floor(b.getTime()/86400000)){d=0}else{d=c.getFullYear()-b.getFullYear();if((b.getMonth()>c.getMonth())||(((b.getMonth()==c.getMonth())&&(b.getDate()>c.getDate())))){d=d-1}if(d<0){d=0}}break}return d}function isNull(b){var a=b;if((a==null)||(a=="")){return true}else{return false}}function isNotNull(b){var a=b;if((a!=null)&&(a!="")){return true}else{return false}}function isNullCheckbox(b,a){if(arguments.length<2){return true}if(b==null||b==""){b="NonStopGov"}var c=document.forms[b][a];if(c.checked){return false}else{return false}}function isNotNullCheckbox(b,a){if(arguments.length<2){return false}if(b==null||b==""){b="NonStopGov"}var c=document.forms[b][a];if(c.checked){return true}else{return true}}function isNullRadio(c,a){if(arguments.length<2){return true}if(c==null||c==""){c="NonStopGov"}var d=document.forms[c][a];var e=true;for(var b=0;b<d.length;b++){if(d[b].checked){e=false;break}}return e}function isNotNullRadio(c,a){if(arguments.length<2){return false}if(c==null||c==""){c="NonStopGov"}var d=document.forms[c][a];var e=false;for(var b=0;b<d.length;b++){if(d[b].checked){e=true;break}}return e}function updateField(c,b,a){c.value=b}function closePopUp(){if(gPopUpWindow){gPopUpWindow.close();gPopUpWindow=null}}function new_window(b,n,g,j,f,m,d,o){if(panelUsed=="true"&&o){closePanel()}if((arguments.length<7)||(d=="")||isNaN(d)){d=200}if(d<10){d=10}if(d>screen.availHeight-100){d=screen.availHeight-100}if((arguments.length<6)||(m=="")||isNaN(m)){m=200}if(m<10){m=10}if(m>screen.availWidth-100){m=screen.availWidth-100}if(windowx=null){windowx=0}if(windowy=null){windowy=0}if(windoww=null){windoww=screen.availWidth}if(windowh=null){windowh=screen.availHeight}if(isIE){windowx=screenLeft;windowy=screenTop}else{if(isNav){windowx=screenX;windowy=screenY}}if((arguments.length<5)||(f=="")||isNaN(f)){f=(screen.availHeight-d-70)/2}if(f<0){f=0}if(f+d>screen.availHeight){f=(screen.availHeight-d-70)/2}if(f<0){f=0}if((arguments.length<4)||(j=="")||isNaN(j)){j=(screen.availWidth-m/2)}if(j<0){j=0}if(j+m>screen.availWidth){j=(screen.availWidth-m)/2}if((arguments.length<3)||(g.length<1)){g="Record Actions"}if(arguments.length<1){b=""}var c="left="+j+",top="+f+",screenX="+j+",screenY="+f+",width="+m+",height="+d+",resizable, scrollbars, menubar=no, toolbar=no, location=no, directories=no, dependent, alwaysRaised";var a=g;a=a.replace(/\s+|[^A-Z]/gi,"_");closePopUp();var e=null;e=window.open(b,a,c);e.focus();gPopUpWindow=e;return e}function load(a){location=a}function openerLoad(a){window.opener.location=a}function textPopup(d,b,a,c,e){if(panelUsed=="true"){closePanel()}if(arguments.length<5){e=""}LeftPosition=(screen.width)?(screen.width-a)/2:100;TopPosition=(screen.height)?(screen.height-c)/2:100;settings="width="+a+",height="+c+",top="+TopPosition+",left="+LeftPosition+",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no,dependent=yes,alwaysRaised=yes";gPopUpWindow=window.open(e,d,settings);gPopUpWindow.load=self.load;if(b.length>0){gPopUpWindow.document.write(b)}gPopUpWindow.load=self.load;gPopUpWindow.document.close;gPopUpWindow.focus()}function textCounter(d,b,a){var c="Space for "+(b-d.value.length)+" characters remaining";if(d.value.length>b){d.value=(d.value.substring(0,b));c="No more space available"}else{if(d.value.length<b-200){c=""}}document.getElementById([a]).innerHTML=c}function focusForm(){formatAllTooltips();allObjs=document.getElementById("Next");if(allObjs!=null){allObjs.disabled=false}setTimeout("setFocus()",250)}function setFocus(){if(document.NonStopGov){theElems=document.NonStopGov.elements;if(theElems==null){return}for(i=0;i<theElems.length;i++){theElem=theElems[i];if(theElem.type&&theElem.type=="hidden"){continue}if(theElem.type&&theElem.disabled==true){continue}theElem.focus();break}}}function formatAllTooltips(){allObjs=document.getElementsByTagName("span");for(i=0;i<allObjs.length;i++){if(allObjs[i].id.indexOf("Help")>0){hideEl(allObjs[i].id)}}allObjs=document.getElementsByTagName("a");for(i=0;i<allObjs.length;i++){if(allObjs[i].id.indexOf("Help")>0){showEl(allObjs[i].id)}}}function setRadioValue(b,d){if(!b){return}var c=b.length;if(c==undefined){b.checked=(b.value==d.toString());return}for(var a=0;a<c;a++){b[a].checked=false;if(b[a].value==d.toString()){b[a].checked=true}}}var fieldseq=0;function selectValue(e){var a;var b;var c=fieldseq;for(a=1;a<arguments.length;a++){fieldseq++;b=document.forms.NonStopGov["p_"+fieldseq];var d=b.length;if(b.type=="checkbox"){if(arguments[a]!=null&&(arguments[a]=="True"||arguments[a]=="true"||arguments[a]=="Yes"||arguments[a]=="YES"||arguments[a]=="yes"||arguments[a]=="Y"||arguments[a]=="y")){b.checked=true}}else{if(b.type=="radio"||(b.type==undefined&&d!=undefined)){if(arguments[a]!=null){setRadioValue(b,arguments[a])}}else{b.value=arguments[a]}}if(e!=null&&e=="true"){b.readOnly=true}else{if(e!=null&&e=="false"){b.readOnly=false}}}closePopUp();b=document.forms.NonStopGov["p_"+c];if(b!=null){b.focus()}}isNav=(navigator.appName.indexOf("Netscape")!=-1)?true:false;isIE=(navigator.appName.indexOf("Microsoft")!=-1)?true:false;isOpera=(navigator.appName.indexOf("Opera")!=-1)?true:false;toplevel="4";function dashChanges(b){toplevel++;var c="box"+b;if(isIE){document.all[c].style.zIndex=toplevel;i=1;for(i=1;i<10;i++){var d="tab"+i;var a="box"+i;if(document.all(d)==null){break}if(document.all(d).className=="tabselected"){document.all(d).className="tabdisplayed";document.all[a].className="dashcontents"}if(document.all(d).className=="tabhidden"&&i==b){dashChanges(1)}else{if(i==b){document.all(d).className="tabselected";document.all[a].className="dashcontentsselected"}}}}if(isNav||isOpera){document.getElementById(c).style.zIndex=toplevel;i=1;for(i=1;i<10;i++){var d="tab"+i;var a="box"+i;if(document.getElementById(d)==null){break}if(document.getElementById(d).className=="tabselected"){document.getElementById(d).className="tabdisplayed";document.getElementById(a).className="dashcontents"}if(document.getElementById(d).className=="tabhidden"&&i==b){dashChanges(1)}else{if(i==b){document.getElementById(d).className="tabselected";document.getElementById(a).className="dashcontentsselected"}}}}}function DoChanges(b){if(panelUsed=="true"){closePanel()}toplevel++;var c="box"+b;setCookie("lastTab",b);if(isIE&&self.document.all[c]!=null){self.document.all[c].style.zIndex=toplevel;i=1;for(i=1;i<12;i++){var d="tab"+i;var a="box"+i;if(self.document.all(d).className=="tabselected"){self.document.all(d).className="tabdisplayed";self.document.all[a].className="contents"}if(self.document.all(d).className=="tabhidden"&&i==b){DoChanges(1)}else{if(i==b){self.document.all(d).className="tabselected";self.document.all[a].className="contentsselected"}}}}if((isNav||isOpera)&&self.document.getElementById(c)!=null){self.document.getElementById(c).style.zIndex=toplevel;i=1;for(i=1;i<12;i++){var d="tab"+i;var a="box"+i;if(self.document.getElementById(d).className=="tabselected"){self.document.getElementById(d).className="tabdisplayed";self.document.getElementById(a).className="contents"}if(self.document.getElementById(d).className=="tabhidden"&&i==b){DoChanges(1)}else{if(i==b){self.document.getElementById(d).className="tabselected";self.document.getElementById(a).className="contentsselected"}}}}}function initialiseTab(){var a=getCookie("lastTab");if(a==null){a==1}DoChanges(a);if(a==11){showGrid()}}addEvent(window,"load",convertTrees);function addEvent(c,b,a){if(c.addEventListener){c.addEventListener(b,a,true);return true}else{if(c.attachEvent){return c.attachEvent("on"+b,a)}else{return false}}}function setDefault(a,b){if(typeof(window[a])=="undefined"||window[a]==null){window[a]=b}}function expandTree(b){var a=document.getElementById(b);if(a==null){return false}expandCollapseList(a,nodeOpenClass)}function collapseTree(b){var a=document.getElementById(b);if(a==null){return false}expandCollapseList(a,nodeClosedClass)}function expandToItem(c,e){var b=document.getElementById(c);if(b==null){return false}var a=expandCollapseList(b,nodeOpenClass,e);if(a){var d=document.getElementById(e);if(d.scrollIntoView){d.scrollIntoView(false)}}}function expandCollapseList(d,g,f){if(!d.childNodes||d.childNodes.length==0){return false}for(var a=0;a<d.childNodes.length;a++){var h=d.childNodes[a];if(f!=null&&h.id==f){return true}if(h.nodeName=="LI"){var e=false;for(var b=0;b<h.childNodes.length;b++){var j=h.childNodes[b];if(j.nodeName=="UL"){e=true;var c=expandCollapseList(j,g,f);if(f!=null&&c){h.className=g;return true}}}if(e&&f==null){h.className=g}}}}function convertTrees(){setDefault("treeClass","mktree");setDefault("nodeClosedClass","liClosed");setDefault("nodeOpenClass","liOpen");setDefault("nodeBulletClass","liBullet");setDefault("nodeLinkClass","bullet");setDefault("preProcessTrees",true);if(preProcessTrees){if(!document.createElement){return}uls=document.getElementsByTagName("ul");for(var b=0;b<uls.length;b++){var a=uls[b];if(a.nodeName=="UL"&&a.className==treeClass){processList(a)}}}}function processList(e){if(!e.childNodes||e.childNodes.length==0){return}for(var b=0;b<e.childNodes.length;b++){var g=e.childNodes[b];if(g.nodeName=="LI"){var a=false;for(var h=0;h<g.childNodes.length;h++){var c=g.childNodes[h];if(c.nodeName=="UL"){a=true;processList(c)}}var f=document.createElement("SPAN");var d="\u00A0";f.className=nodeLinkClass;if(a){if(g.className==null||g.className==""){g.className=nodeClosedClass}if(g.firstChild.nodeName=="#text"){d=d+g.firstChild.nodeValue;g.removeChild(g.firstChild)}f.onclick=function(){this.parentNode.className=(this.parentNode.className==nodeOpenClass)?nodeClosedClass:nodeOpenClass;return false}}else{g.className=nodeBulletClass;f.onclick=function(){return false}}f.appendChild(document.createTextNode(d));g.insertBefore(f,g.firstChild)}}}function blockEnter(){return !(window.event&&window.event.keyCode==13)}function markerOnTop(c,a){return GOverlay.getZIndex(c.getPoint().lat())}function markerNotOnTop(c,a){return -GOverlay.getZIndex(c.getPoint().lat())}var inPolygon="unknown";function zoomMap(a,c,d,b){if(a=="googleNativeR"){map.setCenter(new GLatLng(d,c),G_NORMAL_MAP.getMaximumResolution(),G_NORMAL_MAP)}else{if(a=="googleNativeH"){map.setCenter(new GLatLng(d,c),G_HYBRID_MAP.getMaximumResolution(),G_HYBRID_MAP)}else{if(a=="msNativeR"){map.SetMapStyle(VEMapStyle.Road);map.SetCenterAndZoom(new VELatLong(d,c),parseInt(b))}else{if(a=="msNativeH"){map.SetMapStyle(VEMapStyle.Hybrid);map.SetCenterAndZoom(new VELatLong(d,c),parseInt(b))}else{if(a=="msNativeB"){if(map.IsBirdseyeAvailable()){map.SetMapStyle(VEMapStyle.Birdseye)}map.SetCenterAndZoom(new VELatLong(d,c),parseInt(b))}else{map.setCenter(new OpenLayers.LonLat(c,d),b)}}}}}}function selectMapPoint(f,a,g,j,c,d){zoomMap(f,a,g,j);var b=c;var e=d+"&long="+a+"&lat="+g;var h=new Ajax.Updater({success:"resultDiv"},b,{method:"get",parameters:e,evalScripts:true,onFailure:'$("resultDiv").innerHTML = "Sorry. Our mapping facility does not support your browser. Please select an                                address using the Find Adress facility instead.");'})}function getGMap(a,h,j,b,f,d){GEvent.clearListeners(map,"click");GEvent.clearListeners(map,"addoverlay");map.clearOverlays();if(parseInt(j)<99){map.setCenter(new GLatLng(h,a),parseInt(j),G_NORMAL_MAP)}else{if(mapType=="R"){map.setCenter(new GLatLng(h,a),G_NORMAL_MAP.getMaximumResolution(),G_NORMAL_MAP)}else{if(mapType=="H"){map.setCenter(new GLatLng(h,a),G_HYBRID_MAP.getMaximumResolution(),G_HYBRID_MAP)}}}if(d){GEvent.addListener(map,"click",c);GEvent.addListener(map,"dblclick",g)}function c(n,m){++clickNumber;if(clickNumber==1){window.setTimeout(function(){e(n,m)},350)}}function g(n,m){clickNumber=2}function e(o,m){if(m&&clickNumber==1){var n=b;var q=f+"&long="+m.x+"&lat="+m.y;var p=new Ajax.Updater({success:"resultDiv"},n,{method:"get",parameters:q,evalScripts:true,onFailure:'$("resultDiv").innerHTML = "Sorry. Our mapping facility does not support your browser. Please select an address using the Find Adress facility instead.");'})}clickNumber=0}}var birdseyeview=function(){if((parseInt(ezoom)==99)&&isBirdseye==true){if(map.GetMapStyle()!=VEMapStyle.Birdseye){map.SetMapStyle(VEMapStyle.Birdseye)}map.SetZoomLevel(2)}};function getMSMap(e,f,d,h,g,b){map.DeleteAllShapes();ezoom=d;if(parseInt(d)<99){map.SetMapStyle(VEMapStyle.Road);map.SetCenterAndZoom(new VELatLong(f,e),parseInt(d))}else{if(map.IsBirdseyeAvailable()&&isBirdseye==true){map.SetCenterAndZoom(new VELatLong(f,e),17);if(map.GetMapStyle()!=VEMapStyle.Birdseye){map.SetMapStyle(VEMapStyle.Birdseye);map.SetCenterAndZoom(new VELatLong(f,e),2)}}else{if(mapType=="H"){map.SetMapStyle(VEMapStyle.Hybrid)}else{if(mapType=="R"){map.SetMapStyle(VEMapStyle.Road)}}map.SetCenterAndZoom(new VELatLong(f,e),19)}}if(b){map.DetachEvent("onclick",ajaxMapClick);map.DetachEvent("onclick",formUpdate);if(kmlUrl!=null&&kmlUrl!=""){var c=new VEShapeLayer();var a=new VEShapeSourceSpecification(VEDataType.ImportXML,kmlUrl,c);map.ImportShapeLayerData(a,null,false)}ajaxMapClick=function(o){var j=o.mapX;var q=o.mapY;pixel=new VEPixel(j,q);latLon=map.PixelToLatLong(pixel);if(latLon&&diff<300){if((map.GetMapStyle()==VEMapStyle.Birdseye)&&isBirdseye==true){map.SetMapStyle(VEMapStyle.Hybrid);map.SetZoomLevel(17);latLon=map.PixelToLatLong(pixel)}var m=h;var p="";if(isBirdseye==true){p=g+"&long="+latLon.Longitude+"&lat="+latLon.Latitude}else{p=g+"&long="+latLon.Longitude+"&lat="+latLon.Latitude}var n=new Ajax.Updater({success:"resultDiv"},m,{method:"get",parameters:p,evalScripts:true,onFailure:'$("resultDiv").innerHTML = "Sorry. Our mapping facility does not support your browser. Please select an address using the Find Address facility instead.");'})}}}map.AttachEvent("onclick",ajaxMapClick)}function loadGMapSelect(h,n,f,o,b,g,c,j){if(o){var a=b;var e=g;if(o!="POINT"){e=e+"&AddressId="+o}else{e=e+"&long="+h+"&lat="+n}var m=new Ajax.Updater({success:"resultDiv"},a,{method:"get",parameters:e,evalScripts:true,onFailure:'$("resultDiv").innerHTML = "Sorry. Our mapping facility does not support your browser.");'})}else{getGMap(h,n,f,b,g,c);if(j){var d=j;d(map)}}}function ajaxRequest1(a,b){var c=new Ajax.Updater({success:"resultDiv1"},a,{method:"get",parameters:b,evalScripts:true,onFailure:'$("resultDiv1").innerHTML = "Sorry. We were unable to complete your request");'})}function ajaxRequest2(a,b){var c=new Ajax.Updater({success:"resultDiv2"},a,{method:"get",parameters:b,evalScripts:true,onFailure:'$("resultDiv2").innerHTML = "Sorry. We were unable to complete your request");'})}function ajaxRequest(b,c,a){var d=new Ajax.Updater({success:"resultDiv"+a},b,{method:"get",parameters:c,evalScripts:true})}function loadMSMapSelect(h,n,f,o,b,g,c,j){if(o){var a=b;var e=g;if(o!="POINT"){e=e+"&AddressId="+o}else{e=e+"&long="+h+"&lat="+n}var m=new Ajax.Updater({success:"resultDiv"},a,{method:"get",parameters:e,evalScripts:true,onFailure:'$("resultDiv").innerHTML = "Sorry. Our mapping facility does not support your browser.");'})}else{getMSMap(h,n,f,b,g,c);if(j){var d=j;d(map)}}}function loadWMSMapSelect(b,j,o,g,p,c,h,d,m){if(p){var a=c;var f=h;if(p!="POINT"){f=f+"&AddressId="+p}else{f=f+"&long="+j+"&lat="+o}var n=new Ajax.Updater({success:"resultDiv"},a,{method:"get",parameters:f,evalScripts:true,onFailure:'$("resultDiv").innerHTML = "Sorry. Our mapping facility does not support your browser.");'})}else{b.setCenter(new OpenLayers.LonLat(j,o),g);if(d){b.events.register("click",b,function(t){var s=b.getLonLatFromViewPortPx(t.xy);var q=c;var u=h+"&long="+parseNumber(s.lon,8).toString()+"&lat="+parseNumber(s.lat,8).toString();var r=new Ajax.Updater({success:"resultDiv"},q,{method:"get",parameters:u,evalScripts:true,onFailure:'$("resultDiv").innerHTML = "Sorry. Our mapping facility does not support your browser. Please select an address using the Find Adress facility instead.");'})})}if(m){var e=m;e(b)}}}var timerID=0;var timerStartMillisecs;function initialiseTimer(a){timerStartMillisecs=0;if(a){timerStartMillisecs=a*1000}setTimer(false)}function setTimer(b){if(timerID){clearTimeout(timerID);timerID=0}var a=getCookie("lastContactInterval");if(!a){a=1000}else{a=a/1}var d=new Date();var c=new Date();var e=new Date();c.setTime(d.getTime()-a);e.setTime(timerStartMillisecs+a);if(b){a=a/1+1000;setCookie("lastContactInterval",a)}if((document.theTimer!=null)&&(document.theTimer.theTime!=null)){if(e.getSeconds()<=9){document.theTimer.theTime.value=""+e.getMinutes()+":0"+e.getSeconds()}else{document.theTimer.theTime.value=""+e.getMinutes()+":"+e.getSeconds()}if(e.getHours()>0){document.theTimer.theTime.value=""+e.getHours()+":"+document.theTimer.theTime.value}}timerID=setTimeout("setTimer(true)",1000)}function clearTimer(){if(timerID){clearTimeout(timerID);timerID=0}setCookie("lastContactInterval",0)}function disableButtons(c){var a=c;for(i=0;i<a.form.length;i++){var b=a.form.elements[i];if(b.type.toLowerCase()=="submit"||b.name.toLowerCase()=="gotopage"||b.type.toLowerCase()=="reset"){b.disabled=true}}}function getSelectedFormParas(){var b=Form.serialize($("NonStopGov"));var f=Form.getElements($("NonStopGov"));for(var d=0;d<f.length;d++){var c=$(f[d]);var e=c.name+"=";var a="x_"+c.name+"=";if(c.type.toLowerCase()=="button"||c.type.toLowerCase()=="submit"){b=b.replace(e,a)}}return b}function panelInit(){panelUsed="true";YAHOO.nsg.container.panel=new YAHOO.widget.Panel("panel",{visible:false,constraintoviewport:true,zIndex:99,underlay:"none",effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}})}function calInit(){YAHOO.nsg.container.calendar=new YAHOO.widget.Calendar("calendar","calContainer",{navigator:true});YAHOO.nsg.container.calPanel=new YAHOO.widget.Panel("calPanel",{visible:false,width:"180px",height:"220px",draggable:true,constraintoviewport:true,zIndex:99,underlay:"none",effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25}});YAHOO.nsg.container.calendar.render();YAHOO.nsg.container.calPanel.render();YAHOO.nsg.container.calPanel.hide();YAHOO.nsg.container.calendar.selectEvent.subscribe(handleSelect,YAHOO.nsg.container.calendar,true)}function handleSelect(e,c,h){var g=c[0];var b=g[0];var d=b[0],f=b[1],a=b[2];if(dateFormat=="US"){document.getElementById(calDate).value=f+"/"+a+"/"+d}else{document.getElementById(calDate).value=a+"/"+f+"/"+d}validateField(document.getElementById(calDate),"DATE");if(typeof resetAllItems=="function"){resetAllItems()}YAHOO.nsg.container.calendar.hide();YAHOO.nsg.container.calPanel.hide()}function XYPos(a){YAHOO.nsg.container.panel.cfg.setProperty("xy",[YAHOO.util.Event.getPageX(a),YAHOO.util.Event.getPageY(a)]);YAHOO.nsg.container.panel.show()}function closePanel(a){YAHOO.nsg.container.panel.hide()}function ScreenXY(c){if(typeof(window.innerWidth)=="number"){var a=window.innerHeight*0.75;a=a+"px";var b="90%";YAHOO.nsg.container.panel.cfg.setProperty("width",b);YAHOO.nsg.container.panel.cfg.setProperty("height",a);YAHOO.nsg.container.panel.cfg.setProperty("overflow","visible")}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){YAHOO.nsg.container.panel.cfg.setProperty("width","90%");YAHOO.nsg.container.panel.cfg.setProperty("height",document.documentElement.clientHeight*0.75);YAHOO.nsg.container.panel.cfg.setProperty("overflow","visible")}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){YAHOO.nsg.container.panel.cfg.setProperty("width","90%");YAHOO.nsg.container.panel.cfg.setProperty("height",document.body.clientHeight*0.75);YAHOO.nsg.container.panel.cfg.setProperty("overflow","visible")}}}}function correctPNG(){var f=navigator.appVersion.split("MSIE");var g=parseFloat(f[1]);if((g>=5.5)&&(document.body.filters)){for(var c=0;c<document.images.length;c++){var d=document.images[c];var j=d.src.toUpperCase();if(j.substring(j.length-3,j.length)=="PNG"&&j.indexOf("/ICON")>-1){var e=(d.id)?"id='"+d.id+"' ":"";var m=(d.className)?"class='"+d.className+"' ":"";var b=(d.title)?"title='"+d.title+"' ":"title='"+d.alt+"' ";var h="display:inline-block;"+d.style.cssText;if(d.align=="left"){h="float:left;"+h}if(d.align=="right"){h="float:right;"+h}if(d.parentElement.href){h="cursor:hand;"+h}var a="<span "+e+m+b+' style="width:'+d.width+"px; height:"+d.height+"px;"+h+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.src+"', sizingMethod='scale');\"></span>";d.outerHTML=a;c=c-1}}}}function resetSlots(e,d,c,b){var a=true;k=1;l=0;if(current_session==""){current_session=d}allObjs=document.getElementsByTagName("input");for(i=0;i<allObjs.length;i++){if((current_session!=d)||b>1){if(allObjs[i].type=="checkbox"&&allObjs[i].id==d&&allObjs[i].value==c){allObjs[i].checked=true}else{if(allObjs[i].type=="checkbox"&&allObjs[i].disabled==false){allObjs[i].checked=false}}}}while(b>1&&k<b&&l<allObjs.length){if(allObjs[l].type=="checkbox"&&allObjs[l].id==d&&allObjs[l].name=="sessionSeq"+(c+k)){if(allObjs[l].disabled==true){alert("Could not select required consecutive slots");a=false;break}else{allObjs[l].checked=true;k++}}l++}if(k<b&&a){alert("No further slots available for this date and location")}if(current_session!=d){current_session=d}}function requiredItems(){var a="";allObjs=document.getElementsByTagName("select");for(i=allObjs.length-1;i>=0;i--){if(allObjs[i].id.indexOf("required")>0){if(allObjs[i].value==""){a=allObjs[i]}}}if(a==""){allObjs=document.getElementsByTagName("textarea");for(i=allObjs.length-1;i>=0;i--){if(allObjs[i].id.indexOf("required")>0){if(allObjs[i].value==""){a=allObjs[i]}}}}if(a==""){allObjs=document.getElementsByTagName("input");for(i=allObjs.length-1;i>=0;i--){if(allObjs[i].id.indexOf("required")>0){if(allObjs[i].value==""){a=allObjs[i]}}}}if(a!=""){a.focus();alert("This field must be specified");return false}}function hideEl(a){if(document.getElementById(a)){document.getElementById(a).style.display="none"}else{if(document.id!=null){if(document.layers){document.id.display="none"}else{document.all.id.style.display="none"}}}}function showEl(a){if(document.getElementById(a)){document.getElementById(a).style.display="inline"}else{if(document.id!=null){if(document.layers){document.id.display="inline"}else{document.all.id.style.display="inline"}}}}function FCKeditor_OnComplete(a){a.EditorWindow.focus();a.Focus()}var tl;function onLoadTimeline(f,c,b){var d=new Timeline.DefaultEventSource();var e=Timeline.ClassicTheme.create();e.event.label.width=500;e.event.bubble.width=300;e.event.bubble.height=95;var a;if(b&&b=="DAY"){a=[Timeline.createBandInfo({showEventText:false,eventSource:d,date:c,width:"20%",intervalUnit:Timeline.DateTime.DAY,intervalPixels:50,theme:e}),Timeline.createBandInfo({eventSource:d,date:c,width:"80%",intervalUnit:Timeline.DateTime.HOUR,intervalPixels:40,theme:e})]}else{a=[Timeline.createBandInfo({showEventText:false,eventSource:d,date:c,width:"20%",intervalUnit:Timeline.DateTime.WEEK,intervalPixels:50,theme:e}),Timeline.createBandInfo({eventSource:d,date:c,width:"80%",intervalUnit:Timeline.DateTime.DAY,intervalPixels:100,theme:e})]}a[0].syncWith=1;a[1].highlight=true;tl=Timeline.create(document.getElementById("tl"),a,Timeline.HORIZONTAL);tl.loadXML(f,function(h,g){d.loadXML(h,g)})}var resizeTimerID=null;function onResize(){if(resizeTimerID==null){resizeTimerID=window.setTimeout(function(){resizeTimerID=null;tl.layout()},500)}}var markerClick=function(a){if(this.popup==null){this.popup=this.createPopup(true);map.addPopup(this.popup);this.popup.show()}else{this.popup.toggle()}currentPopup=this.popup;OpenLayers.Event.stop(a)};function setMarker(c,f,a,b,d,e){markerFeature=new OpenLayers.Feature(markersLayer,c);markerFeature.closeBox=true;markerFeature.popupClass=f;markerFeature.data.popupContentHTML=a;markerFeature.data.overflow=(e)?"auto":"hidden"}function LocationHandler(a){window.location=window.location+"&lat="+a.coords.latitude+"&long="+a.coords.longitude;return true}function appendLocation(){if(geo_position_js.init()){geo_position_js.getCurrentPosition(LocationHandler,null)}}function getBrowserLocation(b){if(geo_position_js.init()){geo_position_js.getCurrentPosition(useBrowserLocation,null)}else{if(b!=null){var a=new LokiAPI();a.onSuccess=function(c){useBrowserLocation(c.longitude,c.latitude)};a.onFailure=function(c,d){alert("Sorry. We are unable to establish your current location")};a.setKey(b);a.requestLocation(true,a.NO_STREET_ADDRESS_LOOKUP)}}}var postcode="";var country="";var baseUrl="";var account_code="";var license_code="";var machine_id="";var item_seq=0;var nsg_city=new Array();var nsg_state=new Array();var nsg_postcode=new Array();var nsg_addr=new Array();function pcaByPostcodeBegin(f,c,b,g,e){postcode=document.getElementById("selectpostcode").value;item_seq=c+2;country=f;account_code=b;license_code=g;machine_id=e;var d=document.getElementById("pcaScriptTag");var a=document.getElementsByTagName("head").item(0);var h="";document.getElementById("divLoading").style.display="";h="http://services.postcodeanywhere.co.uk/inline.aspx?postcode="+escape(postcode);if(country&&country=="GB"){h+="&action="+escape("lookup");h+="&type="+escape("by_postcode")}else{h+="&action="+escape("international");h+="&type="+escape("fetch_streets");h+="&country="+escape(country)}h+="&account_code="+escape(account_code);h+="&license_code="+escape(license_code);h+="&machine_id="+escape(machine_id);h+="&callback=pcaByPostcodeEnd";if(d){a.removeChild(d)}d=document.createElement("script");d.src=h;d.type="text/javascript";d.id="pcaScriptTag";a.appendChild(d)}function pcaByPostcodeEnd(){document.getElementById("divLoading").style.display="none";if(pcaIsError){document.getElementById("selectaddress").style.display="none";alert(pcaErrorMessage)}else{if(pcaRecordCount==0){document.getElementById("selectaddress").style.display="none";alert("Sorry, no matching items found. Please try another postcode.")}else{if(country&&country=="GB"){document.getElementById("selectaddress").style.display="none";if(pcaRecordCount<2){document.getElementById("selectaddress").size=2}else{if(pcaRecordCount>6){document.getElementById("selectaddress").size=6}else{document.getElementById("selectaddress").size=pcaRecordCount}}document.getElementById("selectaddress").style.display="";for(i=document.getElementById("selectaddress").options.length-1;i>=0;i--){document.getElementById("selectaddress").options[i]=null}for(i=0;i<pca_id.length;i++){document.getElementById("selectaddress").options[document.getElementById("selectaddress").length]=new Option(pca_description[i],pca_id[i])}}else{document.getElementById("selectaddress").style.display="none";if(pcaRecordCount<2){var b=pca_street[0];if(pca_district[0]!=null){b+="\n"+pca_district[0]}document.getElementById("p_"+item_seq).value=b;item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=pca_city[0];item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=pca_state[0];item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=pca_postcode[0];document.getElementById("selectaddress").size=2;return false}else{if(pcaRecordCount>6){document.getElementById("selectaddress").size=6}else{document.getElementById("selectaddress").size=pcaRecordCount}}document.getElementById("selectaddress").style.display="";for(i=document.getElementById("selectaddress").options.length-1;i>=0;i--){document.getElementById("selectaddress").options[i]=null}nsg_city=new Array();nsg_state=new Array();nsg_postcode=new Array();nsg_addr=new Array();for(i=0;i<pca_street.length;i++){var a=pca_street[i];if(pca_district[i]!=null&&pca_district[i]!=""){a+=", "+pca_district[i]}document.getElementById("selectaddress").options[document.getElementById("selectaddress").length]=new Option(a,"p_"+i);var b=pca_street[i];if(pca_district[i]!=null){b+="\n"+pca_district[i]}nsg_addr[i]=b;nsg_city[i]=pca_city[i];nsg_state[i]=pca_state[i];nsg_postcode[i]=pca_postcode[i]}}}}}function pcaFetchBegin(d){country=d;if(country&&country=="GB"){var c=document.getElementById("selectaddress").value;var b=document.getElementById("pcaScriptTag");var a=document.getElementsByTagName("head").item(0);var e="";e="http://services.postcodeanywhere.co.uk/inline.aspx?action=fetch";e+="&id="+escape(c);e+="&account_code="+escape(account_code);e+="&license_code="+escape(license_code);e+="&machine_id="+escape(machine_id);e+="&callback=pcaFetchEnd";if(b){a.removeChild(b)}b=document.createElement("script");b.src=e;b.type="text/javascript";b.id="pcaScriptTag";a.appendChild(b)}else{var f=document.getElementById("selectaddress").value;f=f.substring(2,f.length);document.getElementById("p_"+item_seq).value=nsg_addr[f];item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=nsg_city[f];item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=nsg_state[f];item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=nsg_postcode[f]}document.getElementById("selectaddress").style.display="none"}function pcaFetchEnd(){if(pcaIsError){alert(pcaErrorMessage)}else{if(pcaRecordCount==0){alert("Sorry, no matching items found")}else{if(country&&country=="GB"){var a=pca_line1[0];if(pca_line2[0]!=null){a+="\n"+pca_line2[0]}if(pca_line3[0]!=null){a+="\n"+pca_line3[0]}document.getElementById("p_"+item_seq).value=a;item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=pca_post_town[0];item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=pca_county[0];item_seq=item_seq+1;document.getElementById("p_"+item_seq).value=pca_postcode[0]}}}}function scheduleResizeFrame(a){setTimeout("resizeFrame('"+a+"')",1)}function resizeFrame(a){var b=0;if(self.parent.document.getElementById(a)){if(self.parent.document.getElementById(a).contentDocument&&self.parent.document.getElementById(a).contentDocument.documentElement){b=self.parent.document.getElementById(a).contentDocument.documentElement.scrollHeight+40;if(!b||b<400||b=="undefined"){b=600}self.parent.document.getElementById(a).style.height=b+"px"}else{if(self.parent.document.getElementById(a).Document&&self.parent.document.getElementById(a).Document.body&&self.parent.document.getElementById(a).Document.body.scrollHeight){b=self.parent.document.getElementById(a).Document.documentElement.scrollHeight+10;if(!b||b<400||b=="undefined"){b=600}self.parent.document.getElementById(a).style.height=b+"px"}}}};