// Zentrale Java Datei zur Internetseite der Deutschen Gesellschaft für Projektmanagement
// PM Delta
// Offener Bereich

// (c) Redaktionsbüro Derwort, Frankfurt am Main (2004)

// 1.) Erstellen eines neuen Browserfensters ohne Navigationselemente und schliessen des Hauptfensters

   function OpenSite()
     {  DocumentViewer = window.open("start.htm", "DocumentViewer", "width=791, height=588, scrollbars=no, resizable=no");	    
		DocumentViewer.moveTo(15,10);
		window.opener = top;
        window.self.close();
		DocumentViewer.focus();
     }
	
// 1.2) Öffnen eines neuen Fensters ohne Schliessen des Hauptfensters	 
   function ViewDocument(linkto)
     {  DocumentViewer = window.open(linkto, "DocumentViewer", "width=675, height=550, scrollbars=yes, resizable=yes");
	    DocumentViewer.focus();
     }
	 
   function CloseDocument()
     {  opener.parent.reload();
		this.close();
     } 
   
   
// 2.) Steuerelemente für Navigationsbaum

   function Go(x) {
   if(x == "nothing") {
     document.forms[0].reset();
     document.forms[0].elements[0].blur();
     return;
   }
   else if(x == "end")
     top.location.href = parent.frames[1].location;
   else {
     parent.location.href = x;
     document.forms[0].reset();
     document.forms[0].elements[0].blur();  
   }
  }


// 3.) Scrollen auf den Inhaltsfenstern
// Achtung: Layout-Informationen auch in der zentralen css-Datei

var clipTop = 0;
var clipWidth = 453;
var clipBottom = 300;
var topper = 218;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;

// onresize = reDo;
// function reDo() {
//     top.flowtext.location.reload();
// }

function prepLyr()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('flowtext');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		x.style.clip = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
	}
}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function stopScroll()
{
	if (time) clearTimeout(time);
}

function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;
	if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper;
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
	time = setTimeout('realscroll()',theTime);
}

function vis(val)
{
	if (!DHTML) return;
	var f = new getObj('flowtext');
	f.style.visibility = val;
}

function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

// 4. Sicherheitsabfrage vor dem Löschen
function confirmSubmit()
{
if (confirm('Möchten Sie die ausgewählten Dateien wirklich löschen?'))
{
return true;
}
else
{
document.focus();
return false;
}

}