function rollover2(a, b) {
	str = a.src;
	if (!a.src) str = a.firstChild.src;
	b ? str.indexOf(".gif") > 0 ? str.substring(0, str.length - 4) + "_b.gif" : str.substring(0, str.length - 4) + "_b.gif" : str.indexOf(".gif") > 0 ? str.substring(0, str.length - 6) + ".gif" : str.substring(0, str.length - 6) + ".gif";
	a.firstChild.src = str;
	if (b) {
		a.onmouseover = function() { };
		a.onmouseout = function() { }
	} 
	  }

  var HidingTimers = {};
  function mega_drop(par, ns, open, rover) {
	  if (open) {
		  clearTimeout(HidingTimers[ns]);
		  var pheight = $(par).height()
	  
		  $('.megaMenu_dropdown').each(function(index) {
				//if (rollover_array[index] != '') {
				//	document.getElementById('img_' + this.id).src = rollover_array[index]
				//}
			  if (this.id == ns) {
				  if (rollover_array_b[index] != '') {
					document.getElementById('img_' + this.id).src = rollover_array_b[index]
				  }
				  $(this).slideDown()
			  } else {
				  $(this).stop(true, true).hide()
			  }
		  })
		
		  var coords_md = $('#mainDiv').offset()
		  var coords_par = $(par).offset()
		  $('#' + ns).css({
			  
			  position: 'absolute',
			  zIndex: 5000,
			  left: '1px',
			  //left: coords_md.left + 'px',
			  top: 33 + 'px'
		  });
	  } else {
		  HidingTimers[ns] = setTimeout(function(){ mega_hide(ns); }, 0)
	  }
  }

	$(function(){
	
  		$('.megaMenu_dropdown').bind("mouseenter", function() { clearTimeout(HidingTimers[this.id]); });
		$('.megaMenu_dropdown').bind("mouseleave", function() { 
			var dd = this;
			HidingTimers[this.id] = setTimeout(function(){ mega_hide(dd.id); }, 500);
		});
	})

	function mega_hide(ns, par) {
		$('#' + ns).stop(true, true).slideUp("fast")
		$('.megaMenu_dropdown').each(function(index) {
			if (this.id == ns && rollover_array[index] != '') {
				document.getElementById('img_' + this.id).src = rollover_array[index]
			}
		}) 
	}
