var ns6 = (document.all && !document.getElementById)
var IE  = (document.all && document.getElementById);
var isOpera = (navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0);

function __transformPNG()
{	
	if(IE && !isOpera)
	{
		var img = document.images;
		for(var i = 0; i < img.length; i++)
		{
			if(img[i].src.toUpperCase().indexOf('.PNG') > -1)
				__changeImage(img[i]);
		}
		
		var input = document.getElementsByTagName('input');
		for(var i = 0; i < input.length; i++)
		{
			if(input[i].type == 'image' && input[i].src.toUpperCase().indexOf('.PNG') > -1)
				__changeImage(input[i]);						
		}
	}
}

function __changeImage(obj)
{	            	
	if(obj.getAttribute('noTransform') != 'yes' || !obj.getAttribute('noTransform'))
	{
		obj.style.visibility = 'hidden';
		var d = document.createElement('div');
		with(d)
		{                                                
			style.width = obj.width;
			style.height = obj.height;		
			style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + 
							obj.src + "', sizingMethod='scale')";
	                        
			innerHTML = '<img src="' + ImageBase + '/t.gif" width="' + obj.width + 
						'" height="' + obj.height + '" />';
	        
			if(obj.style.cursor != '')
				style.cursor = obj.style.cursor;
	        
			if(obj.type == 'image')
				style.cursor = 'pointer';
	        
			onselectstart = new Function("return(false);");
	        
			if(obj.title != '')
				title = obj.title;
		}
	    
		if(obj.onmouseover)                        
			d.onmouseover = new Function("setFilter(this, '" + obj.getAttribute("overImage") + "')");  
	                    
		if(obj.onmouseout)
			d.onmouseout = new Function("setFilter(this, '" + obj.getAttribute("outImage") + "')");  
	    
		if(obj.onclick)
		{
			if(obj.id)
				d.onclick = new Function("__FireEventFor('" + obj.id + "');");    
			else
				d.onclick = obj.onclick;
		}d
	    
		obj.style.display = 'none';     
		obj.insertAdjacentElement("afterEnd", d);
	}	       	
}

function __FireEventFor(s)
{
	// YES It's ie we can call .click() method :)
	findObj(s).click();
}

function setFilter(obj, img)
{	
	window.status = ImageBase + '/' + img;
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + ImageBase + 
	"/" + img  + "', sizingMethod='scale')";		
}