//PwebTools.com - Cub Scout Web Tools//©1999-2003 this code is not to be modified.//Author Wayne Patton pwebtools@pattons.org//This is the program that controls the website.//global varvar qts = "'";var qt = unescape("%22");var vbCrLf = unescape("%0D%0A");var tempcolorvar tempcolor2var tempcalPane = new Array;sbImg = new Array;sbDes = new Array;//Header Functions//link talbefunction header_link_table(){txt = "";txt = txt + "<br>" + vbCrLf;txt = txt + "<br>" + vbCrLf;txt = txt + "<table width='100%' border='0' bgcolor=#C0C0C0>" + vbCrLf;tblrows =2 ;if(Link_Name.length ==15){tblrows = 3;}  for(J=0; J < tblrows; J++){  lnStart= J *5;	  txt = txt + "<tr> " + vbCrLf;  for(I=lnStart; I < (lnStart +5); I++){ txt = txt + header_Link_format(Link_Name[I],Link_Fine[I]);}  txt = txt + "</tr> " + vbCrLf;	  }txt = txt + "</table>" + vbCrLf;document.write(txt);	}//link formatfunction header_Link_format(DspText, LinkUrl){txtS="";ckempty=false;if(DspText=="empty"){ckempty=true;}if(DspText==""){ckempty=true;}if(LinkUrl=="empty"){ckempty=true;}if(LinkUrl==""){ckempty=true;}if(ckempty){txtS=txtS+"<td align='center'>";txtS=txtS+"&nbsp;";txtS=txtS+"</td>";	}else{txtS=txtS+"<td align='center'>";txtS=txtS+"<a href='" + LinkUrl +"' class='Headerlinks' onmouseover='LinkMOver(this);' onmouseout='LinkMOut(this)' target='_parent'>";txtS=txtS+ DspText + "</a>";	txtS=txtS+"</td>";}	return txtS;		}function header_format(){txt = "";txt = txt + "<br>" + vbCrLf;txt = txt + "<center><table width='900' border='2'>" + vbCrLf;txt = txt + "<tr> " + vbCrLf;txt = txt + "<td class='HeaderText' width='300' align='center' valign='middle'>" + vbCrLf;for(I=0; I < Header_Line.length; I++){txt = txt + Header_Line[I]+ "<br>" + vbCrLf;}txt = txt + "</td>" + vbCrLf;txt = txt + "<td align='center' valign='top'>" + vbCrLf;txt = txt + "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='650' height='100'>" + vbCrLf;txt = txt + "<param name=movie value='images/header.swf'>" + vbCrLf;txt = txt + "<param name=quality value=high><param name='LOOP' value='false'>" + vbCrLf;txt = txt + "<embed src='images/header.swf' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='650' height='100' loop='false'>" + vbCrLf;txt = txt + "</embed>" + vbCrLf; txt = txt + "</object>" + vbCrLf;txt = txt + "</td>" + vbCrLf;txt = txt + "</tr></table></center>" + vbCrLf;txt = txt + "" + vbCrLf;if(Flash_Header=="no"){txt = "";txt = txt + "<table width='75%' border='0'>" + vbCrLf;txt = txt + "<tr> " + vbCrLf;txt = txt + "<td align='center' valign='top'>" + vbCrLf;txt = txt + "<img src='images/header.jpg'>" + vbCrLf;txt = txt + "</td>" + vbCrLf;txt = txt + "</tr></table>" + vbCrLf;		}document.write(txt);header_link_table();}function footer_format(){txt = "";txt = txt + "<br><br><table width='100%' border='0'>" + vbCrLf;txt = txt + "<tr> " + vbCrLf;txt = txt + "<td width='120' align='center' valign='top'>" + vbCrLf;txt = txt + "<img src='images/CSrank3Scan.gif' border='0' width='100' height='100'>" + vbCrLf;txt = txt + "</td>" + vbCrLf;txt = txt + "<td class='FooterText' align='center'>";for(I=0; I < Footer_Line.length; I++){ txt = txt + Footer_Line[I] + "<br>";}txt = txt + "</td>" + vbCrLf;txt = txt + "<td width='120' align='center' valign='top'>" + vbCrLf;txt = txt + "<img src='images/footer_right.gif' width='100' height='100'>" + vbCrLf;txt = txt + "</td>" + vbCrLf;txt = txt + "</tr></table>" + vbCrLf;document.write(txt);				}// Linksfunction LinkMOver(linkID){//alert(linkID.id);tempcolor = linkID.style.color;linkID.style.color = "red";		}function LinkMOut(linkID){linkID.style.color = tempcolor;				}// Index Page Funcionsfunction imageBank(){image = "images/index_bank/day##.jpg";today = new Date();m = new Array("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");MonthCode = m[today.getMonth()];DayOfWeek = m[today.getDay()];DayOfMonth = m[today.getDate()-1];filecode = DayOfMonth;image = image.replace("##",filecode);	document.write("<img src='" + image + "' >");		}// Calendar Functions//load calendar panes from Iframefunction calDataLoad(){for(I=1;I<13;I++){refPane = document.getElementById("M"+I);calPane[I]=refPane.innerHTML 	}//Check if parent if(window.parent.location.href.search("data.htm") > 3){	for(J=1;J < 13;J++){		calFormat(J);		}		}}function setCalFont(TabelId){//Fetch font types	}function fontLkUp(fontName){var wzStyleSheet;var fontNum =0;wzStyleSheet= document.styleSheets[0];	if(!wzStyleSheet.cssRules){    wzStyleSheet.cssRules = wzStyleSheet.rules;	    }	for(I=1;I<wzStyleSheet.cssRules.length;I++){	if(wzStyleSheet.cssRules[I].selectorText==fontName){fontNum=I};		}return(fontNum);	}function calload(){//Need to pull font color for calNavSelectvar wzStyleSheet;wzStyleSheet= document.styleSheets[0];	if(!wzStyleSheet.cssRules){    wzStyleSheet.cssRules = wzStyleSheet.rules;	    }tempcolor2 = wzStyleSheet.cssRules[fontLkUp(".calNavSelect")].style.colorvar todaydate = new Date();MNum = todaydate.getMonth() +1;selmonth(MNum);	}function selmonth(MSel){var monthselfor(I=1;I<13;I++){	monthsel = document.getElementById("MS"+I);		monthsel.style.color = tempcolor2;		monthsel.style.cursor = poniter;	}	monthsel = document.getElementById("MS"+MSel);	monthsel.style.color = "#FF0000";	showmonth(MSel);		}function showmonth(MSet){refdspCal = document.getElementById("dspCal");	refdspCal.innerHTML = window.parent.frames["frCalData"].calPane[MSet]//call to format the tablecalFormat(MSet);}//This function will format the tablefunction calFormat(MSet){	var wzStyleSheet;var wzStyleDay;var wzStyleTime;var wzStyleDes;var wzTblObject;wzStyleSheet= document.styleSheets[0];	if(!wzStyleSheet.cssRules){    wzStyleSheet.cssRules = wzStyleSheet.rules;				}wzStyleDay = wzStyleSheet.cssRules[fontLkUp(".calEventDate")].stylewzStyleTime = wzStyleSheet.cssRules[fontLkUp(".calEventTime")].style	wzStyleDes = wzStyleSheet.cssRules[fontLkUp(".calEventDetail")].style	wzTblObject = document.getElementById("MT"+MSet);for(I=0; I < wzTblObject.rows.length;I++){wzTblObject.rows[I].cells[0].style.fontSize = wzStyleDay.fontSize;wzTblObject.rows[I].cells[0].style.fontFamily = wzStyleDay.fontFamliy;wzTblObject.rows[I].cells[0].style.fontStyle = wzStyleDay.fontStyle;wzTblObject.rows[I].cells[0].style.color = wzStyleDay.color;wzTblObject.rows[I].cells[1].style.fontSize = wzStyleTime.fontSize;wzTblObject.rows[I].cells[1].style.fontFamily = wzStyleTime.fontFamliy;wzTblObject.rows[I].cells[1].style.fontStyle = wzStyleTime.fontStyle;wzTblObject.rows[I].cells[1].style.color = wzStyleTime.color;wzTblObject.rows[I].cells[2].style.fontSize = wzStyleDes.fontSize;wzTblObject.rows[I].cells[2].style.fontFamily = wzStyleDes.fontFamliy;wzTblObject.rows[I].cells[2].style.fontStyle = wzStyleDes.fontStyle;wzTblObject.rows[I].cells[2].style.color = wzStyleDes.color;	}}	//Scraop Book Functions//loading data on data pagefunction scrapDataLoad(){dataLayer = document.getElementById("SBD");	temp =dataLayer.innerHTML 	}function sbload(){refDataTbl = document.getElementById("dataTbl");	refDataTbl.innerHTML = window.parent.frames["frScrapBookData"].temp	var tlayertlayer = document.getElementById("SBD");tlayer.style.visibility="hidden";tlayer = document.getElementById("LNN");tlayer.style.visibility="hidden";	var wzStyleSheet;wzStyleSheet= document.styleSheets[0];	if(!wzStyleSheet.cssRules){    wzStyleSheet.cssRules = wzStyleSheet.rules;	    }tempcolor2 = wzStyleSheet.cssRules[fontLkUp(".sbNavName")].style.color//read datavar wzTblObjectwzTblObject = document.getElementById("SBTD");NumRow = wzTblObject.rows.length;temp = 0;txt = "<table  width='100%' border='0'> <tr><td align='center' class='sbNavHeader'>Select Picture</td></tr><tr><td>" + vbCrLf;txt = txt + "<table width='100%' border='0'>" + vbCrLf;	for(I=1;I<NumRow;I++){	if(!wzTblObject.rows[I].cells[0].firstChild.nodeValue==""){	txt = txt + "<tr><td id='SBS" + I + "' class='sbNavName' align='left' onclick=" + qt + "selSBP(" + I + ",'";	txt = txt + wzTblObject.rows[I].cells[0].firstChild.nodeValue +"','" + wzTblObject.rows[I].cells[2].firstChild.nodeValue + "'";	txt = txt + ");" + qt + ">";	txt = txt +  wzTblObject.rows[I].cells[1].firstChild.nodeValue	txt = txt + "</td></tr>" + vbCrLf;		temp=temp+1;		sbImg[I]=wzTblObject.rows[I].cells[0].firstChild.nodeValue;	sbDes[I]=wzTblObject.rows[I].cells[2].firstChild.nodeValue		}	}			txt=txt + "</table>"+ vbCrLf;	txt=txt + "</td></tr></table>"+ vbCrLf;tlayer.innerHTML= txt;tlayer.style.visibility="visible";//Setting highth of navimg NumRownavImg = document.getElementById("imgNav");navImgH = NumRow * 20;if(navImgH < 300){navImgH = 300;}navImg.height=navImgH;pageHeight = document.getElementById("pgHeight");pageH = NumRow *15;if(pageH < 200){pageH = 200;}pageHeight.height = pageH;selSBP(1,wzTblObject.rows[1].cells[0].firstChild.nodeValue,wzTblObject.rows[1].cells[2].firstChild.nodeValue);	}function selSBPClick(NumCl){selSBP(NumCl,sbImg[NumCl],sbDes[NumCl]);	}function selSBP(sbNum,sbPic,sbText){for(I=1;I<=temp;I++){LeftNN = document.getElementById("SBS" + I);	LeftNN.style.color = tempcolor2;LeftNN.style.cursor = poniter;		}	LeftNN = document.getElementById("SBS" + sbNum);	LeftNN.style.color = "#FF0000";arrowLeft = sbNum.valueOf() -1;if(arrowLeft <1){arrowLeft = sbImg.length -1;}arrowRight = sbNum.valueOf() +1;if(arrowRight >= sbImg.length){arrowRight = 1;}DspImage = document.getElementById("SBP");	DspImage.style.visibility ="hidden";	txt = "<table width='90%' border='0'>" + vbCrLf;txt = txt + "<tr colspan='2'><td align='center'><img src='images/scrapbook/" + sbPic + "'></td></tr>" +vbCrLf;txt = txt + "<tr colspan='2'><td class='sbCaption' align='center'>" + sbText + "</td></tr>" +vbCrLf;if (sb_arrows == "off") {txt = txt + "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>";}else {txt = txt + "<tr><td align='left'><a href='#' onMouseOut='MM_swapImgRestore();'  onMouseOver=" +qt + "MM_swapImage('arrowbutton_Left','','images/arrowbutton_Left_f2.gif',1);" + qt + " onClick='selSBPClick(" + arrowLeft  + ");'><img name='arrowbutton_Left' src='images/arrowbutton_Left.gif' width='48' height='38' border='0'></a></td>";      txt = txt + "<td align='right'><a href='#' onMouseOut='MM_swapImgRestore();'  onMouseOver=" +qt + "MM_swapImage('arrowbutton_Right','','images/arrowbutton_Right_f2.gif',1);" + qt + " onClick='selSBPClick(" + arrowRight  + ");' ><img name='arrowbutton_Right' src='images/arrowbutton_Right.gif' width='48' height='38' border='0'></a></td></tr>";;      }txt = txt + "</table>" + vbCrLf;	DspImage.innerHTML = txt;DspImage.style.position = "absolute";DspImage.style.width = 500;DspImage.style.top = 200;DspImage.style.left = 200;DspImage.style.visibility ="visible";	}// Browser Detectorfunction BrowserDetectLite() {	var ua = navigator.userAgent.toLowerCase(); 	// browser name	this.isGecko     = (ua.indexOf('gecko') != -1);	this.isMozilla   = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length);	this.isNS        = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );	this.isIE        = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); 	this.isOpera     = (ua.indexOf("opera") != -1); 	this.isKonqueror = (ua.indexOf("konqueror") != -1); 	this.isIcab      = (ua.indexOf("icab") != -1); 	this.isAol       = (ua.indexOf("aol") != -1); 	this.isWebtv     = (ua.indexOf("webtv") != -1); 		// spoofing and compatible browsers	this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE);	this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla);		// browser version	this.versionMinor = parseFloat(navigator.appVersion); 		// correct version number	if (this.isNS && this.isGecko) {		this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );	}	else if (this.isIE && this.versionMinor >= 4) {		this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );	}	else if (this.isMozilla) {      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );   }   else if (this.isOpera) {		if (ua.indexOf('opera/') != -1) {			this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) );		}		else {			this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) );		}	}	else if (this.isKonqueror) {		this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );	}	else if (this.isIcab) {		if (ua.indexOf('icab/') != -1) {			this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) );		}		else {			this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) );		}	}	else if (this.isWebtv) {		this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) );	}		this.versionMajor = parseInt(this.versionMinor); 	this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );		// dom support   this.isDOM1 = (document.getElementById);	this.isDOM2Event = (document.addEventListener && document.removeEventListener);      // css compatibility mode   this.mode = document.compatMode ? document.compatMode : 'BackCompat';	// platform	this.isWin   = (ua.indexOf('win') != -1);	this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );	this.isMac   = (ua.indexOf('mac') != -1);	this.isUnix  = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)		// specific browser shortcuts	this.isNS4x = (this.isNS && this.versionMajor == 4);	this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);	this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);	this.isNS4up = (this.isNS && this.versionMinor >= 4);	this.isNS6x = (this.isNS && this.versionMajor == 6);	this.isNS6up = (this.isNS && this.versionMajor >= 6);	this.isNS7x = (this.isNS && this.versionMajor == 7);	this.isNS7up = (this.isNS && this.versionMajor >= 7);		this.isIE4x = (this.isIE && this.versionMajor == 4);	this.isIE4up = (this.isIE && this.versionMajor >= 4);	this.isIE5x = (this.isIE && this.versionMajor == 5);	this.isIE55 = (this.isIE && this.versionMinor == 5.5);	this.isIE5up = (this.isIE && this.versionMajor >= 5);	this.isIE6x = (this.isIE && this.versionMajor == 6);	this.isIE6up = (this.isIE && this.versionMajor >= 6);		this.isIE4xMac = (this.isIE4x && this.isMac);}var browser = new BrowserDetectLite();var poniter = "pointer";if(browser.isIE){	var poniter = "hand";}// Mouse over code from firework 4.0function MM_findObj(n, d) { //v3.0  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;}/* Functions that swaps images. */function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}