function onSearch(searchstring){
    if ((searchstring=="") || (searchstring=="Product name"))
    {
        alert("Please fill in a product name/keyword")
        return false;
    }
    else
    {
        return true;
    }
}

function chooseBrand(selectedBrand) {
	if (selectedBrand.value != 'choosebrand') { window.location=selectedBrand.value } 
}

function ToggleDisplay(objectid) {
	var object=document.getElementById(objectid)
	if (object.style.display=="none")
	{
		object.style.display="block"
	}
	else
	{
		object.style.display="none"
	}
}

function submitForm(FormID) {
	var f;
	
	f = document.getElementById(FormID);
	
	f.submit();
	
	return true;
}

function toggle() {

    male = document.getElementById('MaleContent')
    female = document.getElementById('FemaleContent')
    maletxt = document.getElementById('top10Mtxt')
    femaletxt = document.getElementById('top10Ftxt')


    if (female.style.display == 'none') {
        female.style.display = '';
        femaletxt.style.color = '#FFFFFF';
        male.style.display = 'none';
        maletxt.style.color = '#A9A9A9';

    }
    else {
        female.style.display = 'none';
        femaletxt.style.color = '#A9A9A9';
        male.style.display = '';
        maletxt.style.color = '#FFFFFF';

    }

}

function setmain(storyno) {

    for (var i = 1; i <= 5; i++) {
        if (storyno == i) {
            window.document.getElementById("main_link" + i).style.display = '';
            //window.document.getElementById('tab' + i).style.backgroundColor = '#cccccc';
            window.document.getElementById('tab' + i).style.backgroundImage = "url(images/2010a/mainbanner_arrow.gif)";
            window.document.getElementById('tab1').style.backgroundRepeat = "no-repeat";
	          window.document.getElementById('tab1').style.backgroundPosition = "right center";
            //window.document.getElementById("tabb" + i).style.backgroundColor = '#cccccc';
            window.document.getElementById("tabb" + i).style.backgroundImage = "url(images/2010a/mainbanner_rightgrey.gif)";
        }
        else {
            window.document.getElementById("main_link" + i).style.display = 'none';
            window.document.getElementById('tab' + i).style.backgroundColor = '#ffffff';
            window.document.getElementById('tab' + i).style.backgroundImage = '';
            window.document.getElementById('tabb' + i).style.backgroundImage = 'url(images/2010a/mainbanner_lightgrey.gif)';
            //window.document.getElementById("tabb" + i).style.backgroundColor = '#f7f7f7';
        }
    }

}

function rotateoffers() {

    if (!inoffer) {

        for (var i = 1; i <= 4; i++) {
            if (dispoffer == i) {
                window.document.getElementById("main_link" + i).style.display = '';
                //window.document.getElementById('tab' + i).style.backgroundColor = '#cccccc';
                window.document.getElementById('tab' + i).style.backgroundImage = "url(images/2010a/mainbanner_arrow.gif)";
                window.document.getElementById('tab1').style.backgroundRepeat = "no-repeat";
	              window.document.getElementById('tab1').style.backgroundPosition = "right center";
                //window.document.getElementById("tabb" + i).style.backgroundColor = '#cccccc';
                window.document.getElementById("tabb" + i).style.backgroundImage = "url(images/2010a/mainbanner_rightgrey.gif)";
            }
            else {
                window.document.getElementById("main_link" + i).style.display = 'none';
                window.document.getElementById('tab' + i).style.backgroundColor = '#ffffff';
                window.document.getElementById('tab' + i).style.backgroundImage = '';
                //window.document.getElementById("tabb" + i).style.backgroundColor = '#f7f7f7';
                window.document.getElementById('tabb' + i).style.backgroundImage = 'url(images/2010a/mainbanner_lightgrey.gif)';
            }
        }

        dispoffer++;

        if (dispoffer == 5) {
            dispoffer = 1;
        }

    }

}

function rotateNews() {

    for (var i = 1; i <= totstories; i++) {
        if (storyno == i) {
            window.document.getElementById("story" + i).style.display = '';
        }
        else {
            window.document.getElementById("story" + i).style.display = 'none';
        }
    }

    storyno++;

    if (storyno == (totstories + 1)) {
        storyno = 1;
    }

}
