	
	//functions.js
	
	//Create a boolean variable to check for a valid MS instance.
	var xmlhttp = false;
	
	//Check if we are using IE.
	try {
		//If the javascript version is greater than 5.
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		//If not, then use the older active x object.
		try {
			//If we are using IE.
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			//Else we must be using a non-IE browser.
			xmlhttp = false;
		}
	}
	
	//If we are using a non-IE browser, create a javascript instance of the object.
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	
	function checkfortasks (id, e){
		
		Tip('<img src = \'images/icon/ajax-loader.gif\' border = 0 align = \'middle\' > &#272;ang Load d&#7919; li&#7879;u ... ', WIDTH, 300, TITLE, 'Th&#244;ng tin', BGCOLOR, '#DAD8E3', FONTSIZE, '8pt', FONTFACE, 'Tahoma', BORDERCOLOR, '#999999');
		
		document.getElementById("taskbox").style.visibility = "visible";
		document.getElementById("taskbox").style.display = 'none';
		
		serverPage = "classes/product/previewProduct.php?id=" + id;
		objID = "taskbox";
		
		var obj = document.getElementById(objID);
		
		//obj.innerHTML = "<img src = 'images/icon/ajax-loader.gif' border = 0 >";
		
		xmlhttp.open("GET", serverPage,true);
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
				obj.innerHTML = xmlhttp.responseText;
				Tip(obj.innerHTML, WIDTH, 300, TITLE, 'Th&#244;ng tin', BGCOLOR, '#DAD8E3', FONTSIZE, '8pt', FONTFACE, 'Tahoma', BORDERCOLOR, '#999999');
			}
		}
		
		xmlhttp.send(null);
	}
	
	function hidetask (){
		tObject = document.getElementById("taskbox");
		
		tObject.style.visibility = "hidden";
		tObject.style.height = "0px";
		tObject.style.width = "0px";
	}
