function show(url, winname, w, h){
	window.open(url, winname, "scrollbars=yes, resizable=yes, width="+w+", height="+h);
}

function loadHTML(sURL)
{
  var request=null;
  if(!request) try {
    request=new activeXObject('Msxml2.XMLHTTP');
  } catch (e){}
  if(!request) try {
    request=new activeXObject('Microsoft.XMLHTTP');
  } catch (e){}
  if(!request) try {
    request=new XMLHttpRequest();
  } catch (e){}
  if(!request)
    return "";
  request.open('GET', sURL, false);
  request.send(null);
  return request.responseText;
}

function initarray() 
{
	    this.length = initarray.arguments.length
	    for (var i = 0; i < this.length; i++)
		this[i+1] = initarray.arguments[i]
}

colorList = new initarray( "000000", "362929", "6a3939", "a43737", "FF0000", "FF0000", 
                           "FF0000", "FF0000", "a43737", "6a3939", "362929", "000000");
var currentColor = 1;
function korzinaChanger()
{
	    document.getElementById('korzina').style.color = colorList[currentColor];
	    if (currentColor++ < 12)
		setTimeout("korzinaChanger()", 70);
}
	
function addkorzina(idtov, cat, cnt)
{
  var sURL = "/addkorzina.phtml?idtov="+idtov+"&cat="+cat+"&cnt="+cnt;
  document.getElementById('korzina').innerHTML=loadHTML(sURL);
  //currentColor = 1;
  //korzinaChanger();
}

function loadkorzina()
{
  var sURL = "korzina.phtml";
  document.getElementById('main').innerHTML=loadHTML(sURL);

  document.getElementById('captionmain').innerHTML="Корзина";

  document.getElementById('toolmain').innerHTML="";

  document.title.innerHTML="Корзина";
}

function loadprice(tdcell, idtovar, idcatalog)
{
  var sURL = "price.phtml?idtovar="+idtovar+"&idcatalog="+idcatalog;
  tdcell.innerHTML=loadHTML(sURL);
}

function delkorzina(idpoz)
{
  var sURL = "delkorzina.phtml?idpoz="+idpoz;
  document.getElementById('korzina').innerHTML=loadHTML(sURL);
  sURL = "korzina.phtml";
  document.getElementById('main').innerHTML=loadHTML(sURL);
  currentColor = 1;
  korzinaChanger();
  
}

function deletekorzina()
{
  sURL = "deletekorzina.phtml";
  document.getElementById('main').innerHTML=loadHTML(sURL);
  addkorzina();
}

function savekorzina(parametr)
{
  var sURL = "savekorzina.phtml?"+parametr;
  document.getElementById('main').innerHTML=loadHTML(sURL);
  document.getElementById('korzina').innerHTML="";
}

function _onscroll()
{
  document.getElementById('konteiner').style.top=document.body.scrollTop;
}

function checkkorzinaform()
{
   if ( (document.form10.email.value!="") || (document.form10.tel.value!=""))
    {
      document.form10.submit1.disabled=false;
	}
} 

function _onresize() {
  var w1;
  
  w1 = (document.body.clientHeight-260);
  if (w1<0) {w1=1;}
  document.getElementById("maindiv").style.height=w1;

  w1 = (document.body.clientWidth-200);
  if (w1<0) {w1=1;}
  document.getElementById("maindiv").style.width=w1;
 }