/**********************************************************************************
Nom de la fonction:	newContactWindow()
**********************************************************************************/
function newContactWindow(pURL, pTITRE, pWidth, pHeight, pScrollBar)
{
	var objDialogWin = new Object();
	var lValeurScrollbar;
	
	lValeurScrollbar = 'no';
	
	if (typeof(pScrollBar) != 'undefined')
	{
	    if (pScrollBar)
	    {
	        lValeurScrollbar = 'yes';
	    }
	}
	
	if (navigator.appName == "Netscape") 
	{
		if ((typeof(pWidth) != "undefined") && (typeof(pHeight) != "undefined"))
	    {
            objDialogWin.win=window.open(pURL,pTITRE,"left=25,top=20,height=" + pHeight + ",width=" + pWidth + ", menubar=no,resizable=no,status=no,toolbar=no,location=no,scrollbars=" + lValeurScrollbar);
	    }
	    else
	    {
	        objDialogWin.win=window.open(pURL,pTITRE,"left=25,top=20,height=415,width=561, menubar=no,resizable=no,status=no,toolbar=no,location=no,scrollbars=" + lValeurScrollbar);
	    }
	}
	// pour Explorer on utilise la méthode showModalDialog de l'objet Window
	else	
	{
		if ((typeof(pWidth) != "undefined") && (typeof(pHeight) != "undefined"))
	    {
	        objDialogWin.win=window.open(pURL,pTITRE,"left=25,top=20,height=" + pHeight + ",width=" + pWidth + ", menubar=no,resizable=no,status=no,toolbar=no,location=no,scrollbars=" + lValeurScrollbar);
	    }
	    else
	    {
		    objDialogWin.win=window.open(pURL,pTITRE,"left=25,top=20,height=402,width=593, menubar=no,resizable=no,status=no,toolbar=no,location=no,scrollbars=" + lValeurScrollbar);
		}
	}
}

/**********************************************************************************
Nom de la fonction:	SetFocus
**********************************************************************************/
function SetFocus(form, field)
{
	document.forms(form).all(field).focus();
}


function triggerEvent(form, btn)
{
	if(event.keyCode==13){
			if (document.activeElement.name){
				if (document.activeElement.name.indexOf('stbSearchInput', 0) > 0){
					if (document.forms[0].all('usrRecherche_imgRecherche_BoutonImage') != null){
						form.all('usrRecherche_imgRecherche_BoutonImage').click();
						window.event.returnValue=false;
						}
					else
						{
						form.all('usrRecherche2_imgRecherche_BoutonImage').click();
						window.event.returnValue=false;
						}
				}
				else if (document.activeElement.tagName == "TEXTAREA"){			
					window.event.returnValue=true;
				}
				else if (btn){
					document.getElementById(btn).click();
					window.event.returnValue=false;
				}
			}
			else if (btn){
				document.getElementById(btn).click();
				window.event.returnValue=false;
			}
		}
}
