function attachDelete(idAttach){
	var url = "index.php?action=del_attach&id_attach="+idAttach+"&tipo="+tipoReturnDelete;
	if(tipoReturnGallery == "1") url+="&gallerymode=1";
	if(confirm('You are going to REMOVE the selected attachment from our server. Are you sure?')) window.location=url;
}

function previewAttach(id,ida,tipo){
	var url = HTTP_BASE+"preview.php?ID="+id+"&ID_attach="+ida+"&tipo="+tipo+"&mxw="+window.screen.width+"&mxh="+window.screen.height;
	wopen(url,"preview_"+id+"_"+ida,560,560);
}

function viewApplyDetail(id){
	w=800; h=600;
	window.open('index.php?view=detail_main&ID='+id,"applyDetail"+id,"width="+w+",height="+h+",left="+((window.screen.width - w) / 2)+",top="+((window.screen.height - h) / 2)+",resizable=0,status=0,toolbar=0,menubar=0,scrollbars=1");
}

function wopen(url,tit,w,h){
	window.open(url,tit,"width="+w+",height="+h+",left="+((window.screen.width - w) / 2)+",top="+((window.screen.height - h) / 2)+",resizable=0,status=0,toolbar=0,menubar=0,scrollbars=0");
}

function goToGallery(id,tipo){
	var url = "index.php?view=gallery&ID="+id+"&tipo="+tipo;
	wopen(url,"gallery_"+id+"_"+tipo,800,350);
}

function downloadme(x){
	//alert(x);
    myTempWindow = window.open(HTTP_BASE+'download.php?f='+x,'downloadwin','');
    /*myTempWindow.document.execCommand('SaveAs','null',x);
    myTempWindow.close();*/
}

var defaultCalendarSettings = {	constrainInput:true };

function listReload(){
	if(!window.opener) return;
	window.opener.ricarica();
}
