﻿var success = false;
var konami = {
	input:"",
	clear:setTimeout('konami.clear_input()',2000),
	load: function(link) {
		window.document.onkeyup = function(e) {
                    if (!success) {
			konami.input+= e ? e.keyCode : event.keyCode         
			if (konami.input == "38384040373937396665") {
				konami.code()
                                success=true;
				clearTimeout(konami.clear)
			}
			clearTimeout(konami.clear)
			konami.clear = setTimeout("konami.clear_input()",2000)
                    } else {
                         konami.code();
                    }
                }
                                        
	},
	code: function() { falken_add();},
	clear_input: function() {
			konami.input="";
			clearTimeout(konami.clear);
	}
}


konami.load();

var flogo = false;
var falken_count = 0;
var opac = 100;
falken_add = function() {
    var body, div, div2, img;
    var numType = 'px';
    var heightRandom = Math.random()*.75;
    var windowHeight = 1768;
    var windowWidth = 11024;
    var height = 0;
    var width = 0;
    var de = document.documentElement;
    if (typeof(window.innerHeight) == 'number') {
            windowHeight = window.innerHeight;
            windowWidth = window.innerWidth;
    } else if(de && de.clientHeight) {
            windowHeight = de.clientHeight;
            windowWidth = de.clientWidth;
    } else {
            numType = '%';
            height = Math.round( height*100 )+'%';
    }

    if (!flogo) {
          div = document.createElement('div');
          div.style.position = 'fixed';
          div.id = "bigLogo";
          div.style.backgroundColor ="#ffffff";
          
          
          div.style.zIndex = 99;
          div.style.outline = 0;
          div.style.top = 0;
          div.style.left = 0;
          div.style.width = "100%";
          div.style.height = "100%";
          
          div2 = document.createElement('iframe');
          div2.style.position = 'fixed';
          div2.style.zIndex = 100;
          div2.style.outline = 0;
          div2.setAttribute('src','http://jonsdorferfalken.de/scripts/hockey.html');
          div2.setAttribute('scrolling','no');
          div2.style.width="620px";
          div2.style.height="470px";
          
          if( numType=='px' ) div2.style.top = windowHeight/2 - 250 + numType;
          else div2.style.top = height;
          if( numType=='px' ) div2.style.left = windowWidth/2 - 250 + numType;
          else div2.style.left = width;
        
        
          
          
          body = document.getElementsByTagName('body')[0];
          body.appendChild(div);
          div.appendChild(div2);
          
          flogo = true;
    }

    opac = opac-40;
    try {
        $("tableMain").style.opacity = opac/100;
        $("tableMain").style.MozOpacity = opac/100;
        $("tableMain").style.filter = "alpha(opacity = "+opac+")";
        
        $("bigLogo").style.opacity = 1-(opac/100);
        $("bigLogo").style.MozOpacity = 1- (opac/100);
        $("bigLogo").style.filter = "alpha(opacity = "+(100-opac)+")";    } catch(x) {}
	
        
    falken_count += 1;

    div = document.createElement('div');
    div.style.position = 'fixed';
    
    
    
    div.onclick = falken_add;
    div.style.zIndex = 999-falken_count;
    div.style.outline = 0;
    
    if( numType=='px' ) div.style.top = Math.round( windowHeight*heightRandom ) + numType;
    else div.style.top = height;
    div.style.left = Math.round( Math.random()*90 ) + '%';
  
    img = document.createElement('img');
    img.setAttribute('src','http://jonsdorferfalken.de/pics/falke.gif');
    body = document.getElementsByTagName('body')[0];
    body.appendChild(div);
    div.appendChild(img);
    
    
   
}
