<!--
function SelectToTextbox(SelectId, TextId)      {
        var oSel = document.getElementById(SelectId)
        var oTxt = document.getElementById(TextId)
		if(oSel.length > 0)	{
			oTxt.value = oSel.options[oSel.selectedIndex].value;}
		else	{
			oTxt.value = "";	}
}

function EncodeForUrl(str)
{
  var encodedInputString=escape(str);
  encodedInputString=encodedInputString.replace("+", "%2B");
  encodedInputString=encodedInputString.replace("/", "%2F");
  return encodedInputString;
}

var InClick = 0;
function DoSubmit() {
	if(InClick == 1) {
		alert("Your request is being processed.");
	}
	else {
		document.f.submit();
	}
	InClick = 1;
}


function popup(mylink, windowname)
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
	return false;
}

function expandcollapseresetevent (postid) { 

   whichpost = document.getElementById(postid); 
   if (whichpost.className=="postshown") { 
      whichpost.className="posthidden"; 
   } 
   else { 
      reseteventgroups();   
      whichpost.className="postshown"; 
   } 
} 
//------------------------------------------------------------------
function reseteventgroups() {
   closeme = document.getElementById('<$BAF$>1'); 
   closeme.className="posthidden"; 
   closeme = document.getElementById('<$IS$>1'); 
   closeme.className="posthidden"; 
}
//------------------------------------------------------------------
function expandcollapsereset (postid) { 

   whichpost = document.getElementById(postid); 
   if (whichpost.className=="postshown") { 
      whichpost.className="posthidden"; 
   } 
   else { 
      resetgroups();   
      whichpost.className="postshown"; 
   } 
} 
//------------------------------------------------------------------
function resetgroups() {
   closeme = document.getElementById('<$REG$>1'); 
   closeme.className="posthidden"; 
   closeme = document.getElementById('<$GL$>1'); 
   closeme.className="posthidden"; 
   closeme = document.getElementById('<$PDESC$>1'); 
   closeme.className="posthidden"; 
   closeme = document.getElementById('<$Sched$>1'); 
   closeme.className="posthidden"; 
   closeme = document.getElementById('<$SpecializedPrograms$>1'); 
   closeme.className="posthidden"; 
}
//------------------------------------------------------------------
function expandcollapse (postid) { 
   whichpost = document.getElementById(postid); 
   
   if (whichpost.className=="postshown") { 
      whichpost.className="posthidden"; 
   } 
   else { 
      whichpost.className="postshown"; 
	  } 
} 
//------------------------------------------------------------------
function mo( addr1, addr2 ) {
        var a_href = "mail"+"to:";
        a_href += addr1 + "@" + addr2;
        document.location = a_href;
}
//------------------------------------------------------------------
function addbr()
{
	if (navigator.appName!="Netscape") 
	{
		document.write("<BR>");
	}
}
//------------------------------------------------------------------
function dropDownNavigate()
{
	box = document.forms[0].dropSched;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}
//------------------------------------------------------------------
// made by: Nicolas - http://www.javascript-page.com  Modified by Joseph Jorgens
function printpage() 
{
	window.print();  
}
//------------------------------------------------------------------
function startBlink(elementId) {
	var interval = 500;
	var colour1 = "#1a59a5";
	var colour2 = "#FF0000";
	if (document.getElementById) 
	{
		var element = document.getElementById(elementId);
		element.style.color = (element.style.color == colour1) ? colour2 : colour1;
		setTimeout("startBlink('" + elementId + "')", interval);
	}
}
//------------------------------------------------------------------
//http://www.expertsrt.com/scripts/Rod/validate_date.php
function validateDate(fld) {
    return 1;
    var RegExPattern = /^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/;
    var errorMessage = 'Invalid date or format: mm/dd/yyyy';
    if ((!fld.value.match(RegExPattern)) && (fld.value!='')) {
        alert(errorMessage);
        fld.focus();
        return 0;
    }
}


