// JavaScript Document
function validate_phone_finder() {
	var checkCounter
	checkCounter = 0
	for (i = 0; i < document.phone_finder.StyleParam.length; i++) 
	{
		if (document.phone_finder.StyleParam[i].checked == false) {
			checkCounter = checkCounter + 1; 
		}
	}
	if (document.phone_finder.StyleParam.length == checkCounter) {
		alert("Please choose at least one phone style");
		return false;
	}
		

	var lowprice = document.phone_finder.LowPriceParam
	var highprice = document.phone_finder.HighPriceParam
	var charposL = document.phone_finder.LowPriceParam.value.search("[^0-9]"); 
	var charposH = document.phone_finder.HighPriceParam.value.search("[^0-9]"); 
	if(lowprice.value.length > 0 &&  charposL >= 0) 
	{ 
		alert("Please only use whole numbers.\n\nThe following are not accepted:\n - Decimal points\n - Letters\n - Non-numeric Characters"); 
		return false; 
	}
	if(highprice.value.length > 0 &&  charposH >= 0) 
	{ 
		alert("Please only use whole numbers.\n\nThe following are not accepted:\n - Decimal points\n - Letters\n - Non-numeric Characters"); 
		return false; 
	}//if
	document.phone_finder.submit();
}
function formatTime() {
  now = new Date();
  hour = now.getHours();
  min = now.getMinutes();
  sec = now.getSeconds();

  if (min <= 9) {
    min = "0" + min;
  }
  if (sec <= 9) {
    sec = "0" + sec;
  }
  if (hour > 12) {
    hour = hour - 12;
    add = " PM";
  } else {
    hour = hour;
    add = " AM";
  }
  if (hour == 12) {
    add = " PM";
  }
  if (hour == 00) {
    hour = "12";
  }
  document.getElementById("sivam").value = ((hour<=9) ? "0" + hour : hour) + ":" + min + ":" + sec + add;
  setTimeout("formatTime()", 1000);
}
window.onload=formatTime;