function fix_png() {
	if (is_ie) {
		document.getElementById('price').style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/price.png', sizingMethod='scale')";
		document.getElementById('price').src = '/images/clear.gif';
	}
}

function sp(link) {
	thumb = link.firstChild;
	ph = document.getElementById('photo');
	cp = document.getElementById('caption');
	
	ph.src = thumb.getAttribute('src').substring(0, thumb.getAttribute('src').length - 7) + '.jpg';
	ph.setAttribute('alt', thumb.getAttribute('alt'));
	cp.innerHTML = thumb.getAttribute('alt');
	return false;
}

function load_image() {
	// From http://www.helsinki.fi/~jppesone/code/dump_get_params.html
	var query=this.location.search.substring(1);
	if (query.length > 0){
		var params=query.split("&");
		for (var i=0 ; i<params.length ; i++){
			var pos = params[i].indexOf("=");
			var name = params[i].substring(0, pos);
			var value = params[i].substring(pos + 1);
			if (name == 'photo') {
				sp(document.getElementById(value));
			}
		}
	}
}

function preload_images() {
	// Preload the over images
	if (document.images) {
		for (var i = 0; i < document.images.length; i++) {
			if (document.images[i].src.substring(document.images[i].src.length-6,document.images[i].src.length) == 'sm.jpg') {
				(new Image()).src = document.images[i].src.substring(0,document.images[i].src.length-7) + '.jpg';
			}
		}
	}
}