//----------------Javascript Form Validation------------------------
//FROM http://www.sophiaknows.com/codebase/js/validate.js.html
/*
FIELD CHECKS

   1. IsEmail(c,r)    -- is a valid address
   2. IsPhonenumber(c,r)    -- is a valid 10 digit phone number may include " -.()"
   2. IsZip(c,r)    -- is a valid 5 or 9 digit ZIP code
   4. IsPlaintext(c,r) -- allow only numbers and english letters
   5. IsInteger(c,r)    -- is an integer
   6. IsNotHtml(c,r)    -- does not include markup
   7. IsSecure(c,r)    -- is a secure password
   8. IsEqual(c,m,r)    -- matches value of specified field
   9. IsSelected(c) -- a valid option is selected
  10. IsRequired(c) -- a required field has contents

ARGUMENT KEY

   c = control-reference
   r = required (0|1)
   m = matched control reference

*/

// WARNING MESSAGE
//var warning="There are one or more errors or omitted fields in the form";

// CHECK VALIDATION: REVIEW ERRORS BEFORE SUBMIT    

function Validate(f) {
    if(!document.getElementById) { return true;}
    var errors=0;
    errors+=IsPlaintext(f.username,true);
    errors+=IsSecure(f.password,true);
    errors+=IsEqual(f.confirm,f.password,true);
    errors+=IsEmail(f.email,true);
    errors+=IsPhonenumber(f.phone,false);
    errors+=IsRequired(f.address1);
    errors+=IsPlaintext(f.city,1);
    errors+=IsSelected(f.state);
    errors+=IsZip(f.zip,1);
    if(errors>0) alert (warning);
    return ((errors)? false : true);
    }


// FORMAT TESTS:

// FORMAT TESTS: IS EMAIL
function IsEmail(c,r) {
    if(r && IsRequired(c)) {return 1;}
    if (!c.value 
        || c.value.search(/^[\w-\.]+@[\w-\.]+\.\w+$/)>-1) {
        unflag_error(c," Invalid Email Address");
        return 0;
        } else {
            flag_error(c," Invalid Email Address");
            return 1;
            }
    }


// FORMAT TESTS: IS PHONENUMBER        
function IsPhonenumber(c,r) {
    if(r && IsRequired(c)) {return 1;}
    if (!c.value 
        || c.value.search(/\(?\d{3}\)?[ \.-]?\d{3}[ \.-]\d{4}/)>-1) {
        unflag_error(c," Unrecognized Format");
        return 0;
        } else {
            flag_error(c," Unrecognized Format");
            return 1;
            }
    }

// FORMAT TESTS: IS ZIP
function IsZip(c,r) {
    if(r && IsRequired(c)) {return 1;}
    if (!c.value 
        || c.value.search(/^\d\d\d\d\d(-\d\d\d\d)?$/)>-1) {
        unflag_error(c," Unrecognized Format");
        return 0;
        } else {
            flag_error(c," Unrecognized Format");
            return 1;
            }
    }

// FORMAT TESTS: IS PLAINTEXT
function IsPlaintext(c,r) {
    if(r && IsRequired(c)) {return 1;}
    if (c.value.search(/[^\w]/)>-1) {
        flag_error(c," Letters and numbers only");
        return 1;
        } else {
            unflag_error(c," Letters and numbers only");
            return 0;
            }
    }

// FORMAT TESTS: IS INTEGER
function IsInteger(c,r) {
    if(r && IsRequired(c)) {return 1;}
    if (c.value.search(/[^\d]/)>-1) {
        flag_error(c," Must be integer");
        return 1;
        } else {
            unflag_error(c," Must be integer");
            return 0;
            }
    }

// FORMAT TESTS: IS NOT HTML
function IsNotHtml(c,r) {
    if(r && IsRequired(c)) {return 1;}
    if (c.value.search(/<[^>]+>/)>-1) {
        flag_error(c," Markup not permitted");
        return 1;
        } else {
            unflag_error(c," Markup not permitted");
            return 0;
            }
    }

// FORMAT TESTS: IS SECURE
function IsSecure(c,r) {
    if(r && IsRequired(c)) {return 1;}
    if(c.value.search(/[A-Z]/)>-1 
        && c.value.search(/[\d]/)>-1
        && c.value.length>3) {
        unflag_error(c," Must include at least 4 characters, including 1 number and 1 capital");
        return 0;
        } else {
            flag_error(c," Must include at least 4 characters, including 1 number and 1 capital");
            return 1;
            }
    }

