/////////////////////////////////////////////////////////////
// FUNCTION GROUP: lightmeup & bringmeback
//
// Created 1/18/2010 KLemon
// Used Highlight rows
// PUBLIC use with TR or TD and with most DHTML
//
		function lightmeup(currrow) 
			{  
			colorValue = "lightgrey";
			document.getElementById(currrow).style.backgroundColor=colorValue;  
			}
		function bringmeback(currrow)
			{
			colorValue = "white";
			document.getElementById(currrow).style.backgroundColor=colorValue;  
			}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION GROUP: lightmeup & bringmeback ADVANCE
//
// Created 1/22/2010 KLemon
// Used Highlight rows
// PUBLIC use with TR or TD and with most DHTML
//
		function lightmeupADV(currrow, colorValue) 
			{  
			document.getElementById(currrow).style.backgroundColor=colorValue;  
			}
		function bringmebackADV(currrow,colorValue)
			{
			document.getElementById(currrow).style.backgroundColor=colorValue;  
			}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION: jtrim
//
// Created 2/19/2010 KLemon
// Trims out hite space
// PUBLIC use to trim out whitespace
//
		function jtrim(stringValue)
		{
			return stringValue.replace(/(^\s*|\s*$)/, "");
		}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION: MypopUp
//
// Created 2/18/2010 KLemon
// Creates popup window but requires height and width
// PUBLIC/PRIVATE use with any expected popup
//
	function MypopUp(URL,DaWidth,DaHeight) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + DaWidth + ",height=" + DaHeight + ",left = 615,top = 362.5');");
	}
/////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////
// FUNCTION: Show_Stuff
//
// Created 1/18/2010 KLemon
// Used to change CSS hidden
// PUBLIC use with span and div
//
		function Show_Stuff(Click_Menu)
			{
				if (Click_Menu.style.display == "none")
				{
				Click_Menu.style.display = "";
				}
				else
				{
				Click_Menu.style.display = "none";
				}
			}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION: SetToNull
