<!--

function PromoSizeSearch(drSize, d, promoid)
{
    var index = 0;
	var size = '';
	
	//var drSize = document.getElementById(drSize);	
	index = drSize.selectedIndex;	
	size = drSize.options[index].value;
	if(size != '#')
		size = "&size=" + size;
	else
		size = "";

	var url;
	if(d == 1)
	    url = "/bras/level2.aspx?d=" + d;
	else if(d == 21)
	    url = "/dd/level2.aspx?d=" + d;
	else if(d == 2)
	    url = "/knickers/level2.aspx?d=" + d;
	else if(d == 3)
	    url = "/nightwear/level2.aspx?d=" + d;
	else if(d == 4)
	    url = "/swimwear/level2.aspx?d=" + d;
	else if(d == 6)
	    url = "/clothing/level2.aspx?d=" + d;
	else
	    url ="/level2.aspx?d=" + d;
	
	if(promoid != "")
	    promoid = "&promoid=" + promoid;
	
	if(size != "")
	    location.href = url + size + promoid;
}

function FilterBySize(drSizeFilter, d, collection, type, colour)
{    
	var index = drSizeFilter.selectedIndex;
	var size = drSizeFilter.options[index].value;
	
	if(size != "#")
	{
		var url = "level2.aspx?d=" + d + "&size=" + size;
		if(colour != "")
			url += "&colour=" + colour;
			
		if(collection != "")
			location.href = url + "&collection=" + collection;
		else if (type != "")
			location.href = url + "&type=" + type;
		else
			location.href = url;
	}
	else
	{
	    alert("Please select a size.");
	}
}

function QuickSearch(drSize, type)
{
	var index = drSize.selectedIndex;
	var phrase = drSize.options[index].value;
		
	if(phrase != "#")
	{
		if(type == 1)
			location.href = "/search/search2-" + phrase + "-bras.htm";
		else if (type == 2)
			location.href = "/search/search2-" + phrase + "-knickers.htm";
		else if (type == 3)
			location.href = "/search/search2-" + phrase + "-nightwear.htm";
		else if (type == 4)
			location.href = "/search/search2-" + phrase + "-swimwear.htm";
	    else if (type == 12)
			location.href = "/search/search2-" + phrase + "-accessories.htm";
	}
	else
	    alert("Please select an option.");
}
function ClearanceSearch(drSize, type)
{
	var index = drSize.selectedIndex;
	var phrase = drSize.options[index].value;
		
		//location.href = "SearchClearance.aspx?d=" + type + "&size=" + phrase + "&fromclearance=1";
			
	if(phrase != "0")	
	{
		if(type == 1)
			location.href = "/clearance/clearance-" + phrase + "-bras.htm";
		else if (type == 2)
			location.href = "/clearance/clearance-" + phrase + "-knickers.htm";
		else if (type == 3)
			location.href = "/clearance/clearance-" + phrase + "-nightwear.htm";
		else if (type == 4)
			location.href = "/clearance/clearance-" + phrase + "-swimwear.htm";
		else if(type == 6)
		    location.href = "/clearance/clearance-" + phrase + "-clothing.htm";
		else if(type == 12)
		    location.href = "/clearance/clearance-" + phrase + "-accessories.htm";
	}
	else
	{
	    var ediv = document.getElementById('ErrorCon')
	    ediv.innerHTML = "Please select a size.";
	    ediv.style.display = "block";
	}
}

function LastChanceSearch(drSize, type)
{
	var index = drSize.selectedIndex;
	var phrase = drSize.options[index].value;
		
		//location.href = "SearchClearance.aspx?d=" + type + "&size=" + phrase + "&fromclearance=1";
			
	if(phrase != "0")	
		location.href = "/LastChance/SearchLastChance.aspx?d=" + type + "&size=" + phrase;		
	else
	{
	    var ediv = document.getElementById('ErrorCon')
	    ediv.innerHTML = "Please select a size.";
	    ediv.style.display = "block";
	}
}

function SaleSearch(drSize, type)
{
		var index = drSize.selectedIndex;
		var phrase = drSize.options[index].value;
		
		//location.href = "SearchSale.aspx?d=" + type + "&size=" + phrase + "&fromsale=1";
	if(phrase != "0")
	{
		if(type == 1)
			location.href = "/sale/sale-" + phrase + "-bras.htm";
		else if (type == 2)
			location.href = "/sale/sale-" + phrase + "-knickers.htm";
		else if (type == 3)
			location.href = "/sale/sale-" + phrase + "-nightwear.htm";
		else if (type == 4)
			location.href = "/sale/sale-" + phrase + "-swimwear.htm";
		else if (type == 6)
			location.href = "/sale/sale-" + phrase + "-clothing.htm";
	}
	
	return false;
}

function DepartmentSizeSearch(d)
{
	var index = 0;
	var size = '';
	var type = '';
	var colour = '';
	var url;
	if(d == 1)
	    url = "/bras/level2.aspx?d=" + d;
	else if(d == 21)
	    url = "/dd/level2.aspx?d=" + d;
	else if(d == 2)
	    url = "/knickers/level2.aspx?d=" + d;
	else if(d == 3)
	    url = "/nightwear/level2.aspx?d=" + d;
	else if(d == 4)
	    url = "/swimwear/level2.aspx?d=" + d;
	else if(d == 6)
	    url = "/clothing/level2.aspx?d=" + d;
	else
	    url ="/level2.aspx?d=" + d;
	
	var drSize = document.getElementById("drSize");
	
	index = drSize.selectedIndex;	
	size = drSize.options[index].value;
	if(size != '#')
		url = url + "&size=" + size;
	
	location.href = url;	
}

