// JavaScript Document
// haalt parameters uit de URL
function gup( name )
{
	  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( window.location.href );
	  if (results == null)
		{
			return "" 
		}
		else
		{
			return results[1];
		}
}
 //Support function: checks to see if target
//element is an object or embed element

function isObject(targetID)
{
   var isFound = false;
   var el = document.getElementById(targetID);
   
   if(el && (el.nodeName === "OBJECT" || el.nodeName === "EMBED")){
   
      isFound = true;
   
   }
   
   return isFound;
}
//maak een lege <div> waar het swfobject staat zodat het terug gecreeeerd kan worden
function replaceSwfWithEmptyDiv(targetID)
{
   var el = document.getElementById(targetID);
   if(el){
   
      var div = document.createElement("div");
      el.parentNode.insertBefore(div, el);
 
      //Remove the SWF
      swfobject.removeSWF(targetID);
   
      //Give the new DIV the old element's ID
      div.setAttribute("id", targetID);
      
   }
   
}
	
// herlaad de video film
function resetSwf(video)
{
		theFrame = document.getElementById("pop-frame");
	    theFrame.style.display="block";
		var width=560;
		var height=350;
		var params = {};
		var attributes = {};
		var flashvars = {};
		flashvars.CustomerId ="70002034" ;
		flashvars.CustomerVideo = video;
		flashvars.PlayerSkin = "White";
		flashvars.PlayerPlays = "FALSE";
		flashvars.PlayerTitles = "TRUE";
		flashvars.PlayerWidth = width;
		flashvars.PlayerHeight = height;
		flashvars.CurrentVideo = "";
		flashvars.PlayerBack = "";
		flashvars.LogoBezoom = "";
		flashvars.Get3gp = "";
		flashvars.varresult = "";
		flashvars.PlayerLoop = "True";
		swfobject.embedSWF("http://www.bezoom.tv/PlayerBezoom/PlayerBezoom.swf", "video-div", width, height, "9.0.0", false, flashvars, params, attributes);
	}
	
//function showMe(video){
//if(document.getElementById)
//{
//	var theFrame = document.getElementById("pop-frame");
//	theFrame.style.visibility="visible";
//	resetSwf(video);
//	};
//}

function hideMe(){
	theFrame=document.getElementById("pop-frame");
	if (theFrame){
	if (theFrame.style.display=="block") { theFrame.style.display="none";}
	replaceSwfWithEmptyDiv("video-div");
	//insertFlash("/slideshow.swf", "/contact-settings.php","150","81", "contact-slides");
	insertFlash("/slideshow.swf", "/slides.xml","150","81", "contact-slides");

}
}

function showMe(video)
{
	//replaceSwfWithEmptyDiv("contact-slides");
	var el=document.getElementById("contact-slides");
	//el.innerHTML="<img src='http://www.gold-50.be/slides/contact.jpg' />";
	el.innerHTML="<img src='/slides/contact.jpg' />";
	resetSwf(video);
}