<!--




function CheckAllBoxes(formname){
	var fform=eval("document." + formname);
	for (var i=0;i<fform.elements.length;i++) { 
		if (fform.elements[i].type=="checkbox") {
			fform.elements[i].checked=true; 
		}
	}
	return true;
}

function UnCheckAllBoxes(formname) {
	var fform=eval("document." + formname);
	for (var i=0;i<fform.elements.length;i++) { 
		if (fform.elements[i].type=="checkbox") {
			fform.elements[i].checked=false;
		}
	}
	return true;
}








//*
//help topic function
//*/


var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" width="0" height="0" src="/Images/spacer.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip

// -----------------------------------------------------------------------------

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var ua = navigator.userAgent.toLowerCase();
var divw=0;
var divh=0;
var xto;
var divTrailBodyStr = '';

if (document.getElementById || document.all) {
	document.write('<div id="imgtrailer" style="position:absolute;visibility:hidden;"></div>'); }

function gettrailobject() {
	if (document.getElementById) { return document.getElementById("imgtrailer"); }
	else if (document.all) { return document.all.imgtrailer; }
}

function gettrailobj() {
	if (document.getElementById) { return document.getElementById("imgtrailer").style; }
	else if (document.all) { return document.all.imgtrailer.style; }
}

function truebody() {
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function trailOff() {
	if (xto && xto > 0) { clearTimeout(xto); }
	document.onmousemove = '';
	gettrailobj().visibility = "hidden";
}

function trailOn(thumbimg,imgtitle,imgshortdesc,domainname,cssbgcolor,thw,thh) {
	if (cssbgcolor.length == 0) { cssbgcolor = "#000000"; }
	if (navigator.userAgent.indexOf("Opera") == -1) {
		gettrailobj().left = "-500px";
		halfthh = 50;
		halfthh = Math.ceil(parseInt(thh)/2);
		topx = halfthh - 9;

		if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Safari") != -1 || navigator.userAgent.indexOf("MSIE") != -1) {
			divTrailBodyStr = '';
			divTrailBodyStr += '<div style="width='+thw+';background-color: '+cssbgcolor+'; border: 1px none #808080; padding:3px; position:absolute; z-index:2;">';
			divTrailBodyStr += '<table width="'+thw+'" id="btcontainer" cellpadding="4" cellspacing="0" border="0" style="background-color:#ffffff;">';
			divTrailBodyStr += '<tr><td width="'+thw+'" align="center"> <img src="'+thumbimg+'" border="0"> </td></tr>';
			divTrailBodyStr += '<tr><td width="'+thw+'" align="center"> <hr align="center" width="98%" size="1" noshade> </td></tr>';
			divTrailBodyStr += '<tr><td width="'+thw+'" class="Text" align="left" style="word-wrap:break-word;font-weight: bold;"> '+imgtitle+' </td></tr>';
			divTrailBodyStr += '<tr><td width="'+thw+'" class="Text" align="left" style="word-wrap:break-word;"> '+imgshortdesc+' </td></tr>';			
			divTrailBodyStr += '<tr><td width="'+thw+'"> &copy; '+domainname+' </td></tr>';
			divTrailBodyStr += '<tr><td width="'+thw+'"> <img src="/buttons/spacer.gif" width="250" height="1" border="0"> </td></tr>';
			divTrailBodyStr += '</table>';
			divTrailBodyStr += '</div>';
			gettrailobject().innerHTML = divTrailBodyStr;			
		}

		//setTimeOut
		xto = setTimeout("xtimeOut('"+thumbimg+"')",100);
		
		gettrailobj().visibility = "visible";
		gettrailobject().style.zIndex = 9999;
		divw = parseInt(thw)+25;
		divh = parseInt(thh)+130;
		document.onmousemove = followmouse;
	}	
}

function xtimeOut(thumbimgg){
	if (document.getElementById) { document.getElementById('btcontainer').src = thumbimgg; }
	else if (document.all) { document.all.btcontainer.src = thumbimgg; }
}

