// JavaScript Document

function ShowLoadingGif(strPositionRelative)	//	If not set -> pos=absolute; If 0 pos=relative
{
	objLoadingDiv	= document.getElementById("loading");
	
	if (objLoadingDiv!=null)
	{
		if (strPositionRelative==null)
		{
			strPositionRelative = 1;
		}
		else
			strPositionRelative	= 0;
		/*		Define position		*/
		if (strPositionRelative)
		{
			//intWinHeight	= window.screen.height;
			intWinHeight	= document.body.clientHeight;
			intWinWidth		= document.body.clientWidth;
			//intWinHeight	= window.screen.availHeight;
			//intWinWidth		= window.screen.width;
			
			document.getElementById("loading").style.position	= 'absolute';
			document.getElementById("loading").style.left		= intWinWidth/2 - 130/2;
			document.getElementById("loading").style.top		= document.body.scrollTop + intWinHeight/2 - 60/2 + 10;
		}
		else
		{
			document.getElementById("loading").style.position	= 'relative';
		}

		/*		Show DIV			*/
		document.getElementById("loading").style.display="";
	}
}
		
function openPicture(url)  // Opens picture in new window
{
	window.open(url, "picture", "directories=0, location=0, menubar=0, toolbar=0, status=0, resizable=1, scrollbars=1, width=500, height=600");
}

function OpenInNewWindow(strLink)
{
	window.open(strLink,'Camion','scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=yes,width=800,height=600,left=0,top=0');
	return false;
}

function ShowHidePageElement(elementId)
{
	var showState = document.getElementById(elementId).style.display;
//	alert(showState)
	if (document.getElementById(elementId)!=null)
	{
		if (showState == "")	document.getElementById(elementId).style.display	= "none";
		else					document.getElementById(elementId).style.display	= "";
	}
	return false;
}

function ShowHidePageElements(elementName)
{
	var showState = document.getElementById(elementId).style.display;
//	alert(showState)
	if (document.getElementById(elementId)!=null)
	{
		if (showState == "")	document.getElementById(elementId).style.display	= "none";
		else					document.getElementById(elementId).style.display	= "";
	}
	return false;
}

function ShowPageElement(elementId)
{
	document.getElementById(elementId).style.display="";
	return false;
}

function HidePageElement(elementId)
{
	document.getElementById(elementId).style.display="none";
	return false;
}

function SubmitSearchForm(strSearchFormId, strSearchFieldId)
{
	objSearchField	= document.getElementById(strSearchFieldId);
	objSearchForm	= document.getElementById(strSearchFormId);
	strSearchQuery	= objSearchField.value;
	if (strSearchQuery!="")	objSearchForm.submit();
}

function ChangeURL(strURL)
{
	document.location = strURL;
}

function fm_mouse_over(obj)
{
	obj.style.backgroundColor	= '#efefef';
}

function fm_mouse_out(obj)
{
	obj.style.backgroundColor	= '#ffffff';
}