function js1(id)
{
	var cat1 = document.getElementById("cat1");
   var radios  = cat1.getElementsByTagName("a");
	for(var k = 0; k < radios.length; k++){
		if(radios[k].id == id){
		radios[k].className = "cat_s";
		}
		else
		{
			radios[k].className = "cat";
		}
	}
	
	JsHttpRequest.query(
	'cat_back.php', // backend
	{
       'type': 1,
		 'div': id
   },
	function(result) {
   	if (result) {
			document.getElementById("cat2").innerHTML = 
				'<div style="background-image:url(images/scroll_05.jpg); background-repeat:no-repeat; background-position:right; padding-top:3px; padding-bottom:3px;"><div style="width:110px; height:120px; overflow-x:hidden; overflow-y:auto;" class="cat">' + result["text2"] + '</div></div>';
			document.getElementById("cat3").innerHTML = 
					'<div style="background-image:url(images/scroll_05.jpg); background-repeat:no-repeat; background-position:right; padding-top:3px; padding-bottom:3px;"><div style="width:110px; height:120px; overflow-x:hidden; overflow-y:auto;" class="cat"></div></div>';
			document.getElementById("cat4").innerHTML = 
               '<div style="width:70px; height:126px; overflow-x:hidden; overflow-y:auto; background-image:url(images/scroll_05.jpg); background-repeat:no-repeat; background-position:right;" class="cat"></div>';
			document.getElementById("cat5").innerHTML = '<table border="0" cellpadding="0" cellspacing="0" width="100%" height=79 style="table-layout:fixed;"><tr><td width=3 height="3"><img src="images/scrcor_lt.jpg" width="3" height="3"></td><td height="3" background="images/scrln_t.jpg" style="background-repeat:repeat-x;"><img src="images/spacer.gif" width="1" height="3"></td><td width=3 height="3"><img src="images/scrcor_rt.jpg" width="3" height="3"></td></tr><tr><td width=3 background="images/scrln_l.jpg" style="background-repeat:repeat-y;"><img src="images/spacer.gif" width="3" height="1"></td><td><img src="images/spacer.gif" width="1" height="3"></td><td width=3 background="images/scrln_r.jpg" style="background-repeat:repeat-y;"><img src="images/spacer.gif" width="3" height="1"></td></tr><tr><td width=3 height="3"><img src="images/scrcor_lb.jpg" width="3" height="3"></td><td height="3" background="images/scrln_b.jpg" style="background-repeat:repeat-x;"><img src="images/spacer.gif" width="1" height="3"></td><td width=3 height="3"><img src="images/scrcor_rb.jpg" width="3" height="3"></td></tr></table><table border="0" cellpadding="0" cellspacing="0" width="100%" height=47><tr><td width="50%" align="center"><img src="images/pic1.jpg" width="46" height=47></td><td width="50%" align="center" valign="bottom"><img src="images/pic2.jpg" width="46" height=46></td></tr></table>';
   	}
   },
   false  // do not disable caching
	);
}
function js2(id)
{
	var cat2 = document.getElementById("cat2");
   var radios  = cat2.getElementsByTagName("a");
	for(var k = 0; k < radios.length; k++){
		if(radios[k].id == id){
		radios[k].className = "cat_s";
		}
		else
		{
			radios[k].className = "cat";
		}
	}
	
	JsHttpRequest.query(
	'cat_back.php', // backend
	{
       'type': 2,
		 'div': id
   },
	function(result) {
   	if (result) {
			document.getElementById("cat3").innerHTML = 
               '<div style="background-image:url(images/scroll_05.jpg); background-repeat:no-repeat; background-position:right; padding-top:3px; padding-bottom:3px;"><div style="width:110px; height:120px; overflow-x:hidden; overflow-y:auto;" class="cat">' + result["text3"] + '</div></div>';
			document.getElementById("cat4").innerHTML = 
               '<div style="width:70px; height:126px; overflow-x:hidden; overflow-y:auto; background-image:url(images/scroll_05.jpg); background-repeat:no-repeat; background-position:right;" class="cat"></div>';
			document.getElementById("cat5").innerHTML = '<table border="0" cellpadding="0" cellspacing="0" width="100%" height=79 style="table-layout:fixed;"><tr><td width=3 height="3"><img src="images/scrcor_lt.jpg" width="3" height="3"></td><td height="3" background="images/scrln_t.jpg" style="background-repeat:repeat-x;"><img src="images/spacer.gif" width="1" height="3"></td><td width=3 height="3"><img src="images/scrcor_rt.jpg" width="3" height="3"></td></tr><tr><td width=3 background="images/scrln_l.jpg" style="background-repeat:repeat-y;"><img src="images/spacer.gif" width="3" height="1"></td><td><img src="images/spacer.gif" width="1" height="3"></td><td width=3 background="images/scrln_r.jpg" style="background-repeat:repeat-y;"><img src="images/spacer.gif" width="3" height="1"></td></tr><tr><td width=3 height="3"><img src="images/scrcor_lb.jpg" width="3" height="3"></td><td height="3" background="images/scrln_b.jpg" style="background-repeat:repeat-x;"><img src="images/spacer.gif" width="1" height="3"></td><td width=3 height="3"><img src="images/scrcor_rb.jpg" width="3" height="3"></td></tr></table><table border="0" cellpadding="0" cellspacing="0" width="100%" height=47><tr><td width="50%" align="center"><img src="images/pic1.jpg" width="46" height=47></td><td width="50%" align="center" valign="bottom"><img src="images/pic2.jpg" width="46" height=46></td></tr></table>';
   	}
   },
   false  // do not disable caching
	);
}
function js3(id)
{
	var cat3 = document.getElementById("cat3");
   var radios  = cat3.getElementsByTagName("a");
	for(var k = 0; k < radios.length; k++){
		if(radios[k].id == id){
		radios[k].className = "cat_s";
		}
		else
		{
			radios[k].className = "cat";
		}
	}
	
	JsHttpRequest.query(
	'cat_back.php', // backend
	{
       'type': 3,
		 'div': id
   },
	function(result) {
   	if (result) {
			document.getElementById("cat4").innerHTML = 
               '<div style="background-image:url(images/scroll_05.jpg); background-repeat:no-repeat; background-position:right; padding-top:3px; padding-bottom:3px;"><div style="width:70px; height:120px; overflow-x:hidden; overflow-y:auto;" class="cat">' + result["text4"] + '</div></div>';
			document.getElementById("cat5").innerHTML = '<table border="0" cellpadding="0" cellspacing="0" width="100%" height=79 style="table-layout:fixed;"><tr><td width=3 height="3"><img src="images/scrcor_lt.jpg" width="3" height="3"></td><td height="3" background="images/scrln_t.jpg" style="background-repeat:repeat-x;"><img src="images/spacer.gif" width="1" height="3"></td><td width=3 height="3"><img src="images/scrcor_rt.jpg" width="3" height="3"></td></tr><tr><td width=3 background="images/scrln_l.jpg" style="background-repeat:repeat-y;"><img src="images/spacer.gif" width="3" height="1"></td><td><img src="images/spacer.gif" width="1" height="3"></td><td width=3 background="images/scrln_r.jpg" style="background-repeat:repeat-y;"><img src="images/spacer.gif" width="3" height="1"></td></tr><tr><td width=3 height="3"><img src="images/scrcor_lb.jpg" width="3" height="3"></td><td height="3" background="images/scrln_b.jpg" style="background-repeat:repeat-x;"><img src="images/spacer.gif" width="1" height="3"></td><td width=3 height="3"><img src="images/scrcor_rb.jpg" width="3" height="3"></td></tr></table><table border="0" cellpadding="0" cellspacing="0" width="100%" height=47><tr><td width="50%" align="center"><img src="images/pic1.jpg" width="46" height=47></td><td width="50%" align="center" valign="bottom"><img src="images/pic2.jpg" width="46" height=46></td></tr></table>';
   	}
   },
   false  // do not disable caching
	);
}
function js4(id)
{
	var cat4 = document.getElementById("cat4");
   var radios  = cat4.getElementsByTagName("a");
	for(var k = 0; k < radios.length; k++){
		if(radios[k].id == id){
		radios[k].className = "cat_s";
		}
		else
		{
			radios[k].className = "cat";
		}
	}
	
	JsHttpRequest.query(
	'cat_back.php', // backend
	{
       'type': 4,
		 'div': id
   },
	function(result) {
   	if (result) {
			document.getElementById("cat5").innerHTML = result["text5"];
   	}
   },
   false  // do not disable caching
	);
	
}

