function resizeFoto(src, goods_id,imid){
if (src==imgmode0[imid]){src=imgmode1[imid];
  document.getElementById(imid).title="уменьшить";
  if (goods_id != "0"){document.getElementById('good'+goods_id+'').src="/inc/popular_stat.php?goods_id="+goods_id;}
  }
  else if (src==imgmode1[imid]){src=imgmode0[imid];document.getElementById(imid).title="увеличить";}
  document.getElementById(imid).src=src;
}

function PutGoods(g_i, pcount, id){
imgload=1;if (g_i!=''&&pcount!=''&&id!=''){
var p_src='/korquick.php?rand='+Math.random()+
'&func=buy&buy_id='+id;
 i=0;
 i1=1;
  while (i!=pcount){
    if (document.getElementById('quantity_'+g_i+'_'+i)){
    p_src=p_src+'&quant'+i1+'='+document.getElementById('quantity_'+g_i+'_'+i).value+'&indat'+i1+'='+document.getElementById('indate_'+g_i+'_'+i).value+'&outdat'+i1+'='+document.getElementById('outdate_'+g_i+'_'+i).value;
    document.getElementById('quantity_'+g_i+'_'+i).disabled=true;
    document.getElementById('indate_'+g_i+'_'+i).disabled=true;
    document.getElementById('outdate_'+g_i+'_'+i).disabled=true;
    if(document.getElementById('check_'+g_i+'_'+i).checked){
	  p_src=p_src+'&opt'+i1+'=1';
	}
	document.getElementById('check_'+g_i+'_'+i).disabled=true;}
	else {pcount++;}
   i++;
    i1++;
}
document.getElementById('put_'+g_i).src=p_src;
document.getElementById('submit_'+g_i).value='Помещено в корзину';
document.getElementById('submit_'+g_i).disabled=true;
document.getElementById('submit_out_'+g_i).disabled=false;
alert('Товар "'+g_n[g_i]+'" помещен в корзину! Состояние Вашей корзины вы можете узнать в верхней левой части сайта. В случае, если Ваша корзина остается пустой, это означает, что у Вас отключены cookies.');
//document.getElementById('good'+id).src='/inc/popular_stat.php?rand='+Math.random()+'&goods_id='+id;
  return false;}
}
function AwayGoods(g_i, pcount, id){
imgload=1;
var a_src='/korquick.php?rand='+Math.random()+
'&func=kor&kor_id='+id+'&kor_act=Убрать';
document.getElementById('put_'+g_i).src=a_src;
document.getElementById('submit_'+g_i).value='Поместить отмеченное в корзину';
document.getElementById('submit_'+g_i).disabled=false;
document.getElementById('submit_out_'+g_i).disabled=true;
i=0;
  while (i!=pcount){
    if (document.getElementById('quantity_'+g_i+'_'+i)){
    document.getElementById('quantity_'+g_i+'_'+i).disabled=false;
    document.getElementById('indate_'+g_i+'_'+i).disabled=false;
    document.getElementById('outdate_'+g_i+'_'+i).disabled=false;
	document.getElementById('check_'+g_i+'_'+i).disabled=false;}
	else {pcount++;}
    i++;
}
alert('Товар "'+g_n[g_i]+'" убран из корзины! Состояние Вашей корзины вы можете узнать в верхней левой части сайта. В случае, если Ваша корзина остается пустой, это означает, что у Вас отключены cookies.');
  return false;
}
function RefreshKor(){
  if (imgload==1){
 document.getElementById('kor_state').innerHTML='<font color="565656">Данные обновляются...</font><br><br>';var myConn = new XHConn();var fnWhenDone = function(oXML) {document.getElementById('kor_state').innerHTML = oXML.responseText; return false;};myConn.connect("/inc/kor_left_refresh.php", "POST", "", fnWhenDone);}
}
// Важно: XHconn требует совпадения url