// JavaScript Document

function getHTTPObject() 
	{ 
		var xmlhttp; //declare the variable to hold the object.		
		try 
			{ 	
				var browser = navigator.appName; //find the browser name
				if(browser == "Microsoft Internet Explorer"){
					/* Create the object using MSIE's method */					
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				}else{
					/* Create the object using other browser's method */
					xmlhttp = new XMLHttpRequest();
				}				
			} 
			catch (e) 
			{ 
				xmlhttp = false;
			} 
		return xmlhttp; 
	}
	
	var http = getHTTPObject();
	var form_submit_id = "";
	var form_qty = "";
function DisableSubmit(form_id,qty)
{
	form_qty = qty;
	form_submit_id = form_id;
	//alert(form_id);
	http = getHTTPObject();
	var url="style/set_session.php";
	//alert(url);
	http.open("GET",url,true);
	http.onreadystatechange = gotSessionId;
	http.send(null);
}
function gotSessionId() 
{
	//http = getHTTPObject();
	switch(http.readyState)
	{
		case 4: 
			//alert(form_submit_id);
			//alert(http.responseText);
			document.getElementById(form_submit_id+"--sid").value = http.responseText;
			//alert(document.getElementById(form_submit_id+"--sid").value);
			if(form_qty)
			{ document.getElementById(form_submit_id+"--quantity").value = form_qty; }
			//alert(document.getElementById(form_submit_id+"--sid").value);
			document.getElementById(form_submit_id).submit();
			//document.getElementById("session_set_id").innerHTML = http.responseText;
			break;
		default: 
			//document.getElementById1(id).innerHTML = "Loading...";
			break;
	}
}