var ajax_return_function = new Array;
var ajax_results = '';
	function ajaxConnection(url, return_function, method, data) {
			if (method == null) {
				method = 'GET';
			}
			
		ajax_return_function[ajax_return_function.length] = return_function;
		ajax_results = '';
		var xmlHttp;
			try {
				// Firefox, Opera 8.0+, Safari
				xmlHttp=new XMLHttpRequest();
			}
			catch (e) {
				// Internet Explorer
				try {
					xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch (e) {
					try {
						xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch (e) {
						//alert("Your browser does not support AJAX!");
						return false;
					}
				}
			}
			xmlHttp.onreadystatechange=function() {
				if(xmlHttp.readyState==4) {
					ajax_results = xmlHttp.responseText;
						if ((ajax_return_function.length > 0) && (ajax_return_function[0] != null)) {
							var run_function = ajax_return_function.shift();
							eval(run_function);
							ajax_results = '';
						}
				}
			}
			
		xmlHttp.open(method,url,true);
			if (method == 'POST') {
				xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			}
		xmlHttp.send(data);
	}
	
	function check_ajax() {
		var return_var = false;
		var xmlHttp;
			try {
				// Firefox, Opera 8.0+, Safari
				return_var = true;
			}
			catch (e) {
				// Internet Explorer
				try {
					return_var = true;
				}
				catch (e) {
					try {
						return_var = true;
					}
					catch (e) {
						//alert("Your browser does not support AJAX!");
						return_var = true;
					}
				}
			}
		return return_var;
	}
	
	function update_contents(id, contents, timeout_function, timeout, url) {
			if (contents == null) {
				return;
			}
			if (!document.getElementById(id)) {
				return;
			}
		document.getElementById(id).innerHTML = contents;
		setTimeout(timeout_function+'(\''+url+'\', '+timeout+')', timeout);
		return true;
	}

	function fetch_featured_product(url, timeout) {
		var id = 'featured_product_contents';
		ajaxConnection(url, 'update_contents(\''+id+'\', ajax_results, \'fetch_featured_product\', \''+timeout+'\', \''+url+'\')');
	}