/*
$(document).ready(function(){
	$('#contents').shadow({ color: "#a6a6a6", offset: 5 });	
	$('.first-result').shadow({ color: "#e5e5e5", offset: 4 });
});
*/

win = false;
function popup(url, w, h) {
	if ( (win) && (!win.closed) ) {
		win.location = url;
		win.focus();
	} else {
		win = window.open((url), 'popupwin', 'top=10,left=10,width='+w+',height='+h+',resizable=yes,toolbar=no,status=yes,scrollbars=yes');
		win.focus();
	}
}

function showMe(divId) {
if(document.getElementById(divId).style.display = "none") {
	document.getElementById(divId).style.display = "";
}
}
function closeMe(divId) {
document.getElementById(divId).style.display = "none";
}

$(document).ready(function(){

		$("li.tab1").mouseover(
				function () {
					$('div.tab1-menu').show();
				}
		);
		
		$("li.tab1").mouseout(
				function () {
					$('div.tab1-menu').hide();
				}
		);

    $("div.tab1-menu").hover(
      function () {
        $('div.tab1-menu').show();
      }, 
      function () {
        $('div.tab1-menu').hide();
      }
    );
		
		/*
		// Removed popup - 1/19/09, MJK per JR
    // popup content on gallery tile view page
    $('#gallery-list div.result').each(function(){

        // get the content to popup
        var popup_content = $(this).find('div.details').clone();
        var popup_container = $(this).find('div.popup-box');

        $(this).find('a.image').hover(
            function(){
                popup_container.hide();
                popup_container.html( popup_content ).show();
                popup_container.css({width:"202px", "padding":"10px"});
            },
            function(){
                popup_container.hide();
            }
        );
        
        $(this).find('div.popup-box').hover(
            function(){
                popup_container.hide();
                popup_container.html( popup_content ).show();
                popup_container.css({width:"202px", "padding":"10px"});
            },
            function(){
                popup_container.hide();
            }
        );
    });
    
    $('#gallery-list div.first-result').each(function(){

        // get the content to popup
        var popup_content = $(this).find('div.details').clone();
        var popup_container = $(this).find('div.popup-box');

        $(this).find('a.image').hover(
            function(){
                popup_container.hide();
                popup_container.html( popup_content ).show();
                popup_container.css({width:"202px", "padding":"10px"});
            },
            function(){
                popup_container.hide();
            }
        );
        
        $(this).find('div.popup-box').hover(
            function(){
                popup_container.hide();
                popup_container.html( popup_content ).show();
                popup_container.css({width:"202px", "padding":"10px"});
            },
            function(){
                popup_container.hide();
            }
        );
    });
		*/

    $('a.more-categories').click(function(){
    
            $('div.categories-expand').show();
            $('a.more-categories').hide();
    });
     
    $('a.close-categories').click(function(){
            $('div.categories-expand').hide();
            $('a.more-categories').show();
    });

    $('form').each(function(){
			var f   = $(this);
			var btn = f.find('a.submit');
			if (btn.length > 0) {
				btn.click(function(){
					f.submit();
				});
			}
    });
     
});

// right hand recipe feed module content swap//

function showChannel(showThis)
{
     //Swap pannel display to selected
     var ActiveHTML = document.getElementById("active-content");
     //alert(ActiveHTML);
     ActiveHTML.innerHTML = document.getElementById(showThis).innerHTML;

     //Hightlight Button Code
     var lis = document.getElementById("images").getElementsByTagName("LI");
     for (var i=0; i<lis.length; i++)
     {
          //alert(i);
         lis[i].className="button";
     }
     var NewButtonHighlight = document.getElementById("button"+showThis);
     NewButtonHighlight.className = "buttonActive";
}