//Ham fix png
function fix_png(id){
	if(navigator.appVersion.match(/MSIE [0-6]\./)){
		//fix cho background
		$(id).each(function(){
			var background_image=$(this).css("backgroundImage");
			if(background_image!='none'){
				//fix cho background
				if(background_image.substring(4,5)=='"'){
					var img_src=background_image.substring(5,background_image.length-2);
				}else{
					var img_src=background_image.substring(4,background_image.length-1);
				}
				$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+img_src+"')"});
			}else{
				//fix cho anh
				if(this.src!='none'){
					var img = this;
					var imgID = (img.id) ? "id='" + img.id + "' " : "";
		            var imgClass = (img.className) ? "class='" + img.className + "' " : "";
		            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
		            var imgStyle = "display:inline-block;" + img.style.cssText ;
		            if (img.align == "left") 	imgStyle = "float:left;" + imgStyle;
		            if (img.align == "right")	imgStyle = "float:right;" + imgStyle;
		            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
		            //tao the span co background la cai anh day
		            var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" ;
            		img.outerHTML = strNewHTML;
				}
			}
		});
	}
}
//khi trinh duyet load xong thi goi lenh fix_png (cau truc cua jquery)
$(document).ready(function(){
	//id o day: neu la class thi '.ten_class' neu la id thi '#ten_id'
	fix_png('.fix_png');
	fix_png('.module');
});
