// VARS - INTERFACE
var minHeight = 715;
var headerHeight = 48;
var bH;

// INÍCIO - REDIMENSIONAMENTO HTML/FLASH
function browserResize()
{
    if( typeof( window.innerHeight ) == 'number' ) {

        //Non-IE
        bH = window.innerHeight;

        } else if( document.documentElement && document.documentElement.clientHeight ) {

        //IE 6+ in 'standards compliant mode'
        bH = document.documentElement.clientHeight;

        } else if( document.body &&  document.body.clientHeight ) {

        //IE 4 compatible
        bH = document.body.clientHeight;
    }

    if(bH < minHeight) bH = minHeight;
}

function resizeFlash()
{
    browserResize();

    var h = bH - headerHeight;
    document.getElementById("f_content").height = (h + "px");
}
// FINAL - REDIMENSIONAMENTO HTML/FLASH

// INÍCIO - FLASH SWFOBJECT
// swfobject vars
var params = {
        quality: "high",
        scale: "noscale",
        wmode: "transparent",
        menu:"false",
        allownetworking:"all",
        allowscriptaccess: "always"
};

var attributes = {
        id:"f_content",
        name:"f_content"
};

var flashvars = {
        dataXML:"xml/application.xml",
        indexSWF:"swf/index.swf"
};

//Getting querystring params
paramPairs = window.location.search.substring(1).split("&");
for(var i = 0; i < paramPairs.length; i++) {
    var pair = paramPairs[i].split("=");
    flashvars[pair[0]] = pair[1];
}

// se o flash não funcionar, ir para esse endereço
function swfCallback (e) {
    if(!e.success) window.location = "http://www.fiat.com.br/monte-seu-carro/monte/196/NOVO+PALIO+2012";
}

//inicializacao do swf
browserResize();
var h = bH - headerHeight;

swfobject.embedSWF("swf/main.swf", "flashcontent", "100%", h, "10.2", "swf/expressinstall.swf", flashvars, params, attributes, swfCallback);
window.onresize = resizeFlash;
//FINAL - FLASH SWFOBJECT
