
var VarLocker=true;
var LockValue=0	
var ScrollAction=0;		
var ActionValue;
var scrollDirGlobal;

var scrollPosTemp=0;

var truc

var scrollPos
var counter=0;
var counterGlobal=0;
var counterTemp=0;
version = navigator.appVersion
sch = screen.availWidth;

var e = window.innerWidth;
var c=navigator.appVersion;
var b=navigator.appName;
var a= document.lastModified;


function dhtml()
{if(version <"4.0")
{window.top.href="dhtml/bund2.html";}
else{if(sch>1023)
{top.window.location.href="dhtml/bund1.html";}
else    {top.window.location="dhtml/bund1a.html";}}}



function fenster(url,name,h,w){
      window.open(url,name,"toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=1,height="+h+",width="+w);
}

function fensterscroll(url,name,h,w){
      window.open(url,name,"toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,height="+h+",width="+w);
}




$(window).load(function(){
      function getScrollY() {
          var scrOfY = 0;
      		if(typeof(window.pageYOffset) == 'number') {
      						//Netscape compliant
      						scrOfY = window.pageYOffset;
      		} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
      						//DOM compliant
      						scrOfY = document.body.scrollTop;
      		} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
      						//IE6 standards compliant mode
      						scrOfY = document.documentElement.scrollTop;
      		}
      		return scrOfY;
      }
		

      $(document).mouseup(function(){      //--> if (scroll end testing)
      //showFlyingDIV(1)
      });


      var clearQueue = true; 
      var gotoEnd= true; 

     
      function scrollAction()  {
        counterTemp++;
           $('#debug').html("--"+counterTemp);
         var yoffset = getScrollY();
         
         if(yoffset==scrollPosTemp){
                $('#boxMenuMain')
                .stop(clearQueue,gotoEnd)
                .fadeTo("slow", 1);
               
            
					       ScrollAction=0
                 counter=0
                 clearInterval(truc)
                 counterTemp=0
         }
            scrollPosTemp = yoffset;
      }
      
      
      
    function initAction()  {
          truc = setInterval(scrollAction, 500);
    }

  	$(window).scroll(function(){
          counter++;
          if(counter==1){
              $('#boxMenuMain').fadeTo("fast", 0.3);
              initAction()
          }
				}
      );
	}			
);



var movie0 = new Array();

movie0[0] = new Object();
movie0[0]["Name"] = "Skip Intro";
movie0[0]["Url"] = "flash_intro";
movie0[0]["width"] = 550;
movie0[0]["height"] = 370;
movie0[0]["bgColor"] = "#4F5F5F";

movie0[1] = new Object();
movie0[1]["Name"] = "Fiona";
movie0[1]["Url"] = "fiona_kids_calculator";
movie0[1]["width"] = 550;
movie0[1]["height"] = 370;
movie0[1]["bgColor"] = "#9B9BAD";


movie0[2] = new Object();
movie0[2]["Name"] = "Flash draw sample";
movie0[2]["Url"] = "flash_draw_sample";
movie0[2]["width"] = 550;
movie0[2]["height"] = 370;
movie0[2]["bgColor"] = "#4F5F5F";

movie0[3] = new Object();
movie0[3]["Name"] = "Flash Diagramme";
movie0[3]["Url"] = "flash_diagrams";
movie0[3]["width"] = 550;
movie0[3]["height"] = 370;
movie0[3]["bgColor"] = "#4F5F5F";


var movie1 = new Array();


movie1[0] = new Object();
movie1[0]["Name"] = "Akustisches Memory";
movie1[0]["Url"] = "flashgame_memory";
movie1[0]["width"] = 532;
movie1[0]["height"] = 320;
movie1[0]["bgColor"] = "#4F5F5F";

movie1[1] = new Object();
movie1[1]["Name"] = "Space Invaders Klon";
movie1[1]["Url"] = "flashgame_space_invaders_clone";
movie1[1]["width"] = 550;
movie1[1]["height"] = 370;
movie1[1]["bgColor"] = "#4F5F5F";

