AllowCopy=DefaultCopy=!1;function disablePaste(){with(document.body)onselectstart=function(){return AllowCopy},ondrag=function(){return AllowCopy},onfocus=function(){return AllowCopy}}function CharCount(b,d){var c=document.getElementById(b),e=document.getElementById(b+"count");if(null!=e){var c=c.value,f=0;d&&(c+=window.clipboardData.getData("Text"));a=c.replace(/\s/g," ");a=a.split(" ");for(i=0;i<a.length;i++)0<a[i].length&&f++;e.value=c.length+" chars "+f+" words"}return!0}
function setupCharCount(){for(i=0;i<document.forms.length;i++)for(j=0;j<document.forms[i].elements.length;j++)with(document.forms[i].elements[j])"textarea"==type&&(oninput=function(){return CharCount(name,0)},onkeyup=function(){return CharCount(name,0)},onkeydown=function(){return CharCount(name,0)},onpaste=function(){return CharCount(name,1)})}
function getHTTPObject(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}}return!1}
function checkField(b,d,c,e,f,g){""==d.value?(c.value="Please enter "+d.name.toLowerCase().substr(4).replace("_"," "),c.style.color=e):(http=getHTTPObject(),http.open("GET",b+"?"+d.name+"="+encodeURIComponent(d.value),!0),http.onreadystatechange=function(){if(4==http.readyState)"OK"==http.responseText?(c.value=f,c.style.color=g):(c.value=http.responseText,c.style.color=e)},http.send(null))}function setElement(b,d){var c=document.getElementById(b);if(null!=c)c.style.display=d}image_popup=null;
function ShowFullImage(b,d,c,e,f,g,h){if(0<navigator.appVersion.indexOf("Chrome")||0<navigator.appVersion.indexOf("Safari"))f+=20,g+=40;null!=image_popup&&image_popup.closed&&(image_popup=null);null==image_popup?(image_popup=window.open(b,d,"left="+c+",top="+e+",screenX="+c+",screenY="+e+",width="+f+",height="+g+h),image_popup.moveTo(c,e)):(image_popup.location.replace(b),image_popup.resizeTo(f+20,g+60));image_popup.focus()}function ClosePopup(){null!=image_popup&&image_popup.close()}
function setLinks(b){now=new Date;t="tzoffset="+now.getTimezoneOffset()+"&scrw="+screen.width+"&scrh="+screen.height;for(i=0;i<document.links.length;i++)with(document.links[i])-1==href.indexOf("#")&&0<=href.indexOf(b)&&(href=-1==href.indexOf("?")?href+("?"+t):href+("&"+t));for(i=0;i<document.forms.length;i++)with(document.forms[i])action=-1==action.indexOf("?")?action+("?"+t):action+("&"+t)}BoxDisplayed=!1;
function getProgress(b,d){http=getHTTPObject();http.open("GET",b+"?progress_key="+d,!0);http.onreadystatechange=function(){if(4==http.readyState){percent=http.responseText;if(!BoxDisplayed&&100>percent)ProgressBox.style.display="block",BoxDisplayed=!0;ProgressBar.style.width=percent+"%";100>percent&&setTimeout("getProgress('"+b+"','"+d+"')",2E3)}};http.send(null)}function startProgress(b,d,c){""!=c.value&&setTimeout("getProgress('"+b+"','"+d+"')",1E3)}
function clickClear(b,d){if(b.value==d)b.value=""}function clickRecall(b,d){if(""==b.value)b.value=d}function AddOpt(b,d,c){with(b)if(i=options.length,options[i]=new Option(c,d),d==options[0].value)options[i].selected=!0,options[0]=null};
