function openPopup (pp_url){
	var w = window.open(pp_url,'carrello','width=700, height=500, scrolling=auto',true);
	w.focus();
	return false;
}

function addProdotto (idprod,domain){
	openPopup('http://ecomm.alinari.it/addcarrello.php?idprod='+idprod+'&lastdomain='+domain);
	return false;
}

function acquista(domain){
	//alert('Acquista');
	replace('http://ecomm.alinari.it/carrello.php');
	replaceOpener('http://ecomm.alinari.it/dati_acquisto.php');
	focusOpener();
	//replaceOpener('http://bookshop2.alinari.it/dati_acquisto.php');
	//replaceOpener('http://bookshop2.alinari.it/go_acquisto.php');
	return false;
}

function go_acquisto(domain){
	//alert('CIao');
	//replaceOpener('http://ecomm.alinari.it/dati_acquisto.php');
	//replaceOpener('http://bookshop2.alinari.it/dati_acquisto.php');
	replace('http://'+domain+'.alinari.it/go_acquisto.php');
	return false;
}

function replaceOpener(redirectURL) {
	//alert(redirectURL);
	var d = opener.window.document;
	//var d = window.document;
	//var w = opener.window;
	
	// Procedura per reload opener page
	d.location.replace(redirectURL);
	//d.location.reload(true);
	//d.location.href = redirectURL;
	
	return false;
}

function replace(redirectURL) {
	//alert(redirectURL);
	//var d = opener.window.document;
	var d = window.document;
	//var w = opener.window;
	
	// Procedura per reload opener page
	d.location.replace(redirectURL);
	//d.location.reload(true);
	//d.location.href = redirectURL;
	
	return false;
}

function focusOpener() {
	//alert(redirectURL);
	//var d = opener.window.document;
	//var d = window.document;
	var w = opener.window;
	w.focus();
	
	// Procedura per reload opener page
	//d.location.replace(redirectURL);
	//d.location.reload(true);
	//d.location.href = redirectURL;
	
	return true;
}