function verifyphone(thefield){
	if(thefield.value != ''){
	   if(thefield.value.match(/^[0-9]{3}-[0-9]{3}-[0-9]{4}/)){
	        //return true
	   }
	   else{
	   		if(thefield.value.match(/^[0-9]{10}/)){
	        	var fixedNumber = thefield.value.substring(0,3) + "-" + thefield.value.substring(3,6) + "-" + thefield.value.substring(6,10) ;
            	thefield.value = fixedNumber;
			}
			else{
				alert("PLEASE ENTER 10 DIGIT PHONE NUMBER (XXX-XXX-XXXX)")
	   			thefield.select();
			}
			//alert('nope');
	   }
	   return false;
	}
}

function verifydate(thefield){
	if(thefield.value != ''){
	   if(thefield.value.match(/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}/)){
	        //return true
	   }
	   else{
	   		if(thefield.value.match(/^[0-9]{8}/)){
	        	var fixedNumber = thefield.value.substring(0,2) + "/" + thefield.value.substring(2,4) + "/" + thefield.value.substring(4,8) ;
            	thefield.value = fixedNumber;
			}
			else{
				alert("Date format is: MM/DD/YYYY")
				thefield.focus();
			}
		return false;
	  }
	}
}
function confirmdel(vin,page,table){
	var random_num = (Math.round((Math.random()*1000000001)+1))
	var answer = confirm("Are you sure you want to delete this entry?");
	if(answer){
		window.location="index.php?t="+random_num+"&page="+page+"&delete="+vin+"&where="+table;
	}
}
function checksubmit(field){
	if(field.value != ''){
		document.quicklinks.submit();
	}
}

function bunload() {
  var now = new Date();
  var hour = now.getHours();
  var minute = now.getMinutes();
  var second = now.getSeconds();
  if (hour > 12) { hour = hour - 12; }
  if (hour == 0) { hour = 12; }
  if (minute < 10) { minute = "0" + minute; }
  if (second < 10) { second = "0" + second; }
  return ltime + ' = ' + hour + ':' + minute + ':' + second;
}

var now = new Date();
var hour = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
if (hour > 12) { hour = hour - 12; }
if (hour == 0) { hour = 12; }
if (minute < 10) { minute = "0" + minute; }
if (second < 10) { second = "0" + second; }
var ltime = hour + ':' + minute + ':' + second;

