var csMeUrlType = "type";
var csMeUrlID = "id";

function JSFunChiudi(){
	var oDivNote=document.getElementById("id_note");
	if (oDivNote){
		oDivNote.style.display='none';
	}
	var oDivAdmin=document.getElementById("id_admin");
	if (oDivAdmin){
		oDivAdmin.style.display='none';
	}
	var oDivFoto=document.getElementById("id_foto");
	if (oDivFoto){
		oDivFoto.style.display='none';
		var oFraDet=document.getElementById("id_foto_fra");
		if (oFraDet){
			oFraDet.src="fotodtg.aspx";
		}
	}
	var oDivFile=document.getElementById("id_file");
	if (oDivFile){
		oDivFile.style.display='none';
	}
}

function JSFunAdmin(){
	JSFunChiudi()
	var oDivAdmin=document.getElementById("id_admin");
	if (oDivAdmin){
		var iLeft=40;
		var iWidth=((JSFunBrowserWidth()-740)/2);
		if (iWidth > 0){
			iLeft=iLeft+iWidth
		}
		oDivAdmin.style.left=iLeft+"px";
		oDivAdmin.style.top="325px";
		oDivAdmin.style.display='';
	}
}

function JSFunNote(){
	JSFunChiudi()
	var oDivNote=document.getElementById("id_note");
	if (oDivNote){
		var iLeft=100;
		var iWidth=((JSFunBrowserWidth()-740)/2);
		if (iWidth > 0){
			iLeft=iLeft+iWidth
		}
		oDivNote.style.left=iLeft+"px";
		oDivNote.style.top="315px";
		oDivNote.style.display='';
	}
}

function JSFunFoto(sType,sID){
    JSFunChiudi()
	if  (sType&&sID){
		var oDivFoto=document.getElementById("id_foto");
		if (oDivFoto){
			var oFraDet=document.getElementById("id_foto_fra");
			if (oFraDet){
				var iWidth=(JSFunBrowserWidth()-450)/2;
				oDivFoto.style.left=iWidth+"px";
				oDivFoto.style.top="50px";
				oDivFoto.style.display='';
				oFraDet.src="fotodtg.aspx?"+csMeUrlType+"="+sType+"&"+csMeUrlID+"="+sID;
			}
		}
	}
}

function JSFunNewFoto(sType,sID){
	JSFunChiudi()
	var oDivFile=document.getElementById("id_file");
	if (oDivFile){
	    var oFraDet=document.getElementById("id_file_fra");
	    if (oFraDet){
	        var iWidth=(JSFunBrowserWidth()-450)/2;
		    oDivFile.style.left=iWidth+"px";
		    oDivFile.style.top="120px";
		    oDivFile.style.display='';
	        oFraDet.src="admin_foto.aspx?"+csMeUrlType+"="+sType+"&"+csMeUrlID+"="+sID;
	    }
	}
}

function JSFunBrowserWidth(){
	if (navigator.userAgent.indexOf('MSIE')>0){
		return (document.body.clientWidth);
	}else{
		return window.outerWidth;
	}
}

function JSFunBrowserHeight(){
	if (navigator.userAgent.indexOf('MSIE')>0){
		return (document.body.clientHeight);
	}else{
		return window.outerHeight;
	}
}


