$(document).ready(function() {
	
	//$('div.png_fix').pngFix();
	$('.png_fix').supersleight();

});
function showVideo(videoFilename, subtitleFilename, closeText) {
	// update download link
	$("#downloadVideo").attr("href", videoFilename);
	
	var so = new SWFObject('/flash/shared/player-licensed.swf','mpl','530','350','9');
		so.addParam("allowfullscreen","true");
		so.addParam("allowscriptaccess", "always");
		so.addParam("wmode", "transparent");
		so.addVariable("file",videoFilename);
		so.addVariable('autostart', 'true');
		 
		so.addVariable("plugins", "gapro-1");
		so.addVariable("gapro.accountid","UA-1494547-14");
		so.addVariable("gapro.trackstarts","true");
		so.addVariable("gapro.trackpercentage","true");
		so.addVariable("gapro.tracktime","true");

	var api = $("#overlay_conatiner").overlay({ 
		 
	    close: '.right_container .close',
	 
	    // some expose tweaks suitable for facebox-looking dialogs 
	    expose: { 
	 
	        // you might also consider a "transparent" color for the mask 
	        color: '#000', 
	 
	        // load mask a little faster 
	        loadSpeed: 200, 
	 
	        // highly transparent 
	        opacity: 0.7 
	    }, 
	 
	    // disable this for modal dialog-type of overlays 
	    closeOnClick: false, 
	 
	    // we want to use the programming API 
	    api: true 
	 
	// load it immediately after the construction 
	}).load();
	
	so.write('overlay_conatiner');
 
	$('#overlay_conatiner').prepend('<div class="close_button close"><p class="button"><a href="javascript:;">'+closeText+'</a></p></div>');
	
	$(".close").click(function () {
		api.close();
		$('#overlay_conatiner').empty();
	});
	
	$('.png_fix').supersleight();
	
	return false;
	
}

function technologyVideo( videoFilename, subtitleFilename, div, textDiv){
	
	$('#'+div).empty();
	var so = new SWFObject('/flash/shared/player-licensed.swf','mpl','530','350','9');
	so.addParam("allowfullscreen","true");
	so.addParam("allowscriptaccess", "always");
	so.addParam("wmode", "transparent");
	so.addVariable("file",videoFilename);
	so.addVariable('skin', '/flash/shared/stylish.swf');
	so.addVariable('autostart', 'true');
	so.addVariable("plugins", "gapro-1");
	so.addVariable("gapro.accountid","UA-1494547-14");
	so.addVariable("gapro.trackstarts","true");
	so.addVariable("gapro.trackpercentage","true");
	so.addVariable("gapro.tracktime","true");
	
	
	
	so.write(div);
	
	if( textDiv != null ){
		switchText( textDiv );
	}

}
function technologyImage( imagePathName, div, textDiv){
	
	$('#'+div).empty();
	
	$('<img src="'+imagePathName+'" />').appendTo('#'+div);
	
	if( textDiv != null ){
		switchText( textDiv );
	}
	
}
function switchText( textDiv ){
	
	if( $('#'.textDiv).length != 0 ){
		
		var children = $("#overlay_text").children();
		
		children.each(function (i) {

			$(this).hide();
		});
		
		$('#'+textDiv).show();
		
	}

}

