// CONSTANTES
MIN_HEIGHT = 568;
MAX_HEIGHT = 900; 
MENU_HEIGHT = 190;
MIN_WIDTH = 900;
BG_WIDTH = 1440;
BG_HEIGHT = 800;

function ShowPassion (Path) {
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1440" height="800" id="PassionSWF">');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="movie" value="'+Path+'" />');
    document.write('<param name="menu" value="false" />');
    document.write('<param name="play" value="true" />');
    document.write('<param name="scale" value="default" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<embed src="'+Path+'" menu=false play=true quality=high wmode=transparent scale=default width="1440" height="800" name=PassionSWF swLiveConnect=true allowScriptAccess=sameDomain type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
}

function FitFlash() {

    if (is.ie6up && !is.ie7) {
        YBody = document.body.clientHeight;
        XBody = document.body.clientWidth;
    }
    else if (is.ffox) {
        YBody = window.innerHeight;
        XBody = window.innerWidth;
    } 
    else if (is.ie7) {
        YBody = document.documentElement.clientHeight;
        XBody = document.documentElement.clientWidth; 
    }

    YBody = document.getElementById('divY').offsetHeight;
   
    //Ajusto Ancho
    if (XBody <= MIN_WIDTH) {
        document.getElementById('FlashFrame').style.width = MIN_WIDTH + 'px';
    }
    
    if (XBody > MIN_WIDTH) {
        document.getElementById('FlashFrame').style.width = '100%';
    }
    //Ajusto Alto
   
    if (YBody < MIN_HEIGHT) {
        document.getElementById('FlashFrame').style.height = MIN_HEIGHT + 'px';
    }
    
    if (YBody >= MIN_HEIGHT && YBody <= MAX_HEIGHT) {
        document.getElementById('FlashFrame').style.height = document.getElementById('divY').offsetHeight + 'px';
    }
    
    if (YBody > MAX_HEIGHT) {
        document.getElementById('FlashFrame').style.height = MAX_HEIGHT + 'px';
    } 
   
    
    //Centro en Marco
    if (XBody <=  BG_WIDTH) {
        document.getElementById('FlashContent').style.marginLeft =  (Math.round((BG_WIDTH - XBody) / 2) * -1) + 'px' ;
    }
    
    if (YBody < MIN_HEIGHT) {
        document.getElementById('FlashContent').style.marginTop = '0px';
    }
    
    if (YBody >= MIN_HEIGHT && YBody <= MAX_HEIGHT) {
        document.getElementById('FlashContent').style.marginTop = '0px';
    }
    
    if (YBody > MAX_HEIGHT) {
        document.getElementById('FlashContent').style.marginTop = (MAX_HEIGHT - BG_HEIGHT) + 'px';
    }
    
    document.getElementById('FlashFrame').style.visibility = "Visible";
       
}