﻿// JScript File
function ReplaceChar( strIn, strCharIn, strCharOut )
{
	while (strIn.indexOf(strCharIn) > 0)
		strIn = strIn.replace (strCharIn, strCharOut);
	return strIn;
}

function GetElementById(ename)
{
	var obj;

	if (document.all)
		{
		eval("obj = document.all[\"" + ename + "\"]");
		}
	else if (document.layers)
	{		
		eval("obj = document.layers[\"" + ename + "\"]");
	}
	else if (document.getElementById)
	{	
		eval ("obj = document.getElementById (\"" + ename + "\")");		
	}
	else	
		obj =  undefined;

	return obj;
}

function GetElementByIdExtended(ename)
{
	ename = ReplaceChar(ename, "$", "_");
	return GetElementById(ename);
}

function GetElementByIdPopup(ename)
{
	var obj;

	if (window.opener.document.all)
		{
		eval("obj = window.opener.document.all[\"" + ename + "\"]");
		}
	else if (window.opener.document.layers)
	{		
		eval("obj = window.opener.document.layers[\"" + ename + "\"]");
	}
	else if (window.opener.document.getElementById)
	{	
		eval ("obj = window.opener.document.getElementById (\"" + ename + "\")");		
	}
	else	
		obj =  undefined;

	return obj;
}

function GetInputByName (ename)
{
		
	var f = document.forms [fname];
	
	return f[ename];
	
}

function PopupWindow(File,Name)
{
	window.open(File,'' + Name,'width=500,height=450, scrollbars=yes,screenX=0,left=0,screenY=0,top=0');
}

function PopupWindowEx(File, Name, width, height)
{
	window.open(File,'' + Name,'width=' + width + ',height=' + height + ', scrollbars=yes,screenX=0,left=0,screenY=0,top=0');
}

