// Image swap

var base= "http://www.fashion18.com/media/global/is_"
var nrm = new Array();
var omo = new Array();
var stuff = new Array('go','lead1','lead2','lead3','lead4','lead5');

// Pre-load images.

if (document.images)
{
	for (i=0;i<stuff.length;i++)
	{
		nrm[i] = new Image;
		nrm[i].src = base + stuff[i] + ".gif"
		omo[i] = new Image;
		omo[i].src = base + stuff[i] + "_r.gif";
	}
}

// The functions: first mouseover, then mouseout

function over(no)
{
	if (document.images)
	{
        document.images[stuff[no]].src = omo[no].src
	}
}

function out(no)
{
	if (document.images)
	if (document.getElementById('placeholder') == null) {
	//  make sure we're not swapping an image in the leadspot. 
	document.images[stuff[no]].src = nrm[no].src;
	} else 	{
		//  if we're swapping an image in the leadspot,
		//  make sure the current image isn't related to the currently displayed leadspot image.
		var currentImg = document.getElementById('placeholder').alt;
		if (currentImg != no) {
		document.images[stuff[no]].src = nrm[no].src;
		}
	
    }
}
