/*****************************************************************************************************************/
/* Content
/*****************************************************************************************************************/
var arr_actueel = "";

/*****************************************************************************************************************/
/* Global Variables
/*****************************************************************************************************************/

/*****************************************************************************************************************/
/* Global Functions
/*****************************************************************************************************************/

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// onLoad functions:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function init() {
	document.body.onresize = function() {
		setPosition();
	}
	
	setPosition();
}

function setPosition() {
	var currWidth  = document.getElementById("divOutline").offsetWidth;
	var currHeight = document.getElementById("divOutline").offsetHeight;

	if (self.innerHeight) {	// all except Explorer
		var maxWidth = self.innerWidth;
		var maxHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		var maxWidth = document.documentElement.clientWidth;
		var maxHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		var maxWidth = document.body.clientWidth;
		var maxHeight = document.body.clientHeight;
	}	

	var newLeftPos = (maxWidth - currWidth) /2;
	var newTopPos  = (maxHeight - currHeight) /2;

	if (newLeftPos < 0) newLeftPos = 0;
	if (newTopPos < 0)  newTopPos = 0;
	
	document.getElementById("divOutline").style.left = newLeftPos + "px";
	document.getElementById("divOutline").style.top  = newTopPos + "px";
	document.getElementById("divOutline").style.marginLeft = "0px";
	document.getElementById("divOutline").style.marginTop = "0px";
	document.getElementById("divOutline").style.visibility = "visible";
}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Flash functions:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function writeFlashObj(swfFile, bgColor, swfWidth, swfHeight, swfVersion) {
	var objScript = "";
	
	objScript = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + swfVersion + ',0,0,0" width="' + swfWidth + '" height="' + swfHeight + '" id="flashObj">';
	objScript += '	<param name="movie" value="' + swfFile + '" />';
	objScript += '	<param name="quality" value="best" />';
	objScript += '	<param name="bgcolor" value="' + bgColor + '" />';
//	objScript += '	<param name="wmode" value="transparent" />';	
	objScript += '	<embed src="' + swfFile + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" loop="true"  quality="best" bgcolor="' + bgColor + '" wmode="transparent" width="' + swfWidth + '" height="' + swfHeight + '" name="flashObj" allowScriptAccess="sameDomain" />';
	objScript += '</object>';

	document.write(objScript);
}

function setFlashBg() {
	document.getElementById("divOutline").style.backgroundImage = "url(images/background_flash.gif)";
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// More popup functions:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var int_startWidth;
var int_startHeight = 15;
var int_currWidth   = int_startWidth;
var int_currHeight  = int_startHeight;


function showMore (str_contentFile, str_title, int_moreWidth, int_moreHeight) {
	setMoreDefaults();
	createMore(int_moreWidth, int_moreHeight);
	
	document.getElementById("moreHeaderTitle").innerHTML = str_title;
	document.getElementById("iframeMore").src = "content/" + str_contentFile;
}


function setMoreDefaults() {
	var int_moreTop  = 10;
	var int_moreLeft = 225; 

	int_startWidth   = 240;
	int_startHeight  = 15;
	int_currWidth    = int_startWidth;
	int_currHeight   = int_startHeight;

	document.getElementById("divMorePlaceholder").style.display = "none";
	document.getElementById("divMorePlaceholder").style.top     = int_moreTop + "px";
	document.getElementById("divMorePlaceholder").style.left    = int_moreLeft + "px";
	
	document.getElementById("moreHeaderTitle").innerHTML  = "";
}


function createMore(int_moreWidth, int_moreHeight) {
	var int_opacLevel  = 0
	var int_widthStep  = (int_moreWidth - int_startWidth) / 30;
	var int_heightStep = (int_moreHeight - int_startHeight) / 30;
	var obj_function   = document.getElementById("divMorePlaceholder");
	
	obj_function.style.display = "block";
	 
	var obj_timer      = setTimeout(function() { obj_function.bigger(); }, 1); 

	obj_function.bigger = function() {
		int_opacLevel  += 3;
		int_currWidth  += int_widthStep;
		int_currHeight += int_heightStep;
		
 		obj_function.style.width  = Math.round(int_currWidth) + "px";
		obj_function.style.height = Math.round(int_currHeight) + "px";
	
		if (navigator.appName == "Microsoft Internet Explorer") {
			obj_function.filters.alpha.opacity = int_opacLevel;
		} else {
			obj_function.style.MozOpacity = int_opacLevel/100;
		}
			
		if(obj_function.offsetWidth < int_moreWidth) {
			obj_timer = setTimeout(function() { obj_function.bigger(); }, 10);
		} else {
			// moreReady
			if (navigator.appName == "Microsoft Internet Explorer") {
				obj_function.filters.alpha.opacity = 100;
			} else {
				obj_function.style.MozOpacity = 1;
			}
		}
	}
}

function closeMore() {
	var obj_function   = document.getElementById("divMorePlaceholder");
	var int_opacLevel  = 100
	var int_currWidth  = obj_function.offsetWidth;
	var int_currHeight = obj_function.offsetHeight;
	var int_widthStep  = (int_currWidth - int_startWidth) / 25;
	var int_heightStep = (int_currHeight - int_startHeight) / 25;
	var obj_timer      = setTimeout(function() { obj_function.smaller(); }, 1); 

	obj_function.smaller = function() {
		int_opacLevel  -= 2;
		int_currWidth  -= int_widthStep;
		int_currHeight -= int_heightStep;
		
		if (int_currWidth > 0 && int_currHeight > 0) {
			obj_function.style.left   = Math.round(obj_function.offsetLeft + int_widthStep) + "px";
			obj_function.style.top    = Math.round(obj_function.offsetTop + int_heightStep) + "px";
 			obj_function.style.width  = Math.round(int_currWidth) + "px";
			obj_function.style.height = Math.round(int_currHeight) + "px";

			if (navigator.appName == "Microsoft Internet Explorer") {
				obj_function.filters.alpha.opacity = int_opacLevel;
			} else {
				obj_function.style.MozOpacity = int_opacLevel/100;
			}
			
			obj_timer = setTimeout(function() { obj_function.smaller(); }, 1);
		} else {
			setMoreDefaults();
		}
	}
}


