function trim(inputString) { if (typeof inputString != "string") return inputString; var retValue = inputString; var ch = retValue.substring(0, 1); while ((ch == " ") || (ch == "\n") || (ch == "\r") || (ch == "\t")) { retValue = retValue.substring(1, retValue.length); ch = retValue.substring(0, 1); } ch = retValue.substring(retValue.length - 1, retValue.length); while ((ch == " ") || (ch == "\n") || (ch == "\r") || (ch == "\t")) { 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 xcheckdomain() { var o=document.getElementById("workframe"); if (o) { var c=document.getElementById("xdomaininput"); if (c) { var vv=trim(c.value); if ((vv=="") || (!domainfocused)) alert("Není zadána žádná doména pro ověření."); else o.src="index.php?a=checkdomain&domain="+vv; } } } var domainfocused=false; function xfocusdomain() { if (!domainfocused) { var c=document.getElementById("xdomaininput"); if (c) c.value=""; } domainfocused=true; } 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; } var definfoboxtext=""; var iboxfocused=false; function iboxsend(xmode,spuid) { if (!xmode) { if (!iboxfocused) iboxfocus(); else if (spuid!=0) jsAntispam_Show(spuid); else iboxsend2(); } else iboxsend2(); } function iboxsend2() { var 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 cms_change_photo() { var ox=document.getElementById("xjokediv"); var o=document.getElementById("xjokebkg"); if (o) { fxcindex--; if (fxcindex<0) fxcindex=fxcmax-1; o.style.backgroundImage="url(pics/xb"+fxcindex+".jpg)"; ox.className="xvisible"; set_cookie(fxccookiename,fxcindex,86400*14); } } function show_joke(xshow) { var o=document.getElementById("xjokediv"); if (o) { if (xshow) o.style.display="block"; else o.style.display="none"; } } function sms_post_form(xmode,spuid,xsmsconf) { var ox=document.getElementById("xsmstextarea_"+xsmsconf); if (ox) { if (ox.getAttribute("xfocused")!="yes") sms_textarea_focus(xsmsconf); else { if (!xmode) { if (spuid!="") jsAntispam_Show(spuid); else sms_post_form2(xsmsconf); } else sms_post_form2(xsmsconf); } } } function sms_post_form2(xsmsconf) { var o=document.getElementById("xsmsform_"+xsmsconf); if (o) o.submit(); } function send_sms_show(xsmsconf) { send_sms_hide_all(); var o=document.getElementById("xsmsdiv_"+xsmsconf); var ox=document.getElementById("xsmstextarea_"+xsmsconf); if ((o) && (ox)) { if (o.style.display=="block") o.style.display="none"; else { var xorigtext=ox.getAttribute("xorigtext"); if ((xorigtext) && (trim(xorigtext)!="")) { ox.setAttribute("xfocused","no"); ox.value=xorigtext; ox.setAttribute("xorigtext",""); } o.style.display="block"; send_sms_char_refresh(xsmsconf); } } } function send_sms_hide_all() { var e=document.getElementsByTagName("div"); for (var i=0;i < e.length;i++) if (e[i].getAttribute("x_issmsform")=="yes") send_sms_hide(e[i].getAttribute("x_smsconf")); } function send_sms_hide(xsmsconf) { var o=document.getElementById("xsmsdiv_"+xsmsconf); var oi=document.getElementById("xsmscontact_"+xsmsconf); if ((o) && (oi)) { o.style.display="none"; oi.value=""; } } function sms_textarea_focus(xsmsconf) { var o=document.getElementById("xsmstextarea_"+xsmsconf); if (o) { o.focus(); var xorigtext=o.getAttribute("xorigtext"); if ((!xorigtext) || (trim(xorigtext)=="")) { o.setAttribute("xfocused","yes"); o.setAttribute("xorigtext",o.value); o.value=""; } } } function send_sms_char_refresh(xsmsconf) { var o=document.getElementById("xsmsdiv_"+xsmsconf); var ox=document.getElementById("xsmstextarea_"+xsmsconf); var oc=document.getElementById("smscharsspan_"+xsmsconf); if ((o) && (ox) && (oc) && (o.style.display=="block")) { var xorigtext=ox.getAttribute("xorigtext"); if ((!xorigtext) || (trim(xorigtext)=="")) var xs=""; else var xs=new String(ox.value); var xc=100-xs.length; if (xc<0) { xc=0; ox.style.color="#FF0000"; } else ox.style.color="#003C6F"; oc.innerHTML=xc; setTimeout("send_sms_char_refresh('"+xsmsconf+"')",500); } } function js_bookmark(xurl,xtitle) { if (window.sidebar) window.sidebar.addPanel(xtitle, xurl, ""); else if (window.external) window.external.AddFavorite(xurl,xtitle); else if (window.opera && window.print) { var e = document.createElement('a'); e.setAttribute('href',xurl); e.setAttribute('title',xtitle); e.setAttribute('rel','sidebar'); e.click(); } } function xzoom(xpicname) { window.open("getimage.php?id="+xpicname,"_blank","width=500px,height=400px,resizable");}