var homedir = "http://henktenoever.nl/";
//var homedir = "http://thedailymovienews.com/"; // LET OP UIT!!!
//var homedir = "http://localhost/"; // LET OP UIT!!!

jQuery(function() {

	jQuery('.playbut').live('click', function(event) {
		jQuery(".gallerybox").animate({ opacity: 0 }, 400, function() { jQuery('div').remove('.gallerybox'); });
		playVid($(this).attr("href").replace(".jpg", ""));
		return false;
	});

});


function removeVideo() { 
	jQuery('div').remove('.dynamicDiv');
}

function playVid(id){ 

	jQuery('div').remove('.dynamicDiv');
	
	var divFla = document.createElement("div");
	divFla.id = "divflash"+id;
	divFla.className ="dynamicDiv";
	divFla.style.position = "absolute";
	divFla.style.top = jQuery("#"+id).parent().offset().top+"px";
	divFla.style.left = jQuery("#"+id).parent().offset().left+"px";
	divFla.style.zIndex = 9999;
	divFla.style.width = jQuery("#"+id).parent().width()+"px";
	divFla.style.height = Math.round((jQuery("#"+id).parent().width()/854)*480)+"px";

	jQuery(divFla).flash({
	swf: homedir+'videoplayer.swf',
	height: '100%',
	width: '100%',
	hasVersion: 9,
	scale: 'showall',
	allowFullScreen: true,
	allowscriptaccess: 'always',
	wmode: 'opaque',
	flashvars: {
		nde: id
		}
	});
			
	jQuery(divFla).appendTo("body");
	
}
