function submitSearch(oForm, sDefaultValue)
{
	var oEltKeyword = oForm.elements['keywords'];
	
	if (oEltKeyword.value == '' || oEltKeyword.value == sDefaultValue)
	{
		alert('Preciser votre recherche');
		return false;
	}
	else
	{
		var oEltRubrique = oForm.elements['option'];
		document.location.href='/html/Rechercher/Page-1/Type-'+oEltRubrique.value+'/'+oEltKeyword.value;
		return false;
	}
}

function submitRAQSearch(sUrl)
{
	var oEltKeyword = document.forms['searchRAQForm'].elements['keywords'];
	
	if (oEltKeyword.value == '')
	{
		alert('Preciser votre recherche');
		return false;
	}
	else
	{
		var oEltRubrique = document.forms['searchRAQForm'].elements['type'];
		document.location.href=sUrl+'/Rechercher/'+oEltKeyword.value;
		return false;
	}
}

function getElement(elementId)
{
	return document.getElementById(elementId);
}

function focusIframeOnTab(caller, tabTargetId, callEvent)
{
	// If keypress TAB and not SHIFT+TAB 
	if(callEvent.keyCode == 9 && !callEvent.shiftKey)
	{
		document.getElementById(tabTargetId).contentWindow.focus();
	}
}

function cursorX(e) 
{
	if (navigator.appName!="Microsoft Internet Explorer")
	{
		return e.pageX;
	}
	
	if (document.documentElement.clientWidth > 0)
	{
		return e.x + document.documentElement.scrollLeft;
	}
	
	return e.x + document.body.scrollLeft;
}

function cursorY(e) 
{
	if (navigator.appName!="Microsoft Internet Explorer")
	{
		return e.pageY;
	}
	
	if (document.documentElement.clientWidth > 0)
	{
		return e.y + document.documentElement.scrollTop;
	}
	
	return e.y + document.body.scrollTop;
}

function showElement(eltId)
{
	oElt = getElement(eltId);
	
	if (oElt.style.display == 'none')
	{
		oElt.style.display = 'block';
		oElt.style.visible = 'visible';
	}
	else
	{
		oElt.style.display = 'none';
		oElt.style.visible = 'hidden';
	}
}

function openPopup(pageUrl, popupName, popupWidth, popupHeight, showScrollbar) 
{
	var iWidth = popupWidth+30;
	var iHeight = popupHeight+70;
	var leftVal = (screen.width-iWidth)/2;
	var topVal = (screen.height-iHeight)/2;
	
	if (showScrollbar == true) 
	{
		newWindow = window.open(pageUrl, popupName, 'width='+iWidth+',height='+iHeight+',left='+leftVal+',top='+topVal+',scrollbars=yes');
	}
	else
	{
		newWindow = window.open(pageUrl, popupName, 'width='+iWidth+',height='+iHeight+',left='+leftVal+',top='+topVal+',scrollbars=no');
	}
	

	//return false;
}

function taxeCalcul(test) { 
	  return openPopup('/www/pama/taxe_calcul_outil.php?step=0', 'OutilCalculTaxe', 600, 400, true);   
}