function CalculateClientWidth(){
    var w = document.body.clientWidth;
//    alert(w);
    if (w > 800) {
        if (w<1000) {
            document.getElementById("main").style.width = '100%';
        }else{
            document.getElementById("main").style.width = '1000px';
        }
    }else{
        document.getElementById("main").style.width = '780px';
    }
}

/*
 * Javascript pour le menu deroulant sur MSIE
 *
 * adapte de http://www.htmldog.com/articles/suckerfish/dropdowns/example/
 * et passe en jquery pour sa partie javascript (necessaire sous MSIE)
 *
 */
if (jQuery.browser.msie) {
	$(document).ready(
		function(){
			$('#nav li').hover(
				function(){$(this).addClass('sfhover')},
				function(){$(this).removeClass('sfhover')}
			);
			
		}
	);
}

function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}