$(document).ready(function(){

    img1 = new Image();
    img2 = new Image();
    img3 = new Image();
    img4 = new Image();
    img5 = new Image();
    img1.src = "/images/s1a.jpg";
    img2.src = "/images/s2a.jpg";
    img3.src = "/images/s3a.jpg";
    img4.src = "/images/s4a.jpg";
    img5.src = "/images/s5a.jpg";

	$("a.client").click(function(){
		if ($(this).parent().find("div.client_desc").toggle().is(":visible")){
			$(this).addClass("client_desc_sel");
		} else {
			$(this).removeClass("client_desc_sel");
		}
		
		return false;
	});
	
	$(".square td div div.text").hide();
	
	function replace(id)
	{
		var new_id = "#" + id;
		var src = "/images/"+id+"a.jpg";
		var old_src = "/images/"+id+".jpg";
		var current_src = $(new_id).attr("src");
		$(new_id).mouseover(function(e){
			$(this).attr({src: src})
		});
		$(new_id).mouseout(function(e){
			$(this).attr({src: old_src})
		});
	}
	
	$(".link a").mouseover(function(e){
		var img_id = $(this).attr("class");
		
		var new_id = "#" + img_id;
		var src = "/images/"+img_id+"a.jpg";
		var old_src = "/images/"+img_id+".jpg";
		$(new_id).attr({src: src});
	});
	
	$(".link a").mouseout(function(e){
		var img_id = $(this).attr("class");
		
		var new_id = "#" + img_id;
		var src = "/images/"+img_id+"a.jpg";
		var old_src = "/images/"+img_id+".jpg";
		$(new_id).attr({src: old_src});
		});
	
	$(".square td").mouseover(function(e){
		$(".square td").removeClass("act");
		var current_td = "#" + $(this).attr("id");
		$(this).find("div.text").show();
		$(current_td).addClass("act");
	});
	
	$(".square td").mouseout(function(e){
		$(".square td div div.text").hide();
		$(".square td").removeClass("act");
	});
	
});