// FORMAT TESTS: IS EQUAL
function IsEqual(c,m,r) {
    if(r && IsRequired(c)) {return 1;}
    if(!c.value || c.value == m.value) {
        unflag_error(c," Doesn't match "+ m.name);
        return 0;
        } else {
            flag_error(c," Doesn't match "+ m.name);
            return 1;
            }
    }


// FORMAT TESTS: IS SELECTED
function IsSelected(c,r) {
    if(c.selectedIndex>0) {
        unflag_error(c," Required");
        return 0;
        } else {
            flag_error(c," Required");
            return 1;
            }
    }

// FORMAT TESTS: IS REQUIRED
function IsRequired(c) {
    if(c.value) { 
        unflag_error(c," Required"); 
        return 0;
        } else { 
            flag_error(c," Required");
            return 1;
            }
    }

// FORMAT TESTS: IS DATE (of format mm/dd/yyyy)
function IsDate(c,r) {
   if(r && IsRequired(c)){
      return 1;      }
   if (!c.value || c.value.search(/\d{1,2}[\/-]\d{1,2}[\/-]\d{4}/)>-1) {
      unflag_error(c," Unrecognized Format; Correct format xx/xx/xxxx");
      return 0;
   } 
   else {
      flag_error(c," Unrecognized Format; Correct format xx/xx/xxxx");
      return 1;
   }
}


// FLAG/UNFLAG ERRORS

// FLAG ERROR
function flag_error(field,msg) {
    if(document.getElementById) {
		var td=document.getElementById(field.name + "_validator");
		td.className="warning_active";
		td.firstChild.nodeValue=td.firstChild.nodeValue.replace(msg,"");
        td.firstChild.nodeValue+=msg;
        }
    }

// UNFLAG ERROR
function unflag_error(field,msg) {
    if(document.getElementById) {
        var td=document.getElementById(field.name + "_validator");
        td.className="warning";
        td.firstChild.nodeValue=td.firstChild.nodeValue.replace(msg,"");
        }
    }


/*---------------------------------------------------------------------------

JavaScript Vertical Message Scroller for Web Designers Toolkit
(C)1999-2005 USINGIT.COM, All Rights Reserved.
To get more free and professional scripts, visit:
http://www.usingit.com/
http://www.usingit.com/products/webtoolkit
Tech Support:
http://www.usingit.com/support

This script can be used freely for non-commercial sites only if you don't 
alert the copyright info here! Contact us if you need to use it for any 
other purpose.
Contact Us:
http://www.usingit.com/support

---------------------------------------------------------------------------*/

//Modify the parameters below to make this script fit your need.

function vmsscroll(vmspDIV){
	vmsoDIV=eval(vmspDIV);
	if (parseInt(vmsoDIV.style.top)>0&&parseInt(vmsoDIV.style.top)<=5){
		vmsoDIV.style.top=0+"px";
		setTimeout("vmsscroll(vmsoDIV)",vmsDelay);
		setTimeout("vmsscroll2(vmsoDIV2)",vmsDelay);
		return;
	}
	if (parseInt(vmsoDIV.style.top)>=vmsoDIV.offsetHeight*-1){
		vmsoDIV.style.top=parseInt(vmsoDIV.style.top)-3+"px";
		setTimeout("vmsscroll(vmsoDIV)",50);
	}
	else{
		vmsoDIV.style.top=parseInt(vmsHeight)+"px";
		vmsoDIV.innerHTML=vmsMsgList[i];
		if(i==vmsMsgList.length-1){
			i=0;
		}
		else{
			i++;
		}
	}
};

