//----------------------------------------------------------------------------------------------------
//
//     Rel. 2005.08.17
//     
//     copyright 1996-2005 by EELImedia snc
//
//----------------------------------------------------------------------------------------------------


function legalInfo() {
	var xx;
	var xx = window.open("/" + xpAlias + "/legalInfo.aspx?pid=" + xpAlias , "LegalInfo", "height=500,width=500,menubar=no,scrollbars=no,toolbar=no,status=no,location=no,resizable=no");
	if (xx != undefined) {
		xx.focus()
	}
}

// editArea
var bVisible;
function editArea(ctl,show){
	if(!bVisible){
		if(window.event.ctrlKey){
			if(show==1){
				document.getElementById(ctl).style.left=window.event.clientX-10
				document.getElementById(ctl).style.top=window.event.clientY-10
				document.getElementById(ctl).style.visibility=''
				document.getElementById(ctl).style.display='inline'
				bVisible=true
				window.setTimeout("closeEditArea('"+ctl+"')",4000,"javascript")
			}
			else {
				document.getElementById(ctl).style.visibility='hidden'
				document.getElementById(ctl).style.display='none'
				bVisible=false
			}
		}
	}
}

function closeEditArea(ctl){
	document.getElementById(ctl).style.visibility='hidden'
	document.getElementById(ctl).style.display='none'
	bVisible=false
}

// AdminMenuArea
var bMnuVisible;
function AdminMenuArea(ctl,show){
	if(!bMnuVisible){
		if(show==1){
			document.getElementById(ctl).style.left=window.event.clientX-200
			document.getElementById(ctl).style.top=window.event.clientY-10
			document.getElementById(ctl).style.visibility=''
			document.getElementById(ctl).style.display='inline'
			bMnuVisible=true
			window.setTimeout("closeMenuArea('"+ctl+"')",4000,"javascript")
		}
		else {
			document.getElementById(ctl).style.visibility='hidden'
			document.getElementById(ctl).style.display='none'
			bMnuVisible=false
		}
	}
}

function closeMenuArea(ctl){
	document.getElementById(ctl).style.visibility='hidden'
	document.getElementById(ctl).style.display='none'
	bMnuVisible=false
}

// immagine ingrandita
function imgBig(imgName,slideShow){
	var xx;
	if(slideShow!=undefined)
		var xx = window.open("/"+xpAlias+"/imgBIG.aspx?pid="+xpAlias+"&CMS_SHOW=1&ID="+escape(imgName),"imgw","height=540,width=680,menubar=yes,scrollbars=no,toolbar=no,status=no,location=no,resizable=yes");
	else 
		var xx = window.open("/"+xpAlias+"/imgBIG.aspx?pid="+xpAlias+"&ID="+escape(imgName),"imgw","height=540,width=680,menubar=yes,scrollbars=no,toolbar=no,status=no,location=no,resizable=no");
	
	xx.focus();
}
// editing descrizioni SlideSHow
function editSlideShow(strPath,album){
	var xx = window.open("/DesktopModules/_GalleryEdit.aspx?pid=" + xpAlias + "&ID=" + strPath + "&A="+album,"imgw","height=350,width=550,menubar=no,scrollbars=no,toolbar=no,status=no,location=no,resizable=no" );
	xx.focus();
}

// del Image SlideSHow
function delSlideShowPhoto(strPath,album){
	var xx = window.open("/DesktopModules/_GalleryAdvancedUtilityFrame.aspx?pid=" + xpAlias + "&ID=" + strPath + "&A="+album,"imgD","height=100,width=350,menubar=no,scrollbars=no,toolbar=no,status=no,location=no,resizable=no,top=200,left=300" );
	xx.focus();
}

// immagine protetta
function imgDownload(imgName){
	var xx = window.open(xpAlias+"/imgDownload.aspx?pid=" + xpAlias + "&ID=" + escape(imgName),"imgw","height=540,width=680,menubar=yes,scrollbars=no,toolbar=no,status=no,location=no,resizable=no" );
	xx.focus();
}

