var activeTimeout = new Array();

function disappear(d_id) {
	if( activeTimeout[d_id] != null ) {
		clearTimeout(activeTimeout);
	}
	activeTimeout[d_id] = setTimeout("closediv('"+d_id+"')",200);
}
function closediv(d_id){
	object = document.getElementById(d_id);
	if(object.style.visibility){
		object.style.visibility="hidden";
	}
	else{
		object.style.display='none';
	}
}
function reappear(d_id) {
	if( activeTimeout[d_id] ) {
		clearTimeout( activeTimeout[d_id] );
		activeTimeout[d_id] = null;
	}
	var object = document.getElementById(d_id);
	
	if(object.style.visibility){
		object.style.visibility="visible";
	}
	else{
		object.style.display='block';
	}
}

function cms_windowopen(url,name,width,height,pvpDir)
{
	if(pvpDir && pvpDir != ''){
		var opener = window.open(pvpDir+'/administration'+url,name,'locationbar=no,menubar=no,status=no,width='+width+',height='+height+',resizable=yes,dependent=yes,scrollbars=yes').focus();
	}else{
		var opener = window.open('/administration'+url,name,'locationbar=no,menubar=no,status=no,width='+width+',height='+height+',resizable=yes,dependent=yes,scrollbars=yes').focus();
	}
}

function cms_popupwindowopen(url,name,width,height,pvpDir)
{
	if(pvpDir && pvpDir != ''){
		url = pvpDir + url;
	}
	if(url.indexOf('?') > 0) {
		tURL = url+'&REF=popup'
	}
	else {
		tURL = url+'?REF=popup';
	}
	var opener = window.open(tURL,name,'locationbar=no,menubar=no,status=no,width='+width+',height='+height+',resizable=yes,dependent=yes,scrollbars=yes').focus();
}
function cms_refwindowopen(url,ref,name,width,height)
{
	if(url.indexOf('?') > 0) {
		tURL = url+'&REF='+ref;
	}
	else {
		tURL = url+'?REF='+ref;
	}
	var opener = window.open(tURL,name,'locationbar=no,menubar=no,status=no,width='+width+',height='+height+',resizable=yes,dependent=yes,scrollbars=yes').focus();
}
function DeleteArticleQuestion(url, pvpDir)
{
 	if( confirm( "Wollen Sie diesen Artikel wirklich löschen?" ) == true )
	{
		cms_windowopen(url,'articleedit',100,10, pvpDir)
	}
}
function DeleteCategoryQuestion(url)
{
 	if( confirm( "Wollen Sie diese Kategorie wirklich löschen?" ) == true )
	{
		cms_windowopen(url,'categoryedit',100,10, pvpDir)
	}
}
function ArchiveArticleQuestion(url, pvpDir)
{
 	if( confirm( "Wollen Sie diesen Artikel wirklich archivieren?" ) == true )
	{
		cms_windowopen(url,'articleedit',100,10, pvpDir)
	}
}
function UnpublishArticleQuestion(url, pvpDir)
{
 	if( confirm( "Soll der Artikel wirklich unsichtbar geschaltet werden?" ) == true )
	{
		cms_windowopen(url,'articleedit',100,10, pvpDir)
	}
}
function DeleteEventQuestion(url, pvpDir)
{
 	if( confirm( "Wollen Sie diese Veranstaltung wirklich löschen?" ) == true )
	{
		cms_windowopen(url,'eventedit',100,10, pvpDir)
	}
}
function UnpublishEventQuestion(url, pvpDir)
{
 	if( confirm( "Soll diese Veranstaltung wirklich unsichtbar geschaltet werden?" ) == true )
	{
		cms_windowopen(url,'eventedit',100,10, pvpDir)
	}
}
function gisapp()
{
// 800 - 10 (rechte Scrollbar) = 790,   600 - 100 (Titelleiste, Menueleiste, Statusleiste) = 500
  xwidth=screen.width*1-10;
  xheight=screen.height*0.92;
  window.open("http://geoinfo.lfrz.at/website/geoinfo","GeoInfo","width="+xwidth+",height="+xheight+",top=0,left=0,scrollbars,dependent=no,locationbar=no,menubar=no,statusbar=no,titlebar=no,resizable=yes");
}

function ewep(url)
{
// 800 - 10 (rechte Scrollbar) = 790,   600 - 100 (Titelleiste, Menueleiste, Statusleiste) = 500
  xwidth=screen.width*1-10;
  xheight=screen.height*0.92;
  window.open(url,"eWEP","width="+xwidth+",height="+xheight+",top=0,left=0,scrollbars,dependent=no,locationbar=no,menubar=no,statusbar=no,titlebar=no,resizable=yes");
}

function cms_externalFullWindowOpen(url,name,width,height)
{
	var newWindow = window.open(url,name,"location=yes,locationbar=yes,menubar=yes,status=yes,width="+width+",height="+height+",resizable=yes,dependent=yes,scrollbars=yes" );
	newWindow.focus();
}


var externerLinkText = "Externer Link";
	var textNeuesFenster = "(neues Fenster)";
	function titleAnpassen(linkObjekt) {
	  if (linkObjekt.getAttribute) {
	    textAlt = linkObjekt.getAttribute("title");
	    if(textAlt && textAlt.indexOf(textNeuesFenster) == -1) {
	      textZusatz = textAlt.substring((textAlt.indexOf(externerLinkText)) + externerLinkText.length, textAlt.length);
	      linkObjekt.setAttribute("title", externerLinkText + " " + textNeuesFenster + textZusatz);
	    }
	  }
	}
