function trim(inputString) { if (typeof inputString != "string") return inputString; var retValue = inputString; var ch = retValue.substring(0, 1); while (ch == " ") { retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1); } ch = retValue.substring(retValue.length - 1, retValue.length); while (ch == " ") { retValue = retValue.substring(0, retValue.length - 1); ch = retValue.substring(retValue.length - 1, retValue.length); } while (retValue.indexOf(" ") != -1) retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ") + 1, retValue.length); return retValue; } function set_cookie ( name, value, exp_seconds, path, domain, secure ) { var cookie_string = name + "=" + escape ( value ); if ( exp_seconds ) { var expires = new Date (); ex=expires.valueOf()+exp_seconds*1000; expires = new Date (ex); cookie_string += "; expires=" + expires.toGMTString(); } if ( path ) cookie_string += "; path=" + escape ( path ); if ( domain ) cookie_string += "; domain=" + escape ( domain ); if ( secure ) cookie_string += "; secure"; document.cookie = cookie_string; } function delete_cookie ( cookie_name ) { var cookie_date = new Date ( ); // current date & time cookie_date.setTime ( cookie_date.getTime() - 1 ); document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString(); } function get_cookie ( cookie_name ) { var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' ); if ( results ) return ( unescape ( results[1] ) ); else return null; } function xx_switch_lang(xlang) { set_cookie("lang", xlang, 86400*30); window.location=window.location; } var definfoboxtext=""; var iboxfocused=false; function iboxsend() { if (!iboxfocused) iboxfocus() else { o=document.forms["infoboxform"]; if (o) o.submit(); } } function iboxfocus() { m=document.getElementById("defmail"); o=document.getElementById("infobox"); if ((o) && (!iboxfocused)) { o.style.cursor="text"; o.title=_infobox_hint; iboxfocused=true; definfoboxtext=o.value; xx=_infobox_inside; if (m) xx+=m.value; o.value=xx; o.focus(); } } function resetInfobox() { o=document.getElementById("infobox"); if ((o) && (iboxfocused)) { iboxfocused=false; o.value=definfoboxtext; } } function xzoom(a,xid,xidx) { if (!xidx) xidx=""; else xidx="&xid="+xidx; window.open("getimage.php?a="+a+"&id="+xid+xidx,"_blank","width=300px,height=300px"); } function isshopkosik() { var o=document.getElementById("kosiktag"); var ret=false; if (o) ret=true; return ret; } function shop_ask(itemid) { window.open("index.php?shopinfo="+itemid,"_blank","width=550px,height=600px,resizable"); } function shop_info(itemid,xed) { if (xed) var xadds="&ed=1"; else var xadds=""; window.open("index.php?shopinfo="+itemid+"&details=1"+xadds,"_blank","width=550px,height=600px,resizable"); } function shop_add(itemid) { var o=document.getElementById("workframe"); var k=document.getElementById("shopksinput"+itemid); if ((o) && (k)) o.src="index.php?shopaction=add&itemid="+itemid+"&itemks="+k.value; } function shop_set(itemid) { var o=document.getElementById("workframe"); var k=document.getElementById("shopksinput"+itemid); if ((o) && (k)) o.src="index.php?shopaction=set&itemid="+itemid+"&itemks="+k.value; } function shop_del(itemid) { var vv=true; if (isshopkosik()) { var o=document.getElementById("shop_delete_confirm_message"); if (o) var ss=o.value; else var ss="Delete ?"; vv=confirm(ss); } var o=document.getElementById("workframe"); if ((o) && (vv)) o.src="index.php?shopaction=del&itemid="+itemid; } function shop_delete_all() { var o=document.getElementById("workframe"); var c=document.getElementById("shop_delete_all_confirm_message"); if (c) { var vv=confirm(c.value); if ((o) && (vv)) o.src="index.php?shopaction=deleteall"; } } function shop_send() { var o=document.getElementById("regform"); var f=document.getElementById("shopactionformsend"); if ((o) && (f)) { var cansend=true; var e=document.getElementsByTagName("input"); for (var i=0;i