
 
$(document).ready(function() 
{  
	
	 $("div.box").hover(
      function () {
        $(this).find("div:first").show();
      }, 
      function () {
        $(this).find("div:first").hide();
      }
    );	
    
    $("div.box:last").css({ "margin-left" : "0" });
    
    
	$("div.gallery a").click( function(){
     	var id = $(this).attr("rel");
     	var src = $(this).attr("href");
     	
  		$("#"+id).load(function(){ $(this).hide(); $(this).fadeIn("slow"); }).error(function () { }).attr('src', src);
  		
     	var selected = $(this).parents().get(1);
     	$(selected).find("li.selected").removeClass("selected");
     	$(this).parent().addClass("selected");
     	
	 	return false;
	 	
     });	
    
    $("div.box:last").css({ "margin-left" : "0" });
    	
  
	   
});


function openWin(page){

	w = 450;
	h = 350;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=1,resizable=0,location=0,status=1,menubar=0,toolbar=0'
	win = window.open(page, "", winprops);

	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

}