
$(document).ready(function(){
	
	// mega drop down menu 
	// http://www.geektantra.com/2009/09/jquery-mega-menu/
	$(".MegaMenuLink").megamenu(".MegaMenuContent", {							
	});

	// hover entire row, except rows with .noHover class
	// http://www.learningjquery.com/2007/02/quick-tip-set-hover-class-for-anything
	$('table tr:not(.noHover)').hover(function() {
		$(this).addClass('hover');      
	}, function() {
	  $(this).removeClass('hover');
	});
	$('.item').hover(function() {
		$(this).addClass('hover');      
	}, function() {
	  $(this).removeClass('hover');
	});

	// make entire row clickable based on href inside td, except rows with .noHover class
	// http://www.queness.com/post/126/useful-and-handy-jquery-tips-and-tricks
	 $("table tr:not(.noHover)").click(function(){  
	   //get the url from href attribute and launch the url  
	   window.location=$(this).find("a").attr("href"); return false;  
	 }); 
	 $(".item").click(function(){  
	   //get the url from href attribute and launch the url  
	   window.location=$(this).find("a").attr("href"); return false;  
	 }); 


	// product grid & list view switcher
	// todo: add cookie support
	// http://designm.ag/tutorials/jquery-display-switch/
    $("a.switch_thumb").toggle(function(){
        $(this).addClass("swap");
        $(".list .item").fadeOut("fast", function() {
            $(this).fadeIn("fast").addClass("detailview");
        });
    }, function () {
        $(this).removeClass("swap");
        $(".list .item").fadeOut("fast", function() {
            $(this).fadeIn("fast").removeClass("detailview");
        });
    }); 
						  
	// sliding doors button styling, ie6 fix
	// http://www.filamentgroup.com/lab/update_styling_the_button_element_with_css_sliding_doors_now_with_image_spr/
	$('.submitBtn').hover(
		// mouseover
		function(){ $(this).addClass('submitBtnHover'); },
		
		// mouseout
		function(){ $(this).removeClass('submitBtnHover'); }
	);	

	// columnizer
	// http://codeasily.com/jquery/multi-column-list-with-jquery
//	$('.mcol').makeacolumnlists({cols: 3, colWidth: 0, equalHeight: 'ul', startN: 1});

	// equal height columns 
	// http://www.cssnewbie.com/equalheights-jquery-plugin/
	// $(".fixHeight").equalHeights();


	// jquery ui (custom theme)
	// Tabs
	$('#tabs-product').tabs();

	// force links within a tab to open within the tab panel
	/*$('#tabs-location').tabs({
		load: function(event, ui) {
			$('a', ui.panel).click(function() {
				$(ui.panel).load(this.href);
				return false;
			});
		}
	});*/




	/*
				// Accordion
				$("#accordion").accordion({ header: "h3" });
	
				// Tabs
				$('#tabs').tabs();
	

				// Dialog			
				$('#dialog').dialog({
					autoOpen: false,
					width: 600,
					buttons: {
						"Ok": function() { 
							$(this).dialog("close"); 
						}, 
						"Cancel": function() { 
							$(this).dialog("close"); 
						} 
					}
				});
				
				// Dialog Link
				$('#dialog_link').click(function(){
					$('#dialog').dialog('open');
					return false;
				});
				
				// Slider
				$('#slider').slider({
					range: true,
					values: [17, 67]
				});
				
				// Progressbar
				$("#progressbar").progressbar({
					value: 20 
				});
				
				//hover states on the static widgets
				$('#dialog_link, ul#icons li').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);	

	*/
	
});




