(function($) {
	$(function() {
			   
		//rollover
		setRollovers();
		
		//js_exmple
		$('.js_exmple').example(function() {
			return $(this).attr('title'); 
		});
		
		//add "first" or "last" class
		$addClassItems = $('li, dt, dd, tr, td');
		//first
		$addClassItems
		.add("body.casestudy_detail #contents_main div.sec_detail div.list_tnail:last ul")
		.filter(':first-child').addClass('first');
		//last
		$addClassItems
		.add("body.stated_detail #contents_main div.sec_detail")
		.filter(':last-child').addClass('last');
		
		//initialize swap photo table 
		var $swapPhotoTable = $("table.swap_photo");
		if($swapPhotoTable.size() && $.fn.swapPhoto) {
			$swapPhotoTable.swapPhoto();
		}
		
		//global navi dropdown aciton
		var duration = 200;
		var $menus = $("#gnav_solution, #gnav_casestudy").children("ul").css("opacity", 0).end().hover(
			function(){
				$(this).addClass("hover").children("ul").stop().show().animate({ "opacity": 0.85}, duration, "linear");
			},
			function(){
				$(this).removeClass("hover").children("ul").stop().animate({ "opacity": 0}, duration, "linear", function(){
					$(this).hide();
				});
			}
		);
		$menus.find("ul li a").hover(
			function(){ $(this).addClass("link_hover"); },
			function(){ $(this).removeClass("link_hover"); }
		);
		
		//add function to print map
		$("body.company_branch p.btn_print a").click(function(e){
			window.print();
			e.preventDefault();
			return false;
		});
	});
	
})(jQuery);


