var xmlHttp
var setAtt = new Object();
function GetXmlHttpObject() {
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}

function getDir(str, path, setup) {
	
	xmlHttp=GetXmlHttpObject();
	setAtt.path = path;
	
	setAtt.str = str;
	setAtt.setup = setup;
	
	document.getElementById(setAtt.path).innerHTML="Loading...";
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="/global/getlist.php"
	url=url+"?dir="+str+"&setup="+setup
	xmlHttp.onreadystatechange = stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	
} 

function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById(setAtt.path).innerHTML=xmlHttp.responseText 
	} 
} 

function downloadTemplate(pathLoad, getId) {
	document.getElementById(getId).innerHTML = '<a href="/global/save_image.php?path1=' + setAtt.str + '&path2=' + pathLoad + '" onclick="new Effect.Appear(document.getElementById(\'uploadTutorial\'))"><img src="/images/download.gif" title="download template" alt="download template" border="0" /></a>';
}

function browseChange(sURL) { 
	window.location.href = sURL; 
}