//Name:TicToc
//Creation Date: 5/10/2001
//Last edited:  08/07/2002 - BA
//Description:  Gets the month, date and time, returns it in this format:
//Day of Week , Month Date, Year 
//Example:  Thur, June 14, 2001 
//@author Ben Arcisewski 
function ticToc(){  
   var day = new Array();
	day[0] = "Sunday";
	day[1] = "Monday";
	day[2] = "Tuesday";
	day[3] = "Wednesday";
	day[4] = "Thursday";
	day[5] = "Friday";
	day[6] = "Saturday";
	var mo = new Array();
	mo[0] = "January";
	mo[1] = "February";
	mo[2] = "March";
	mo[3] = "April";
	mo[4] = "May";
	mo[5] = "June";
	mo[6] = "July";
	mo[7] = "August";
	mo[8] = "September";
	mo[9] = "October";
	mo[10] = "November";
	mo[11] = "December";
	
	var now = new Date();
	var dom = now.getDate();
	var dow = now.getDay();
	var year = now.getFullYear();
	//var hours = now.getHours();
	//var ampm = "am"
	/*if( hours == 12 ){
				ampm = "pm";
	}
   	else if( hours > 12 && hours != 24)
   	{  hours = hours - 12;
      	   ampm= "pm";
   	}
       
	var minutes = now.getMinutes();
	if (minutes < 10){
		minutes = "" + "0" + minutes;
	}*/
	var month = now.getMonth(); 
	//var theEnd = ("" + day[dow] + ", " + mo[month] + " " + dom + ", " + year + " " + hours + ":" + minutes + ampm);
	var theEnd = ("" + day[dow] + ", " + mo[month] + " " + dom + ", " + year );
	
   return theEnd;
}

//***********************************************************************************************************************************
	function newwindow(url, w, h) {
		winHandle = window.open(url, 'popup', 'toolbar,scrollbars,resizable,width=' + w + ',height=' + h);
		winHandle.focus();
	}
	
//***********************************************************************************************************************************	
	//commonly put in a loop that goes through an array of fields that need to be required

	function general_check_required(formHandle, transfer_type, section_type)

	{	//text fields only

		var stringHandler = formHandle[transfer_type].value
		var sh2 = stringHandler.substring(0,2)

		if( stringHandler == "")

		{		alert( "Please fill in the required " + section_type + " field.");		

				formHandle[transfer_type].focus();

				return 0;	
		}	
		return 1;
	}	

//***********************************************************************************************************************************
	function email_required(formHandle, transfer_type, section_type)
	{	//text fields only

		var stringHandler = formHandle[transfer_type].value
		var sh2 = stringHandler.substring(0,2)

		if( stringHandler == "")
		{		alert( "Please Enter A Valid E-mail Address.");		
				formHandle[transfer_type].focus();
				return 0;	
		}	
		return 1;
	}

//***********************************************************************************************************************************
      function validateEmailAt(formHandle, transferType)
		{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(formHandle[transferType].value)){
		return (true)
		}
		alert("Invalid E-mail Address. Please Re-enter.")
		return (false)
		}

//************************************************************************************************************************************
	
	function thirdPartyAlert(URL)
	{
		var accept = confirm ("Warning: Wheatland Bank is not endorsing or guaranteeing the products, information, or recommendations provided by linked sites and we are not liable for any failure of products and services advertised on those sites ");
		
		if(accept)
			window.open(URL)
		
	}
