// JavaScript Document
var fName

function dirgetselect(dirCatID, fieldName) { 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="includes/dirgetselect.php"
	url=url+"?dirCatID="+dirCatID
	url=url+"&fieldName="+fieldName
	
	switch(fieldName){
		case 'dirCatID': fName='divdirSubCatID'
		break
		case 'dirCatID2': fName='divdirSubCatID2'
		break
		case 'dirCatID3': fName='divdirSubCatID3'
		break
	}
	
	xmlHttp.onreadystatechange=dirStateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function dirgetselect2(dirCatID, fieldName) { 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="includes/dirgetselect2.php"
	url=url+"?dirCatID="+dirCatID
	
	switch(fieldName){
		case 'dirCatID': fName='divdirSubCatID'
		break
		case 'dirCatID2': fName='divdirSubCatID2'
		break
		case 'dirCatID3': fName='divdirSubCatID3'
		break
	}
	
	xmlHttp.onreadystatechange=dirStateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function dirStateChanged(){ 
	//alert('document.getElementById(\'' + fName + '\').innerHTML=xmlHttp.responseText')
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		eval('document.getElementById(\'' + fName + '\').innerHTML=xmlHttp.responseText')
	} 
} 