movie1[2] = new Object();
movie1[2]["Name"] = "Arcade Shooter";
movie1[2]["Url"] = "flashgame_arcade_shooter";
movie1[2]["width"] = 550;
movie1[2]["height"] = 370;
movie1[2]["bgColor"] = "#4F5F5F";


movie1[3] = new Object();
movie1[3]["Name"] = "Jump and Run";
movie1[3]["Url"] = "flashgame_supermario_clone";
movie1[3]["width"] = 550;
movie1[3]["height"] = 370;
movie1[3]["bgColor"] = "#4F5F5F";

movie1[4] = new Object();
movie1[4]["Name"] = "Pong";
movie1[4]["Url"] = "flashgame_pong";
movie1[4]["width"] = 280;
movie1[4]["height"] = 140;
movie1[4]["bgColor"] = "#4F5F5F";



function ActionFlashPlayer(myMenu,myNo,myType){



if(myType){
ActionMinimize(1)
var flashCode;
var menuCode="";
var movieName= this["movie"+myMenu][myNo]["Name"];




for (var i = 0; i < this["movie"+myMenu].length; i++) {
if(i==myNo){
menuCode += " <b><a href=\"#\"  class=\"a1\" onclick=\"ActionFlashPlayer("+myMenu+","+i+",1);return false;\">"+this["movie"+myMenu][i]["Name"]+"</a></b><br/>";

}else{
menuCode += " <a href=\"#\"  class=\"a1\" onclick=\"ActionFlashPlayer("+myMenu+","+i+",1);return false;\">"+this["movie"+myMenu][i]["Name"]+"</a><br/>";

}


}

var movieUrl= this["movie"+myMenu][myNo]["Url"];
var movieWidth = this["movie"+myMenu][myNo]["width"];
var movieHeight = this["movie"+myMenu][myNo]["height"];
var movieBgColor = this["movie"+myMenu][myNo]["bgColor"];

//var movieBgColor = "#CBCDCD";
     $('#boxContent').fadeOut(400);
     $('#boxFlashAction').fadeIn(400);
     
flashCode = "<div style=\"background-color:"+movieBgColor+";\">";
   flashCode += "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" WIDTH=\""+movieWidth+"\" HEIGHT=\""+movieHeight+"\" >";
  flashCode += "<PARAM NAME= movie VALUE=\"flash/"+movieUrl+".swf\">";
    flashCode += "<PARAM NAME=quality VALUE=high><PARAM NAME=scale VALUE=exactfit><param name=\"wmode\" value=\"transparent\"> "; 
    flashCode += "<EMBED src=\"flash/"+movieUrl+".swf\" quality=high name=datum scale=exactfit wmode=\"transparent\"   WIDTH="+movieWidth+" HEIGHT="+movieHeight+" TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>"; 
    flashCode += "</OBJECT>";    
    flashCode += "</div>";   
     flashCode += "<span style=\"font-size:9px;\">direkter Link: <a href=\"http://www.radiocity.ch?v="+myMenu+","+myNo+">http://www.radiocity.ch?v="+myMenu+","+myNo+"</a></span>";    
     
     var VarMovieTop = ((480-movieHeight)/2)-10;
      var VarMovieLeft = (600-movieWidth)/2;

     document.getElementById("boxFlashInnerContent").style.left = VarMovieLeft+"px";    
    document.getElementById("boxFlashInnerContent").style.top =VarMovieTop+"px";
     document.getElementById("boxFlashInnerContent").style.width =movieWidth+"px";
     document.getElementById("boxFlashInnerContent").innerHTML=flashCode;
     document.getElementById("boxFlashMenu").innerHTML=menuCode;
  
     }else{
 ActionMinimize(0)
     $('#boxFlashAction').fadeOut(400);
     $('#boxContent').fadeIn(400);    
     
     }
     
     
     
}


function fader(){
     $('#boxMenuMain').fadeTo("slow", 0.5);
}

function ActionMinimize(myType){
if(myType){
     $('#boxMenuMain').fadeOut(400);
          $('#boxMinimizedMain').fadeIn(400);
}else{

     $('#boxMenuMain').fadeIn(400);
          $('#boxMinimizedMain').fadeOut(400);
}




}



function starter(){

//setTimeout("ActionMinimize(1)",2000)

}
