function accordion_toggle_hover() { 
    $$('h2.accordion_toggle').each(function(toggle) {
        Event.observe(toggle, 'mouseover', function() {
            toggle.addClassName('accordion_toggle_hover') ;
        }) ;
        
        Event.observe(toggle, 'mouseout', function() {
            toggle.removeClassName('accordion_toggle_hover') ;
        }) ;
    }) ;
    
    $$('a.fake_accordion_toggle').each(function(toggle) {
        Event.observe(toggle, 'mouseover', function() {
            toggle.addClassName('accordion_toggle_hover') ;
        }) ;
        
        Event.observe(toggle, 'mouseout', function() {
            toggle.removeClassName('accordion_toggle_hover') ;
        }) ;
    }) ;
}

function getW(){
	return (typeof window.innerWidth == 'undefined')?document.body.clientWidth:window.innerWidth;
}
function getH(){
    // return (typeof window.innerHeight == 'undefined')?document.body.clientHeight:window.innerHeight;
    alert('fourte');
	return document.body.clientHeight;
}

function resizeDocumentTo(setw,seth){
    // return window.resizeTo(setw,seth),window.resizeTo(setw*2-((typeof window.innerWidth ==
    // 'undefined')?document.body.clientWidth:window.innerWidth),seth*2-((typeof window.innerHeight ==
    // 'undefined')?document.body.clientHeight:window.innerHeight));

	return window.resizeTo(setw,seth);
}

function resize_to(width, height) {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    return window.resizeTo(width,height),window.resizeTo(width*2-((typeof window.innerWidth ==
    'undefined')?document.body.clientWidth:window.innerWidth),height*2-((typeof window.innerHeight ==
    'undefined')?document.body.clientHeight:window.innerHeight));
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      window.resizeTo(width,height);
      var ie_width = document.documentElement.clientWidth ;
      var ie_height = document.documentElement.clientHeight ;
      window.resizeTo(width + (width - ie_width), height + (height - ie_height - 16)) ;
  }
}

function submit_form(id, lg)
{
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    
    var email_field = $('email-field') ;
    
    if (!filter.test(email_field.value))
    {
        if (lg=="fr")
            alert("Veuillez entrer une adresse e-mail valide. Merci.");
        else
            alert("Please enter a valid e-mail address. Thanks.") ;
    }
    else
    {
        $(id).submit() ;
    }
}




function loadAccordions() {
	var bottomAccordion = new accordion('vertical_container');
}


Event.observe(window, 'load', function(event) {
    if ($$('body.splash').length > 0)
    {
        resize_to(960, 642)
        count_down();
    }
    else
    {
        if ($('vertical_container')!==null)
            loadAccordions() ;
        accordion_toggle_hover() ;
    }
})
