$().ready(function(){
	if(navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Chrome") == -1) $("body").css("font-size", "11px");
	if($("#newsListTbl").size() > 0) addTargetBlank("newsListTbl");
	smartRollover();
});

function smartRollover() {

	if( $.browser.msie && $.browser.version<7)
	{
		$("img, input").each(function()
		{
			if($(this).attr("src").match("_default.png"))
			{
				$(this)
				.data("src",$(this).attr("src"))
				.attr("src","/common/images/blank.gif")
				.css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$(this).data("src")+"',sizingMethod='scale')");
				$('<img/>').attr( 'src', $(this).data("src").replace("_default.", "_over.") );
				$(this).mouseover(
					function() {
						$(this).css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$(this).data("src").replace("_default.", "_over.")+"',sizingMethod='scale')")
					}
				);
				$(this).mouseout(
					function() {
						$(this).css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$(this).data("src")+"',sizingMethod='scale')")
					}
				);
			}
			else if($(this).attr("src").match("_default."))
			{
				$('<img/>').attr( 'src', $(this).attr("src").replace("_default.", "_over.") );

				$(this).mouseover(
					function() {
						$(this).attr("src", $(this).attr("src").replace("_default.", "_over."));
					}
				);
				$(this).mouseout(
					function() {
						if($(this).attr("class") != "btn" || ($(this).attr("class") == "btn" && gnavi_sub==0)) $(this).attr("src", $(this).attr("src").replace("_over.", "_default."));
					}
				);
			}
			else if($(this).attr("src").match(".png"))
			{
				$(this)
				.data("src",$(this).attr("src"))
				.attr("src","/common/images/blank.gif")
				.css("filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+$(this).data("src")+"',sizingMethod='scale')");
			}
		});
	}
	else
	{
		$("img, input").each(function (){
			if($(this).attr("src"))
			{
				if($(this).attr("src").match("_default."))
				{
					$('<img/>').attr( 'src', $(this).attr("src").replace("_default.", "_over.") );

					$(this).mouseover(
						function() {
							$(this).attr("src", $(this).attr("src").replace("_default.", "_over."));
						}
					);
					$(this).mouseout(
						function() {
							if($(this).attr("class") != "btn" || ($(this).attr("class") == "btn" && gnavi_sub==0)) $(this).attr("src", $(this).attr("src").replace("_over.", "_default."));
						}
					);
				}
			}
		});
	}
}


function addTargetBlank(idName) {

	if(document.getElementsByTagName) {

	if(!document.getElementById(idName)){return;}

		var anchors = document.getElementById(idName).getElementsByTagName("a");
		for(var i=0; i < anchors.length; i++) {

			if(anchors[i].getAttribute("href").match(/\.pdf$/i))
			{
				anchors[i].setAttribute("target","_blank");
			}
		}
	}
}



/*
 * Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22119728-1']);
_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);
})();
 */


