var rTimer;
var sds ;
var dts = ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th", "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th", "30th", "31st"];
var mths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];

function TimeTick()
{
	var str = "";
	sds =  new Date();
	//document.date.tdate.value = dts[sds.getDate()-1]+" "+mths[sds.getMonth()]+", "+sds.getFullYear();
	str_date = "<p>"+dts[sds.getDate()-1]+" "+mths[sds.getMonth()]+", "+sds.getFullYear()+"</p>";
	var h = sds.getHours();
	if(h < 10){
		h = "0"+h;
	}
	var m = sds.getMinutes();
	if(m <10){
		m = "0"+m;
	}
	var s = sds.getSeconds();
	if(s < 10){
		s = "0"+s;
	}
	//document.time.ttime.value=" "+h+" : "+m+" : "+s;
	str_time = "<p>"+h+" : "+m+" : "+s+"</p>";
	 switch(sds.getHours()){
		case 0 :
		var welcome = "Midnight Hour!! <br/>Let's be the first to wish you a beautiful day ahead.";
		break;
		case 1:
		case 2:
		case 3:
		case 4:
		var welcome ="Wee Hours and still working!! <br/>Let's give you company :)";
		break;
		case 5:
		case 6:
		case 7:
		case 8:
		case 9:
		var welcome = "Good Morning|| <br/>May your day be bright and smiling as the sunflower!!";
		break;
		case 10:
		case 11:
		case 12:
		var welcome ="Starting the day with us?<br/>Thank you and welcome to our website!!";
		break;
		case 13:
		case 14:
		case 15:
		var welcome =" Lunch Time and still going!!<br/>Let's share the byte... :)";
		break;
		case 16:
		case 17:
		var welcome = "Tea Time Folks!!<br/>Enjoy your tea with us!! ";
		break;
		case 18:
		case 19:
		case 20:
		case 21:
		var welcome =" Beyond Office Hours :)<br/>We are happy to hold your attention !"
		break;
		case 22:
		case 23:
		case 24:
		var welcome= " Winding up or winding out? :) <br/>We are with You always!"
		break;
		default :
		var welcome = "Welcome to Aurora Media";
	} 
		
	//document.welcome.wcome.value = welcome;
	str += "<p>"+welcome+"</p>";
	document.getElementById("datetimecontentholder").innerHTML = str;
	document.getElementById("datetime").innerHTML = "<p>"+str_date+"</p><p>"+str_time+"</p>";
	//document.datetimecontentholder.value = str;
	if(rTimer)
		{
			clearTimeout(rTimer);
		}

	rTimer = setTimeout('TimeTick()', 1000);
}

TimeTick();
