
/*/// <summary>

/// *************************************************************************************************************

/// MAIN MODULE:              Hit Track

/// SUB MODULE :              script

/// AUTHOR:                   Chandika Jayawardena.

/// CREATED:                  27-May-2008

/// DESCRIPTION:              This module contained all the common client functionality

/// MODIFICATION HISTORY:     1.0     06-June-2008       Initial Version

/// COPYRIGHT:                Copyright teamwork.lk. All Rights Reserved

/// *************************************************************************************************************

/// </summary>

*/


//position the PopupMenu control
function positionPopupMenu()
{
	var windowWidth=screen.width;
	var windowWidth = parseInt(windowWidth)-200;
	document.getElementById("popupMenu").style.left = windowWidth+"px";
}

//Show/Hide the PopupMenu control
function togglePopupMenu(flag)
{	
	if(flag=="S")
		document.getElementById("popupMenu").style.visibility = "visible";
	else
		document.getElementById("popupMenu").style.visibility = "hidden";
	positionPopupMenu();
}

//Return the system date
function getCurrentDate()
{
	var months = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	var day = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var datesup = new Array("st","nd","rd","th");
	
	var cdate = new Date();
	var dd = cdate.getDate();
	var dy = cdate.getDay();
	var mm = cdate.getMonth();
	var yy = cdate.getFullYear();
	var datesupno;
	
	switch(dd)
	{
		case(1):
		case(21):
		case(31):
			datesupno = 0;
			break;
		case(2):
		case(22):
			datesupno = 1;
			break;
		case(3):
		case(23):
			datesupno = 2;
			break;
		default:
			datesupno = 3;
		
	}
	
	var currentdate = day [dy] + ",&nbsp;" + months[mm] + dd + "&nbsp;" + "<sup>" + datesup[datesupno] + "</sup>" + ",&nbsp;" + yy;
	document.write(currentdate);
}