function DepartmentSearch(d)
{
	var index = 0;
	var size = '';
	var type = '';
	var colour = '';
	var url;
	if(d == 1)
	    url = "/bras/level2.aspx?d=" + d;
	else if(d == 21)
	    url = "/dd/level2.aspx?d=" + d;
	else if(d == 2)
	    url = "/knickers/level2.aspx?d=" + d;
	else if(d == 3)
	    url = "/nightwear/level2.aspx?d=" + d;
	else if(d == 4)
	    url = "/swimwear/level2.aspx?d=" + d;
	else if(d == 6)
	    url = "/clothing/level2.aspx?d=" + d;
	else
	    url ="/level2.aspx?d=" + d;
	
	var drSize = document.getElementById("drSize");
	
	index = drSize.selectedIndex;	
	size = drSize.options[index].value;
	if(size != '#')
		url = url + "&size=" + size;
	
	if(d != '21')
	{
        var drType = document.getElementById("drType");
        index = drType.selectedIndex;
        type = drType.options[index].value;
        if(type != '#')
	        url = url + "&type=" + type;
	}

		
	var drColour = document.getElementById("drColour");
	index = drColour.selectedIndex;
	colour = drColour.options[index].value;
	if(colour != '#')
		url = url + "&colour=" + colour;	
	
	location.href = url;	
}
function DepartmentSearchSelection(size, type, colour)
{
    var index = 0;
    if(size != '#')
    {
        var drSize = document.getElementById("drSize");
        for(s=0; s < drSize.options.length; s++)
        {
            if(drSize.options[s].value == size)
                index = s;
        }
        drSize.options[index].selected = "1"        
    }
    
    if(type != '#')
    {
        var drType = document.getElementById("drType");
        for(t=0; t < drType.options.length; t++)
        {
            if(drType.options[t].value == type)
                index = t;
        }
        drType.options[index].selected = "1";
    }
    
    if(colour != '#')
    {
        var drColour = document.getElementById("drColour");
        for(c=0; c < drColour.options.length; c++)
        {
            if(drColour.options[c].value == colour)
                index = c;
        }
        drColour.options[index].selected = "1";
    }
}

function CheckCriteria(d)
{
	var index = 0;
	var size = '';
	var type = '';
	var colour = '';
	var url = "/search/search2.aspx?search2=1&d=" + d;
	
	var drSize = document.getElementById("drSize");
	index = drSize.selectedIndex;
	size = drSize.options[index].value;
	if(size != '#')
		url = url + "&size=" + size;
		
	var drType = document.getElementById("drType");
	index = drType.selectedIndex;
	type = drType.options[index].value;
	if(type != '#')
		url = url + "&type=" + type;
		
	var drColour = document.getElementById("drColour");
	index = drColour.selectedIndex;
	colour = drColour.options[index].value;
	if(colour != '#')
		url = url + "&colour=" + colour;	
	
	if(size != '#' || type != '#' || colour != '#')
	    location.href = url;	
	else
	    return false;
}

function CheckDeptSize(d)
{
	var index = 0;
	var size = '';
	var url = "/search/search2.aspx?search2=1&d=" + d;
	
	var drSize = document.getElementById("drSize");
	index = drSize.selectedIndex;
	size = drSize.options[index].value;
	if(size != '#')
		url = url + "&size=" + size;
	location.href = url;	
}

function CheckDeptSize2(d)
{
	var index = 0;
	var size = '';
	var url = "/search/search2.aspx?search2=1&d=" + d;
	
	var drSize = document.getElementById("drSize");
	index = drSize.selectedIndex;
	size = drSize.options[index].value;
	if(size != '#')
		url = url + "&size=" + size;
	location.href = url;	
}

function CheckClearanceCriteria(d)
{
	var index = 0;
	var size = '';
	
	var drSize = document.getElementById("drSize");
	index = drSize.selectedIndex;
	size = drSize.options[index].value;
	if(size != '#')
	{	
		if(d == "1")
		    location.href = "clearance-" + size + "-bras.htm";
		if(d == "2")
		    location.href = "clearance-" + size + "-knickers.htm";
		if(d == "3")
		    location.href = "clearance-" + size + "-nightwear.htm";
		if(d == "4")
		    location.href = "clearance-" + size + "-swimwear.htm";
		if(d == "6")
		    location.href = "clearance-" + size + "-clothing.htm";
	    if(d == "12")
	    location.href = "clearance-" + size + "-accessories.htm";
    }
}

function CheckSaleCriteria(d)
{
	var index = 0;
	var size = '';
	
	var drSize = document.getElementById("drSize");
	index = drSize.selectedIndex;
	size = drSize.options[index].value;
	if(size != '#')
	{
		if(d == "1")
		    location.href = "sale-" + size + "-bras.htm";
		if(d == "2")
		    location.href = "sale-" + size + "-knickers.htm";
		if(d == "3")
		    location.href = "sale-" + size + "-nightwear.htm";
		if(d == "4")
		    location.href = "sale-" + size + "-swimwear.htm";
		if(d == "6")
		    location.href = "sale-" + size + "-clothing.htm";
	}
}

function SizeFilter(d, phrase, SizeDR)
{
    var index = SizeDR.selectedIndex;
	var size = SizeDR.options[index].value;
		
    location.href = "search.aspx?phrase=" + phrase + "&size=" + size + "&sd=" + d;                     
}

-->