// JavaScript Document
function newwindow(URL,title,w,h){
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
    window.open(URL, title, "menubar=no,width="+w+",height="+h+",toolbar=no, left="+left+", top="+top+", resizable=yes,location=no,status=no");
}
function get_user(){
    document.login.method = "POST";
    document.login.action = "login.php";
	document.login.submit();
}
function hdemail(){
    document.hdform.method = "POST";
    document.hdform.action = "hdemail.php";
	document.hdform.submit();
}
function update_tables(){
    document.login.method = "POST";
    document.login.action = "sqlinserts.php";
	document.login.submit();
}

			
// JQuery Functions
$(document).ready(function() {
	$('.headerbar2').click(function() {
		$.each($('div.thumnailbox'),function(index,value){
			$(value).hide();
		});
		$(this).next('div.thumnailbox').show();
	});
	
	$('.titlecol').click(function() {
		$.each($('div.detailsbox'),function(index,value){
			$(value).slideUp();
		});
		$(this).next('div.detailsbox').slideDown();
	});

	$("#topnav").find("li").each(function() {  
		if ($(this).find("ul").length > 0) {  

			//show subnav on hover  
			$(this).mouseenter(function() {  
				$(this).find("ul").stop(true, true).slideDown();  
			});  

			//hide submenus on exit  
			$(this).mouseleave(function() {  
				$(this).find("ul").stop(true, true).slideUp();  
			});  
		}  
	});  
	
	/*$('.catimage').hover(function() {
		$.each($('ul.catlist'),function(index,value){
			$(value).hide();
		});
		$(this).next('ul.catlist').slideDown();
	});
	$('ul.catlist').mouseout(function() {
		$(this).slideUp();
	});*/
		
	$(".thumbnail").click(function() {$("#my_image").attr("src",$(this).attr("src"));});
});
