$(function(){
//=== rolloverimage making ===
	$('a.bt').each(function(){
		$(this).removeClass('bt');
		$(this).wrap('<span class="bt">')
	}
	);
	$('.bt a').hover(function(){
		if($(this).attr('class')=='on'){}else{
			var imgsrc = $(this).find('img').attr('src').replace(/\.(gif|png|jpg|jpeg)$/i,'_ro.$1');
			$(this).find('img').attr('src',imgsrc);
		}
	},function(){
		if($(this).attr('class')=='on'){}else{
			var imgparent = $(this).find('img').parent();
			var imgsrc = $(this).find('img').attr('src').replace(/_ro\.(gif|png|jpg|jpeg)$/i,'.$1');
			$(this).find('img').attr('src',imgsrc);
		}
	});

	//==== IE6 png ====
	//http://docs.jquery.com/Tutorials:PNG_Opacity_Fix_for_IE6
	var blank = new Image();
	blank.src = '/images/blank.gif';

	$(document).ready(function() {
	var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
	if (badBrowser) {
		// get all pngs on page
		// $('img[src$=.png]').each(function() {
		// get all pngs which has a class 'fixpng'.
		// because this function doen't work for a few small size png.
		$('img.fixpng').each(function() {
			if (!this.complete) {
				this.onload = function() { fixPng(this) };
			} else {
				fixPng(this);
			}
		});
	}
	});

	function fixPng(png) {
		var src = png.src;
		// set width and height
		if (!png.style.width) { png.style.width = $(png).width(); }
		if (!png.style.height) { png.style.height = $(png).height(); }
		// replace by blank image
		png.onload = function() { };
		png.src = blank.src;
		// set filter (display original image)
		png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
	}

});

