
(function($){

sfHover = function() {
	var sfEls = document.getElementById("navi").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);

$(".submenu").hover(function(){
    
        $(".departmenturl").addClass("hover");
   
    }, function(){
    $(".departmenturl").removeClass("hover");
        
    });

//$('ul.sf-menu').superfish({pathClass:  'current'}); 

        $("#left-sf-menu > ul").superfish({ 
            // animation: {height:'show'},   // slide-down effect without fade-in 
            speed: 'fast',
            delay:     400               // 1.2 second delay on mouseout 
        });




    // Logo
    $("#emergelogo").parent().append('<img src="/includes/images/powered-by-Emerge.png" width="100" height="51" alt="Powered by Emerge Inc."  id="emergelogocolor"/>');
    $("#emergelogocolor").fadeTo(0, 0).mouseover(function() {
        $(this).stop().animate({
            opacity: 1
        }, 1000);
    }).mouseout(function() {
        $(this).stop().animate({
            opacity: 0.2
        }, 1000);
    });
    
    // Logo on economic page
    $("#emerge_logo").parent().append('<img src="/images/emerge_logo_full.png" width="100" height="51" alt="Powered by Emerge Inc." id="emerge_logo_full"/>');
    $("#emerge_logo_full").fadeTo(0, 0).mouseover(function() {
        $(this).stop().animate({
            opacity: 1
        }, 1000);
    }).mouseout(function() {
        $(this).stop().animate({
            opacity: 0.2
        }, 1000);
    });

})(this.jQuery);




window.log = function(){
  log.history = log.history || [];   
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);



