﻿ var PTT_debugResult=new String("Nothing yet");var cachingServer=(location.protocol=="https:")?"":'http://www.goodhandscommunity.org';var cssurl=cachingServer+'/dir-css/880046/forum.css';var webtag=queryString('webtag',document.location);var PTT_webtag=webtag;/*OPTIONS LIST SORTING CODE*/function PTT_CaseSort(x,y){var xx=x.toUpperCase();var yy=y.toUpperCase();return(xx>yy)?1:(xx==yy)?0:-1;}function PTT_CaseSortReverse(x,y){var xx=x.toUpperCase();var yy=y.toUpperCase();return(yy>xx)?1:(yy==xx)?0:-1;}function PTT_sortOptions(btn,id){var userSelect=document.getElementById(id);var optionsList=userSelect.options;var iMax=optionsList.length;var sortList=new Array();for(var i=0;i<iMax;i++){sortList.push(optionsList[i].text+";"+optionsList[i].value);}switch(btn.value){case"Sort A-Z":sortList.sort(PTT_CaseSort);btn.value="Sort Z-A";break;case"Sort Z-A":sortList.sort(PTT_CaseSortReverse);btn.value="Sort A-Z";break;}optionsList.length=0;optionsList.length=iMax;for(var i=0;i<iMax;i++){var t=sortList[i].split(";")[0];var v=sortList[i].split(";")[1];userSelect.options[i].text=t;userSelect.options[i].value=v;}}/*This takes an element ID and scrolls the page to put that element at the top.*/function PT_scrollToAnchor(id,pref){if(id.match('.')){id=id.split('.')[0];}var p=pref;var elm=document.getElementById(p+id);if(elm){var loc=PT_getElementPosition(elm);scrollTo(1,loc.absTop);}}/*Show an error message via Widget.SystemMessage without posting back*/function PTT_showSysAlert(whereElm,txt){var myDiv=document.getElementById("ptSystemAlertDiv");if(myDiv){if(document.getElementById("ptSystemAlertDiv")){document.getElementById("ptSystemAlertText").innerHTML=txt;var showPos=PT_getElementPosition(whereElm);var windowSize=PT_getWindowSize();showPos.left-=Math.max(0,showPos.left+myDiv.offsetWidth-windowSize.width-document.body.scrollLeft);showPos.top-=Math.max(0,showPos.top+myDiv.offsetHeight-windowSize.height-document.body.scrollTop);myDiv.style.left=showPos.left;myDiv.style.top=showPos.top;myDiv.style.display="block";myDiv.style.visibility="visible";}}}/*This function searches for SPAN elements with cssClass set to"popupOnly"and makes them visible in a popup.*/function PTT_showPopItems(){var arySpans=document.getElementsById("SPAN");for(var i=0;i<arySpans.length;i++){var mySpan=arySpans[i];if(mySpan.cssClass=="popupOnly"){mySpan.style.display="inline";}}}/*This provides a routine for the Java chat app*/function setChatUserCount(uCount){var found=false;var pf=parent.frames;var ppf=parent.parent.frames;var df=document.forms;if(pf.length==0){for(var g=0;g<df.length;g++){if(df[g].name=='mmForm'){for(var h=0;h<df[g].elements.length;h++){if(df[g].elements[h].name=='userCountField'){df[g].elements[h].value=uCount;return;}}}}}else{for(var i=0;i<pf.length;i++){for(var j=0;j<pf[i].document.forms.length;j++){if(pf[i].document.forms[j].name=='mmForm'){for(var k=0;k<pf[i].document.forms[j].elements.length;k++){if(pf[i].document.forms[j].elements[k].name=='userCountField'){pf[i].document.forms[j].elements[k].value=uCount;found=true;return;}}}}}if(!found){for(var m=0;m<ppf.length;m++){for(var n=0;n<ppf[m].document.forms.length;n++){if(ppf[m].document.forms[n].name=='mmForm'){for(var p=0;p<ppf[m].document.forms[n].elements.length;p++){if(ppf[m].document.forms[n].elements[p].name=='userCountField'){ppf[m].document.forms[n].elements[p].value=uCount;found=true;return;}}}}}}}}/*This checks or unchecks all cases of checkboxes which have a similar name-id prefix of the calling checkbox.The onclick event of the master checkbox should be set thus onClick="PTT_checkMaster(this)"Checkboxes in the group should have the same prefix separated by an underscore.ID and NAME must both be set.Example(slaves group members to cbx_m's state):name="cbx_m"id="cbx_m"is the master and has the onClick event handler name="cbx_child1"id="cbx_child1"is a member of the group name="cbx_child2"id="cbx_child2"is a member of the group*/function PTT_checkMaster(cbox){var masterId=cbox.id;var masterVal=cbox.checked;var masterRoot=masterId.split("_")[0];var subChecks=document.getElementsByTagName("INPUT");var mr=masterRoot+"_";for(var i=0;i<subChecks.length;i++){if(subChecks[i].type.toLowerCase()=="checkbox"){if(subChecks[i].id.indexOf(mr)==0&&subChecks[i].id!=masterId){subChecks[i].checked=masterVal;}}}}if(window.opener){try{if(!window.opener.name||window.opener.name=="")var ptw_parentWin=window.opener;}catch(ex){PTT_debugResult=ex;var pt_dbgResult=ex;}}function checkChar(inptext,wtVal){var Cr=String.fromCharCode(13);var Lf=String.fromCharCode(10);var strSearchPrefix="forum.aspx?webtag="+wtVal+"&nav=search&q=";var textbox=inptext;var s=new String();s=inptext.value;if(s.indexOf(Cr)>=0||s.indexOf(Lf)>=0){s=strSearchPrefix+s;textbox.value="";location.href=s;}}function csPostShowHideDiv(id){var myDiv=document.getElementById(id);myDiv.style.display=(myDiv.style.display!="block")?"block":"none";}function popPmWin(wUrl,wName,wW,wH){window.open(wUrl,wName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+wW+',height='+wH);}function ptLeftColOpenShut(id,a){var myBod=document.getElementById(id);myBod.style.display=(myBod.style.display=="none")?"block":"none";var anch=a;/*var s,s1=new String()s=a.firstChild.src;var ary=s.split("_");s1=ary[1];if(s1.indexOf("rt")>-1){s1="dn.icon";}else{s1="rt.icon";}s=ary[0]+"_"+s1;a.firstChild.src=s;*/if(a.blur())a.blur();}function PT_loadFrame(url,destination,onload,loadedDiv){if(typeof destination=="string"){var destCtl=top.document.getElementById(destination);if(destCtl==null)destCtl=document.getElementById(destination);destination=destCtl;}var ifr=document.createElement("IFRAME");ifr.style.height=0;ifr.style.width=0;document.body.appendChild(ifr);var iframeId="__IFRAME_"+(++PT_iframeId);ifr.id=iframeId;var loadedFn=function(evt){var ifrDoc=PT_getIFrameDoc(ifr);var divToLoad;if(loadedDiv)divToLoad=ifrDoc.getElementById(loadedDiv);if(divToLoad)destination.innerHTML=divToLoad.innerHTML;else destination.innerHTML=ifrDoc.body.innerHTML;if(onload)onload();window.setTimeout("var ifr=document.getElementById('"+iframeId+"');ifr.parentNode.removeChild(ifr);",0);};if(ifr.addEventListener){ifr.addEventListener("load",loadedFn,false);}else{ifr.attachEvent("onload",loadedFn);}ifr.src=url;}var PT_iframeId=0;function PT_getIFrameDoc(oIframe){if(oIframe!=null)return(oIframe.contentDocument)?oIframe.contentDocument:(oIframe.contentWindow)?oIframe.contentWindow.document:(oIframe.document)?oIframe.document:null;}function PT_cancelBubble(evt){evt=(evt)?evt:window.event;evt.cancelBubble=true;}function PT_setButtonState(buttonId,state){var button=document.getElementById(buttonId);var imageDiv=document.getElementById(buttonId+"_image_"+state);button.style.backgroundImage=imageDiv.style.backgroundImage;button.setAttribute("state",state);}function PT_getButtonState(buttonId){return document.getElementById(buttonId).getAttribute("state");}function LLW(){window.name='MsgWin';var popupList=window.open('/n/mb/list.asp?webtag='+PTT_webtag+'&popup=true&gfc=1&super=y','popupList','width=245,height=600,toolbar=no,menubar=no,status=yes,scrollbars=yes,resizable=yes,screenX=10,screenY=10,left=10,top=10');popupList.focus();return false;}function print_page(){if(navigator.userAgent.toLowerCase().indexOf("mac")!=-1&&!window.netscape){alert("Press Command+P to Print");}else{window.print();}}var __gbl_qstr=stripQuery(this.location);function queryString(key,src){var __qstr=stripQuery(src);var strIndex=__qstr.indexOf(key+'=');if(strIndex==-1)return null;var strReturn='',ch='';for(var i=strIndex+key.length;i<__qstr.length;i++){ch=__qstr.charAt(i);if(ch=='&'||ch==';')break;if(ch=='+')strReturn+='';else if(ch!='=')strReturn+=ch;}return unescape(strReturn);}function stripQuery(src){if(src==null)return __gbl_qstr;if(typeof src=='string'){var __qstr=new String();var __tmpNum=src.indexOf('?');__qstr=(__tmpNum!=-1)?src.substr(__tmpNum+1,src.length):null;delete __tmpNum;return __qstr;}else if(typeof src=='object'){return location.search.substr(1,location.search.length);}else return __gbl_qstr;}function PT_shrinkWrap(){var myDiv=document.body;var x,y;if(myDiv){if(self.innerHeight){x=self.innerWidth;y=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){x=document.documentElement.clientWidth;y=document.documentElement.clientHeight;}else if(document.body){x=document.body.clientWidth;y=document.body.clientHeight;}}window.resizeTo(x,y);}function PT_getElementPosition(elm){var offsetTrail=elm;var offsetLeft=0;var offsetTop=0;while(offsetTrail){offsetLeft+=offsetTrail.offsetLeft;offsetTop+=offsetTrail.offsetTop;offsetTrail=offsetTrail.offsetParent;}if(navigator.userAgent.indexOf("Mac")!=-1&&navigator.userAgent.indexOf("Safari")==-1&&typeof document.body.leftMargin!="undefined"){offsetLeft+=document.body.leftMargin;offsetTop+=document.body.topMargin;}return{left:offsetLeft,top:offsetTop+elm.offsetHeight,absTop:offsetTop,btnWidth:elm.offsetWidth};}function PT_getWindowSize(){var w,h;if(self.innerHeight){w=self.innerWidth;h=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){w=document.documentElement.clientWidth;h=document.documentElement.clientHeight;}else if(document.body){w=document.body.clientWidth;h=document.body.clientHeight;}return{width:w,height:h};}function PT_showConfirmDialog(dlgId,button){var dlg=document.getElementById(dlgId);var buttonPos=PT_getElementPosition(button);dlg.style.display='block';dlg.style.left=buttonPos.left-(dlg.offsetWidth/2);dlg.style.top=buttonPos.top-(dlg.offsetHeight/2);}function AddDbgFlags(url){var dbgMatch=/dbg=\d+/.exec(document.location.search);if(dbgMatch==null)return url;else{var punct=(url.indexOf("?")>-1)?"&":"?";return url+punct+dbgMatch[0];}}function PT_ShowHideSelects(bolval){var arySelects=document.getElementsByTagName("SELECT");var showVal=(bolval)?"visible":"hidden";for(var i=0;i<arySelects.length;i++){arySelects[i].style.visibility=showVal;}}function PT_gotoWebtag(theSelect){theSelect.changed=false;theSelect.onfocus=PT_selectFocused;theSelect.onchange=PT_selectChanged;theSelect.onkeydown=PT_selectKeyed;theSelect.onclick=PT_selectClicked;return true;}function PT_selectChanged(theElement){var theSelect;if(theElement&&theElement.value){theSelect=theElement;}else{theSelect=this;}if(!theSelect.changed){return false;}top.location.href='/'+theSelect.value;return true;}function PT_selectClicked(){this.changed=true;}function PT_selectFocused(){this.initValue=this.value;return true;}function PT_selectKeyed(e){var theEvent;var keyCodeTab='9';var keyCodeEnter='13';var keyCodeEsc='27';if(e){theEvent=e;}else{theEvent=event;}if((theEvent.keyCode==keyCodeEnter||theEvent.keyCode==keyCodeTab)&&this.value!=this.initValue){this.changed=true;PT_selectChanged(this);}else if(theEvent.keyCode==keyCodeEsc){this.value=this.initValue;}else{this.changed=false;}return true;}