
	function view_products_image_popup(map, str_url_image, i_id, i_width, i_height, str_name) {
		var image = new Image(), image_size;

		if (str_url_image.indexOf("http:")>=0) {
		} else {
			str_url_image = map + str_url_image;
		}
		if (document.getElementById('products_name_' +  i_id) != null) {
			str_name = document.getElementById('products_name_' +  i_id).innerHTML;
		}
		
		image.src = str_url_image;
		image_size = set_size_products_image_popup(i_width, i_height)
		
		document.getElementById('products_image_id_' + i_id).innerHTML = '<div style="background-color:white; padding:0px;" onMouseout=close_products_image_popup("' +  str_url_image + '","' + i_id + '"); onMousedown=close_products_image_popup("' +  str_url_image + '","' + i_id + '");><fieldset style="padding:10px;"><div class="productlist_heading" style="width:100%; height:22px; text-align:center; background-color:white;">' + str_name + '</div><div><img src="' + image.src + '" ' + image_size + '></div></fieldset></div>';
	}
	
	function close_products_image_popup(str_url_image, i_id) {
		document.getElementById('products_image_id_' + i_id).innerHTML = '';
	}
	
	function set_size_products_image_popup(i_width, i_height) {
		if (i_width>i_height) {
			size = 'width=' + i_width;
		} else if (i_height>i_width) {
			size = 'height=' + i_height;
		} else { 
			size = '';
		}
		return size;	
	}
	
	function buy_now_focus(id) {
		document.getElementById('buy_now_' + id).focus();	
		document.getElementById('buy_now_' + id).select()
	}
	
	
	//AJAX
	function view_products_text_popup(i_id) {
		document.getElementById('products_text_id_' + i_id).innerHTML = '<div style="background-color:white; padding:0px;"><fieldset style="padding:10px;"><div class="' + document.getElementById('products_class_id_hidden_' + i_id).value + 'popup_text" style="width:250px; height:22px; text-align:center;">' + document.getElementById('products_text_id_hidden_' + i_id).innerHTML + '</div></fieldset></div>';
	}
	function close_products_text_popup(i_id) {
		document.getElementById('products_text_id_' + i_id).innerHTML = '';
	}
	
	function buy_now(id) {
		document.getElementById('run_working_gif_' + id).innerHTML = "<img src='http://www.hoffmeiershop.dk/images/icons/run_working.gif'>"; document.getElementById('run_working_gif_id').value = id;
		run = setTimeout("run_waiting_image()",1000);
		
		var url ="xml_menucard_products_basket.php?ajax=get&action=update_product&products_id=" + id + "&quantity=" + document.getElementById('buy_now_' + id).value
		xmlHttp=GetXmlHttpObject()
		xmlHttp.onreadystatechange=stateChanged_add_products_category_to_db

		xmlHttp.open("GET", url, true) 
		xmlHttp.send(null) 
	}
	function stateChanged_add_products_category_to_db() {
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")	{
			xmlDoc=xmlHttp.responseXML;
		}
	}
	
	function run_waiting_image() {
		document.getElementById('run_working_gif_' + document.getElementById('run_working_gif_id').value).innerHTML = "";
		clearTimeout(run);
	}
	
	//---------------------------------------------------------------------------
	
	//HTTP
	function GetXmlHttpObject() { 
		var objXMLHttp=null
		if (window.XMLHttpRequest) {
			objXMLHttp=new XMLHttpRequest()
		} else if (window.ActiveXObject) {
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		if (objXMLHttp==null)  {
			alert ("Your browser does not support AJAX!");
			return;
		}
		return objXMLHttp
	} 