function vmsscroll2(vmspDIV){
	vmsoDIV2=eval(vmspDIV);
	if (parseInt(vmsoDIV2.style.top)>0&&parseInt(vmsoDIV2.style.top)<=5){
		vmsoDIV2.style.top=0+"px";
		setTimeout("vmsscroll2(vmsoDIV2)",vmsDelay);
		setTimeout("vmsscroll(vmsoDIV1)",vmsDelay);
		return;
	};
	if (parseInt(vmsoDIV2.style.top)>=vmsoDIV2.offsetHeight*-1){
		vmsoDIV2.style.top=parseInt(vmsoDIV2.style.top)-3+"px";
		setTimeout("vmsscroll2(vmsoDIV2)",50);
	}
	else{
		vmsoDIV2.style.top=parseInt(vmsHeight)+"px";
		vmsoDIV2.innerHTML=vmsMsgList[i];
		if(i==vmsMsgList.length-1){
			i=0;
		}
		else{
			i++;	
		}
	}
};

function vmsstart(){
	vmsoDIV1=vmsIE4?VMSDIV1:document.getElementById("VMSDIV1");
	vmsoDIV2=vmsIE4?VMSDIV2:document.getElementById("VMSDIV2");
	vmsscroll(vmsoDIV1);
	vmsoDIV2.style.top=vmsHeight;
	vmsoDIV2.style.visibility='visible';
};

//---------------------------------------------------------------------------

//JavaScript Vertical Message Scroller for Web Designers Toolkit
//(C)1999-2005 USINGIT.COM, All Rights Reserved.
//To get more free and professional scripts, visit:
//http://www.usingit.com/
//http://www.usingit.com/products/webtoolkit
//Tech Support:
//http://www.usingit.com/support

//This script can be used freely for non-commercial sites only if you don't 
//alert the copyright info here! Contact us if you need to use it for any 
//other purpose.
//Contact Us:
//http://www.usingit.com/support

//--------------------------------------------------------------------------*/

//Modify the parameters below to make this script fit your need.

function startVMSScroll()
{
	alert("Top of Code (Function)");
	var vmsDelay='2000'; //how long the script will wait before scrolling next message in millisecond (1 second = 1,000 millisecond).
	var vmsWidth='200px'; //the width of the scroll box.
	var vmsHeight='200px'; //the height of the scroll box.
	var vmsBGColor='#FFFFFF'; //the background color of the scroll box.
	var vmsBGImage=''; //the background image of the scroll box. For example, your_image.gif.
	
	//specifies scrolling messages here.
	var vmsMsgList=new Array();
	vmsMsgList[0]="<P class=\"normal\"><B>NEWS FLASH!</B></P><HR><P class=\"normal\">Msg1</P>";
	vmsMsgList[1]="<P class=\"normal\">msg2";
	vmsMsgList[2]="<P class=\"normal\"><B>JM's IDEA!</B></P><HR><P class=\"normal\">Msg3</P>";
	//DO NOT CHANGE ANYTHING BELOW.
	
	var vmsIE4=document.all;
	var vmsDOM=document.getElementById;
	i=(vmsMsgList.length>2)?2:0;
	
		alert("Before If 1 (Function)");
	if (vmsIE4||vmsDOM){
		document.writeln('<div id="VMS" style="position:relative;width:'+vmsWidth+';height:'+vmsHeight+';overflow:hidden;background-color:'+vmsBGColor+' ;background-image:url('+vmsBGImage+')">');
		document.writeln('<div style="position:absolute;width:'+vmsWidth+';height:'+vmsHeight+';clip:rect(0 '+vmsWidth+' '+vmsHeight+' 0);left:0px;top:0px">');
		document.writeln('<div id="VMSDIV1" style="position:absolute;width:'+vmsWidth+';left:0px;top:1px;">');
		document.write(vmsMsgList[0]);
		document.writeln('</div>');
		document.writeln('<div id="VMSDIV2" style="position:absolute;width:'+vmsWidth+';left:0px;top:0px;visibility:hidden">');
		document.write(vmsMsgList[(vmsMsgList.length==1)?0:1]);
		document.writeln('</div></div></div>');
	};
	
		alert("Before If 2 (Function)");
	if (window.addEventListener){
		window.addEventListener("load", vmsstart, false);
	}else if (window.attachEvent){
		window.attachEvent("onload", vmsstart);
	}else if (vmsIE4||vmsDOM){
		window.onload=vmsstart;
	};
}
//-->

