function fncMakeTop()
{
	if (self != top) 
	{
		if (document.images)
			top.location.replace(window.location.href);
		else
			top.location.href = window.location.href;
	}
}

function doRedirect(strFormName,strField)
{
    window.location.replace( strFormName+ '?field=' + strField);
}


function formPopDate(strFormName, strField)
{	
	var winWidth = 290;
	var winHeight = 240;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
	if (! window.focus)return true;
	window.open(strFormName + '?field=' + strField,"DateSelect", "width="+winWidth +",height="+winHeight+",top="+winTop+",left="+winLeft+",resizable=yes");

}

function formPopNoResize(strFormName,strName, strField)
{	
	var winWidth = 750;
	var winHeight = 450;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
	if (! window.focus)return true;
	window.open(strFormName + '?field=' + strField, strName, "width="+winWidth +",height="+winHeight+",top="+winTop+",left="+winLeft+",resizable=no,status=no");
	
}

function formPopFull(strFormName,strName,strField)
{	
	var winWidth = screen.width;
	var winHeight = screen.width;
	var winLeft = 0;
	var winTop = 0;
	if (! window.focus)return true;
	window.open(strFormName + '?field=' + strField, strName, "width="+winWidth +",height="+winHeight+",top="+winTop+",left="+winLeft+",resizable=yes,status=yes");

}

function formPopResize(strFormName,strName,strField)
{	
	var winWidth = 750;
	var winHeight = 450;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
	if (! window.focus)return true;
	window.open(strFormName + '?field=' + strField, strName, "width="+winWidth +",height="+winHeight+",top="+winTop+",left="+winLeft+",resizable=yes,status=yes");

}

function formPopResizeCert(strFormName,strName,strField)
{	
	var winWidth = 850;
	var winHeight = 600;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
	if (! window.focus)return true;
	window.open(strFormName + '?field=' + strField, strName, "width="+winWidth +",height="+winHeight+",top="+winTop+",left="+winLeft+",resizable=yes,status=yes");

}

function formPopSizeNoResize(strFormName,strName,valWidth,valHeight)
{
	var winWidth = valWidth; 
	var winHeight = valHeight;
	var winLeft = (screen.width-winWidth)/2; 
	var winTop = (screen.height-winHeight)/2; 
	if (! window.focus)return true;
	window.open(strFormName,strName, 'width='+winWidth+',height='+winHeight+',top='+winTop+',left='+winLeft+',resizable=no,alwaysRaised=yes,status=no');			

}

function formPopSizeResize(strFormName,strName,valWidth,valHeight)
{
	var winWidth = valWidth; 
	var winHeight = valHeight;
	var winLeft = (screen.width-winWidth)/2; 
	var winTop = (screen.height-winHeight)/2; 
	if (! window.focus)return true;
	window.open(strFormName,strName, 'width='+winWidth+',height='+winHeight+',top='+winTop+',left='+winLeft+',resizable=yes,alwaysRaised=yes,status=yes');

}

function formPopResizeParam(strFormName,strName,strField,valWidth,valHeight)
{	
	var winWidth = valWidth; 
	var winHeight = valHeight;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
	if (! window.focus)return true;
	window.open(strFormName + '?field=' + strField, strName, "width="+winWidth +",height="+winHeight+",top="+winTop+",left="+winLeft+",resizable=yes,status=yes");

}

function PrintContent() 
{
	focus();  
	// Required to support IE
	print();
}

function fncReportPop(strFormName,strName,valWidth,valHeight)
{
	var winWidth = valWidth; 
	var winHeight = valHeight;
	var winLeft = (screen.width-winWidth)/2; 
	var winTop = (screen.height-winHeight)/2; 
	if (! window.focus)return true;
	window.open(strFormName,strName, 'width='+winWidth+',height='+winHeight+',top='+winTop+',left='+winLeft+',resizable=yes,alwaysRaised=yes');			

}
            
function fnTrapKD(btn, event)
{
	if (document.all)
	{
		if (event.keyCode == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
	}
	else if (document.getElementById)
	{
		if (event.which == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
	}
	else if(document.layers)
	{
		if(event.which == 13)
		{
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
	}
}

function validate(string) 
{
	if (!string) return false;
	var Chars = "0123456789-";
	if (string.length == 0)
	{}
	else
	{
		for (var i = 0; i < string.length; i++) 
		{
			if (Chars.indexOf(string.charAt(i)) == -1)
				return false;
		}
	}
	return true;
}