
w33c = (document.getElementById)? true:false;
if (w33c) {
	nsb4 = false;
	ieb4 = false;
}
else if (!w33c) {
	nsb4 = (document.layers)? true:false;
	ieb4 = (document.all)? true:false;
}


if (w33c || ieb4 || nsb4) 	browserOK = true;

if (navigator.userAgent.indexOf("Firefox")!=-1)
	firefox = 1;
else
	firefox = 0;
	

function con() {
        if(!confirm("Weet u dit zeker ?"))
			return false;
		return true;
}

var dim = getWindowSize();


function getWindowSize() {
	var width, height;
    w = window;
    width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
    height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
    
    return [width,height];
}


function showDiv(div) {
	new Effect.Appear('overlay2', { duration: 1, from: 0.0, to: 0.6 });
	var arrayPageSize = getPageSize();
	Element.setWidth('overlay2', arrayPageSize[0]);
	Element.setHeight('overlay2', arrayPageSize[1]);
	Effect.Appear(div);
}


function closeDiv(div) {
		new Effect.Fade('overlay2');
		Effect.Fade(div);
		$(div).update('');
}

function showMovie() {
	new Effect.Appear('overlay2', { duration: 1, from: 0.0, to: 0.6 });
	var arrayPageSize = getPageSize();
	Element.setWidth('overlay2', arrayPageSize[0]);
	Element.setHeight('overlay2', arrayPageSize[1]);
	Effect.Appear('playmovie');
}


function closeFirst() {
		new Effect.Fade('overlay2');
		Element.hide('playmovie');
		$('loadMovie').update('');
}

function pause( iMilliseconds ){

    var sDialogScript = 'window.setTimeout( function () { window.close(); }, ' + iMilliseconds + ');';

    window.showModalDialog('javascript:document.writeln ("<script>' + sDialogScript + '<' + '/script>")');

}

var slideC = 0;
var fixPos = 0;
var firstS = 1;


function slideOpen() {
	
	//new Effect.Move('slider', {  x:-200 });
	//new Effect.Move('right', {  x:-200 });
	if(firstS && !firefox) {
		
		$('slider').setStyle({
			right: '40%'
		});
		$('right').setStyle({
			right: '0',
			width: '40%'
		});

		slideC++;
		
	}
	else {
		if($('right').getWidth()+100<dim[0]) {
			$('slider').morph({right: $('right').getWidth()+100+"px"});
			$('right').morph({width: $('right').getWidth()+100+"px"});
			slideC++;
		}
	}
}

function slideClose() {
	
	if(slideC) {
		$('slider').morph({right: $('right').getWidth()-150+"px"});
		$('right').morph({width: $('right').getWidth()-150+"px"});
		slideC--;
	}
	
}


function placeText() {
	
	
	posImg = findPos($('spot'));
	//posTxt = findPos($('fact'));
	
	if(firstS && !firefox) {
		if(!posImg[1]) {
			$('factD').setStyle({
				left: posImg[0]+50+"px",
				top: posImg[1]+280+"px"
			});
		}else {
			$('factD').setStyle({
				left: posImg[0]+100+"px",
				top: posImg[1]+55+"px"
			});
		}

		firstS = 0;
	}
	else {

		if(firefox) {
			$('factD').setStyle({
				left: posImg[0]-20+"px",
				top: posImg[1]+65+"px"
			});
			

		}
		else {
			
		
				if(!posImg[1]) {
					$('factD').setStyle({
						left: posImg[0]+40+"px",
						top: posImg[1]+280+"px"
					});
				}
				else {
					$('factD').setStyle({
						left: posImg[0]-20+"px",
						top: posImg[1]+65+"px"
					});
					
				}
		
			
			
			
			/*$('fact_imgD').setStyle({
				left: posImg[0]-32+"px",
				top: posImg[1]+$('factD').getHeight()+110+"px"
			});*/
		}
	}
	
	//if(fixPos && !posImg[1]) 
		//dofixPos();
	
	Effect.Appear('factD', ( { duration: 2.5 } ));
	Effect.Appear('fact_imgD', ( { duration: 0.5 } ));
	
	
	
	
}

function dofixPos() {
	posImg = findPos($('spot'));
	if(firefox) {
		$('factD').setStyle({
			left: posImg[0]+120+"px",
			top: posImg[1]+65+"px"
		});
		

	}
	else {
		$('factD').setStyle({
			left: posImg[0]+100+"px",
			top: posImg[1]+65+"px"
		});
		
	}
	
	fixPos = 0;
		

}

function fadeAll() {
	
	if($('factD'))
		Effect.Fade('factD', ( { duration: 0.1 } ));
	
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

var slideClosed = 0;
function  youreca() {
	
	if(!slideClosed) {
		$('youreca').morph({width: 200+"px"});
		//$('youreca').insert(,'After');
		new Insertion.Bottom('youreca','<span id="tmpId" style="display:none;" ><a style="margin-left:5px;margin-top:2px;" href="http://www.youreca.be" target="_blank">Webmastered by Youreca</a></span>');
		slideClosed = 1;
		Effect.Appear('tmpId', ( { duration: 1.0 } ));
	}
}


function restoreYoureca() {
	
	if(slideClosed ) {
		Effect.Fade('tmpId', ( { duration: 1.0 } ));
		$('youreca').morph({width: 30+"px"});
		slideClosed = 0;
		
	}
	
}


function swapInfo(div) {
	$('carInfo').update($(div).innerHTML);
	Effect.Appear('carInfo');
	$('carInfo').setStyle({
			overflow: "auto",
			height: '365px'
		});
}
