function extractImgURL(i) {
	var o = i;
	var cando = ((i.indexOf("(") != -1) && (i.indexOf(")") != -1));
	var firstIndex = i.indexOf("(");
	var secondIndex = i.indexOf(")");	
	if (cando) {
		o = i.substring((firstIndex + 1), secondIndex);
	}
	return o;
}

function initPNGs() {
	var isOldIE = ((navigator.userAgent.toLowerCase().indexOf("msie") != -1) && 
				   (navigator.userAgent.toLowerCase().indexOf("msie 7") == -1));

	if (isOldIE) { // detect for IE 6.0 and older 

		// Replace all <input> sources with DirectX hack
		is = document.getElementsByTagName("div"); // get all images
		for(x = 0; x < is.length; x++){ // cycle through those images
			var initPNGs_imgurl = extractImgURL(is[x].style.background);
			if(initPNGs_imgurl.indexOf(".png") != -1){ // only do this to png files				
				is[x].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + initPNGs_imgurl + "', sizingMethod='crop')"; // apply the filter stuff that makes IE do it's magic
				is[x].style.background = "url(transparent.gif)"; // replace the image with a clear gif so that the filter can show through
			}
		}


	}
}

