var blinkColTbl  = new Array();
blinkColTbl[0] = "#034694";
blinkColTbl[1] = "#ffffff";

var blinkTimeout = 1000;
var blinkIdx = 1000;
function blink () {
    if ( document.all && document.all.blink ) {
        blinkIdx = (blinkIdx+=1) % 2 ;
        var color = blinkColTbl [ blinkIdx ];
        if ( document.all.blink.length ) {
            for(i=0;i<document.all.blink.length;i++)
                document.all.blink[i].style.color=color;
        } else
            document.all.blink.style.color=color;
        setTimeout( "blink();" , blinkTimeout);
    }
}

function popup(data,width,height)
  {
  	//window center
    var winwidth = (screen.width - width) / 2;
    var winheight = (screen.height - height) / 2;
	
    Neufenster2=window.open(data,"Zweitfenster2","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top="+winheight+",left="+winwidth+",height="+height+",width="+width); 
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('Neufenster2.focus();',250);
   }   
	 
	 
function popupmedia()
  {
		data = "index2.php?page=media";
		width = "770";
		height = "580";
  	//window center
    var winwidth = (screen.width - width) / 2;
    var winheight = (screen.height - height) / 2;
	
    Neufenster3=window.open(data,"Zweitfenster3","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top="+winheight+",left="+winwidth+",height="+height+",width="+width); 
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('Neufenster3.focus();',250);
   }
   


 
function findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function CopyClipboard(obj) {
	obj = findObj(obj);
	if (obj) {
	  window.clipboardData.setData('Text', obj.value);
	}
}




// Dynamically change an image when the user touches it
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		nav_flugfeld_over = newImage("/images/nav/NavInd16s.gif");
		nav_planen_over = newImage("/images/nav/NavInd21s.gif");
		nav_investoren_over = newImage("/images/nav/NavInd27s.gif");
		nav_zweckverband_over = newImage("/images/nav/NavInd2s.gif");
		nav_aktuell_over = newImage("/images/nav/NavInd33s.gif");
	
		preloadFlag = true;
	}
}

function showSubMenu(submenu)
	{
/*		if (NN4)
			document.layers[submenu].visibility="show";
		else*/
			document.getElementById(submenu).style.visibility="visible";
	}
	
function hideSubMenu(submenu)
	{
/*		if (NN4)
			document.layers[submenu].visibility="hide";
		else*/
		document.getElementById(submenu).style.visibility="hidden";
	}
	
	
function drucken() {
	var newWin = window.open('/tpl/druck.html','Drucken','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=780,height=500');
}
