function setCart(_action,value,obj) {
	//show preloader
   	pos = getPosition(obj);
    if(_action=='addItem')
		showBlock(document.getElementById('cartloader'),pos['x'],pos['y']-70,'show'); 		
    if((_action=='remItem') || (_action=='refreshCart')){
	    pos = getWindowCenter();
		showBlock(document.getElementById('cartloader'),pos['x']-20,pos['y']-20,'show'); 		
    }  
		
	//запрос      	
    JsHttpRequest.query('/shop/ajax/php/cart_loader.php', {'_action': _action, 'item': value},
    //обработчик результата
    function(result, errors) {
		//hide preloader
		document.getElementById('cartloader').style.display = 'none';
        //
        if(_action=='addItem'){
			document.getElementById('cartloader').style.display = 'none';    				
            document.getElementById('Basket').innerHTML = result["contentBlock"];
        	//
        	
			showBlock(document.getElementById('addItemConfirm'),pos['x']-70,pos['y']-100,'show');
			setTimeout("showBlock(document.getElementById('addItemConfirm'),1,1,'hide');",10000);
        }
        if((_action=='remItem') || (_action=='refreshCart')){
			document.getElementById('cartloader').style.display = 'none';    				
            document.getElementById('cartdetail').innerHTML = result["contentBlock"];
            document.getElementById('Basket').innerHTML = result["addBlock"];
        }		
        //ошибки при отладке
		if(errors) alert(errors);
		
	},true);
}
//
function showImageBlock(obj,iw,ih,img,title){
	//
	pos = getPosition(obj);
	winx = parseInt(pos['x']-iw/2);
	winy = parseInt(pos['y']-ih/2);
	//
	document.getElementById('imgBlock').style.width = iw+'px';  
	document.getElementById('imgBlock').style.height = (ih+25)+'px';  
	document.getElementById('imgBlock').style.left = winx+'px';  
	document.getElementById('imgBlock').style.top = winy+'px';  
	document.getElementById('imgBlockOut').src = img;  
	document.getElementById('imgBlockTitle').innerHTML = title;  
	document.getElementById('imgBlock').style.display = 'block';  
}