function KeyDownHandler(btn)
{
	if (event.keyCode==13)
	{
		event.returnValue = false;
		event.cancel = true;
		document.getElementById(btn).click();
	}
}

function SuppressEnterKey(textfield)
{
	if (event.keyCode==13)
	{
		event.returnValue = false;
		event.cancel = true;
	}
}

function TabOn(tab)
{
	tab.style.background = "#CCCCFF";
	tab.style.cursor = "hand";
	return true;
}
function TabOff(tab,alt)
{
	if (alt==1)
	{
		tab.style.background = "#D0C883";
	}
	else
	{
		tab.style.background = "beige";
	}
	tab.style.cursor = "pointer";
	return true;
}				
function Lo(row,showhand)
{
	row.style.background = "#CCCCFF";
	if(showhand)
	{
		row.style.cursor = "hand";
	}
	return true;
}
function Lo1(row)
{
	row.style.background = "#CCCCFF";
	return true;
}
function Lf(row,alt)
{
	if (alt==1)
	{
		row.style.background = "beige";
	}
	else
	{
		row.style.background = "white";
	}
	row.style.cursor = "pointer";
	return true;
}	
function Po(item)
{
	item.style.cursor = "hand";
	return true;
}
function Pf(item)
{
	item.style.cursor = "pointer";
	return true;
}	
function PointerOn(sItem)
{
	document.getElementById(sItem).style.cursor = "hand";
	return true;
}
function PointerOff(sItem)
{
	document.getElementById(sItem).style.cursor = "pointer";
	return true;
}	
function loadreportmonitor()
{
	var nTop;
	var nLeft;
	var nHeight;
	var nWidth;
	var nMaxWidth;
	var nMaxHeight;
	var oWindow;
	nTop = 10;
	nMaxHeight = screen.height;
	if (nMaxHeight>768)
	{
		nMaxHeight = 768;
	}
	nHeight = nMaxHeight - 125;
	nMaxWidth = screen.width;
	if (nMaxWidth>1024)
	{
		nMaxWidth = 1024;
	}
	nWidth = nMaxWidth - 15;
	nLeft = (screen.width/2)-nWidth;;
	oWindow = window.open("reportmonitor.aspx","ReportMonitor","width=" + nWidth + ",height=" + nHeight + ",top=" + nTop + ",left=" + nLeft + ",toolbars=no,scrollbars=yes,status=yes,resizable=yes");
	if (oWindow != null)
	{
		oWindow.focus();
	}
}
function loadreportarchiving()
{
	var nTop;
	var nLeft;
	var nHeight;
	var nWidth;
	var nMaxWidth;
	var nMaxHeight;
	var oWindow;
	nTop = 10;
	nMaxHeight = screen.height;
	if (nMaxHeight>768)
	{
		nMaxHeight = 768;
	}
	nHeight = nMaxHeight - 125;
	nMaxWidth = screen.width;
	if (nMaxWidth>1024)
	{
		nMaxWidth = 1024;
	}
	nWidth = nMaxWidth - 15;
	nLeft = (screen.width/2)-nWidth;;
	oWindow = window.open("reportarchiving.aspx","ReportArchive","width=" + nWidth + ",height=" + nHeight + ",top=" + nTop + ",left=" + nLeft + ",toolbars=no,scrollbars=yes,status=yes,resizable=yes");
	if (oWindow != null)
	{
		oWindow.focus();
	}
}
function choosecolor(sForm)
{
	var CalUrl = "choosecolor.aspx?formname=excelirate." + sForm;
	var oWindow = window.open(CalUrl,"ColorWin","width=430,height=285,resizeable=no");
	if (oWindow != null)
	{
		oWindow.focus();
	}
}
function pickcompetencies(sForm)
{
	var nTop = (screen.height-600)/2;
	var nLeft = (screen.width-975)/2;
	var PickUrl = "pickcompetencies.aspx?formname=" + sForm;
	var oWindow = window.open(PickUrl,"CompetencyPickWin","width=975,height=600,top=" + nTop + ",left=" + nLeft + ",toolbars=no,scrollbars=yes,status=yes,resizable=yes");
	if (oWindow != null)
	{
		oWindow.focus();
	}
}
function TabHOn( sId )
{
	var oObject;
	oObject = document.getElementById( sId + 'left' );
	if (oObject!=null)
	{
		oObject.src = 'images/tabstrip/tab_hover_left.gif';
	}
	setCellBGimage( sId + 'bg','images/tabstrip/tab_hover_bg.gif' );
	oObject = document.getElementById( sId + 'right' );
	if (oObject!=null)
	{
		oObject.src = 'images/tabstrip/tab_hover_right.gif';
	}
}
function TabHOff( sId )
{
	var oObject;
	oObject = document.getElementById( sId + 'left' );
	if (oObject!=null)
	{
		oObject.src = 'images/tabstrip/tab_unsel_left.gif';
	}
	setCellBGimage(sId + 'bg','images/tabstrip/tab_unsel_bg.gif' );
	oObject = document.getElementById( sId + 'right' );
	if (oObject!=null)
	{
		oObject.src = 'images/tabstrip/tab_unsel_right.gif';
	}
}
function setCellBGimage(id,sImgSrc) 
{
	var c = document.getElementById ? document.getElementById(id) :
		document.all ? document.all[id] : 
		document.layers ? document[id+'Outer'].document[id+'Inner'] : null;
	if (document.layers) 
	{ 
		c.background.src = sImgSrc; 
	} 
	else
	{ 
		c.style.backgroundImage = 'url('+sImgSrc+')'; 
	} 
}
