
function dispDiv (n, display, section) {
	if (section == 0) {
		s = '';
	} else if (section == 1) {
		s = '2';
	}

	if (document.getElementById) {
		if (display) {
			document.getElementById('so' + s + n).style.display = 'block';
			document.getElementById('dso' + s + n).style.visibility = 'hidden';
			document.getElementById('hso' + s + n).style.visibility = 'visible';
		} else {
			document.getElementById('so' + s + n).style.display = 'none';
			document.getElementById('dso' + s + n).style.visibility = 'visible';
			document.getElementById('hso' + s + n).style.visibility = 'hidden';
		}
	}
}


// Function to display and hide the Special Offer's detail information
var lastBoxItem, lastPointerItem;

function mn_show_Spec_Off_Text(sw,name,item_type) {
 
	// show/hide the divisions
	  if (document.getElementById)
	  {
        // Hide the last item, if it exists
        if (lastBoxItem && item_type == 'box')
            lastBoxItem.style.visibility = 'hidden';
        if (lastPointerItem && item_type == 'pointer')
            lastPointerItem.style.visibility = 'hidden';
		if (sw) 
		    document.getElementById(name).style.visibility = 'visible';
		else
		    document.getElementById(name).style.visibility = 'hidden';
		if (item_type == 'box')
		    lastBoxItem = document.getElementById(name);
	    else
	        lastPointerItem = document.getElementById(name);
	  }
	  else if (document.all)
	  {
         // Hide the last item, if it exists
        if (lastBoxItem && item_type == 'box')
            lastBoxItem.style.visibility = 'hidden';
        if (lastPointerItem && item_type == 'pointer')
            lastPointerItem.style.visibility = 'hidden';
		if (sw) document.all[name].style.visibility = 'visible';
		if (!sw) document.all[name].style.visibility = 'hidden';
		if (item_type == 'box')
		    lastBoxItem = document.all[name];
	    else
	        lastPointerItem = document.all[name];
	  }
	  else if (document.layers)
	  {
         // Hide the last item, if it exists
        if (lastBoxItem && item_type == 'box')
             lastBoxItem.visibility = 'hidden';
        if (lastPointerItem && item_type == 'pointer')
            lastPointerItem.visibility = 'hidden';
		if (sw) document.layers[name].visibility = 'visible';
		if (!sw) document.layers[name].visibility = 'hidden';
		if (item_type == 'box')
		    lastBoxItem = document.layers[name];
	    else
	        lastPointerItem = document.layers[name];
	  }
}

// Function to sort Special Offers by various sort orders
function mn_reload(page, orderBy, categoryId, merchantId)
{
    window.location.href = "index.php?p="+page+"&order="+orderBy+"&cat="+categoryId+"&mId="+merchantId;
}

// Function to show Merchant's Rebate Disclaimer/Description. This is typically invoked by a mouse over event
function mn_show_merchant_disclaimer(sw,name,item_type) {
    
	// show/hide the divisions
	  if (document.getElementById)
	  {
		if (sw) document.getElementById(name).style.visibility = 'visible';
	  }
	  else if (document.all)
	  {
		if (sw) document.all[name].style.visibility = 'visible';
	  }
	  else if (document.layers)
	  {
		if (sw) document.layers[name].visibility = 'visible';
	  }
}

// Function to hide Merchant's Rebate Disclaimer/Description. This is typically invoked by a mouse out event
function mn_hide_merchant_disclaimer(sw,name,item_type) {
    
	// show/hide the divisions
	  if (document.getElementById)
	  {
		if (sw) document.getElementById(name).style.visibility = 'hidden';
	  }
	  else if (document.all)
	  {
		if (sw) document.all[name].style.visibility = 'hidden';
	  }
	  else if (document.layers)
	  {
		if (sw) document.layers[name].visibility = 'hidden';
	  }
}

//this switches expand collapse icons
function filter(imagename,objectsrc){
	if (document.images){
		document.images[imagename].src=eval(objectsrc+".src");
	}
}

//show OR hide funtion depends on if element is shown or hidden
function shoh(id) { 
	
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter(("img"+id),'imgin');			
		} else {
			filter(("img"+id),'imgout');
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter(("img"+id),'imgin');
			} else {
				filter(("img"+id),'imgout');	
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter(("img"+id),'imgout');
				document.all.id.style.display = 'none';
			}
		}
	}
}

//function to handle category menu fly-out menus
mnjQuery(window).load(function(){
    $('.mn_catTop').hover(function(){
        $(this).addClass('mn_catTopHov').find('.mn_flyHide').show();
      },
    function(){
      $(this).removeClass('mn_catTopHov').find('.mn_flyHide').hide();
    })
});
