// JavaScript Document

//test function
function test(){window.alert("test");}

//adjust size webpage for different screenresolutions

function screenResolution(){
	 var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
	var containerHeight = myHeight * 0.93;
	var containerWidth = 1.2 * containerHeight;

	$('#container').width(containerWidth); 
	$('#container').height(containerHeight);
	
	$('#container').css('left', (myWidth-containerWidth)/2);
	
	//to do: onderstaande werkt nog niet voor het iframe van nieuws
	
	if (screen.width <= 1400){
	$('h1').css('font-size','11px');
	$('h2').css('font-size','11px');
	$('p').css('font-size','11px');
	$('a').css('font-size','11px');
	}
		if (screen.width <= 900){
	$('h1').css('font-size','8px');
	$('h2').css('font-size','8px');
	$('p').css('font-size','8px');
	$('a').css('font-size','8px');
	}
	
}

//set a link to active
function setLinkActive(id){ 
	obj = document.getElementById(id);
	obj.style.fontWeight = "bold";
}

//set a link to inactive
function setLinkInActive(id){ 
	obj = document.getElementById(id);
	obj.style.fontWeight = "normal";
}

//fade in first image or div when it is loaded
function fadeInId(id,time)
{	
	$(id).hide();
	$(window).load(function () {
  		$(id).fadeIn(time);
		$(id).show();
	});
}
