// JavaScript Document

function popup(url, w, h) {
	if (!w) w = 560;
	if (!h) h = 349;
	
	window.open(url, '', 'width='+w+',height='+h+',statusbar=0,status=0,scrollbars=0,resizable=0');
	return false;
}

function popup_with_size(url,width,height){
	window.open(url, '', 'width=' + width + ',height=' + height + ',status=no,scrollbars=no,resizable=no');
	return false;
}

function refresh_opener() {
	var win = window;
	while(o = win.opener) {
		url = o.location.href;
		if (url.match(/jins/i)) {
			o.location.replace(url);
			window.setTimeout("self.focus();", 800);
		}
		else {
			alert('Die darunterliegende Seite wurde nicht refreshed\nda keine Session in der URL gefunden wurde.');
		}
		win = o;
	}
}

function refresh_opener_close() {
	refresh_opener();
	if (window.opener) self.close();
}

function close_popup() {
	if (window.opener) window.opener.focus();
	window.close();
	return false;
}

function openDocument(id_menue, id_document, pages) {
    document.location.href='index.php?id_menue='+id_menue+'&id_document='+id_document+'&pages='+pages;
}

function openPopup(document,winName,features) { //v2.0
  theURL= document;
   newwin = window.open(theURL,winName,features);
   setTimeout('newwin.focus();',200);
}

function cms_findObj(n, d) { //v4.01
  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=cms_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function cms_swapImgRestore() { //v3.0
  var i,x,a=document.cms_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function cms_swapImage() { //v3.0
  var i,j=0,x,a=cms_swapImage.arguments; document.cms_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=cms_findObj(a[i]))!=null){document.cms_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function cms_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.cms_pgW=innerWidth; document.cms_pgH=innerHeight; onresize=cms_reloadPage; }}
  else if (innerWidth!=document.cms_pgW || innerHeight!=document.cms_pgH) location.reload();
}

function cms_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function sitemap_navigation(id_nav) { 
		parent.window.opener.document.location.href = 'index.php?id_menue='+id_nav;
		parent.window.close();
}
cms_reloadPage(true);

function cms_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.cms_p) d.cms_p=new Array();
    var i,j=d.cms_p.length,a=cms_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.cms_p[j]=new Image; d.cms_p[j++].src=a[i];}}
}


function showlang() {
 document.getElementById("lang").style.visibility = "visible";
}
function hidelang() {
 document.getElementById("lang").style.visibility = "hidden";
}
function showpullmann() {
 document.getElementById("pullmann").style.visibility = "visible";
}
function hidepullmann() {
 document.getElementById("pullmann").style.visibility = "hidden";
}


