//--------------------------------------------------------------------------------
// Apply style to toolbar td element when mouse enters.
//--------------------------------------------------------------------------------
function ToolbarItemOnMouseOver(tdIn)
{
	tdIn.style.border = "#669933 1px solid";
	tdIn.style.cursor = "hand";
	tdIn.style.backgroundColor = "#cccc99";
}

//--------------------------------------------------------------------------------
// Apply style to toolbar td element when mouse pointer moves away.
//--------------------------------------------------------------------------------
function ToolbarItemOnMouseOut(tdIn)
{
	tdIn.style.border = "#ece9d8 1px solid";
	tdIn.style.backgroundColor = "";
}

//--------------------------------------------------------------------------------
// Assign new url <strHyperlinkIn> to current window.
//--------------------------------------------------------------------------------
function LoadLink(strHyperlinkIn) 
{
	window.location.assign(strHyperlinkIn);
}

function LoadFrameLink(strFrameNameIn, strUrlIn)
{
	window.frames(strFrameNameIn).location.assign(strUrlIn);
}

function LoadFrameLink2(strFrameIdIn, strUrlIn)
{
	if (	 window.frames(strFrameIdIn).location == "about:blank" 
			|| window.frames(strFrameIdIn).location == null 
			|| window.frames(strFrameIdIn).location == "" )
	{
		window.frames(strFrameIdIn).location.assign(strUrlIn); 		
	}
}

//--------------------------------------------------------------------------------
// Shows or hides HTML element with identity <strElementIdIn>, using 
// style.display.	
//--------------------------------------------------------------------------------
function Display(strElementIdIn)
{
	if (document.all[strElementIdIn].style.display == "none") 
	{
		document.all[strElementIdIn].style.display = "block"		
	}
	else 
	{
		document.all[strElementIdIn].style.display = "none"
	}
}

//--------------------------------------------------------------------------------
// Roll over source of image element with identity <strElementIdIn>.
//--------------------------------------------------------------------------------
function FlipImage(strElementIdIn, strImageSrcIn, strFlipImageSrcIn)
{	
	// Find image name.
	var strCurrentImageName;
	var strImageName;
	var strFlipImageName;
	var objImage = document.all[strElementIdIn];
	
	strCurrentImageName = objImage.src.toLowerCase().substring(objImage.src.lastIndexOf("/")+1, objImage.src.length);
	strImageName = strImageSrcIn.toLowerCase().substring(strImageSrcIn.lastIndexOf("/")+1, strImageSrcIn.length);
	strFlipImageName = strFlipImageSrcIn.toLowerCase().substring(strFlipImageSrcIn.lastIndexOf("/")+1, strFlipImageSrcIn.length);
	
	if (strCurrentImageName == strImageName)
	{
		objImage.src = strFlipImageSrcIn;
	}
	else
	{
		objImage.src = strImageSrcIn;
	}	
}

function AddFormActionParam(objFormIn, strParamNameIn, strParamValueIn)
{
	if (objFormIn.action.lastIndexOf("?")>=0) 
		objFormIn.action += "&" + strParamNameIn + "=" + strParamValueIn;
	else
		objFormIn.action += "?" + strParamNameIn + "=" + strParamValueIn;
}

function DelFormActionParam(objFormIn, strParamNameIn)
{
	var intIndexOf = objFormIn.action.lastIndexOf(strParamNameIn)
	if (intIndexOf>=0) 
	{
		objFormIn.action += "&" + strParamNameIn + "=" + strParamValueIn;
		
	}
	else
		objFormIn.action += "?" + strParamNameIn + "=" + strParamValueIn;
}

//--------------------------------------------------------------------------------
// Opens new window.
//--------------------------------------------------------------------------------
function OpenWindow(strUrl,intWidth,intHeight)
{
	window.open(strUrl,"_blank","height=" + intHeight + ",width=" + intWidth + ",scrollbars=yes,menubar=no,statusbar=no,toolbar=no,resizable=yes",false);
	
}

//--------------------------------------------------------------------------------
// Resizes window to specified width and height.
//--------------------------------------------------------------------------------
function ResizeWindow(width, height)
{
	window.resizeTo(width, height);
	return true;
}

//--------------------------------------------------------------------------------
// Gets maximum width and height of screen, and sets window size accordingly.
//--------------------------------------------------------------------------------
function MaximizeWindow()
{
	var width = screen.width;
	var height = screen.height;
				
	window.moveTo(0,0);			
	window.resizeTo(width, height);
	return true;
}
