/*********************************************************************
 *
 * hoyu : </en/common/js/common.js>
 * 
 * Last Update: 2008.07.30
 *
 * ===================================================================
 *
 *  Required:
 *
 *     - jquery.js (1.2.5)
 *     - jquery.preload.js (1.0.7)
 *     - styleswitcher.js
 *
 *********************************************************************/

$(function(){
	// Link Blank
	$("div#main .link_blank, div#footer .link_blank").not("important").children("a")
		.after('<img src="/en/common/image/icon_link_blank.gif" alt="" width="14" height="14" />');

	// Font Changer (Set)
	var title = getActiveStyleSheet();
	createCookie("style", title, 365);

	$("div#header div#pagetop").append('<dl id="font_changer">'+
		'<dt><img src="/en/common/image/txt_font_size.gif" alt="Text Size" width="41" height="9" /></dt>'+
		'<dd class="medium"><a href="#">General</a></dd>'+
		'<dd class="large"><a href="#">Larger</a></dd>'+
		'</dl>');

	$("div#header dd.medium a").click(function(e){ setActiveStyleSheet('medium'); return false; });
	$("div#header dd.large a").click(function(e){ setActiveStyleSheet('large'); return false; });

	// Preload
	$("img, input").preload({ find: "_off.gif", replace: "_on.gif"});

	// Rollover
	$("img, input").hover(
		function(){ this.src = this.src.replace("_off.gif","_on.gif"); },
		function(){ this.src = this.src.replace("_on.gif","_off.gif"); }
	);

	$("div#main .link_blank.important a").hover(
		function(){ var me = $(this).children("img"); me.attr("src","/common/image/icon_link_blank_dark.gif"); },
		function(){ var me = $(this).children("img"); me.attr("src","/common/image/icon_link_blank_light.gif"); }
	);

	$("div#sub .link_blank a").hover(
		function(){ var me = $(this).children("img"); me.attr("src","/common/image/icon_sub_link_blank_dark.gif"); },
		function(){ var me = $(this).children("img"); me.attr("src","/common/image/icon_sub_link_blank_light.gif"); }
	);
});
