/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 3.7.2
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2008 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
var win=window;var n=0;function Sdo(B,A){B=B.split("_");if(B[0]=="template"){switch(B[1]){case"templates":goURL="modify&expandset=";break;case"addtemplate":goURL="add&dostyleid=";break;case"editstyle":goURL="editstyle&dostyleid=";break;case"addstyle":goURL="addstyle&parentid=";break;case"delete":goURL="deletestyle&dostyleid=";break;case"download":goURL="files&dostyleid=";break;case"revertall":goURL="revertall&dostyleid=";break}if(goURL){window.location="template.php?s="+SESSIONHASH+"&group="+document.forms.tform.group.value+"&do="+goURL+A}}else{if(B[0]=="css"){window.location="css.php?s="+SESSIONHASH+"&do=edit&dowhat="+B[1]+"&group="+document.forms.tform.group.value+"&dostyleid="+A}}}function Tjump(A){var B="template.php?s="+SESSIONHASH+"&do="+A+"&searchstring="+SEARCHSTRING+"&expandset="+EXPANDSET;if(is_ie&&event.shiftKey){window.open(B)}else{window.location=B}}function Texpand(A,B){window.location="template.php?s="+SESSIONHASH+"&do=modify&expandset="+B+"&group="+A+"#"+A}function Tedit(A){Tjump("edit&templateid="+A+"&dostyleid="+EXPANDSET+"&group="+GROUP)}function Tcustom1(A,B){Tjump("add&dostyleid="+A+"&title="+B+"&group="+GROUP)}function Tcustom2(A,B){Tjump("add&dostyleid="+A+"&templateid="+B+"&group="+GROUP)}function Tdelete(A,B){Tjump("delete&dostyleid="+A+"&templateid="+B+"&group="+GROUP)}function Toriginal(A){window.open("template.php?s="+SESSIONHASH+"&do=view&title="+A)}function Tprep(elm,styleid,echo){var str=elm.value;if(echo){button=new Array();button.edit=eval("document.forms.tform.edit"+styleid);button.edit.disabled="disabled";button.cust=eval("document.forms.tform.cust"+styleid);button.cust.disabled="disabled";button.kill=eval("document.forms.tform.kill"+styleid);button.kill.disabled="disabled";button.expa=eval("document.forms.tform.expa"+styleid);button.expa.disabled="disabled";button.orig=eval("document.forms.tform.orig"+styleid);button.orig.disabled="disabled";textbox=document.getElementById("helparea"+styleid)}if(str!=""){selitem=eval("document.forms.tform.tl"+styleid);var out=new Array();out.selectedtext=selitem.options[selitem.selectedIndex].text.replace(/^-- /,"");if(str=="~"){str=out.selectedtext}out.styleid=styleid;out.original=str;if(str.search(/^\[(\w*)\]$/)!=-1){out.value=str.replace(/^\[(\w*)\]$/,"$1");if(isNaN(out.value)||out.value==""){out.action="expand";out.text=construct_phrase(vbphrase.click_the_expand_collapse_button,out.selectedtext.replace(/Templates/,"").bold());button.expa.disabled=""}else{out.action="editinherited";selecteditem=eval("document.forms.tform.tl"+styleid);tsid=selecteditem.options[selecteditem.selectedIndex].getAttribute("tsid");out.text=construct_phrase(vbphrase.this_template_has_been_customized_in_a_parent_style,STYLETITLE[tsid].bold(),STYLETITLE[styleid].bold(),out.selectedtext.bold(),"template.php?s="+SESSIONHASH+"&amp;do=edit&amp;templateid="+out.value+"&amp;group="+GROUP);button.orig.disabled="";button.cust.disabled=""}}else{out.value=str;if(isNaN(out.value)){out.action="customize";out.text=vbphrase.this_template_has_not_been_customized;button.cust.disabled=""}else{out.action="edit";out.text=vbphrase.this_template_has_been_customized_in_this_style;button.edit.disabled="";button.orig.disabled="";button.kill.disabled=""}}if(echo){textbox.innerHTML=out.selectedtext.bold()+":<br /><br />"+out.text;if(elm.getAttribute("i")){var editinfo=elm.getAttribute("i").split(";");editinfo[1]=new Date(editinfo[1]*1000);var day=editinfo[1].getDate();var month=editinfo[1].getMonth();var year=editinfo[1].getFullYear();var hours=editinfo[1].getHours();if(hours<10){hours="0"+hours}var mins=editinfo[1].getMinutes();if(mins<10){mins="0"+mins}textbox.innerHTML+=construct_phrase("<br /><br />"+vbphrase.template_last_edited_js,MONTH[month],day,year,hours,mins,editinfo[0].bold())}}else{return out}}else{textbox.innerHTML=construct_phrase("<center>"+vbphrase.x_templates+"</center>",STYLETITLE[styleid].bold())}}function Tdo(B,A){switch(B.action){case"expand":Tjump("modify&expandset="+EXPANDSET+"&group="+B.value);break;case"customize":Tjump("add&dostyleid="+B.styleid+"&title="+B.value+"&group="+GROUP);break;case"edit":switch(A){case"vieworiginal":window.open("template.php?s="+SESSIONHASH+"&do=view&title="+B.selectedtext);break;case"killtemplate":Tjump("delete&templateid="+B.value+"&dostyleid="+B.styleid+"&group="+GROUP);break;default:Tjump("edit&templateid="+B.value+"&group="+GROUP);break}break;case"editinherited":if(A=="vieworiginal"){window.open("template.php?s="+SESSIONHASH+"&do=view&title="+B.selectedtext)}else{Tjump("add&dostyleid="+B.styleid+"&templateid="+B.value+"&group="+GROUP)}break}}var popup="";function displayHTML(){var A=document.cpform.template.value;if(popup&&!popup.closed){popup.document.close()}else{popup=window.open(", ","popup","toolbar = no, status = no, scrollbars=yes")}popup.document.open();popup.document.write(""+A+"")}function HighlightAll(){document.cpform.template.focus();document.cpform.template.select();if(document.all){var A=document.cpform.template.createTextRange();A.execCommand("Copy")}}var startpos=0;function findInPage(F){var B,C,D;if(F==""){return false}if(is_moz){B=fetch_object(textarea_id).value;if(!startpos||startpos+F.length>=B.length){startpos=0}var A=0;var E=false;for(C=startpos;C<B.length;C++){if(B.charAt(C).toLowerCase()==F.charAt(A).toLowerCase()){A++}else{A=0}if(A==F.length){C++;startpos=C;fetch_object(textarea_id).focus();fetch_object(textarea_id).setSelectionRange(C-F.length,C);moz_txtarea_scroll(fetch_object(textarea_id),C);E=true;break}if(C==B.length-1&&startpos>0){C=0;startpos=0}}if(!E){alert(vbphrase.not_found)}}if(is_ie){B=win.fetch_object(textarea_id).createTextRange();for(C=0;C<=n&&(D=B.findText(F))!=false;C++){B.moveStart("character",1);B.moveEnd("textedit")}if(D){B.moveStart("character",-1);B.findText(F);B.select();B.scrollIntoView(true);n++}else{if(n>0){n=0;findInPage(F)}else{alert(vbphrase.not_found)}}}return false}function moz_txtarea_scroll(A,B){var C=A.cloneNode(true);C.setAttribute("id","moo");C.style.width=A.offsetWidth+"px";C.value=A.value.substr(0,B)+"\n";document.body.appendChild(C);if(C.scrollHeight<=A.scrollTop||C.scrollHeight>=A.scrollTop+A.offsetHeight){if(C.scrollHeight==C.clientHeight){A.scrollTop=0}else{A.scrollTop=C.scrollHeight-40}}document.body.removeChild(document.getElementById("moo"));C=A.cloneNode(true);C.setAttribute("id","moo");C.style.width=A.offsetWidth+"px";var D=A.value.substr(0,B).lastIndexOf("\n");if(!D){D=0}C.value=A.value.substring(D,B);document.body.appendChild(C);if(C.scrollWidth==A.offsetWidth){A.scrollLeft=0}else{A.scrollLeft=C.scrollWidth-40}document.body.removeChild(document.getElementById("moo"))}function set_wordwrap(B,A){element=fetch_object(B);if(A){element.wrap="soft"}else{element.wrap="off"}}function check_children(A,C){fetch_object("userselect_"+A).checked=C;for(var B in STYLEPARENTS){if(YAHOO.lang.hasOwnProperty(STYLEPARENTS,B)&&STYLEPARENTS[B]==A){check_children(B,C)}}return false};