function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}


function validation_email(mail) {
   if ((mail.indexOf("@")>=0)&&(mail.indexOf(".")>=0)) {
       return true;
   } else {
       return false;
   }
}

function validation(formulaire) {
	var erreur = 0;
	var msg = "Veuillez renseigner correctement le champ suivant : :\n\n";
	var formulaire = document.forms[formulaire];
	
	if (formulaire.elements["emailheader"].value.length == 0 ) { 
		erreur = 1;
		msg += "   - Email\n";
	} else if (validation_email(formulaire.elements["emailheader"].value) == false ){
		erreur = 1;
		msg += "   - Email invalide\n";
	}
	
	if (erreur == 0) {
		//return true;
		//document.formulaire.submit();
		formulaire.submit();
	} else {alert(msg);	return false;
	}
} 



///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////



//BLINK - IE does not understand the blink css
var text_timer = new Array();
var text_visible = new Array();
var text_tmp;
function start_blink()
{
	if(document.getElementById("emailheader"))
	{
		if (document.getElementById('emailheader').value=='@')
		{
			text_visible["emailheader"] = true;
			text_timer["emailheader"] = setInterval('blink("emailheader")', 500);
		}
	}
	if(document.getElementById("emailfooter"))
	{
		if (document.getElementById('emailfooter').value=='@')
		{
			text_visible["emailfooter"] = true;
			text_timer["emailfooter"] = setInterval('blink("emailfooter")', 500);
		}
	}
}
function blink(champ)
{
   
   if (text_visible[champ])
	 {
	    text_tmp = document.getElementById(champ).value;
			document.getElementById(champ).value = '';
			text_visible[champ] = false;
	 }
   else
	 {
	    document.getElementById(champ).value = text_tmp;
			text_visible[champ] = true;
	 }
}
function stop_blink(champ)
{
   if (text_timer[champ])
    {
	    clearInterval(text_timer[champ]);
	 }
 }
function email_focus(champ)
{
    stop_blink(champ);
    if (document.getElementById(champ).value == '@') document.getElementById(champ).value = '';
}
function email_blur(champ)
{
   e = document.getElementById(champ);
	 if (document.getElementById(champ).value == '@' || document.getElementById(champ).value == '')
	 {
	    document.getElementById(champ).value = '@';
	    start_blink();
	 }
}
if (window.addEventListener) window.addEventListener("load", start_blink, false);
else if (window.attachEvent) window.attachEvent("onload", start_blink);
else if (document.getElementById) window.onload=start_blink;