var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;


if(document.getElementById)
{
	isID    = 1;
	isDHTML = 1;
}
else
{
	if(document.all)
	{
		isAll   = 1;
		isDHTML = 1;
	}
	else
	{
		browserVersion = parseInt(navigator.appVersion);
		if((navigator.appName.indexOf('Netscape')!=-1) && (browserVersion == 4))
		{
			isLayers = 1;
			isDHTML  = 1;
		}
	}
}


function findDOM(objectID, withStyle)
{
	if(withStyle==1)
	{
		if(isID)
		{
			return (document.getElementById(objectID).style);
		}
		else
		{
			if(isAll)
			{
				return (document.all[objectID].style);
			}
			else
			{
				if(isLayers)
				{
					return (document.layers[objectID]);
				}
			}
		}
	}
	else
	{
		if(isID)
		{
			return (document.getElementById(objectID));
		}
		else
		{
			if(isAll)
			{
				return (document.all[objectID]);
			}
			else
			{
				if(isLayers)
				{
					return (document.layers[objectID]);
				}
			}
		}
	}
}


function OpenNewWindow(strHREF, strName, sizeX, sizeY)
{
	//
	// Open a new window and tell it what to display
	//
	hlpPopUp = window.open(strHREF,
		strName,
		"toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=" + sizeX + ",height=" + sizeY
		);

}






function PageHeight()
{
	if(window.innerHeight != null)			return window.innerHeight;
	if(document.body.clientHeight != null)	return document.body.clientHeight;
	return null;
}
function PageWidth()
{
	if(window.innerWidth != null)			return window.innerWidth;
	if(document.body.clientWidth != null)	return document.body.clientWidth;
	return null;
}




function ShowTableKey(strItem, strText)
{
	var obj = findDOM("HelpText", 0);
	if(obj!=null)
	{
		obj.innerHTML = "<b>" + strItem + "</b> - " + strText
	}

}

function ShowHelpItem(strItem)
{
	var obj = findDOM("HelpText", 0);
	if(obj!=null)
	{
		obj.innerHTML = strItem
	}
}


function AutoFillNumChanged(num_chosen, num_left)
{
	var i, obj;

	// enable the top 'n'
	for(i=1; i<=num_chosen; ++i)
	{
		obj = findDOM('autofill_name_' + i, 1);
		findDOM('autofill_name_' + i, 1).display = 'Block';
//alert(obj.display);
	}

	// disable the rest
	for(; i<=num_left; ++i)
	{
		findDOM('autofill_name_' + i, 1).display = 'None';
	}


}




function Resized()
{
/*
	var obj = findDOM("ContentPane", 0);
	var newheight = PageHeight() - 150;
	var newwidth = PageWidth() - 150;
	if(newheight<320)
	{
		obj.style.height = 0;
		obj.style.width = newwidth;
	}
	else
	{
		obj.style.height = newheight;
		obj.style.width = newwidth;
	}
*/
}