var xmlHttp
var bCount = 0;
var bID
bID = 0

var confirmDivID
confirmDivID = 0

function getSizes(colourID){ 


	var colourRefID = colourID.split(",");

	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	var url="ajax_sizes.asp?colourID="+colourRefID[0]	
	url=url+"&sid="+Math.random()
		
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
}


function stateChanged(){ 	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 		
		document.getElementById("ajaxSizes").innerHTML=xmlHttp.responseText
		setStock();
	} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}


// -------------------------------------
// Andrew Scott - 03/02/06
// -------------------------------------
//	function to control Nav
// -------------------------------------

function showNav(navID,linkName){

	var navID = document.getElementById(navID);
	var linkName = document.getElementById(linkName);
	
	// get an Array of all Nav IDs used
	var navArray = new Array(new Array('netballs','netballsLink'),
		new Array('clothing','clothingLink'),
		new Array('bags','bagsLink'),
		new Array('accessories','accessoriesLink')
	);
	var navArray = new Array(new Array('netballs','netballsLink'));
		var i=0; 
		
		// This gets the current Class of the selected Nav. This is to work out whether to close the menu or open it
		var currentState = navID.className;
		
		// Firstly, close all navs - we will then determine what to do
		for (i=0; i<1; i++) { 
			// if the array nav to change is the same as the one which has been clicked then don't do this bit
			
			if(navArray[i][0]!=navID){
				document.getElementById(navArray[i][0]).className = 'hidden';
				document.getElementById(navArray[i][1]).className = '';
			}
		} 
	// if the nav class is 'display (i.e. it is open) then set it to 'hidden' (i.e. closed)
		if (currentState == 'display'){
			navID.className = 'hidden';
			linkName.className = 'a';
		}else{
			navID.className = 'display';
			linkName.className = 'currentItem';
		}
}
	function checkSearch(){
	txtKeywordAd = document.fmSearch.txtKeywordAd
	
	
	if (txtKeywordAd.value == "" || txtKeywordAd.value == "Product Search"){
		alert("Please enter a search term")
		return(false);
	}else{
		document.fmSearch.submit();	
	}
}


