// JavaScript Document

/* ////////////////////////////////////////////////////////

	
	
//////////////////////////////////////////////////////// */


$(function(){
	

	$("img.hover").each(function(){

	  $(this).mouseover(function(){
		  
		  var src = $(this).attr("src");
		  
		  src = src.replace(/^(.+)_(.+)(\.[a-z]+)$/, "$1_hover$3");
		  
		  $(this).attr("src", src);
		  
		  
		  $(this).css("cursor","pointer");
		
	  });
	
	  $(this).mouseout(function(){
		  
		  var src = $(this).attr("src");
		  
		  src = src.replace(/^(.+)_(.+)(\.[a-z]+)$/, "$1_normal$3");
		  
		  $(this).attr("src", src);
		  
		  $(this).css("cursor","default");
		
  	  });
	  
	  $(this).each(function(){
		  
		  $("<img>").attr("src",$(this).attr("src").replace(/^(.+)_(.+)(\.[a-z]+)$/, "$1_hover$3"));
		
  	  });
		
	});
	
	$("div.hover").each(function(){
	  
	  $(this).mouseover(function(){
		  
		  var name = $(this).attr("name");
		  
		  var src = $(".imagewrapper img",this).attr("src");
		  
          var rgexp = /([\\\/].)[^\\\/]+$/;
          var repl = "/";
          var pass = src.replace(rgexp, repl);
		  
		  var hoverpass = pass + name;
		  
		  var inserthover = "<img src='" + hoverpass + "' class='hoverframe' alt='' />";
		  
		  $(this).prepend(inserthover);
		  
		  $(".hoverframe",this).css({left: 0,top:0});
		  
		  $(".hoverframe",this).css("position","absolute");
		  
		  
		  
		  $(this).css("cursor","pointer");
		  
		
	  });
	
	  $(this).mouseout(function(){
		  
		  $(".hoverframe",this).remove();
		  
		  var name = $(this).attr("name");
		  
		  $(this).css("cursor","default");
		  
		
  	  });
		
	});
	
	
	
	
	
	
	
});