// apre finestra Login
function goLogin() {
	//var xx = window.open("login.aspx?pid=" + xpAlias + "&ReturnUrl=login.aspx?pid=" + xpAlias,"Login","top=100,left=100,height=280,width=700,menubar=no,scrollbars=no,toolbar=no,status=no,location=no");
	var xx = window.open("login.aspx?pid=" + xpAlias,"Login","top=100,left=100,height=280,width=700,menubar=no,scrollbars=no,toolbar=no,status=no,location=no");
	xx.focus();
}

//Admin
function goOrganize(id) {
	var xx = window.open(id,"Organize","top=50,left=50,height=513,width=742,menubar=no,scrollbars=no,toolbar=no,status=no,location=no");
	xx.focus();
}

//opzioni Singolo Modulo
function goModuleOptions(id) {
	var xx = window.open(id,"Organize","top=50,left=50,height=513,width=742,menubar=no,scrollbars=no,toolbar=no,status=no,location=no");
	xx.focus();
}


//NewsTicker
//function goNews(alias,mid) {
//	var xx = window.open("DesktopModules/NewsTickerDetail.aspx?pid=" + xpAlias + "&Mid=" + mid,"newsReader","top=50,left=50,height=380,width=680,resizable=yes,menubar=no,scrollbars=yes,toolbar=no,status=yes,location=no");
//	xx.focus();
//}

//WebMail
function goMail() {
	var xx = window.open("http://portal.eelimedia.it/webmail/","mailReader","top=50,left=50,height=480,width=780,resizable=yes,menubar=yes,scrollbars=yes,toolbar=yes,status=yes,location=no");
	xx.focus();
}
//Advanced editing
function goEdit(id) {
	var xx = window.open(id,"Editing","top=50,left=50,height=680,width=900,resizable=yes,menubar=no,scrollbars=no,toolbar=no,status=no,location=no");
	xx.focus();
}

//New Std Editor
function editor3(tabindex,tabid,mid) {
	if (this.ctlOri==undefined){
		self.location="_bottom.aspx?pid=" + xpAlias + "&tabindex=" + tabindex + "&tabid=" + tabid + "&mid=" + mid
	}
	else {
		alert("Attenzione! Un modulo risulta in fase di Editing.\nSalvare oppure annullare le modifiche al modulo selezionato in precedenza.");
	}

}

//News Editor
function editorNews(mid) {
	var x = window.open("/Editor/newsEditor.aspx?pid=" + xpAlias + "&ID=" + mid, "NewsEditor", "statusbar=yes,minimize=yes,maximize=yes,width=900,height=750,top=20,left=20,resizable=yes");
	x.resizeTo(screen.availWidth-40,screen.availHeight-40);
	x.focus();
}

 //SlideShow
function slideShow(id,alias) {
	var x = window.open("/EELIEditor/SlideShow.aspx?pid=" + xpAlias + "&ID=" + id, "SlideShowGallery", "statusbar=no,minimize=no,maximize=no,width=690,height=540,top=10,left=10,resizable=yes");
	x.focus();
}

// Funzione Stampa
function printerFriendly(nomefile) {
	var pf = window.open(nomefile,"Printer","height=450,width=600,menubar=yes,scrollbars=1,toolbar=no,status=no,location=no");
	pf.focus();
}

// Funzione dialogbox conferma
function conferma(tipo) {

	if (confirm("Vuoi veramente eliminare il record " + tipo + " selezionato?")) {
		return (true);
		}
	else {
		return (false);
		}
}

//Editor esterno 
function editExternal(URL,tabindex,tabid,mid) {
	alert("hooo");
	if (this.ctlOri==undefined){
		var tTop = (screen.Height-630) / 2;
		var tLeft = (screen.width-900) / 2;
		xPopup = window.open(URL+"?pid=" + xpAlias + "&tabindex=" + tabindex + "&tabid=" + tabid + "&mid=" + mid,"advED","top=" + tTop + ",Left=" + tLeft + ",status=yes,menu=yes,height=600,width=900,resizable=yes,scrollbar=no");
		xPopup.focus();
	}
	else {
		alert("Attenzione! Un modulo risulta in fase di Editing.\nSalvare oppure annullare le modifiche al modulo selezionato in precedenza.");
	}

}



// MessageBox
var EELI_MsgBox_ReturnValue=null;
