/* detection */
function whichBrs() {
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1) { return 'Opera'; }
	if (agt.indexOf("staroffice") != -1) { return 'Star Office'; }
	if (agt.indexOf("webtv") != -1) { return 'WebTV'; }
	if (agt.indexOf("beonex") != -1) { return 'Beonex'; }
	if (agt.indexOf("chimera") != -1) { return 'Chimera'; }
	if (agt.indexOf("netpositive") != -1) { return 'NetPositive'; }
	if (agt.indexOf("phoenix") != -1) { return 'Phoenix'; }
	if (agt.indexOf("firefox") != -1) { return 'Firefox'; }
	if (agt.indexOf("safari") != -1) { return 'Safari'; }
	if (agt.indexOf("skipstone") != -1) { return 'SkipStone'; }
	if (agt.indexOf("msie") != -1) {
		if(agt.indexOf("msie 7.0;") != -1) {
			return 'IE7';
		}
		return 'IE'; 
	}
	if (agt.indexOf("netscape") != -1) { return 'Netscape'; }
	if (agt.indexOf("mozilla/5.0") != -1) { return 'Mozilla'; }
	if (agt.indexOf('\/') != -1) {
		if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
			return navigator.userAgent.substr(0,agt.indexOf('\/'));
		} else { 
			return 'Netscape';
		}
	} else {
		if (agt.indexOf(' ') != -1) {
			return navigator.userAgent.substr(0,agt.indexOf(' '));
		} else {
			return navigator.userAgent;
		}
	}
}

var browzer = whichBrs();

if(browzer == 'IE') {
	isIE = true;
	isFF = false;
} else {
	if(browzer == 'Firefox') {
		isFF = true;
	} else { isFF = false; }
	isIE = false;
}
/* detection ends */



function pngfix(img) {
//	if ((isIE) && (document.body.filters)) {
	if((isIE)) {
		imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			imgID = (img.id) ? img.id : "";
			imgClass = (img.className) ? img.className: "";
			imgTitle = (img.title) ? img.title : img.alt;
			imgStyle = "display:inline-block;" + img.style.cssText + 
				"; width: "+img.width+"px; height: "+img.height+"px; " + 
				"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + 
				"(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
			span = Builder.node('span',{id: imgID, className: imgClass, title: imgTitle, style: imgStyle});
			img.parentNode.replaceChild(span, img);
			img  = span;
		}
	}
	return img;
}
