	
	function Browser(){
	  this.uA = navigator.userAgent.toLowerCase();
	  this.aN = navigator.appName.toLowerCase();
	  this.iE = this.aN.indexOf('microsoft') != -1 ? 1 : 0;
	  this.mac =  this.uA.indexOf('mac') != -1 ? 1 : 0;
	  this.win = this.uA.indexOf('windows') != -1 ? 1 : 0;
	  this.safari =  this.uA.indexOf('webkit') != -1 ? 1 : 0;
	  this.opera =  this.uA.indexOf('opera') != -1 ? 1 : 0;    
	  this.mozilla = this.aN.indexOf('netscape') != -1 && !this.safari ? 1 : 0;
	  this.winMozilla = this.mozilla && this.win ? 1 : 0;
	  this.winIE = this.iE && this.win && !this.opera ? 1 : 0;
	  this.winIE6Down = this.winIE && parseInt(this.uA.split('msie ')[1].substring(0,1)) <= 6 ? 1: 0;
	  this.macIE = this.iE && this.mac ? 1 : 0;
	};

	var browser = new Browser();
	
	function startLightbox(boxwidth, boxheight, content){
		if(browser.winIE){
			if(boxheight >document.documentElement.clientHeight-150)	{
				boxheight = document.documentElement.clientHeight-150;
				document.getElementById('lightbox').style.left=((document.body.clientWidth - boxwidth)/2)+'px' ;
				document.getElementById('lightbox').style.top=((document.documentElement.clientHeight - boxheight)/2 + document.documentElement.scrollTop)+'px';
			}else{
				document.getElementById('lightbox').style.left=((document.body.clientWidth - boxwidth)/2)+'px' ;
				document.getElementById('lightbox').style.top=((document.documentElement.clientHeight - boxheight)/2 + document.documentElement.scrollTop)+'px';
			}
		}else{
			if(boxheight > window.innerHeight-150)	{
				boxheight = window.innerHeight-150;
			document.getElementById('lightbox').style.left=((window.innerWidth - boxwidth)/2)+'px' ;
			document.getElementById('lightbox').style.top=((window.innerHeight - boxheight - 100)/2 + window.pageYOffset)+'px';
			}else{
				document.getElementById('lightbox').style.left=((window.innerWidth - boxwidth)/2)+'px' ;
				document.getElementById('lightbox').style.top=((window.innerHeight - boxheight)/2 + window.pageYOffset)+'px';
			}
		}
		document.getElementById('lightbox').innerHTML=content;
		if(document.getElementById('screenshot')){
			document.getElementById('screenshot').style.width=boxwidth+'px';
			document.getElementById('screenshot').style.height=(boxheight-50)+'px';
		}
		document.getElementById('lightbox').style.width=boxwidth+'px';
		document.getElementById('lightbox').style.height=boxheight+'px';
		document.getElementById('lightbox').style.display="block";
		//alert(boxwidth+' X '+boxheight+"\n"+content);
	}
	function stopLightbox(){
		document.getElementById('lightbox').style.display='none';
	}
	function startDemo(location, width, height){
		if(browser.winIE){
			window.open("_media/_swf/"+location, width+height,'width='+(width+20)+',height='+(height+20));
		}else{
			/*alert('check');*/
			startLightbox(width, height+50, '<a href="javascript:stopLightbox();">sluiten</a><br/><br/><div id="demoBlock"></div>');
			var so = new SWFObject("_media/_swf/"+location, "demo", width, height, "9", "#000");
			so.write("demoBlock");
		}
	}
	function startScreenshot(location, width, height){
		startLightbox(width, height+20, '<a href="javascript:stopLightbox();">sluiten</a><br/><br/><div id="screenshot" style="background:url(\'_media/_img/'+location+'\')"></div>');
	}
/*
  	<script type="text/javascript">
		// <![CDATA[
		var so = new SWFObject("/2006/shell.swf?playerxml=/2006/flvplayer.xml", "shell", "760", "427", "9", "#000");
    so.addParam("videoplay", "true");
    so.addParam("wmode", "transparent");
		so.write("ria");
		// ]]>
	</script>
*/