function followmouse(e) {
	var docwidth = document.all ? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15;
	var docheight = document.all ? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight);
	if (typeof e != "undefined") {
		if (docwidth < 15+e.pageX+divw) { xcoord = e.pageX-divw-5; } 
		else { xcoord = 15+e.pageX; }
		if (docheight < 15+e.pageY+divh) { ycoord = 15+e.pageY-Math.max(0,(divh + e.pageY - docheight - truebody().scrollTop - 30)); } 
		else { ycoord = 15+e.pageY; }
	}
	else if (typeof window.event != "undefined") {
		if (docwidth < 15+truebody().scrollLeft+event.clientX+divw) { xcoord = truebody().scrollLeft-5+event.clientX-divw; }
		else { xcoord = truebody().scrollLeft+15+event.clientX; }
		if (docheight < 15+truebody().scrollTop+event.clientY+divh) { ycoord = 15+truebody().scrollTop+event.clientY-Math.max(0,(divh + event.clientY - docheight - 30)); }
		else { ycoord = truebody().scrollTop+15+event.clientY; }
	}
	gettrailobj().left = xcoord+"px";
	gettrailobj().top = ycoord+"px";
}

function ToggleSelect(DivIDName, OnOffState)  { // 1 visible, 0 hidden 
	OnOffState == 0
	var obj = document.layers ? document.layers[DivIDName] :
	document.getElementById ?  document.getElementById(DivIDName).style :
	document.all[DivIDName].style;
	obj.display = document.getElementById ? (OnOffState ? "block" : "none") :
	(OnOffState ? "visible" : "hidden");
}
				
function cOn(td,BGColor) {
	if (document.getElementById||(document.all && !(document.getElementById))) {
		td.style.backgroundColor = BGColor; }
}

function cOut(td,BGColor) {
	if (document.getElementById||(document.all && !(document.getElementById))) {
	td.style.backgroundColor = BGColor; }
}

function imgOn(td,BGimg) {
	if (document.getElementById||(document.all && !(document.getElementById))) {
		td.style.backgroundimage = "url(" + BGimg + ")"; }
}

function imgOut(td,BGimg) {
	if (document.getElementById||(document.all && !(document.getElementById))) {
	td.style.backgroundimage = "url(" + BGimg + ")"; }
}




function Confirm(){
	var name = confirm("Are you sure you want to delete???");
	if (name == true) { return true; } else { return false; }
}

function Pagebookmark(SiteURL,SiteTitle){
	if (window.external) {
		// IE Favorite
		bmsg = confirm("Add a bookmark to your favorites?");
		if (bmsg == true) {		
			window.external.AddFavorite(SiteURL,SiteTitle);
		}
	}
	else if (window.sidebar) {
		var detectBrowser = navigator.userAgent.toLowerCase();
		//alert(detectBrowser);
		//alert(detectBrowser.indexOf('netscape'));
		//alert(detectBrowser.indexOf('firefox'));
		if (detectBrowser.indexOf('netscape') > 0) {	
			// Mozilla Netscape Bookmark
			bmsg = confirm("Add a tab to the Sidebar (F9 to view)? \n- OR - \nPress CTRL-D (Win) or CMD-D (Mac) instead, to create a bookmark.");
			if (bmsg == true) {
				window.sidebar.addPanel(SiteTitle,SiteURL,"");
			}
		}
		else if (detectBrowser.indexOf('firefox') > 0) {			
			// Mozilla Firefox Bookmark
			bmsg = confirm("Add a link to your Bookmarks (Ctrl-B to view)? \n- OR - \nPress CTRL-D (Win) or CMD-D (Mac) instead, to create a bookmark.");
			if (bmsg == true) {
				window.sidebar.addPanel(SiteTitle,SiteURL,"");
			}
		}
	}	
	else if (window.opera && window.print) {
		// Opera Bookmark
		// Supposed to set page to true, which adds it to the Sidebar/Hotlist - not tested
		bmsg = confirm("Add a tab/link to the Sidebar/Hotlist (F4 to view)? \n- OR - \nPress CTRL-T (Win) instead, to create a bookmark.");
		if (bmsg == true) {
			return true;
		}
	}
	else {
		alert("Press CTRL-D (Mozilla/Internet Explorer) or CTRL-T (Opera) or CMD-D (Mac) to bookmark this site");
	}
}

