function sramk_flash_advantage(motorType, sectionId) {
    if (motorType == "home") {
        var flashvars = {};
        var filename = "advantage_home";
    }
    else {
        var flashvars = {
            motorType: motorType,
            sectionID: sectionId
        };
        var filename = "advantage";
    }
    var params = {
        allowfullscreen: "true",
        bgcolor: "#000000",
        quality: "best",
        wmode: "transparent"
    };
	var attributes = {};
	
	// Load Flash
	if (userHasFlashVersion) {
	    swfobject.embedSWF("/_ui/sramk08/swf/advantage/" + filename + ".swf", "flash-advantage", "960", "470", flashVersion, expressInstall, flashvars, params, attributes);
	} else {
	    $('div#flash-advantage').append('<div class="noflash"><p>The Advantage Minn Kota feature is only viewable with the latest version of <a href="http://get.adobe.com/flashplayer">Adobe Flash Player</a>. You can view summarized versions of Minn Kota\'s technologies in the "Features" tab on all <a href="/products/trolling_motors/">Trolling Motors</a>.</p></div>');
	}
}

$(document).ready(function() {
    // Water Types
    if (document.location.href.indexOf("saltwater") != -1) {
        var motorType = "salt";
    }
    else if (document.location.href.indexOf("freshwater") != -1) {
        var motorType = "fresh";
    }
    else if (document.location.href.indexOf("ipilot") != -1) {
        var motorType = "ipilot";
    }
    else {
        var motorType = "home";
    }

    // Section ID
    var section_qs = location.search.substr(1).split("&");
    var sectionId = section_qs[0].split("=")[1];

    // Product Landing
    if ($('#flash-advantage').length > 0) {
        sramk_flash_advantage(motorType, sectionId);
    }
});
