/*
  $Id: general.js,v 1.2 2005/05/21 17:02:22 manmachine Exp $
+-----------------------------------------------------------------------+
|                  osCSS Open Source E-commerce                         |
+-----------------------------------------------------------------------+
| Copyright (c) 2005 The osCSS developers                               |
|                                                                       |
| http://www.counteractdesign.com                                       |
|                                                                       |
| Portions Copyright (c) 2003 osCommerce                                |
+-----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the GPL license,        |
| available at the following url:                                       |
| http://www.counteractdesign.com/license/2_0.txt.                      |
+-----------------------------------------------------------------------+
*/
$(document).ready(function() {      
      function addMega(){
		$(this).find(".menu_to_hide").stop().fadeTo(50, 1).show();
		$(this).find("a.menutop").addClass('menutop_actif');
        }
 
      function removeMega(){
		$(this).find(".menu_to_hide").stop().fadeTo(100, 0, function() { //Fade to 0 opactiy
      $(this).hide();  //after fading, hide it
  });
		$(this).find("a.menutop").removeClass('menutop_actif');
        }
 
    var megaConfig = {
         interval: 20,
         sensitivity: 1,
         over: addMega,
         timeout: 200,
         out: removeMega
    };
	
	$("li.mega .menu_to_hide").css({'opacity':'0'});
    $("li.mega").hoverIntent(megaConfig)

});

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
}

