var IE = document.all?true:false;

jQuery(function(){
	$('img[@class^="btn_o"]').each(function(){
		var theImgType = $(this).attr('src').toString().match(/\.[a-z][a-z][a-z][a-z]?$/);
		var theExt = $(this).attr('class').toString().match(/btn_[a-zA-Z0-9]*/gi).toString().replace('btn', '');
		$(this).mouseover(function(){
			$(this).attr('src', $(this).attr('src').toString().replace(''+theImgType,''+theExt+theImgType));
	    }).mouseout(function(){
			$(this).attr('src', $(this).attr('src').toString().replace(''+theExt+theImgType,''+theImgType));
	    });
	});
/*
	$("object, embed").each(function() {
		this.outerHTML = this.outerHTML;
	});
*/
	$("table.tableframe tr:even").not($("table.notableframe tr")).addClass("even");
	if (typeof(configureLeftMenu)=="function") {
		configureLeftMenu();
	}
	if (typeof(updatelink)=="function") {
		updatelink();
	}
	if (typeof(configureRevisionDate)=="function") {
		configureRevisionDate();
	}
	if (typeof(updateServerTime)=="function") {
		updateServerTime();
	}
	if (typeof($.preloadImages)=="function") {
		$.preloadImages();
	}

	if ($.browser.msie && $.browser.version == 6.0 && document.body.clientWidth>=1000 && typeof fullWidth != "undefined"){
		document.body.style.width = "1000px";
	}

	if (typeof(readCookie)=="function") {
		var pagesize = readCookie("pagesize");
		if (!(pagesize=="small" || pagesize=="medium" || pagesize=="large")) {
			pagesize = "small";
			createCookie('pagesize', "small", 365);
		}
		$("#whole").addClass("whole-" + pagesize);
		$("."+pagesize+"A").addClass("selected");
	}
});


function debug(msg){
	if($('div[id="debug"]').length == 0){
		$('body').append('<div id="debug" style="position:absolute; left: 10px; top: 10px; background: #999999; color: #333333;"></div>');
	}$('div[id="debug"]').html(msg);
}

