// JavaScript Document
function dspMsg(msg,idVal)
{
	document.getElementById('form-message').display = 'block';
	document.getElementById('form-message').innerHTML = msg;
	if (idVal) { highF(idVal,1); }
}

function highF(idVal,onOff)
{
	if (onOff == 1)
	{
		idVal.style.border = '1px solid #ff0000';
	} else {
		idVal.style.border = '0px solid #ff0000';
	}
}

function formSubmit(formName)
{
	document.getElementById(formName).submit();
}

function jumpToURL(url)
{
	document.location = url;
}

function getImageWidth(myImage) {
	var x, obj;
	if (document.layers) {
		var img = getImage(myImage);
		return img.width;
	} else {
		return getElementWidth(myImage);
	}
	return -1;
}

function imgWidth(img,widthToBe)
{
	currWidth	= document.getElementById(img).width;
	if (currWidth > widthToBe)
	{
		document.getElementById(img).width = widthToBe;
	}	
}

function hideShow(id,fromID)
{
	if (document.getElementById(id).style.display == 'none')
	{
		document.getElementById(id).style.display		= 'block';
		document.getElementById(fromID).innerHTML		= '-';
	} else {
		document.getElementById(id).style.display		= 'none';
		document.getElementById(fromID).innerHTML		= '+';
	}
}

function siteSearch(sq)
{
	loc = '/nmd/general/search/?from=home&sq=' + sq;
	document.location = loc;
}

function subForm(e,v)
{
	var k;
	if(window.event) // IE
	{
		k = e.keyCode;
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		k = e.which;
	}

	if (k == 13)
		siteSearch(v);

}


