window.onerror=null;
function jumpurl (form){location = form.URL.options[form.URL.selectedIndex].value;return true;}
function reloadPage(init) {
 if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
 else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

function show_layer(x){if(document.getElementById){document.getElementById(x).style.visibility="visible";}}
function hide_layer(x){if(document.getElementById){document.getElementById(x).style.visibility="hidden";}}
var old;var memold;var subold;
if(document.layers){
 window.captureEvents(Event.MOUSEDOWN);
 window.onmousedown=do_out;}
else{document.onmouseup=do_out;}
function do_menu(x){if(!old){old=memold;}if(old!=x){show_layer(x);old=x;}else{old="";}}
function do_check(x){if(old && old!=x){hide_layer(old);show_layer(x);old=x;}do_submenu();}
function do_out(){if(old){hide_layer(old);memold="";old="";do_submenu();}}
function do_submenu(x){if(subold){hide_layer(subold);subold="";}if(x){show_layer(x);subold=x;}}
function lade(seite){parent.pageFrame.location.href = seite;}

function BlurLinks(){
 var lnks=document.getElementsByTagName('a');
 for(var i=0;i<lnks.length;i++){lnks[i].onfocus=new Function("this.blur()");}
}
window.onload=BlurLinks;

var Fenster = null;
function pop(Seite,w,h,scroll){
 LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
 TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
 settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',status=no,toolbar=no,menubar=no,location=no,resizable=no,titlebar = no';
 Fenster = window.open(Seite,"GSRA",settings);
}

var wnd = null;
function pic(img_url, img_title, img_width, img_height) {
  links = (screen.width) ? (screen.width-img_width)/2 : 0;
  oben = (screen.height) ? (screen.height-img_height)/2 : 0;
  wnd = open("","Bildanzeige","width="+(img_width)+",height="+(img_height)+",innerWidth="+(img_width)+",innerHeight="+(img_height)+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,dependent=0,top="+oben+",left ="+links);
  with(wnd.document) {
    open("text/html")
    writeln("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"	\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">")
    writeln("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"de\" lang=\"de\" onContextMenu=\"return event.ctrlKey\">")
    writeln("<head><title>&bull;&bull; "+img_title+" &bull;&bull;</TITLE><meta http-equiv=\"imagetoolbar\" content=\"no\"></head>")
    writeln("<body onblur=\"window.close()\" style=\"margin:0;padding:0;overflow:hidden;\" onload=\"window.status='"+img_title+"'; return true\" onmouseover=\"window.status='"+img_title+"'; return true\">")
    writeln("<div style=\"position:absolute;z-index:2;width:96%;bottom:6px;color:#fff;font:700 12px Verdans, sans-serif;text-align:right;filter:alpha(opacity=20);\">(&copy;) GSRA</div>")
    writeln("<a onfocus=\"this.blur()\" href=\"javascript:window.close();\">")
    writeln("<img src=\""+img_url+"\" style=\"width:"+img_width+"px;height:"+img_height+"px;margin:0;padding:0;border:0;\" alt=\""+img_title+"\" />")
    writeln("</a>")
    writeln("</body></html>")
    close()
  }
  wnd.focus()
}

var locationAfterPreload = "index.php";
var lengthOfPreloadBar = 250;
var heightOfPreloadBar = 10;
var yourImages = new Array("img/b_bot.png","img/b_mid.png","img/b_top.png","img/bg_b.jpg","img/bg_c.jpg","img/bg_f.jpg","img/bg_h.jpg","img/btn.png","img/ft_bck.png","img/ft_pnt.png","img/ft_top.png");
if(document.images){
 var dots = new Array();
 dots[0] = new Image(1,1);
 dots[0].src = "img/sw.gif";
 dots[1] = new Image(1,1);
 dots[1].src = "img/bl.gif";
 var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0;
 var loaded = new Array(),i,covered,timerID;
 var leftOverWidth = lengthOfPreloadBar%coverage;
}
function loadImages(){    
 for(i = 0; i < yourImages.length; i++){preImages[i] = new Image();preImages[i].src = yourImages[i];}
 for (i = 0; i < preImages.length; i++){loaded[i] = false;}
 checkLoad();
}
function checkLoad(){
 if(currCount == preImages.length){location.replace(locationAfterPreload);return;}
 for(i = 0; i <= preImages.length; i++){if(loaded[i] == false && preImages[i].complete){loaded[i] = true;eval("document.img" + currCount + ".src=dots[1].src");currCount++;}}   
 timerID = setTimeout("checkLoad()",10)    
}
