function shopAppend(id){
	var f=document.forms['shop'];
	f.oid.value = '';
	f.ok.setAttribute('disabled','true');
	f.action = "/cms/shop/shop_add.html";
	f.target = "_self";
	f.submit();
}
function shopEdit(id){
	var f=document.forms['shop'];
	f.oid.value = id;
	f.ok.setAttribute('disabled','true');
	f.action = "/cms/shop/shop_edit.html";
	f.target = "_self";
	f.submit();
}
function shopCopy(id){
	var f=document.forms['shop'];
	f.oid.value = id;
	f.ok.setAttribute('disabled','true');
	f.action = "/cms/shop/shop_add.html";
	f.target = "_self";
	f.submit();
}
function shopDelete(id, caption){
	var f=document.forms['shop'];
	if(confirm(f.message_delete.value+" "+caption+"?")){
		f.oid.value = id;
		f.ok.removeAttribute('disabled');
		f.action = "/cms/shop/shop_unpublish.html";
		f.target = "_hidden";
		f.submit();
		document.getElementById('shop_li_'+id).style.display = 'none';
	}
}
function shopPut(id){
/*	var f=document.forms['shop'];
	f.oid.value = id;
	f.ok.setAttribute('disabled','true');
	f.action = "/rus/basket/put.html";
	f.target = "_hidden"; */
	var q = document.getElementById('shop_basket_quantity');
	q.innerHTML=parseInt(q.innerHTML)+1;
	window.open('/rus/basket/?action=put&oid='+id,'_self')
/*	f.submit(); 
/*	window.open("/rus/basket/","_self"); */
}
function shopPrevImage(){
	iCurImage--;
	if(iCurImage<0){
		iCurImage = aImages.length-1;
	}
	shopShowImage()
}
function shopNextImage(){
	iCurImage++;
	if(iCurImage>aImages.length-1){
		iCurImage = 0;
	}
	shopShowImage()
}
function shopShowImage(){
	var iAmp = aImages[iCurImage][2]/200;
	document.getElementById('image').width = 200;
	document.getElementById('image').height = aImages[iCurImage][3]/iAmp;
	document.getElementById('image').src = aImages[iCurImage][0];
	document.getElementById('image_cur').innerHTML = iCurImage+1;
}
function shopZoomImage(){
	i = document.getElementById('image');
	window.open(aImages[iCurImage][1],"_image_"+iCurImage,"width="+aImages[iCurImage][2]+",height="+aImages[iCurImage][3]);
}