var c_serverUrl = "http://localhost:8080/spotfire/wp/"; //your webplayer url. remove the spacing between last / and “
var c_analysisPath = "/test/Analytics/AssetManagerKPIs"; //path to your analysis after /Library/

var c_parameters = "";
var customization = new spotfire.webPlayer.Customization();

var app;
var wp_doc, wp_doc1;
var c_reloadAnalysisInstance = false;

window.onload=function()
{
app = new spotfire.webPlayer.Application(c_serverUrl, customization, c_analysisPath, c_parameters, c_reloadAnalysisInstance);


//create the customisation variable for the web player
customization.showDodPanel = false;
customization.showStatusBar = false;
customization.showToolBar = false;
customization.showAuthor = false;
customization.showPageNavigation = false;
customization.showClose = false;
customization.showAnalysisInfo = false;
customization.showExportFile = true;
customization.showExportVisualization = false;
customization.showUndoRedo = false;
customization.showFilterPanel = false;


var onOpened = function(analysisDocument)
{
console.log("Analysis has opened");
};

var onError = function(errorCode, description)
{
alert(errorCode + ": " + description);
};

app.onOpened(onOpened);
app.onError(onError);
wp_doc1 = app.openDocument("filter", "Filter", customization);
wp_doc = app.openDocument("summary-kpi", "Summary KPI", customization);
wp_doc = app.openDocument("map", "Map", customization);
wp_doc = app.openDocument("monthly-allocation", "Monthly Allocation", customization);
wp_doc = app.openDocument("cumulative-production", "Cumulative Production", customization);

wp_doc = app.openDocument("well-summary", "Well Summary", customization);
wp_doc = app.openDocument("production-loss", "Production Losses", customization);
wp_doc = app.openDocument("downtime-loss", "Downtime Losses", customization);
wp_doc = app.openDocument("production-opportunities", "Production Opportunities", customization);


//app.openDocument(arg1, arg2, arg3, arg4) arguments
//arg1: This refers to the div component to embed the web player
//arg2: This is optional. Analysis page name as default page to display

}