/**---------------------------------
 * common.js
 * 
 * ...
 * url 		: http://www.sph62.net
 * mail		: sph62.net@gmail.com
 *
 * @use jQuery 1.2.6 later
 ---------------------------------*/
;(function($){
	$(document).ready(function(){
		//rollover	
		// switching image xxx_off.xxx -> xxx_on.xxx
		// if image name is bnr_xxxx or btn_xxx which don't has neme _off , _on
		// fade effect on mouse over.
		$("a img[src*='_on']").addClass("current");
		
		$("a img,:image").mouseover(function(){
			if($(this).hasClass('current')) return;
			if ($(this).attr("src").match(/_off./)){
				$(this).attr("src",$(this).attr("src").replace("_off.", "_on."));
				return;
			}
		}).mouseout(function(){
			if($(this).hasClass('current')) return;
			if ($(this).attr("src").match(/_on./)){
				$(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
				return;
			}
		}).click(function(){
			if($(this).hasClass('current')) return;
			if ($(this).attr("src").match(/_on./)){
				$(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
				return;
			}
		});
		
		//preload images
		var images = [];
		$("a img,:image").each(function(index){
				if($(this).attr("src").match(/_off./)){
					 images[index]= new Image();
					 images[index].src = $(this).attr("src").replace("_on.", "_off.");
				}
		});
		
	});

	$(window).load(function() {
	 $('body').css("visibility","visible");
	});

})(jQuery);

document.writeln('<style type="text/css">body{visibility:hidden;}</style>');

