function ReloadParent()
{
	window.opener.document.location.reload();
	window.close();
}
function OpenPopUp(Address, Width , Height,scroll)
{
	if (scroll == null) scroll='1';
	//if(Scroll == null) Scroll="off";
	var top = (screen.height - Height) / 2;
	var left = (screen.width - Width) / 2;
	var Features = 'width='+Width+',height='+Height+',top=' + top + ',left=' + left + ',scroll='+ scroll +', resizable=0,status:off;';
	window.open(Address , window.parent.name + "1" ,Features);
}
function OpenModalDialog(Address, Width , Height, scroll)
{
	if (scroll == null) scroll='off';
	var top = (screen.height - Height) / 2;
	var left = (screen.width - Width) / 2;
	
	var Features = 'dialogHeight=' + Height +'px;dialogWidth=' + Width+' px;dialogTop=' + top + ';dialogleft=' + left  +'px;'+ 'resizable:no; scroll:'+ scroll + '; help:off; status:off ;';
	
	window.showModalDialog(Address,window.parent.name + "1", Features); 
}
function CloseWindow()
{
	window.close();
}
function PrintPage(control)
{
	control.style.visibility = "hidden";
	window.print();
	control.style.visibility = "visible";		  
}
var oPopup = window.createPopup();

function richToolTip(control,title , description,width,height)
{	
	var lefter = event.offsetX + 15;
	var topper = event.offsetY + 15;
	var result = oToolTip.innerHTML.replace('{0}', title ); 
	result = result.replace('{1}', description);
	oPopup.document.body.innerHTML = result;
	oPopup.show(lefter, topper, width, height, control);
}
/*function GridToolTip(control, lentgh,title, text)
{
	var lefter = event.offsetY + 0;
	var topper = event.offsetX + 15;
	var result = oToolTip.innerHTML.replace('{0}',title); 
	result = result.replace('{1}', text);
	oPopup.document.body.innerHTML = result;
	oPopup.show(topper, lefter, 220, 150, control);
}
*/
function CheckLength(control)
{
	LenString = control.value.length;
	if (LenString > 500)
	{
		control.value = control.value.substring(0,500);
	}
}