function doBlink() {
	var blink = document.all.tags("BLINK");
	if(blink !=null || blink !=0)
	{
		for (var i=0; i<blink.length; i++)
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
	}
}
function userPhoto(){
	var photo = document.getElementById('user_small');
	if(photo !=null)
	{
		var user_image_div = document.getElementById('user_image_div');
		if(photo.height > 59)
		{
			user_image_div.style.height =photo.height+"px";
		}
	}
}
function makeArray() {
for (i = 0; i<makeArray.arguments.length; i++)
	this[i + 1] = makeArray.arguments[i];
}
var k =0;
var time_id =0;
function startTime(){
var months = new makeArray('January','February','March','April','May','June','July','August','September','October','November','December');
var today=new Date();
userPhoto();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
var wish="";
var day = today.getDate();
var weakday =today.getDay();
var day_name="";
if(weakday==0){day_name ='Sunday'}
else if(weakday==1){day_name ='Monday'}
else if(weakday==2){day_name ='Tuesday'}
else if(weakday==3){day_name ='Wednesday'}
else if(weakday==4){day_name ='Thursday'}
else if(weakday==5){day_name ='Friday'}
else if(weakday==6){day_name ='Saturday'}
var month =today.getMonth() + 1;
var yy = today.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var time_format =""
var hours ="";
//var time_div =document.getElementById('time');
var online_user = document.getElementById('online_user');
var wish_div = document.getElementById('wish');
m=checkTime(m);
s=checkTime(s);
if(h > 11){
	if(h >=12){
		hours =h-12;
	}else{
			hours =h;
	}

	if(hours >=0 && hours <=3)
	{
		wish ='Good Afternoon';
	}
	else
	{
		wish ='Good Evening';
	}
	time_format ='PM'
} else {
	hours =h;
	wish ='Good Morning';
	time_format ='AM';
}if(hours < 10){
			hours ='0'+hours;
}
//-->
//if(time_div !=null){
  // time_div.innerHTML="Today is "+day_name+', '+ months[month] + "   " +  day + ", " + year+'. It is	'+hours+":"+m +' '+ time_format+"";
	   wish_div.innerHTML =wish+',';

//}

if(online_user !=null){
	if(document.getElementById('user_message') !=null){
			getMessage("user_message.php");
			if(navigator.userAgent.indexOf('MSIE')!= -1){
					doBlink();
			}
		}
		getRecord("user_online.php");
		
	}
}
function checkTime(i)
{
	if (i<10)
	{
		i="0" + i;
	}
	return i;
}