//
// Created 1/18/2010 KLemon
// Used to set Login form elements to null
// PRIVATE use 
//
	function SetloginnameToNull()
		{
         isubmitform.loginname.value='';
        }
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION: Info_formvalidation
//
// Created 1/18/2010 KLemon
// Used for info request/login/create account forms
// PRIVATE requires form names and object names to match.
//
	function Info_formvalidation()
		{

		var ecode;
        var eMSGTxt;
        eMSGTxt='';

         // Check to see if login Type
         if(isubmitform.loginname.value=='') {


            // Required for info request and create account



			if (jtrim(isubmitform.firstname.value)=='')
				{
				eMSGTxt = 'First Name';
				ecode=1;
				}



			if (jtrim(isubmitform.lastname.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Last Name';
				ecode=1;
				}

			if (jtrim(isubmitform.email_address.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Email';
				ecode=1;
				}

			if (jtrim(isubmitform.street_address.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Street Address';
				ecode=1;
				}

			if (jtrim(isubmitform.postcode.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Post Code';
				ecode=1;
				}

			if (jtrim(isubmitform.city.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'City';
				ecode=1;
				}
			if (jtrim(isubmitform.state.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'State';
				ecode=1;
				}
			if (jtrim(isubmitform.country.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Country';
				ecode=1;
				}

			if (jtrim(isubmitform.telephone.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Telephone';
				ecode=1;
				}

			if (isubmitform.primaryinterest.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Primary Course Interest';
				ecode=1;
				}




            // check password for new accouint if TRUE
            if(isubmitform.newaccount.checked){

			if (jtrim(isubmitform.password.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password';
				ecode=1;
				}
			if (jtrim(isubmitform.confirmation.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password Confirmation';
				ecode=1;
				}

			if (isubmitform.confirmation.value!=isubmitform.confirmation.value)
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password and Confirmation must match';
				ecode=1;
				}
        
               }


           } else {
 
	               if (isubmitform.loginname.value=='')
					{
					eMSGTxt = 'Login Email';
					ecode=1;
					}
	
			 	    if (isubmitform.loginpassword.value=='')
					{
	                  if(eMSGTxt!='') {
	                   eMSGTxt= eMSGTxt + ', ';
	                  }
					eMSGTxt = eMSGTxt + 'Password';
					ecode=1;
					}

           }

            // Do something with error flag
           	if (ecode!=1)
				{
				isubmitform.submit();
				} else {
                  alert('Missing Required Information: ' + eMSGTxt + '. Please check the form and try again.');
                }
		}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION: acct_formvalidation
//
// Created 1/18/2010 KLemon
// Used for info request/login/create account forms
// PRIVATE requires form names and object names to match.
//
	function acct_formvalidation()
		{
		var ecode;
        var eMSGTxt;
        eMSGTxt='';

			if (EditStudent.SFName.value=='')
				{
				eMSGTxt = 'First Name';
				ecode=1;
				}

			if (EditStudent.SLName.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Last Name';
				ecode=1;
				}

			if (EditStudent.SEmail.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Email';
				ecode=1;
				}

			if (EditStudent.SADDYLINE1.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Street Address';
				ecode=1;
				}

			if (EditStudent.SZIP.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Post Code';
				ecode=1;
				}

			if (EditStudent.SCITY.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'City';
				ecode=1;
				}
			if (EditStudent.SSTATE.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'State';
				ecode=1;
				}
			if (EditStudent.SCOUNTRY.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Country';
				ecode=1;
				}

			if (EditStudent.STelephone.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Telephone';
				ecode=1;
				}

            // check password to see if trying to update
            if(EditStudent.password.value !=''){

			if (EditStudent.password.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password';
				ecode=1;
				}
			if (EditStudent.confirmation.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password Confirmation';
				ecode=1;
				}

			if (EditStudent.confirmation.value!=EditStudent.confirmation.value)
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password and Confirmation must match';
				ecode=1;
				}
        
               }


      

            // Do something with error flag
           	if (ecode!=1)
				{
				EditStudent.submit();
				} else {
                  alert('Missing Required Information: ' + eMSGTxt + '. Please check the form and try again.');
                }
		}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION: Info_formvalidation
//
// Created 1/18/2010 KLemon
// Used for info request/login/create account forms
// PRIVATE requires form names and object names to match.
//
	function Info_formvalidation()
		{

		var ecode;
        var eMSGTxt;
        eMSGTxt='';

         // Check to see if login Type
         if(isubmitform.loginname.value=='') {


            // Required for info request and create account



			if (jtrim(isubmitform.firstname.value)=='')
				{
				eMSGTxt = 'First Name';
				ecode=1;
				}



			if (jtrim(isubmitform.lastname.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Last Name';
				ecode=1;
				}

			if (jtrim(isubmitform.email_address.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Email';
				ecode=1;
				}

			if (jtrim(isubmitform.street_address.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Street Address';
				ecode=1;
				}

			if (jtrim(isubmitform.postcode.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Post Code';
				ecode=1;
				}

			if (jtrim(isubmitform.city.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'City';
				ecode=1;
				}
			if (jtrim(isubmitform.state.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'State';
				ecode=1;
				}
			if (jtrim(isubmitform.country.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Country';
				ecode=1;
				}

			if (jtrim(isubmitform.telephone.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Telephone';
				ecode=1;
				}

			if (isubmitform.primaryinterest.value=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Primary Course Interest';
				ecode=1;
				}




            // check password for new accouint if TRUE
            if(isubmitform.newaccount.checked){

			if (jtrim(isubmitform.password.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password';
				ecode=1;
				}
			if (jtrim(isubmitform.confirmation.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password Confirmation';
				ecode=1;
				}

			if (isubmitform.confirmation.value!=isubmitform.confirmation.value)
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password and Confirmation must match';
				ecode=1;
				}
        
               }


           } else {
 
	               if (isubmitform.loginname.value=='')
					{
					eMSGTxt = 'Login Email';
					ecode=1;
					}
	
			 	    if (isubmitform.loginpassword.value=='')
					{
	                  if(eMSGTxt!='') {
	                   eMSGTxt= eMSGTxt + ', ';
	                  }
					eMSGTxt = eMSGTxt + 'Password';
					ecode=1;
					}

           }

            // Do something with error flag
           	if (ecode!=1)
				{
				isubmitform.submit();
				} else {
                  alert('Missing Required Information: ' + eMSGTxt + '. Please check the form and try again.');
                }
		}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION: Info_formvalidation_sm
//
// Created 1/25/2010 KLemon
// Used for info request/login/create account forms
// PRIVATE requires form names and object names to match.
//
	function Info_formvalidation_sm()
		{

		var ecode;
        var eMSGTxt;
        eMSGTxt='';


            // Required for info request and create account



			if (jtrim(isubmitform.firstname.value)=='')
				{
				eMSGTxt = 'First Name';
				ecode=1;
				}



			if (jtrim(isubmitform.lastname.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Last Name';
				ecode=1;
				}

			if (jtrim(isubmitform.email_address.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Email';
				ecode=1;
				}

			if (jtrim(isubmitform.city.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'City';
				ecode=1;
				}
			if (jtrim(isubmitform.state.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'State';
				ecode=1;
				}

              	if (jtrim(isubmitform.telephone.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Telephone';
				ecode=1;
				}


		
            // Do something with error flag
           	if (ecode!=1)
				{
				isubmitform.submit();
				} else {
                  alert('Missing Required Information: ' + eMSGTxt + '. Please check the form and try again.');
                }
		}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
// FUNCTION: Info_formvalidation
//
// Created 1/18/2010 KLemon
// Used for info request/login/create account forms
// PRIVATE requires form names and object names to match.
//
	function Info_formvalidation_s2()
		{

		var ecode;
        var eMSGTxt;
        eMSGTxt='';

         // Check to see if login Type
         if(isubmitform.loginname.value=='') {


            // Required for info request and create account



		

			if (jtrim(isubmitform.street_address.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Street Address';
				ecode=1;
				}

			if (jtrim(isubmitform.postcode.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Post Code';
				ecode=1;
				}


			if (jtrim(isubmitform.country.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Country';
				ecode=1;
				}

			if (jtrim(isubmitform.telephone.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Telephone';
				ecode=1;
				}






            // check password for new accouint if TRUE
            if(isubmitform.newaccount.checked){

			if (jtrim(isubmitform.password.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password';
				ecode=1;
				}
			if (jtrim(isubmitform.confirmation.value)=='')
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password Confirmation';
				ecode=1;
				}

			if (isubmitform.confirmation.value!=isubmitform.confirmation.value)
				{
                  if(eMSGTxt!='') {
                   eMSGTxt= eMSGTxt + ', ';
                  }
				eMSGTxt = eMSGTxt + 'Password and Confirmation must match';
				ecode=1;
				}
        
               }


           } else {
 
	               if (isubmitform.loginname.value=='')
					{
					eMSGTxt = 'Login Email';
					ecode=1;
					}
	
			 	    if (isubmitform.loginpassword.value=='')
					{
	                  if(eMSGTxt!='') {
	                   eMSGTxt= eMSGTxt + ', ';
	                  }
					eMSGTxt = eMSGTxt + 'Password';
					ecode=1;
					}

           }

            // Do something with error flag
           	if (ecode!=1)
				{
				isubmitform.submit();
				} else {
                  alert('Missing Required Information: ' + eMSGTxt + '. Please check the form and try again.');
                }
		}
/////////////////////////////////////////////////////////////