function list_cart(id)
{
	  var req = new Subsys_JsHttpRequest_Js();
     req.onreadystatechange = function()
     {
          if (req.readyState == 4)
          {
               //alert(req.responseJS.text);
			   document.getElementById('cart_info').innerHTML = req.responseJS.rez_text;
          }
     }
     req.caching = false;
     req.open('GET', 'list_cart.php', true);
     req.send({ good_id: id });
	
     return false;
}
function list_pic(good_id,id)
{
	  var req = new Subsys_JsHttpRequest_Js();
     req.onreadystatechange = function()
     {
          if (req.readyState == 4)
          {
               //alert(req.responseJS.text);
			   document.getElementById('cart_info').innerHTML = req.responseJS.rez_text;
          }
     }
     req.caching = false;
     req.open('GET', 'list_pic.php', true);
     req.send({ good_id: good_id, id: id });
     return false;
}

function DelGood(id,col)
{
	  var req = new Subsys_JsHttpRequest_Js();
     req.onreadystatechange = function()
     {
          if (req.readyState == 4)
          {
               //alert(req.responseJS.text);
					//alert(req.responseJS.rez_text);
			   document.getElementById('cart_info').innerHTML = req.responseJS.rez_text;
          }
     }
     req.caching = false;
     req.open('GET', 'del_back.php', true);
     req.send({ good_id: id , count: col});
	
     return false;
}
function sold()
{
	alert("Невозможно добавить этот товар в корзину!");
}
