// cacher et montrer les valeur par defaut sur input text

function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
		thisfield.style.color = '#000';
	}
}
function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
		thisfield.style.color = '#646565';
	}
}


function sendContactForm()
{
    $("err_msg").hide();
    $("confirm_msg").show();
    $("err_msg").innerHTML = "&nbsp;";
    $("confirm_msg").innerHTML = "&nbsp;";
    
    if ($("email").value == "" || $("email").value.indexOf("@") == -1 || $("email").value.indexOf(".") == -1 ) {
        $("err_msg").show();
        $("confirm_msg").hide();
		if (lang == "en"){
        $("err_msg").innerHTML = "Please enter a valid email.";
		}else{
        $("err_msg").innerHTML = "Svp entrer un courriel valide.";
		}
        $("email").focus();
        return;
    }
    
    new Ajax.Updater("confirm_msg", "/app/actions/sendContactForm.php?lang="+lang, { 
						asynchronous: true, 
						method: "post", 
						evalScripts: true,
						parameters: $("frm_contact").serialize()
						});
}

function init()
{
	var height = $("contentToresize").offsetHeight;	
		if (height > "470" ){
				$("contentToresize").style.paddingBottom = "30px";
				//$("center").style.backgroundPosition = "bottom";
		}else{
			var cHeight = 470 - parseInt(height);
			$("contentToresize").style.paddingBottom = parseInt(cHeight)+"px";
			//$("center").style.backgroundPosition = "bottom";
		}
				
				
	
}