// JavaScript Document
// minimum flash version to view the website
flash_version = 8;
 
function carregar(filme, div, _w, _h, par) {
 // writes the flash movie when document completly loads
 //alert(filme+' '+div+' '+_w+' '+_h);
 var div = document.getElementById(div);
 var version = deconcept.SWFObjectUtil.getPlayerVersion ();
 // if user does not have the minimum version, writes an alert mesage
 if(version["major"] < flash_version) div.innerHTML = 'You need the newest version of Adobe Flash Player to view this website.<br><br>Please download the player clicking on the following link:<br><br><a href=" http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash " target="_blank" title="Instalar Flash Player">Install Flash Player</a>';
 else {
  // writes flash
  flash(filme, div, _w, _h, par);
  // set the flash div height
  setFlashHeight(div, _w, _h);
 }
}

flash = function(filme, div, _w, _h, par) {
 // the parameters are: the movie file, the js id of the movie, width, height, minimum flash version
 var swf = new SWFObject(filme, div, _w, _h, flash_version);
 // this is to avaoid flash scaling...
 // if you want that Flash scales proportionally to 100% as in Tribeca Summit website, replace "noscale" for "showAll"
 swf.addParam("scale", "noscale");
 swf.addParam("menu", false);
 swf.addParam("wmode", "transparent");
 swf.addParam("flashVars", "par="+par);
 swf.write(div);
} 

setFlashHeight = function(div, _w, _h) {
 //  this functions is to show the browser scroller if the user's browser available browser space is minot than the minimal flash movie
 var minW = _w; // change for width of the stage of the flash movie
 var minH = _h; // change height of the stage of the flash movie
 // gets the client available space
 var w = document.body.clientWidth;
 var h = document.body.clientHeight;
 var div = document.getElementById(div);
 // if available space in major than the movie dimension, sets to 100% and show the flash bg, ele sets to the mininum dimensions to show the scroller
 div.style.width = (w > minW) ? ("100%") : minW + "px";
 div.style.height = (h > minH) ? ("100%") : minH + "px";
}
 
// re-calculates the div size when browser resize
//window.onresize = setFlashHeight;
