// JavaScript Document


onresize = function() 
{
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';
}

function game1()
{
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';

	$('wrapper1').show();
	$('gamewindow1').show();
	opacity('wrapper1', 0, 50, 600);
	opacity('gamewindow1', 0, 100, 400);
	$('game1flash').innerHTML='<iframe src="game1/index.html" width="600" height="600" frameborder=\"0\"></iframe>';
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';	
}

function game2()
{
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';	
	
	$('wrapper1').show();
	$('gamewindow2').show();
	opacity('wrapper1', 0, 70, 600);
	opacity('gamewindow2', 0, 100, 400);
	var d = new SWFObject("scrapshoot.swf", "d", "640", "500", "8");
	d.write("game2flash");	
}

function game3()
{
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';

	$('wrapper1').show();
	$('gamewindow2').show();
	opacity('wrapper1', 0, 50, 600);
	opacity('gamewindow2', 0, 100, 400);
	$('game2flash').innerHTML='<iframe src="game3/index.html" width="640" height="500" frameborder=\"0\"></iframe>';
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';	
	
}

function game4()
{
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';

	$('wrapper1').show();
	$('gamewindow2').show();
	opacity('wrapper1', 0, 50, 600);
	opacity('gamewindow2', 0, 100, 400);
	$('game2flash').innerHTML='<iframe src="game4/index.html" width="640" height="500" frameborder=\"0\"></iframe>';
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';	
	
}

function plantgame()
{
	var a = confirm('De prijswinnaars zijn inmiddels bekend, je kunt dus geen prijzen meer winnen. Toch spelen?');
	if (!a) { return; }
	$('wrapper1').show();
	$('plantgamewindow').show();
	opacity('wrapper1', 0, 70, 600);
	opacity('plantgamewindow', 0, 100, 400);
}

function plantgame_()
{
	$('wrapper1').show();
	$('gamebinnenkort').show();
	opacity('wrapper1', 0, 70, 600);
	opacity('gamebinnenkort', 0, 100, 400);
}

function closegame1()
{
	opacity('wrapper1', 70, 0, 400);
	opacity('gamewindow1', 100, 0, 400);
	setTimeout("$('wrapper1').hide()",400);
	setTimeout("$('gamewindow1').hide()",400);	
	setTimeout("$('wrapper1').style.height='477px'",400);
	setTimeout("$('game1flash').innerHTML=''",400); 
	
}
function closegame2()
{
	opacity('wrapper1', 70, 0, 400);
	opacity('gamewindow2', 100, 0, 400);
	setTimeout("$('wrapper1').hide()",400);
	setTimeout("$('gamewindow2').hide()",400);	
	setTimeout("$('wrapper1').style.height='477px'",400);
	setTimeout("$('game2flash').innerHTML=''",400);	
}
function sluitgame() { verlaatgame(); }
function verlaatgame()
{
	opacity('wrapper1', 70, 0, 400);
	opacity('plantgamewindow', 100, 0, 400);
	setTimeout("$('wrapper1').hide()",400);
	setTimeout("$('plantgamewindow').hide()",00);	
//	setTimeout("$('plantgamewindow').innerHTML=''",400);	
}

onload = function() 
{
	//voor forum
	PreloadFlag = true;
	//
//	a_tags=document.getElementsByTagName('a')
//	for (i=0;i<a_tags.length;i++) {
//	a_tags[i].onfocus=blur_links
//	}
	
	SkipToFrame(label);	
	setTimeout("SkipToFrame(label)",500);
	setTimeout("SkipToFrame(label)",1000);
	setTimeout("SkipToFrame(label)",2000);
	setTimeout("SkipToFrame(label)",3000);	
	
	var h = document.body.parentNode.scrollHeight;
	$('wrapper1').style.height=h+'px';
	

	
}

function shiftOpacity(id, millisec) { 
    //if an element is invisible, make it visible, else make it ivisible 
    if(document.getElementById(id).style.opacity == 0) { 
        opacity(id, 0, 100, millisec); 
    } else { 
        opacity(id, 100, 0, millisec); 
    } 
} 

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 





/// flash movie scripts///

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}


function SkipToFrame(frame)
{
	var flashMovie=getFlashMovieObject("menu");
	flashMovie.TGotoLabel('_level0/', frame);
}

/// einde flash movie scripts///