window.onresize = function () {
    if ((navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)==4)) {
        location.reload();
    }}

bookprops = "top=0,left=0,resizable=yes,toolbar=no,directories=no,menubar=no,status=no,scrollbar=no,width=" + screen.width + ",height=" + screen.height;
// dir = directory path
// fn_anchor = filename to be loaded with anchor or name
// Usage: javascript: BookHelp('../resources/index_test.html', 'sb203.htm$1152')
function BookHelp(dir, fn_anchor) {
		bookwin = window.open(dir + "#" + fn_anchor , "bookhelp", + bookprops)
		if (bookwin.opener == null) bookwin.opener = self;
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=555,height=425');");
if (window.focus) {newwindow.focus()
}
	
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function maskEmail(u,d,t)
{
	if (!d) var d = "whitestag.org";
	var e = (u + '@' + d).removeSpaces();
	document.write('<p>Please use this spam-protected email address.</p>');
	document.write('<p><a href="mailto:' + e + '">');
	if (t) document.write(t); else document.write(e);
	document.write('</a></p>');
	document.write('<p>When done, choose ');
	document.write('<a HREF="javascript:parent.history.go(-1)"');
	document.write('>back</a>.</p>');
	}

// Spam-proof email by deanq.com
// Copyright © 2003. deanq.com
function email(who,domain,subject) {
  if (!domain) var domain = "whitestag.org";
  if (!subject) var subject = " ";
  document.write('who' + ' email to ' + 'domain');
  var attrib = "width=1,height=1,resizable=1,toolbar=0,menubar=0,left=2000,top=2000,screenX=2000,screenY=2000,scrollbars=0";
  MyWindow=window.open('', "email", attrib);
  MyWindow.document.write("<HTML><HEAD><TITLE> <\/TITLE><META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=iso-8859-1'><\/HEAD><BODY leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad=\"javascript:location.href='mailto:" + who + "@" + domain + "?subject=" + subject + "'\" onBlur='window.close()' onFocus='window.close()'><\/BODY><\/HTML>");
  MyWindow.window.resizeTo(1, 1);
  MyWindow.document.title = " ";
  MyWindow.document.close();
}	

function lastdate () {
	var days = new Array(8);
	days[1] = "Sunday";
	days[2] = "Monday";
	days[3] = "Tuesday";
	days[4] = "Wednesday";
	days[5] = "Thursday";
	days[6] = "Friday";
	days[7] = "Saturday";
	var months = new Array(13);
	months[1] = "January";
	months[2] = "February";
	months[3] = "March";
	months[4] = "April";
	months[5] = "May";
	months[6] = "June";
	months[7] = "July";
	months[8] = "August";
	months[9] = "September";
	months[10] = "October";
	months[11] = "November";
	months[12] = "December";
	var dateObj = new Date(document.lastModified)
	var wday = days[dateObj.getDay() + 1]
	var lmonth = months[dateObj.getMonth() + 1]
	var date = dateObj.getDate()
	var fyear = dateObj.getYear()
	if (fyear < 2000) 
	fyear = fyear + 1900
	document.write(wday + ", " + lmonth + " " + date + ", " + fyear)
	
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
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;
}
function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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];}
}

// Testimonials for random display

var testi_text = new Array ();
testi_text[0] = "&quot;&quot;This dynamic program lives what it teaches.  The skills and attitudes that my children and I worked on as a part of White Stag have served me well in all aspects of my adult life.&quot; &#8212;Diana B."
testi_text[1] = "&quot;I was present at the 1st session of the camp this year. I have to say that it was one of the most fun weeks ever. Also, I learned a lot of skills like using your resources and controlling the group. I will try to use the skills in my Boy Scout troop. I hope you continue working on the program and keeping the spirit alive.&quot; &ndash;Aakash V.";
testi_text[2] = "&quot;White Stag is where I'm with my best friends. There, I work with the people who I feel closest to. We are all working together towards a common goal and that feeling of unity can't be found anywhere else. Knowing we're all going in the same direction allows me to drop the barriers I have at school and other places. All that matters is the learning and sharing of leadership.&quot; &ndash;camikins";
testi_text[3] = "&quot;White Stag had the biggest impact on my life and skills I learned there are still being used in my life today.&quot; &ndash;Tanya A.";
testi_text[4] = "&quot;Yeah, this was an awesome camp! I really had a lot of fun! And I learned so much too, everything from knots and lashings to first aid to firebuilding.&quot; &ndash;Evilkinky";
testi_text[5] = "&quot;White Stag is the best leadership camp. Because of White Stag, I am more confident and spirited. Also, I can now lead others to teach them leadership so we can bond together just like White Stag has bonded me with so many candidates and staff.&quot; &ndash;Jule C.";


testi_text[22] = "&quot;TBD&quot; &ndash;NAME";

var i = Math.floor(6*Math.random())

<!--<h3>Recent Comments</h3>-->
//<script language="JavaScript">
<!--
//document.write(testi_text[i]);
//-->
//<!--/script-->

function formatPhone(phone)
{
	var regex = /^(?:1?[ .-]?)\(?([1-9]\d{2})\)?[ .-]?\s?(\d{3})[ .-]?(\d{4})$/
	if (regex.test(phone))
	{
		return phone.replace(regex,"($1) $2-$3");
	}
	else
	{
		return "";
	}
}

// Remove spaces
String.prototype.removeSpaces = function()
{
	return this.replace(/\s+/g,'');
}
// Compress spaces
String.prototype.compress = function()
{
	return this.replace(/\s+/g,' ').trim();
}
// Trim
String.prototype.trim = function()
{
	return this.replace(/^\s+/,'').replace(/\s+$/,'');
}
// Validate email
String.prototype.isEmail = function()
{
	return /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(this);
}
