function getUrlParam(param, df)
    {
        var params = document.location.search.split('&');
        for (var i = 0; i < params.length; i++)
        {
            var qm = (i == 0 ? "?" : "");
            if (params[i].slice(0, params[i].indexOf('=')).toLowerCase() == (qm + param.toLowerCase()))
            {
                return unescape(params[i].slice(params[i].indexOf('=') + 1));
            }
        }
        return false;
    }


if (getUrlParam('icon', 1)==false)
{
	wallpaperNo = getUrlParam('wallpaper', 1);
	if (wallpaperNo == 1)
	 	document.getElementById('wallpaper1').style.display = "block";
	else if (wallpaperNo == 2)
		document.getElementById('wallpaper2').style.display = "block";
	else if (wallpaperNo == 3)
		document.getElementById('wallpaper3').style.display = "block";
	else if (wallpaperNo == 4)
		document.getElementById('wallpaper4').style.display = "block";
}
else{
	iconNo = getUrlParam('icon', 1);
	if (iconNo == 1)
		document.getElementById('icon1').style.display = "block";
	else if (iconNo == 2)
		document.getElementById('icon2').style.display = "block";
	else if (iconNo == 3)
		document.getElementById('icon3').style.display = "block";
	else if (iconNo == 4)
		document.getElementById('icon4').style.display = "block";
	else if (iconNo == 5)
		document.getElementById('icon5').style.display = "block";
}


// Supersleights

var supersleight	= function() {
	
	var root = false;
	var applyPositioning = false;
	
	// Path to a transparent GIF image
	var shim			= 'http://stc.sand.msn-int.com/br/DD/TheDarkKnight/images/x.gif';
	
	// RegExp to match above GIF image name
	var shim_pattern	= /x\.gif$/i;
	
	
	
	var fnLoadPngs = function() { 
		if (root) {
			root = document.getElementById(root);
		}else{
			root = document;
		}
		for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) {
			// background pngs
			if (obj.currentStyle.backgroundImage.match(/\.png/i) !== null) {
				bg_fnFixPng(obj);
			}
			// image elements
			if (obj.tagName=='IMG' && obj.src.match(/\.png$/i) !== null){
				el_fnFixPng(obj);
			}
			// apply position to 'active' elements
			if (applyPositioning && (obj.tagName=='A' || obj.tagName=='INPUT') && obj.style.position === ''){
				obj.style.position = 'relative';
			}
		}
	};

	var bg_fnFixPng = function(obj) {
		var mode = 'scale';
		var bg	= obj.currentStyle.backgroundImage;
		var src = bg.substring(5,bg.length-2);
		if (obj.currentStyle.backgroundRepeat == 'no-repeat') {
			mode = 'crop';
		}
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
		obj.style.backgroundImage = 'url('+shim+')';
	};

	var el_fnFixPng = function(img) {
		var src = img.src;
		img.style.width = img.width + "px";
		img.style.height = img.height + "px";
		img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
		img.src = shim;
	};
	
	var addLoadEvent = function(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				if (oldonload) {
					oldonload();
				}
				func();
			};
		}
	};
	
	return {
		init: function() { 
			addLoadEvent(fnLoadPngs);
		},
		
		limitTo: function(el) {
			root = el;
		},
		
		run: function() {
			fnLoadPngs();
		}
	};
}();

// limit to part of the page ... pass an ID to limitTo:
// supersleight.limitTo('header');

if(navigator.appName=='Microsoft Internet Explorer' &&  navigator.appVersion.indexOf("6.0")!=-1)
{
	supersleight.init();
}

