//*** CONEXIÓN AJAS DEL CARRITO ***
function shiftBuyButton(theUrl) {
	//Mostramos el carrito y lo iluminamos
	var cartBlock = Ext.get('block-Carrito');
	cartBlock.show();
	var cartContent = cartBlock.last();
	cartContent.highlight('#ee934a');

	//Generación del objeto
	var costePeque = Ext.get('costePeque');
	var proxy = document.createElement('div');
	var cuerpoRef = document.getElementsByTagName("body")[0];
	cuerpoRef.appendChild(proxy);
	//Ext.DomHelper.append('parent-div', {tag: 'div', cls: 'new-div-cls', id: 'new-div-id'});
	
	var proxyElement = Ext.get(proxy);
	proxyElement.update(costePeque.dom.innerHTML);
	proxyElement.applyStyles({position:'absolute','z-index':2000});
	proxyElement.setXY(costePeque.getXY());

	//Animamos el producto hasta el carrito
	var opt = {
		duration: 2,
		remove: true,
		callback: updateCart.createCallback(theUrl),
		xy: cartContent.getXY()
	};
	proxyElement.shift(opt);

	//Actualizamos el carrito cuando llegue el producto
	//setTimeout("updateCart('" + theUrl + "')", 2000);
}

//Funcion de actualización del carrito
function updateCart(theUrl) {
	var cartContent = Ext.get('block-Carrito').last();

	//Efecto en al carrito a la llegada
	cartContent.highlight('#84ee84');

	//Actualización del carrito
	cartContent.load({
		url: theUrl,
		text: "Actualizando carrito...",
		timeout: 10
	});
}


//******************************************
//*** VENTANA DE CARACTERISTICAS ***
function updateWin(theUrl, title, width, height) {
	var win = new Ext.Window({
	    title: '',
	    width: 800,
	    height: 600,
	    closeAction: 'close',
	    autoScroll: true,
	    modal: true,
	    bodyStyle: 'background-color:#fff;padding:10px;'
	});

	win.setTitle(title);
	win.setSize(width, height);
	win.show();
	win.center();
	
	win.load({
	    url: theUrl,
	    text: "Cargando...",
	    timeout: 30
	});
}
