if (top.frames.length > 1) { top.location=self.location.href; }


function popup(mypage, myname, w, h, win_x, win_y, scroll, resize) {
	if (screen.width) {
	var win_x = (screen.width - w) / 2;
	var win_y = (screen.height - h) / 4;
	}
else { var win_x = "200"; var win_y = "100"; }
winprops = 'height='+h+',width='+w+',top='+win_y+',left='+win_x+',scrollbars='+scroll+',resizable='+resize;
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


// builds email addresses with javascript

function buildaddr(user,domain,link) {
var default_domain = "southfiredistrict.com";					// defines default domain for email addresses
// document.write('user='+user + ', domain=' + domain + '<br>')	// for troubleshooting
if (!domain) { domain = default_domain }						// inserts default domain if omitted
domain	= domain.replace( /[\s,]+/g, "." );						// convert space or , to .
user	= user.replace( /\s/g, "" );							// remove spaces in user name
if (!/\.\w{2,3}$/.test(domain)) { domain = domain + '.com' }	// appends .com if omitted
var fulladdr = user + "@" + domain;
if (!link) { link = fulladdr }									// if no link name specified, use address
document.write('<a href="mailto:' + fulladdr + '">' + link + '</a>')
};

function buildlcaddr(user,domain,link,subj) {
var default_domain = "southfiredistrict.com";					// defines default domain for email addresses
// document.write('user='+user + ', domain=' + domain + '<br>')	// for troubleshooting
if (!domain) { domain = default_domain }						// inserts default domain if omitted
domain	= domain.replace( /[\s,]+/g, "." );						// convert space or , to .
user	= user.replace( /\s/g, "" );							// remove spaces in user name
if (!/\.\w{2,3}$/.test(domain)) { domain = domain + '.com' }	// appends .com if omitted
var fulladdr = user + "@" + domain;
if (!link) { link = fulladdr }									// if no link name specified, use address
if (subj)  { subj = "?subject=" + subj } else { subj = "" }
document.write('<a class=lclink href="mailto:' + fulladdr + subj + '">' + link + '</a>')
};



var cleared = 0;
function clearField(field){
if (cleared == 0) { field.value = ""; cleared += 1; }
}


function checkrequired() {
if ((document.joinlist.sendto.value=='')||(document.joinlist.sendto.value=='\(enter your email addr\.\)')) {
alert("Before submitting,\nplease enter a valid email address\."); return false;}
else { return true; }
}


function verify(title) {
var msg = 'Are you sure you want to delete these Meeting Minutes?';
if (confirm(msg)) { return true; }
else { return false; }
}

function CheckUploadForm() {
if  (document.upload.FILE1.value=='') {
alert("Ummm... you forgot to select a file to upload."); return false;}

if (document.upload.lastname.value=='') {
alert("Please enter your last name so we'll know who took the photo."); return false;}

var limit		= 500
var sumval		= document.upload.notes.value; sumval = strip(sumval);
var sumlength	= sumval.length;
var diff		= sumlength - limit;
		
if (diff > 1) { var chars = " characters." } else { var chars = " character." }

if (sumlength > limit) {
alert("The \"Description\" entry contains "+sumlength+" characters.\n\
The limit is "+limit+" characters.\nPlease shorten it by "+diff+chars); return false;}

return true;

}

function strip( s ) {
	s = s.replace( /^\s+/, "" );   // remove leading whitespace
	s = s.replace( /\s+$/, "" );  // remove trailing whitespace
	return s;
}



var agt			= navigator.userAgent.toLowerCase(); 
var is_win		= ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_ie		= (agt.indexOf("msie") != -1);

var is_crap		= (is_ie && is_win);

if (is_crap) { document.write('<style>p{margin-top:10px;}</style>') }


function Toggle(item1,item2,item3) {
obj1=document.getElementById(item1);
if (obj1.style.display=="block")	{ obj1.style.display="none";  }
else								{ obj1.style.display="block"; }

if (item2) {
obj2=document.getElementById(item2);
if (obj2.style.display=="inline")	{ obj2.style.display="none";   }
else								{ obj2.style.display="inline"; }
}

if (item3) {
obj3=document.getElementById(item3);
if (obj3.style.display=="inline")	{ obj3.style.display="none";   }
else								{ obj3.style.display="inline"; }
}
}

