if(location.replace==null){location.replace=location.assign}function selected_items(d){var b,a=false,c=document.getElementById("selection_list");for(b=0;b<c.elements.length;b++){if(c.elements[b].checked){a=true;break}}if(!a){form_checkAll(true)}c.action="/"+d;c.submit();return true}function form_checkAll(a){var b,c=document.getElementById("selection_list");for(b=0;b<c.elements.length;b++){c.elements[b].checked=a}return false}function setDisabled(e,a){e.disabled=a;var d,c=e.getElementsByTagName("*");if(c){for(d=0;d<c.length;d++){setDisabled(c[d],a)}}}function form_get(d){var b,c,a="";for(b=0;b<d.elements.length;b++){c=d.elements[b];if(c.tagName=="INPUT"){if(c.type=="text"||c.type=="hidden"){a+="&"+c.name+"="+encodeURI(c.value)}if(c.type=="checkbox"){if(c.checked){a+="&"+c.name+"="+encodeURI(c.value)}}if(c.type=="radio"){if(c.checked){a+="&"+c.name+"="+encodeURI(c.value)}}continue}if(c.tagName=="SELECT"){if(c.selectedIndex>=0){a+="&"+c.name+"="+encodeURI(c.options[c.selectedIndex].value)}continue}if(c.tagName=="TEXTAREA"){a+="&"+c.name+"="+encodeURI(c.value);continue}}return a}function subtleRow(a,i){var g=a.className,f=g.indexOf("_"),d=(i)?"_on":"_off",b=g.substring(0,f)+d;a.className=b}function site_sndml(j,a,b){var d,g,f,e="";for(d=0;d<a.length;d++){g=a.charAt(d);f=sndml.indexOf(g,0);if(f<0){e=e+g}else{e=e+sndml.charAt(27-f)}}j.href="mailto:"+e;if(b){j.href=j.href+"?"+b}return true}function getParent(b,a){if(b==null){return null}if(b.nodeType==1&&b.tagName.toLowerCase()==a.toLowerCase()){return b}else{return getParent(b.parentNode,a)}}function getposOffset(b,a){return(b.offsetParent)?b[a]+this.getposOffset(b.offsetParent,a):b[a]}function seteleClass(c,a){var b=document.getElementById(c);if(b){b.className=a}}function add_arg2url(b,a){if(b.indexOf("?")>0){return b+"&"+a}else{return b+"?"+a}}function add_args(b,a){if(b==""){return a}else{return b+"&"+a}}function cursor_wait(){if(document.body){document.body.style.cursor="wait"}}function cursor_clear(){if(document.body){document.body.style.cursor="default"}}function site_div_state(a,c){var b=document.getElementById(a).style;if(b.display=="none"){b.display="block"}else{b.display="none"}}function clear_div(a){var b=document.getElementById(a);if(b){b.innerHTML=""}}function replace_div(div_id,body){if(body.substr(0,5)=="AJAX:"){eval(body.substr(5));return}var i,x,result_div=document.getElementById(div_id);if(result_div){result_div.innerHTML=body;x=result_div.getElementsByTagName("script");for(i=0;i<x.length;i++){eval(x[i].text)}}}function confirm_ajax_action(b,a){if(confirm(a)){return ajax_action(b)}else{return true}}function ajax_submit_form(d,b,c){var e=getParent(d,"FORM"),f=getParent(e,"DIV"),a=site_root+"?"+b;return ajax_form(e.id,f.id,a,c)}function ajax_action(i,c,f){if(!use_ajax){location.replace(i.href);return false}var b,g,e,d,a=i.href;if(a.indexOf("?")>0){e=a.split("?");d=e[1].split("#");b=d[0]}else{b=""}if(c==null){g=getParent(i,"DIV");c=g.id}b=add_args(b,"ajax_id="+c);if(f!=null){b=add_args(b,f)}if(!ajax_setdiv(b,c)){return false}location.replace(i.href);return false}function ajax_send(a){return ajax_request("get",site_root,a,null,null)}function ajax_row_action(f,e,c){if(c&&!confirm(c)){return true}var d=getParent(f,"TR"),a="action="+e+"&func=row_action",b=f.href.indexOf("?");if(b>0){a+="&"+f.href.substring(b+1)}if(ajax_setdiv(a,d.id)){location.replace(f.href);return false}else{return false}}function ajax_setdiv(a,b){var c=document.getElementById(b);if(c){c.className="form_disabled";c.style.cursor="wait";setDisabled(c,true)}return !ajax_request("get",site_root,a,function(d){if(c){c.className="";c.style.cursor="default";c.disabled=false}if(d.responseText!="VOID"){replace_div(b,d.responseText)}},function(d){alert("There was a problem with the request.(Code: "+d.status+")");if(c){c.className="";c.style.cursor="default";setDisabled(c,false)}})}function ajax_form(d,e,b,c){if(!use_ajax){return true}var a,g,f=document.getElementById(d);if(f.method=="post"&&f.encoding=="multipart/form-data"){return true}a=form_get(f);setDisabled(f,true);g=document.getElementById(e);if(g){g.className="form_disabled";g.style.cursor="wait"}if(ajax_request(f.method,b,a,function(i){if(g){g.className="";g.style.cursor="default";g.disabled=false}replace_div(e,i.responseText)},function(i){alert("There was a problem with the request.(Code: "+i.status+")");if(g){g.className="";g.style.cursor="default"}setDisabled(f,false)})){return false}if(!c||f.method=="post"){return true}location.replace(f.action+a);return false}function ajax_url(a){a=add_arg2url(a,"jsa=1&ourl="+escape(location.href));if(sid!=""){a=add_arg2url(a,"PHPSESSID="+sid)}return a}function ajax_request(i,d,c,b,a){var g;if(window.XMLHttpRequest){g=new XMLHttpRequest();if(g.overrideMimeType){g.overrideMimeType("text/html")}}else{if(window.ActiveXObject){try{g=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{g=new ActiveXObject("Microsoft.XMLHTTP")}catch(f){}}}}if(!g){return false}g.onreadystatechange=function(){if(g.readyState==4){if(g.status==200){if(b&&typeof b!="undefined"){b(g)}}else{if(a&&typeof a!="undefined"){a(g)}}}};d=ajax_url(d);if(i=="post"){g.open("POST",d,true);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.setRequestHeader("Content-length",c.length);g.send(c)}else{g.open("GET",add_arg2url(d,c),true);g.send(null)}return true}function accordion(c,a){var b,d=document.getElementById(c);clearInterval(d.timer);d.timer=false;if(d.style.visibility=="hidden"||d.style.visibility==""){d.maxh=d.offsetHeight;d.w=d.offsetWidth;d.style.visibility="visible";d.style.display="none"}if(typeof a!="undefined"){b=getposOffset(a,"offsetLeft");if(d.w){b+=Math.round(a.offsetWidth/2-d.w/2)}if(b<10){b=10}d.style.left=b+"px";d.style.top=getposOffset(a,"offsetTop")+a.offsetHeight+"px"}if(d.style.display=="none"||d.style.display==""){d.style.display="block";if(d.maxh){d.style.height="0px";d.ex=d.offsetHeight;d.d=1}else{d.ex=0;return false}}else{d.maxh=d.offsetHeight;d.d=-1}d.inc=Math.round(d.maxh/15);if(d.inc<1){d.inc=1}d.timer=setInterval("accordion_slide('"+c+"')",10);return false}function accordion_hide(a){var b=document.getElementById(a);if(!b||b.style.display!="block"){return false}return accordion(a)}function accordion_init(a){var b=document.getElementById(a);if(!b){return}b.maxh=b.offsetHeight;b.w=b.offsetWidth;b.style.height="0px";b.ex=b.offsetHeight;b.style.visibility="visible";b.style.display="none"}function accordion_slide(b){var e=document.getElementById(b),a=e.maxh,d=e.offsetHeight+e.inc*e.d;if(d>=a&&e.d==1){clearInterval(e.timer);e.style.height="auto";e.style.opacity=1;e.style.filter="alpha(opacity=100)";return}e.style.opacity=d/e.maxh;e.style.filter="alpha(opacity="+(d*100/e.maxh)+")";d-=e.ex;if(d<2&&e.d!=1){e.style.display="none";clearInterval(e.timer);return}e.style.height=d+"px"}
var bb_successCallback;var bb_errorCallback;function handleBlackBerryLocation(){if(bb_successCallback&&bb_errorCallback){if(blackberry.location.latitude==0&&blackberry.location.longitude==0){bb_errorCallback({message:"Position unavailable",code:2})}else{var a=null;if(blackberry.location.timestamp){a=new Date(blackberry.location.timestamp)}bb_successCallback({timestamp:a,coords:{latitude:blackberry.location.latitude,longitude:blackberry.location.longitude}})}if(parseFloat(navigator.appVersion)>=4.6){blackberry.location.removeLocationUpdate(handleBlackBerryLocation)}bb_successCallback=null;bb_errorCallback=null}}var geo_position_js=function(){var a={};var b=null;a.getCurrentPosition=function(c,d,e){b.getCurrentPosition(c,d,e)};a.init=function(){try{if(typeof(geo_position_js_simulator)!="undefined"){b=geo_position_js_simulator}else{if(typeof(bondi)!="undefined"&&typeof(bondi.geolocation)!="undefined"){b=bondi.geolocation}else{if(typeof(window.google)!="undefined"&&typeof(window.google.gears)!="undefined"){b=google.gears.factory.create("beta.geolocation");a.getCurrentPosition=function(d,f,g){try{function i(e){if(typeof(e.latitude)!="undefined"){d({timestamp:e.timestamp,coords:{latitude:e.latitude,longitude:e.longitude}})}else{d(e)}}b.getCurrentPosition(i,f,g)}catch(j){f({message:j,code:1})}}}else{if(typeof(navigator.geolocation)!="undefined"){b=navigator.geolocation;a.getCurrentPosition=function(d,e,f){function g(i){if(typeof(i.latitude)!="undefined"){d({timestamp:i.timestamp,coords:{latitude:i.latitude,longitude:i.longitude}})}else{d(i)}}b.getCurrentPosition(g,e,f)};a.watchPosition=function(d,f,g){try{b.watchPosition(d,f,g);a.clearWatch=function(e){if(typeof(b.clearWatch)!="undefined"){b.clearWatch(e)}}}catch(i){f({message:i,code:1})}}}else{if(typeof(Mojo)!="undefined"&&typeof(Mojo.Service)!="undefined"&&typeof(Mojo.Service.Request)!="Mojo.Service.Request"){b=true;a.getCurrentPosition=function(d,e,f){parameters={};if(f){if(f.enableHighAccuracy&&f.enableHighAccuracy==true){parameters.accuracy=1}if(f.maximumAge){parameters.maximumAge=f.maximumAge}if(f.responseTime){if(f.responseTime<5){parameters.responseTime=1}else{if(f.responseTime<20){parameters.responseTime=2}else{parameters.timeout=3}}}}r=new Mojo.Service.Request("palm://com.palm.location",{method:"getCurrentPosition",parameters:parameters,onSuccess:function(g){d({timestamp:g.timestamp,coords:{latitude:g.latitude,longitude:g.longitude,heading:g.heading}})},onFailure:function(g){if(g.errorCode==1){e({code:3,message:"Timeout"})}else{if(g.errorCode==2){e({code:2,message:"Position Unavailable"})}else{e({code:0,message:"Unknown Error: webOS-code"+errorCode})}}}})}}else{if(typeof(device)!="undefined"&&typeof(device.getServiceObject)!="undefined"){b=device.getServiceObject("Service.Location","ILocation");a.getCurrentPosition=function(d,e,f){function i(m,k,j){if(k==4){e({message:"Position unavailable",code:2})}else{d({timestamp:null,coords:{latitude:j.ReturnValue.Latitude,longitude:j.ReturnValue.Longitude,altitude:j.ReturnValue.Altitude,heading:j.ReturnValue.Heading}})}}var g=new Object();g.LocationInformationClass="BasicLocationInformation";b.ILocation.GetLocation(g,i)}}else{if(typeof(window.blackberry)!="undefined"&&blackberry.location.GPSSupported){blackberry.location.setAidMode(2);a.getCurrentPosition=function(d,e,f){bb_successCallback=d;bb_errorCallback=e;if(parseFloat(navigator.appVersion)>=4.6){blackberry.location.onLocationUpdate(handleBlackBerryLocation)}else{blackberry.location.onLocationUpdate("handleBlackBerryLocation()")}blackberry.location.refreshLocation()};b=blackberry.location}}}}}}}}catch(c){if(typeof(console)!="undefined"){console.log(c)}}return b!=null};return a}();function geolocate(){if(geo_position_js.init()){geo_position_js.getCurrentPosition(success_callback,error_callback,{enableHighAccuracy:true})}else{ajax_setdiv("page=selgenero","geoloc")}}function success_callback(a){ajax_setdiv("page=geolocate&lat="+a.coords.latitude.toFixed(2)+"&lon="+a.coords.longitude.toFixed(2),"geoloc")}function error_callback(a){ajax_setdiv("page=selgenero","geoloc")}function toggle_anyfoto(m,k,g,a,b){var j=document.getElementById("cont_"+k),i=document.getElementById("conf_"+k),e=document.getElementById("fotob_"+k);if(j.style.display=="none"){j.style.display="block";i.style.display="none";e.style.left="0px";e.style.top="0px";e.style.height="0px";e.style.width="0px";e.src="/i/workinga.gif"}else{if(e.src.indexOf("thumb")<0){i.style.display="block";j.style.display="none";if(i.offsetHeight==400){if(g>a){if(g<=400){e.style.height=a+"px";e.style.width=g+"px";l=Math.round((i.offsetWidth-g)/2);e.style.left=l+"px"}else{h=Math.ceil((i.offsetWidth*a)/g);e.style.width=i.offsetWidth+"px";e.style.height=h+"px";e.style.left="0px"}}else{if(a<=400){e.style.height=a+"px";e.style.width=g+"px";l=Math.round((i.offsetWidth-g)/2);e.style.left=l+"px"}else{w=Math.ceil((i.offsetHeight*g)/a);e.style.height=i.offsetHeight+"px";e.style.width=w+"px";l=Math.round((i.offsetWidth-w)/2);e.style.left=l+"px"}}}else{h=Math.ceil((i.offsetWidth*a)/g);e.style.width=i.offsetWidth+"px";e.style.height=h+"px";e.style.left="0px"}if(e.offsetHeight<i.offsetHeight){t=Math.round((i.offsetHeight-e.offsetHeight)/2);e.style.top=t+"px"}else{e.style.top="0px"}e.src=b+m}}return false}function toggle_foto(d,c,a,b){return toggle_anyfoto(d,c,a,b,"/index.php?action=foto&id=")}function toggle_pfoto(d,c,a,b){return toggle_anyfoto(d,c,a,b,"/index.php?action=foto&p=")};
