//js lib

function getxmlhttp() {
	var xmlhttp = false;
	
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	
	return xmlhttp;
}

function open_uploader(app) {
	var obj = document.getElementById("uploader");
	
	obj.style.visibility = "visible";
	
	//add value to the hidden field
	var hidden_obj = document.getElementById("app");
	hidden_obj.value = app;
}

function close_uploader() {
	var obj = document.getElementById("uploader");
	
	obj.style.visibility = "hidden";
	
	//default value to the hidden field
	var hidden_obj = document.getElementById("app");
	hidden_obj.value = 0;
	
	var frameobj = document.getElementById("uploadframe");
	frameobj.style.visibility = "hidden";
	frameobj.style.height = "1px";
}

function upload_ajax(theform) {
	var frameobj = document.getElementById("uploadframe");
	frameobj.style.visibility = "visible";
	frameobj.style.height = "75px";
	
	theform.submit();
}
