window.onerror=null;

window.defaultStatus = "TeenDefence - Sicherheitstraining für Jugendliche";

function jumpurl (form) {
    location = form.URL.options[form.URL.selectedIndex].value;
    return true;
}
//if (window.location.host != "www.teendefence.de") { 
//    window.location.href = "http://www.teendefence.de"; 
//}

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);

//Kategorienavigation
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;}

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,"12Rounds",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;) by 12Rounds</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()
}


function BlurLinks(){
 lnks=document.getElementsByTagName('a');
 for(i=0;i<lnks.length;i++){
  lnks[i].onfocus=new Function("this.blur()");
 }
 lnks=document.getElementsByTagName('area');
 for(i=0;i<lnks.length;i++){
  lnks[i].onfocus=new Function("this.blur()");
 }
 lnks=document.getElementsByName('Verweis');
 for(i=0;i<lnks.length;i++){
  lnks[i].onfocus=new Function("this.blur()");
 }
}
onload=BlurLinks;

