/*
 * common scripts.
 */
(function($){

	$(document).ready(function(){
							   
		$('a[rel=external]').click(function(){					
			window.open(this.href, '_blank');
			return false;
		});
		
		
		/* rollover */
		$('.rollover').hover(
			function(){
				$(this).stop().fadeTo(0,0);	
			},
			function(){
				$(this).stop().fadeTo(0,1);		
			}
		);

		// sidebar rollover
		$('#aside .nav ul a').hover(
			function(){
				$(this).stop().animate({ backgroundColor:"#ffffff" },0);
			},
			function(){
				$(this).stop().animate({ backgroundColor:"#F2F2F2" },0);		
			}
		);

		// company index rollover
		$('#main .company_index .box01 dl dd .detail a').hover(
			function(){
				$(this).children('img').stop().animate({ backgroundColor:"#52CDE2" },0);
			},
			function(){
				$(this).children('img').stop().animate({ backgroundColor:"#eee" },0);		
			}
		);
		
		// print burtton
		$('.print_button').click(
			function(){
				window.print();
			}
		);
		
		// Footer include script
		$('#footer .site_map').load("/include/footer.html .footer");
		
		// Form add CSS Class
		$('#main input:text').addClass('inp_text')
		$('#main textarea').addClass('textarea')
		
		// Form focus add class 'focus'
		$('#main input:not(:radio,:checkbox,:button,:submit,:image),#main textarea').focus(
			function(){
				$(this).addClass('focus');
			}
		);
		$('#main input,#main textarea').focusout(
			function(){
				$(this).removeClass('focus');
			}
		);
			
	});

})(jQuery);

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-526963-2']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


