// load

var preload_images =
[
"../images/nav1/0.gif",
"../images/nav1/1.gif",
"../images/nav1/2.gif",
"../images/nav1/3.gif",
"../images/nav1/4.gif",
"../images/nav1/5.gif",
"../images/nav1/6.gif",
"../images/nav1/7.gif",
"../images/nav1/8.gif"
]
var load_next = 50
var pos_array = 0
function preload()
{
var new_image = new Image()
new_image.src = preload_images[pos_array]
pos_array++
if(pos_array < preload_images.length){
setTimeout('preload()', load_next);
}
}

function load_img()
{
if(preload_images.length == 0)
return
setTimeout('preload()', load_next)
}

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); return x;
}

function swapImage() { 
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


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 glossar(data)
  {
		width = "350";
		height = "200";
  	//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=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('Neufenster2.focus();',250);
   }   
	 
function print(data)
  {
		width = "530";
		height = "500";
  	//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=1,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('Neufenster2.focus();',250);
   } 	 
	 
function tell(data)
  {
		width = "300";
		height = "300";
  	//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=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('Neufenster3.focus();',250);
   } 	 
	 
function popupmedia()
  {
		data = "./content.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);
	}
}


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];
		}
	}
}