setInterval("ping()",20*60000);function ping(){$.get(searchFormI18N.pingUrl,function(data){})}function hidePoi(){$("#poiDisplay").css({visibility:"hidden",display:"none"});$("#poiOverlay").css("visibility","hidden")}function showPoi(inId,inTab,inProviderCode){var url=poiDisplayI18N.url;url+=(url.indexOf("?")==-1?"?ts=":"&ts=")+poiDisplayI18N.ts;url+="&api=search";if(inTab){url+="&cardTab="+inTab}if(inProviderCode){url+="&code="+inProviderCode}url=url.replace(/T4EOID/g,inId);if(poiDisplayI18N.poiDisplay=="INTERNAL"){$("#poiFrame").attr("src",url);var height=getHeight(document.body);var width=getWidth(document.body);$("#poiDisplay").css({top:((height-(height*0.8))/2)+"px",left:((width-(width*0.8))/2)+"px",width:(width*0.8)+"px",height:(height*0.8)+"px",visibility:"visible",display:"block"});$("#poiOverlay").css("visibility","visible")}else{if(poiDisplayI18N.poiDisplay=="WINDOW"){win=openWindow(url,"POI",poiDisplayI18N.poiWidth,poiDisplayI18N.poiHeight);window.setTimeout(function(){win.focus()},200)}}}function editFile(inUrl,inId){if(inUrl.indexOf("?")==-1){inUrl+="?id="+inId}else{inUrl+="&id="+inId}openWindow(inUrl,"addInfo",500,190)}function editText(inUrl,inId){if(inUrl.indexOf("?")==-1){inUrl+="?id="+inId}else{inUrl+="&id="+inId}openWindow(inUrl,"addInfo",500,300)}function editPosition(inUrl,inId,inName,inGiataId,inLng,inLat){if(inUrl.indexOf("?")==-1){inUrl+="?"}else{inUrl+="&"}height=Math.round(screen.height*0.8);width=Math.round(screen.width*0.8);if(inId==null||inId==""){inUrl+="&name="+inName+"&giataid="+inGiataId+"&longitude="+inLng+"&latitude="+inLat+"&height="+height}else{inUrl+="id="+inId+"&height="+height}openWindow(inUrl,"addInfo",width,height)}function addOption(inSelect,inValue,inSelValue){if(inSelect){var newOption=new Option(inValue,inValue,false,(inSelValue==inSelValue));inSelect.options[inSelect.length]=newOption}}function removeAllElements(inSelect){if(inSelect){while(inSelect.length>1){inSelect.remove(inSelect.length-1)}}}function openWindow(mypage,myname,w,h,scroll,x,y){if(x!=null){leftPosition=x}else{leftPosition=(screen.width)?(screen.width-w)/2:0}if(leftPosition<0){leftPosition=0}if(y!=null){topPosition=y}else{topPosition=(screen.height)?(screen.height-h)/2-15:0}if(topPosition<0){topPosition=0}if((typeof scroll)=="boolean"){if(scroll){scroll="yes"}else{scroll="no"}}settings="height="+h+",width="+w+",top="+topPosition+",left="+leftPosition+",scrollbars="+scroll+",resizable";var paramSep="&";if(mypage.indexOf("?")==-1){paramSep="?"}var now=new Date();mypage=mypage+paramSep+"ts="+now.getMilliseconds()+1000*now.getSeconds()+60000*now.getMinutes();try{if((opener&&!opener.closed&&opener.name==myname)||(window.name==myname)){window.location.href=mypage;try{window.focus()}catch(err){}return window}}catch(Error){}w=window.open(mypage,myname,settings);try{w.focus()}catch(err){}return w}function html_entity_decode(str){if(str){var ta=document.getElementById("htmlDecoder");if(ta==null){ta=document.createElement("textarea");ta.id="htmlDecoder"}ta.innerHTML=str.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&amp;/g,"&");return ta.value}return str}function html_entity_encode(str){if(str){return str.replace(/&lt;/g,"<").replace(/&gt;/g,">")}return str}function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!="function"){window.onload=func}else{window.onload=function(){oldonload();func()}}}function addUnloadEvent(func){var oldonunload=window.unload;if(typeof window.onunload!="function"){window.onunload=func}else{window.onunload=function(){oldunonload();func()}}}function getWidth(inElement){if(inElement){return inElement.offsetWidth}else{if(typeof(window.innerWidth)=="number"){return window.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){return document.body.clientWidth}}}}}function getHeight(inElement){if(inElement){return inElement.offsetHeight}else{if(typeof(window.innerHeight)=="number"){return window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){return document.body.clientHeight}else{return 0}}}}}function getLeft(inElement,relative){var x=0;if(typeof(inElement)=="object"&&document.getElementById){x=inElement.offsetLeft;if(inElement.offsetParent&&!relative){x+=getLeft(inElement.offsetParent)}return x}else{return 0}}function getTop(inElement,relative){var y=0;if(typeof(inElement)=="object"&&document.getElementById){y=inElement.offsetTop;if(inElement.offsetParent&&!relative){y+=getTop(inElement.offsetParent)}return y}else{return 0}}function UserAgent(){var aAppName=navigator.appName.toUpperCase();var aAppVersion=navigator.appVersion;var aAppAgent=navigator.userAgent;var aAppIntVersion=parseInt(this.aAppVersion);if(aAppName=="NETSCAPE"){aAppName="ns"}else{if(aAppName=="MICROSOFT INTERNET EXPLORER"){aAppName="ie"}else{if(aAppName=="OPERA"){aAppName="op"}}}this.ns=(aAppName=="ns"&&aAppIntVersion>=4);this.ns4=(aAppName=="ns"&&aAppIntVersion==4);this.ns5=(aAppName=="ns"&&aAppIntVersion==5);this.ie=(aAppName=="ie");this.ie4=(aAppVersion.indexOf("MSIE 4")>0);this.ie55=(aAppVersion.indexOf("MSIE 5.5")>0);this.ie5=(!this.ie55&&aAppVersion.indexOf("MSIE 5")>0);this.ie6=(aAppVersion.indexOf("MSIE 6")>0);this.ie7=(aAppVersion.indexOf("MSIE 7")>0);this.ie8=(aAppVersion.indexOf("MSIE 8")>0);this.ie9=(aAppVersion.indexOf("MSIE 9")>0);this.saf=(aAppName=="ns"&&aAppVersion.indexOf("Safari")>0);this.chrome=(aAppVersion.indexOf("Chrome")>0);this.ff=(aAppName=="ns"&&aAppVersion.indexOf("Firefox")>0);this.ff3=(this.ff&&aAppVersion.indexOf("3.0")>0);this.ff35=(this.ff&&aAppVersion.indexOf("3.5")>0);this.ff36=(this.ff&&aAppVersion.indexOf("3.6")>0);this.ff4=(this.ff&&aAppVersion.indexOf("4.0")>0);this.op=(aAppName=="op");this.op4=(aAppName=="op"&&aAppIntVersion==4);this.op5=(aAppName=="op"&&aAppIntVersion==5);this.op5=(aAppName=="op"&&aAppIntVersion==6);this.win7=(aAppAgent.indexOf("Windows NT 6.1")>0);this.vista=(aAppAgent.indexOf("Windows NT 5.2")>0);this.xp=(aAppAgent.indexOf("Windows NT 5.1")>0);this.w2k=(aAppAgent.indexOf("Windows NT 5.0")>0);this.macOSX=(aAppAgent.indexOf("Mac OS X")>0);this.linux=(aAppAgent.indexOf("Linux")>0)}var at=new UserAgent();function buildPOST(theFormName){arr=buildPOSTArray(theFormName);var qs="";for(var name in arr){qs+=(qs=="")?"":"&";qs+=name+"="+encodeURIComponent(arr[name])}return qs}function buildPOSTArray(theFormName){theForm=document.forms[theFormName];var qs={};for(e=0;e<theForm.elements.length;e++){if(theForm.elements[e].name!=""){name=theForm.elements[e].name;value=theForm.elements[e].value;if(value!=WatermarkFields.get(theForm.elements[e].id)){qs[name]=value}}}return qs}var WatermarkFields={fields:{},get:function(id){return this.fields[id]},init:function(array){if(array){this.fields=array;$.each(this.fields,function(key,value){$("#"+key).each(function(){if($(this).val()==""||$(this).val()==value){$(this).val(value);$(this).addClass("watermark")}});$("#"+key).bind("focus",function(){if($(this).val()==value&&$(this).selection){$(this).selection(0,0)}});$("#"+key).bind("keydown",function(){if($(this).val()==value){$(this).val("");$(this).removeClass("watermark")}});$("#"+key).bind("blur",function(){if($(this).val()==""){$(this).val(value);$(this).addClass("watermark")}})})}}};var TabbedItems={init:function(){$(".tab_item").click(function(){TabbedItems.displayElem(this)});$(".selected").each(function(){TabbedItems.displayElem(this)});$(".tabname").each(function(){selTab=$(this).val();TabbedItems.selectTab(selTab)})},selectTab:function(selTab){elem=$(".tab_item[val='"+selTab+"']");if(elem){TabbedItems.displayElem(elem)}},displayElem:function(elem){$(elem).parent().children().each(function(){$(this).removeClass("selected");$("#"+$(this).attr("rel")).hide()});$(elem).addClass("selected");background=$(elem).parent().find(".moving_bg");$(background).hide();$(background).css("left",$(elem).position()["left"]);$(background).css("top",getHeight($(elem)[0])+4);$(background).css("width",getWidth($(elem)[0]));$(background).show();tabname=$(elem).parent().find(".tabname");$(tabname).val($(elem).attr("val"));$("#"+$(elem).attr("rel")).show();if(at.ie){$(".tabshowhide").hide().show()}window.setTimeout(function(){$("#"+$(elem).attr("rel")).focus()},500)},focusTab:function(selTab){$("#"+selTab).focus()}};
