function GetMonth(nMonth)
{
	var Months = new Array("January","February","March","April","May","June",
	                       "July","August","September","October","November","December");
	return Months[nMonth] 	  	 
}

function DateString()
{
	var Today = new Date();
	var suffix = "th";
	switch (Today.getDate())
	{
		case 1:
		case 21:
		case 31: 
			suffix = "st"; break;
		case 2:
		case 22:
			suffix = "nd"; break;
		case 3:
		case 23:
			suffix = "rd"; break;
	};

	var strDate = Today.getDate();
	strDate += suffix + " " + GetMonth(Today.getMonth()) + ", " + Today.getFullYear();
	return strDate
}
//-->
var timerID = null;
var timerRunning = false;
function stopclock ()
{
	if(timerRunning)
		clearTimeout(timerID);
	timerRunning = false;
}
function showtime ()
{
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds()
	var timeValue = "" + ((hours >12) ? hours -12 :hours)
	if (timeValue == "0") timeValue = 12;
		timeValue += ((minutes < 10) ? ":0" : ":") + minutes
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds
	timeValue += (hours >= 12) ? " pm." : " am."
	document.getElementById('time').innerHTML = timeValue;
	timerID = setTimeout("showtime()",1000);
	timerRunning = true;
}
function startclock()
{
	stopclock();
	showtime();
}
window.onload=startclock;

//function to validate url
function validateURL(urlvalue)
{
 	var theurl=urlvalue;
 	var tomatch= /[w]{3,}\.[A-Za-z0-9\.-]{3,}\.[A-Za-z]{2}/
 	if (tomatch.test(theurl))
 	{
 		return true;
 	}
 	else
 	{
 		return false; 
	}
}

//function to check for number	
function isNumber(inputStr) {
		for( var i=0; i < inputStr.length; i++)
		{
			var oneChar = inputStr.substring(i, i + 1)
			if ((oneChar < "0" || oneChar > "9") && (oneChar!="."))
			{
				return false
				exit
			}
		}
		return true
}

//function to check email validation
function validateEmail(email)
{
	//passing controlas a argument
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if (!re_mail.test(email.value))
	{
		return false;
	}
	return true;
}