function zetVideoLinks(){
	videolink = document.getElementsByTagName('a');
	for(i=0;i<videolink.length;i++){
		if(videolink[i].className == 'webvideo'){
			videolink[i].onclick = function(){
				openVideo(this);
				return false;
			}
		}
	}
}

function openVideo_old(dit){
	// maak de transparante div, wordt gestyled in de stylesheet
	var div1=document.createElement('DIV');
	div1.className='outer';
	var div2=document.createElement('DIV');
	div2.className='middle';
	div1.appendChild(div2);
	var div3=document.createElement('DIV');
	div3.className='inner';
	div3.setAttribute('id','flashcontainer');
	txt1 = document.createTextNode('');
	div3.appendChild(txt1);
	div2.appendChild(div3);
	// maak het flashobject

	var flashobject = '<h2><a href="javascript:sluitVideo();" title="Sluiten"><img src="/bezorgersgeadresseerd/img/webvideo-button-close.png" alt="" /></a><a href="javascript:fullscreen(\'';
	flashobject += dit.href;
	flashobject += '\');" title="Full screen"><img src="/bezorgersgeadresseerd/img/webvideo-button-fullscreen.png" alt="" /></a>';
	flashobject += dit.getAttribute('title')+'</h2><div id="flashhouder">';
	flashobject += '<object type="application/x-shockwave-flash" data="';
	flashobject += dit.href;
	flashobject += '" id="flashfilm" name="flashfilm" swliveconnect="true">';
	flashobject += '<param name="movie" value="';
	flashobject += dit.href;
	flashobject += '" />';
	flashobject += '<!--[if !IE]>--><param name="wmode" value="transparent"><!--<![endif]-->'
	flashobject += '</object></div>';
	flashobject += ''
	document.body.appendChild(div1);
	//alert(document.getElementById('flashcontainer').innerHTML)
	document.getElementById('flashcontainer').innerHTML = flashobject;
	
}


function openVideo(dit){
	var win = window.open(dit.href, 'NetwerkVSP','width=398,height=350,scrollbars=no,toolbar=no,location=no,resizable=yes');
                win.focus();
                return false; 
}





  function ce(tag,name){
    if (name && window.ActiveXObject){
      element = document.createElement('<'+tag+' name="'+name+'">');
    }else{
      element = document.createElement(tag);
      element.setAttribute('name',name);
    }
    return element;
  };

function sluitVideo(){
	thediv = document.getElementsByTagName('div');
	for(i=0;i<thediv.length;i++){
		if(thediv[i].className == 'outer'){
			document.body.removeChild(thediv[i]);
		}
	}
                var flashMovie=getFlashMovieObject("flashfilm");
                flashMovie.StopPlay();

}

function fullscreen(url){
	breedte = screen.availWidth;
	hoogte = screen.availHeight
	window.open(url,'fullflash','height='+hoogte+',width='+breedte+',status=yes,toolbar=no,menubar=no,location=no');
}

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);
  }
}
