function caricaFoto(img){
	w=200;
	h=120;
	var left = Math.floor((screen.width-w)/2);
	var top = Math.floor((screen.height-h)/2);
	var setting="location=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no,width="+w+",height="+h+",top="+top+",left="+left;
	newWin=window.open("openimg.php?img="+img, 'popUp', setting);
	newWin.focus();
}

function gId(id){
	return document.getElementById(id);
}



function caricaFotoPhotoGallery(url) {
	wid = window.open(url, "popupimmagine", 'toolbar=no,directories=no,resizable=NO,menubar=no,scrollbars=NO,width=100,height=100');
	wid.focus();
}

function APG(URL,width,height) {

var left = (screen.width/2) - width/2;
var top = (screen.height/2) - height/2;
var styleStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;

window.open(URL,"", styleStr);
}


function APG2(URL,width,height) {

var left = (screen.width/2) - width/2;
var top = (screen.height/2) - height/2;
var styleStr = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;

window.open(URL,"", styleStr);
}


function resize(){


var scrResHeight = document.getElementById('divBoxFucsiaMiddle').offsetHeight;
var h = Number(scrResHeight);
document.getElementById("divBoxFogliaOffertaMiddleDescrizioneOfferta").style.height = h;
document.getElementById("divBoxFucsiaMiddle").style.height = h;


}



function gId(id){
	return document.getElementById(id);
}

function getItem(id)
 {
     var itm = false;
     if(document.getElementById)
         itm = document.getElementById(id);
     else if(document.all)
         itm = document.all[id];
     else if(document.layers)
         itm = document.layers[id];

     return itm;
 }

 function toggleItem(id)
 {
     itm = getItem(id);

     if(!itm)
         return false;

     if(itm.style.display == 'none')
         itm.style.display = '';
     else
         itm.style.display = 'none';

     return false;
 }
