function contentload(){
	$(document).bind("contextmenu",function(){
		return false;
	});

	$(window).bind("resize", function(){
		var window_w = parseInt($(window).width());
		if($("object#contents").length && $(window).width() < 900 ){
			$("object#contents").attr("width", "900px");
		} else if($("object#contents").length && $(window).width() > 900 ){
			$("object#contents").attr("width", "100%");
		};
	});
	
	if($("#header .btn a img").length){$("#header .btn a img").rollover();};
	if($(".y_box").length){$(".y_box").flatHeights();};
	var flashvars = {};
	var params = {};
	params.wmode = "transparent";
	var attributes = {};

	var html1 = $("#contents").html();
	var isFlashInstalled=function(){if(navigator.plugins["Shockwave Flash"]){return true;}try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true;}catch(a){return false;}}();

	if ( isFlashInstalled ) {
		$("#flash").attr("src","http://www.idh.co.jp/common/images/select_flash_on.gif");
		swfobject.embedSWF("style.swf", "contents", "100%", "575", "10.0.0", "http://www.idh.co.jp/common/images/expressInstall.swf",flashvars, params, attributes);
	} else	{
		$("#html").attr("src","http://www.idh.co.jp/common/images/select_html_on.gif");
	};
	

	$("#html").click(function(){
		$(this).attr("src","http://www.idh.co.jp/common/images/select_html_on.gif");
		$("#flash").attr("src","http://www.idh.co.jp/common/images/select_flash_off.gif");
		$("#contents").empty();
		$("#contents").replaceWith('<div id="contents">' + html1 + '</div>');
		$("#contents").css("visibility","visible");


		$(".top_link a img").hover(
			function(){
				filename = $(this).attr("src");
				if($(this).attr("class") != "non_over"){
					var filename_a = filename.split("/");
					i = parseFloat(filename_a.length) - 1;
					l = i - 2;
					filename_b = filename_a[i].split(".");
					over_name = filename_b[0] + "_on." + filename_b[1];
					delete filename_a[i];
					$(this).attr("src",filename_a.join("/") + over_name);
				}
			},function(){
				$(this).attr("src",filename);
			}
		);

		if($(".y_box").length){$(".y_box").flatHeights();};
	});

	if ( isFlashInstalled ) {
		$("#flash").click(function(){
			$(this).attr("src","http://www.idh.co.jp/common/images/select_flash_on.gif");
			$("#html").attr("src","http://www.idh.co.jp/common/images/select_html_off.gif");
			swfobject.embedSWF("style.swf", "contents", "100%", "575", "10.0.0", "http://www.idh.co.jp/common/images/expressInstall.swf",flashvars, params, attributes);
		});
	};
	
}


if ($.browser.msie && $.browser.version < 9){
	window.onload = function(){
		contentload();
	};
} else {
	$(function(){
		contentload();
	});
}

