function OpenPopup(a,b,c,d,e,f,g){if(f==null)f=0;if(e==null)e=0;if(g==null)g="no";param="height="+d+", width="+c+", top="+(screen.height-d)/2+", left="+(screen.width-c)/2+", scrollbars="+e+", resizable="+f+", location="+g;win=window.open(a,b,param);parseInt(navigator.appVersion)>=4&&win.window.focus()}function isSet(a){return typeof window[a]!=="undefined"}function ConvertToInteger(a){if(a)a.value=parseInt(a.value);if(a.value=="NaN")a.value=""} function getInputFormElement(a,b){var c=null;if(a!=null&&b!=null)c=document.getElementById(a+":"+b);return c}function getInputValue(a,b){var c=getInputFormElement(a,b),d=null;if(c!=null)d=c.value;return d}function setInputValue(a,b,c){b=getInputFormElement(a,b);if(b!=null&&c!=null){b.value=c;a=document.getElementById(a);a!=null&&iceSubmitPartial(a,b)}} function loadjscssfile(a,b){if(b!=null&&a!=null)if(b.toLowerCase()=="js"){var c=document.createElement("script");c.setAttribute("type","text/javascript");c.setAttribute("src",a)}else{c=document.createElement("link");c.setAttribute("rel","stylesheet");c.setAttribute("type","text/css");c.setAttribute("href",a)}typeof c!="undefined"&&document.getElementsByTagName("head")[0].appendChild(c)} function CTools(){this.ID=0;this.GetID=function(){return this.ID++};this.GetBoundingBox=function(a,b,c,d){a=parseFloat(a);b=parseFloat(b);c=parseFloat(c);d=parseFloat(d);if(a&&b&&c&&d&&a!=0&&b!=0&&c!=0&&d!=0)return new GLatLngBounds(new GLatLng(a,b),new GLatLng(c,d))};this.GetBounds2PolygonPnts=function(a){if(a!=null&&a instanceof GLatLngBounds){var b=a.getSouthWest();a=a.getNorthEast();var c=new GLatLng(a.lat(),b.lng()),d=new GLatLng(b.lat(),a.lng());return[b,d,a,c,b]}return null};this.DebugBounds= function(a,b,c,d){var e=null;e=a instanceof GLatLngBounds?this.GetBounds2PolygonPnts(a):[new GLatLng(parseFloat(a),parseFloat(b)),new GLatLng(parseFloat(a),parseFloat(d)),new GLatLng(parseFloat(c),parseFloat(d)),new GLatLng(parseFloat(c),parseFloat(b)),new GLatLng(parseFloat(a),parseFloat(b))];if(e!=null){a=new GPolygon(e,null,1,0.7,"#aaaaff",0);g_map.addOverlay(a)}};this.getElementAbsolutePosition=function(a){var b=0,c=0;if(a&&typeof a.offsetParent!="undefined")for(;a&&typeof a.offsetLeft=="number";){b+= a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return{x:b,y:c}};this.isIE=function(){return BrowserDetect.browser=="Explorer"};this.getWindowInnerHeight=function(){var a=null;return a=BrowserDetect.browser=="Explorer"?parseInt(document.documentElement.clientHeight):parseInt(window.innerHeight)};this.getWindowInnerWidth=function(){var a=null;return a=BrowserDetect.browser=="Explorer"?parseInt(document.documentElement.clientWidth):parseInt(window.innerWidth)};this.FilterString2FilterArray=function(a){var b= [];if(a!=null){b=[];a=a.split(";");for(var c=0;c<a.length;c++)if(a[c]!=null&&a[c]!=""&&a[c]!=";")b[a[c]]=true}return b};this.IsMapObject=function(a){var b=false;if(a!=null)if(a instanceof CMarker||a instanceof CPolyline||a instanceof CPolygon)b=true;return b};this.ParsePointsArrayCSV=function(a){var b=[];if(a!=null){a=a.split(";");for(var c=0;c+1<a.length;c+=2)if(a[c]!=""&&a[c+1])b[b.length]=new GLatLng(parseFloat(a[c]),parseFloat(a[c+1]))}return b};this.ParseBoolean=function(a){var b=null;if(a!= null&&typeof a==="string"){a=a.toLowerCase();if(a=="true")b=true;else if(a=="false")b=false;else if(a=="1")b=true;else if(a=="0")b=false;else if(a<1)b=false;else if(a>0)b=true}else if(typeof a==="boolean")b=a;return b};this.GetPoint=function(a,b){return new GLatLng(parseFloat(a),parseFloat(b))};this.BinarySearch=function(a,b){if(a.length>0){var c=0,d=0,e=0,f=a.length-1;do{d=Math.round((c+f)/2);if(a[d][0]==b){e=1;break}else if(a[d][0]<b)c=d+1;else d=f=d-1}while(e==0&&c<=f);if(d>=a.length-1&&e!=1)d= a.length;else if(d<0)d=0;return d}return null};this.InsertIntoArrayAt=function(a,b,c){if(c.length<=0)c[c.length]=b;else if(a==0)c.unshift(b);else if(a>0){var d=c.slice(a);c=c.slice(0,a);c[c.length]=b;c=c.concat(d)}return c};this.InsertObject=function(a,b,c){b=Array(c,b);c=0;if(a.length>0){c=this.BinarySearch(a,b[0]);var d=0;if(c<a.length)if(a[c][0]==b[0])if(b[1]==a[c][1])d=-1;else c++;else a[c][0]<b[0]&&c++;if(d==0)a=this.InsertIntoArrayAt(c,b,a)}else a[0]=b;return Array(c,a)};this.CalcArea=function(a, b,c,d){for(var e=0;d<b;)d+=360;return e=(c-a)*(d-b)};this.CalculateFillRate=function(a,b,c,d){var e=g_map.getBounds(),f=e.getSouthWest(),g=e.getNorthEast();e=f.lat();f=f.lng();var i=g.lat();g=g.lng();var h=0;var j=h=0;a=a;b=b;c=c;d=d;if(a>=i||c<=e||d<=f||a>=i)return 0;if(b<f)b=f;if(d>g)d=g;if(c>i)c=i;if(a<e)a=e;if(f>g)g+=360;h=this.CalcArea(a,b,c,d);j=this.CalcArea(e,f,i,g);h=h/j*100;if(h>100||h<0)h=0;return h};this.InsertObject2Array=function(a,b){if(a==null)a=[];a[a.length]=b;return a};this.RemoveArrayElement= function(a,b){a!=null&&a.length>0&&b!=null&&b>=0&&b<a.length&&a.splice(b,1);return a}} var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(a){for(var b=0;b<a.length;b++){var c=a[b].string,d=a[b].prop;this.versionSearchString=a[b].versionSearch||a[b].identity;if(c){if(c.indexOf(a[b].subString)!=-1)return a[b].identity}else if(d)return a[b].identity}}, searchVersion:function(a){var b=a.indexOf(this.versionSearchString);if(b!=-1)return parseFloat(a.substring(b+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor, subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}], dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();function hideIframeLoadingMessage(a){if(a!=null){var b=document.getElementById(a+"_loading");if(b!=null)b.style.display="none";a=document.getElementById(a);if(a!=null)a.style.display="block"}} function findIframeByName(a){var b=null;if(a!=null)for(var c=0;c<window.frames.length;c+=1)if(window.frames[c].name==a){b=window.frames[c];break}return b}function toggleJsCheckboxState(a,b,c,d,e){if(a!=null){if(a.checked===undefined){a.checked=b;a.cross=c}a.checked===true?uncheckCheckbox(a,b,e):checkCheckbox(a,b,d)}}function processInitialCheckboxState(a,b){if(a!=null)if(b!=null&&(a.initialState==null||a.initialState==undefined)){a.initialState=b;a.checked=b}} function checkCheckbox(a,b,c){if(a!=null){processInitialCheckboxState(a,b);a.checked=true;checkJsCheckbox(a);c!=null&&eval(c)}}function uncheckCheckbox(a,b,c){if(a!=null){processInitialCheckboxState(a,b);a.checked=false;uncheckJsCheckbox(a);c!=null&&eval(c)}}function uncheckJsCheckbox(a){if(a!=null)a.style.backgroundPosition="0 0"}function checkJsCheckbox(a){if(a!=null)a.style.backgroundPosition=a.cross?"0 -26px":"0 -13px"};