/*
$(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(){

	$('.menu-bar li').each(function(){
		var f   = $(this);
		var subnav = f.find('div');
		if (subnav.length > 0) {
			f.mouseover(function(){
				subnav.show();
			});
			f.mouseout(function(){
				subnav.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();
				});
			}
    });
    
// submit form on enter press for login page //
	    
/*    $('#login').each(function() {$('form').each(function() {
    	var f = $(this);
    	if ($.browser.mozilla) {
	$('input').keypress (checkForEnter);
	} else {
	$('input').keydown (checkForEnter);
	}
    });});

    function checkForEnter (event) {
	if (event.keyCode == 13) {
	document.getElementsByTagName('form')[1].submit();
	} 
    }
    
*/
     
});