function xoopsGetElementById(a){if(document.getElementById){return(document.getElementById(a))}else{if(document.all){return(document.all[a])}else{if((navigator.appname.indexOf("Netscape")!=-1)&&parseInt(navigator.appversion==4)){return(document.layers[a])}}}}function xoopsSetElementProp(b,d,c){var a=xoopsGetElementById(b);if(a){a[d]=c}}function xoopsSetElementStyle(b,d,c){var a=xoopsGetElementById(b);if(a&&a.style){a.style[d]=c}}function xoopsGetFormElement(c,a){var b=document.forms[c];return b?b.elements[a]:null}function justReturn(){return}function openWithSelfMain(d,c,f,a,e){var b="width="+f+",height="+a+"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";new_window=window.open(d,c,b);window.self.name="main";new_window.document.clear();new_window.focus();if(e!=null){return new_window}}function setElementColor(b,a){xoopsGetElementById(b).style.color="#"+a}function setElementFont(b,a){xoopsGetElementById(b).style.fontFamily=a}function setElementSize(b,a){xoopsGetElementById(b).style.fontSize=a}function changeDisplay(b){var a=xoopsGetElementById(b).style;if(a.display==""){a.display="none"}else{a.display="block"}}function setVisible(a){xoopsGetElementById(a).style.visibility="visible"}function setHidden(a){xoopsGetElementById(a).style.visibility="hidden"}function makeBold(b){var a=xoopsGetElementById(b).style;if(a.fontWeight!="bold"&&a.fontWeight!="700"){a.fontWeight="bold"}else{a.fontWeight="normal"}}function makeItalic(b){var a=xoopsGetElementById(b).style;if(a.fontStyle!="italic"){a.fontStyle="italic"}else{a.fontStyle="normal"}}function makeUnderline(b){var a=xoopsGetElementById(b).style;if(a.textDecoration!="underline"){a.textDecoration="underline"}else{a.textDecoration="none"}}function makeLineThrough(b){var a=xoopsGetElementById(b).style;if(a.textDecoration!="line-through"){a.textDecoration="line-through"}else{a.textDecoration="none"}}function appendSelectOption(b,a,e){var c=xoopsGetElementById(b);var d=new Option(a,e);c.options[c.length]=d;c.options[c.length].selected=true}function disableElement(b){var a=xoopsGetElementById(b);if(a.disabled!=true){a.disabled=true}else{a.disabled=false}}function xoopsCheckAll(f,c){var d=document.forms[f].elements;var b=xoopsGetElementById(c);for(var a=0;a<d.length;a++){var g=d[a];if((g.name!=b.name)&&(g.type=="checkbox")){g.checked=b.checked}}}function xoopsCheckGroup(g,d,a){var f=document.forms[g].elements;var c=xoopsGetElementById(d);for(var b=0;b<f.length;b++){var h=f[b];if((h.type=="checkbox")&&(h.id.substr(0,a.length)==a)){h.checked=c.checked}}}function xoopsCheckAllElements(f,d){var b=xoopsGetElementById(d);for(var a=0;a<f.length;a++){var c=xoopsGetElementById(f[a]);if((c.name!=b.name)&&(c.type=="checkbox")){c.checked=b.checked}}}function xoopsSavePosition(b){var a=xoopsGetElementById(b);if(a.createTextRange){a.caretPos=document.selection.createRange().duplicate()}}function xoopsInsertText(b,c){if(b.createTextRange&&b.caretPos){var a=b.caretPos;a.text=a.text.charAt(a.text.length-1)==" "?c+" ":c}else{if(b.getSelection&&b.caretPos){var a=b.caretPos;a.text=a.text.charat(a.text.length-1)==" "?c+" ":c}else{b.value=b.value+c}}}function xoopsCodeSmilie(d,c){var b;var a=xoopsGetElementById(d);xoopsInsertText(a,c);a.focus();return}function showImgSelected(c,d,e,a,b){if(b==null){b="./"}imgDom=xoopsGetElementById(c);selectDom=xoopsGetElementById(d);imgDom.src=b+"/"+e+"/"+selectDom.options[selectDom.selectedIndex].value+a}function showThemeScreenshot(b,c,a){if(a==null){a="./"}imgDom=xoopsGetElementById(b);selectDom=xoopsGetElementById(c);serctValues=selectDom.options[selectDom.selectedIndex].value.split("!-!");imgDom.src=a+"/themes/"+serctValues[0]+"/"+serctValues[1]}function xoopsCodeUrl(h,e,c){if(e==null){e="Enter the URL of the link you want to add:"}var f=prompt(e,"");var d=xoopsGetElementById(h);if(f!=null&&f!=""){if(c==null){c="Enter the web site title:"}var b=prompt(c,"");if(b!=null){if(b==""){var a="[url="+f+"]"+f+"[/url]"}else{var g=b.indexOf(unescape("%00"));if(0<g){b=b.substr(0,g)}var a="[url="+f+"]"+b+"[/url]"}xoopsInsertText(d,a)}}d.focus()}function xoopsCodeImg(b,f,e,g,d){if(f==null){f="Enter the URL of the image you want to add:"}var h=prompt(f,"");var a=xoopsGetElementById(b);if(h!=null&&h!=""){if(e==null){e="Now, enter the position of the image."}if(g==null){g="'R' or 'r' for right, 'L' or 'l' for left, or leave it blank."}if(d==null){d="ERROR! Enter the position of the image:"}var c=prompt(e+"\n"+g,"");while((c!="")&&(c!="r")&&(c!="R")&&(c!="l")&&(c!="L")&&(c!=null)){c=prompt(d+"\n"+g,"")}if(c=="l"||c=="L"){c=" align=left"}else{if(c=="r"||c=="R"){c=" align=right"}else{c=""}}var i="[img"+c+"]"+h+"[/img]";xoopsInsertText(a,i)}a.focus()}function xoopsCodeEmail(e,d){if(d==null){d="Enter the email address you want to add:"}var c=prompt(d,"");var b=xoopsGetElementById(e);if(c!=null&&c!=""){var a="[email]"+c+"[/email]";xoopsInsertText(b,a)}b.focus()}function xoopsCodeQuote(f,b){if(b==null){b="Enter the text that you want to be quoted:"}var d=prompt(b,"");var c=xoopsGetElementById(f);if(d!=null&&d!=""){var e=d.indexOf(unescape("%00"));if(0<e){d=d.substr(0,e)}var a="[quote]"+d+"[/quote]";xoopsInsertText(c,a)}c.focus()}function xoopsCodeCode(e,b){if(b==null){b="Enter the codes that you want to add."}var d=prompt(b,"");var c=xoopsGetElementById(e);if(d!=null&&d!=""){var a="[code]"+d+"[/code]";xoopsInsertText(c,a)}c.focus()}function xoopsCodeText(b,f,k){var c=xoopsGetElementById(b);var g=xoopsGetElementById(b+"Addtext");var m=xoopsGetElementById(b+"Font");var e=xoopsGetElementById(b+"Color");var l=xoopsGetElementById(b+"Size");var a=xoopsGetElementById(f).style;var i=g.value;var h=m.options[m.options.selectedIndex].value;var j=e.options[e.options.selectedIndex].value;var d=l.options[l.options.selectedIndex].value;if(i==""){if(k==null){k="Please input text into the textbox."}alert(k);g.focus()}else{if(h!="FONT"){i="[font="+h+"]"+i+"[/font]";m.options[0].selected=true}if(j!="COLOR"){i="[color="+j+"]"+i+"[/color]";e.options[0].selected=true}if(d!="SIZE"){i="[size="+d+"]"+i+"[/size]";l.options[0].selected=true}if(a.fontWeight=="bold"||a.fontWeight=="700"){i="[b]"+i+"[/b]";a.fontWeight="normal"}if(a.fontStyle=="italic"){i="[i]"+i+"[/i]";a.fontStyle="normal"}if(a.textDecoration=="underline"){i="[u]"+i+"[/u]";a.textDecoration="none"}if(a.textDecoration=="line-through"){i="[d]"+i+"[/d]";a.textDecoration="none"}xoopsInsertText(c,i);g.value="";a.color="#000000";a.fontFamily="";a.fontSize="12px";a.visibility="hidden";c.focus()}}function xoopsValidate(c,i,f,e,k,j,g){var h=65535;var b=xoopsGetElementById(c);var a=xoopsGetElementById(i);var d=xoopsGetElementById(f);if(a.value==""||b.value==""){if(e==null){e="Please complete the subject and message fields."}alert(e);return false}if(h!=0){if(a.value.length>h){if(k==null){k="Your message is too long."}if(j==null){j="Allowed max chars length: "}if(g==null){g="Current chars length: "}alert(k+"\n\n"+j+h+"\n"+g+a.value.length+"");a.focus();return false}else{d.disabled=true;return true}}else{d.disabled=true;return true}};
