// JavaScript Document

var vdo_data = '';
var fileName;

function openLayerBC()
	{
	
	tWidth = $(document).width();
	tHeight = $(document).height();
    
	$("select").fadeOut('fast');
	$('#layer').css("width",tWidth+"px");
	$('#layer').css("height",tHeight+"px");
	//$('#layer').html('<div style="padding-left:'+($(window).width()/2)+'px;padding-top:'+(positions.cTop+($(window).height()/2)-20)+"px"+'" id="loaderImg"><img src="'+globalImgPath+'images/loader.gif"/></div>');
	$('#layer').css('z-index',9990);
	$('#layer').fadeIn('fast');
	$('#layer').bind("click",closePopupBC);

	}

function closePopupBC()
	{
	$("#popup").html('');
	$('#popup').fadeOut('fast');
	$('#layer').fadeOut('slow');
	$("select").fadeIn('fast');
	}

function brochuredownload(fileId, vWidth, vHeight)
	{
		if(vWidth == 0)
		{
			vWidth = 854;
		}
		if(vHeight == 0)
		{
			vHeight = 480;
		}
	//alert(fileId);
	fileName = video_file_name[fileId];
	var vdo_file = '<embed type="application/x-shockwave-flash" id="player2" name="player2" src="'+player_file_loc+'player-licensed.swf" width="'+vWidth+'" height="'+vHeight+'" allowscriptaccess="always" allowfullscreen="true" flashvars="file='+video_file_loc+fileName+'&bufferlength=3&autostart=true" />';
	//var vdo_file = '<embed src='+video_file_loc+fileName+' width="'+vWidth+'" height="'+vHeight+'" scale="tofit" autoplay="true" controller="true" cache="true" pluginspage="http://www.apple.com/quicktime/download/"></embed>'
	//alert(vdo_file);
	openLayerBC();
	if (vdo_data != '')
	{
		$("#popup").html(vdo_data);
	}
	topHtml = '';
	vdo_data = $("#popup").html();
	
	
	$("#popup_vdo").html(vdo_file);
	
	$("#popup").css("width", vWidth+"px");
	$("#popup").css("height", (vHeight+27)+"px");
	
	//bodyHtml = $("#brochureContent").html();
	$("#popup").css("border","5px solid #FFFFFF");
	//$("#popup").css("padding","0 0 10px 10px");
	$("#popup").css("background","#000000");
	$("#popup").css("z-index",10000);
	//$("#popup").html(topHtml+"<div id='brochureStyle'>"+bodyHtml+"</div>");
	
	$("#popup").css("left",(($(document).width() / 2) - (vWidth/2)));
	$("#popup").css("top",$(window).scrollTop()+40);
	$("#popup").fadeIn("slow");
	}

