var mkwin = false;
var resp = /%20/g;
function gen_qstr(form) 
{
	if(!form) { form = document.forms[0]; }
	
	var qstr = "";
	var tmp = "";
	var txt = "";
	fl =  form.elements.length;
	for(i=0;i<fl;i++) {
	  el = form.elements[i];
	 if((el.type == 'text' && el.value.length > 0) || (el.type == 'checkbox' && el.checked == true) ||
	  (el.type == 'textarea' && el.value.length > 0) || (el.type == 'radio' && el.checked == true) ||
	   (el.type == 'hidden' && el.value.length > 0)) {
	   tmp = el.name+'='+escape(el.value)+'&';}
	 if(el.selectedIndex != undefined && el.selectedIndex != -1){
	   for(j=0;j<el.options.length;j++) { if(el.options[j].selected == true) {
	  tmp += el.name+'='+escape(el.options[j].value)+'&'; }}}
	if(tmp.length > 0) { qstr += tmp;  tmp = "";}}
	qstr = qstr.substring(0,qstr.length - 1);
	
	return qstr.replace(resp,"+");
  
}
//////////////////////////////////////////////////////////////////////////
function buildQueryString(theFormName) 
{
	return gen_qstr(document.getElementById(theFormName));
}




var xmlHttp;

function storeaaa()
{ 
document.getElementById("txtHinta").innerHTML="";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="_zonefirst.asp"
url=url+"?sid="+Math.random()
//alert(url);
xmlHttp.onreadystatechange=stateChangeda
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function storebbb()
{ 
document.getElementById("txtHintb").innerHTML="";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="_zone2.asp"

url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedb
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function storeccc()
{ 
document.getElementById("txtHintc").innerHTML="";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="_zone3.asp"
alert (buildQueryString("theform"));
url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedc
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function storeorder(act,id,comment)
{ 
var act;
var id;
document.getElementById("txtHintd").innerHTML="";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="_zone4.asp"
//alert (buildQueryString("theform"));
url=url+"?act="+act+"&id="+id+"&comment="+comment
url=url+"&sid="+Math.random()

//alert(url);

xmlHttp.onreadystatechange=stateChangedd
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function storeddd(str)
{ 
document.getElementById("txtHintd2").innerHTML="";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="_zone5.asp?idprod="+str
//alert (str);
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedd2
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function stateChangeda() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHinta").innerHTML=xmlHttp.responseText 
} 
} 

function stateChangedb() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHintb").innerHTML=xmlHttp.responseText 
} 
} 

function stateChangedc() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHintc").innerHTML=xmlHttp.responseText 
} 
} 

function stateChangedd() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHintd").innerHTML=xmlHttp.responseText 
} 
} 

function stateChangedd2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtHintd2").innerHTML=xmlHttp.responseText 
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}