function highlight(field) {
  field.focus();
  field.select();
}

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_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_findObj(n, d) { //v4.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);
  if(!x && document.getElementById) x=document.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];}
}

function changeImages(strName, strSrc) {
	if (document.images) {
		document.images[strName].src= strSrc;
	}
	return true;
}
	
function openCategories(url) {
  popupWin = window.open(url,'740x680','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=400,height=500');
}

function validateForm (form) {
	for (var e = 0; e < form.elements.length; e++) {
		var el = form.elements[e];
		
		if (el.type == 'checkbox') {
			var group = form[el.name];
			if (group.length) {
				var checked = false;
				for (var r = 0; r < group.length; r++) {
					if ((checked = group[r].checked)) {
						break;
					}
					if (!checked) {
						alert('Please check one of the checkboxes.');
						el.focus();
						return false;
					}
				}
			}
		}   
	}
	if (confirm('Are you sure you want to do this?')) { return true; } else { return false; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function openCatPopup(url, newwin) {
	if (opener && !opener.closed) opener.focus(); 
    myPopup = window.open(url,"catpopup","scrollbars=yes, height=500, width=400");
    if (!myPopup.opener) { myPopup.opener = self; }
}

function displayPopup(url, height, width) {
	properties = "toolbar=0,location=0,scrollbars=1,height=" + height;
	properties = properties + ",width=" + width;
	properties = properties + ",left=0,top=0";
	popupHandle = open(url, "disppopup", properties);
}
myPopup = '';

function openWindow(url) {
  popupWin = window.open(url,'740x680','toolbar=yes,status=no,scrollbars=yes,location=no,menubar=yes,directories=no,width=680');
}
function openPopUp(url) {
  popupWin = window.open(url,'740x680','toolbar=yes,status=no,scrollbars=yes,location=no,menubar=yes,directories=no,width=680');
}

function openHelp(url) {
	window.open(url,'640x480','toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,directories=no,width=300,height=480');
}

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 time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();

if ((navigator.appName == "Microsoft Internet Explorer") && (year < 2000))		
year="19" + year;
if (navigator.appName == "Netscape")
year=1900 + year;

function ValidatePhone(m){
p=m.value
if(p.length==3){
pp=p;
d4=p.indexOf('(')
d5=p.indexOf(')')
if(d4==-1){pp="("+pp;}
if(d5==-1){pp=pp+")";}
m.value="";
m.value=pp;
}
if(p.length>3){
d1=p.indexOf('(')
d2=p.indexOf(')')
if (d2==-1){
l30=p.length;
p30=p.substring(0,4);
p30=p30+")"
p31=p.substring(4,l30);
pp=p30+p31;
m.value="";
m.value=pp;
}
}
if(p.length>5){
p11=p.substring(d1+1,d2);
if(p11.length>3){
p12=p11;
l12=p12.length;
l15=p.length
p13=p11.substring(0,3);
p14=p11.substring(3,l12);
p15=p.substring(d2+1,l15);
m.value="";
pp="("+p13+")"+p14+p15;
m.value=pp;
}
l16=p.length;
p16=p.substring(d2+1,l16);
l17=p16.length;
if(l17>3&&p16.indexOf('-')==-1){
p17=p.substring(d2+1,d2+4);
p18=p.substring(d2+4,l16);
p19=p.substring(0,d2+1);
pp=p19+" "+p17+"-"+p18;
m.value="";
m.value=pp;
}
}
}
function testphone(obj1){
p=obj1.value
p=p.replace("(","")
p=p.replace(")","")
p=p.replace("-","")
p=p.replace("-","")
if (isNaN(p)==true){
alert("Check phone");
return false;
}
}	
/* Function AllScripts is in the Footer.asp of every TEMPLATE */
/* Make sure to add it to new templates, or your validation and dynabox will not work together */
/* This update was implemented in November of 2008. Just went through and corrected the newer clients */
/* Graz 02/03/2009 */
//  End -->
