window.onload = function () 
{
	var x = document.getElementsByTagName('label');
	for (var i=0;i<x.length;i++)
	{
		x[i].onmouseover	= function(){this.className = 'labelIn';}
		x[i].onmouseout		= function(){this.className = '';}
	}

	var t = document.getElementsByTagName('input');
	for (var i=0;i<t.length;i++)
	{
		if(t[i].getAttribute("type") == 'text' || t[i].getAttribute("type") == 'password')
		{
			t[i].onfocus	= function(){this.style.backgroundColor = '#FFFFE3';}
			t[i].onblur		= function(){this.style.backgroundColor = '';}
		}
	}

	var t = document.getElementsByTagName('select');
	for (var i=0;i<t.length;i++)
	{
		t[i].onfocus	= function(){this.style.backgroundColor = '#FFFFE3';}
		t[i].onblur		= function(){this.style.backgroundColor = '';}
	}

	var t = document.getElementsByTagName('textarea');
	for (var i=0;i<t.length;i++)
	{
		t[i].onfocus	= function(){this.style.backgroundColor = '#FFFFE3';}
		t[i].onblur		= function(){this.style.backgroundColor = '';}
	}
}


function f_popup(Url, PopupName, dl_width, dl_height, scrollbars, resizable){
	
	if(!scrollbars){scrollbars='no';}
	else{scrollbars='yes';}
	
	if(!resizable){resizable='no';}
	else{resizable='yes';}
	
	var x	= Math.round((screen.availWidth  - dl_width) / 2);
	var y	= Math.round((screen.availHeight - dl_height) / 2);

	window.open(Url,PopupName,"left=" + x + ",top=" + y + ", scrollbars="+scrollbars+",resizable="+resizable+",width="+dl_width+",height="+dl_height+",menubar=no");
	return false;
}

/**
 * Highlight the table grid rows
 */
function dp_grid_hl(table){
	var colorOver	= '#FFFFFF';
	var colorOut	= '';
	var colorClick	= '#FFFFCE';
	var tbl  = document.getElementById(table);
	for(var i=0; i<tbl.rows.length; i++){
		row = tbl.rows[i];
		if(row == null || row == 'undefined'){
			continue;
		}
		row.onmouseover = function(){
			this.style.backgroundColor = colorOver;
		}

		row.onmouseout = function(){
			color = this.dpcolor ?  colorClick : colorOut;
			this.style.backgroundColor = color;
		}

		
		row.onclick = function(){
			color = this.dpcolor ? colorOut : colorClick;
			this.dpcolor = !this.dpcolor;
			this.style.backgroundColor = color;
		}
		

	}
}
