//$c10 SRC 12/06/13 SPR 746103 Fixed: Changes related not to show Discovery link URL and to open the webpage based on the current language.
//$c9 SRC 09/23/13 SPR 730623 fixed. Changes related to add Discovery link in start page.
//$c8 NAJ 08/20/12 SPR 659598 changes in GotoNextStep()
//$c7 TMZ 02/26/09 PRJ 15008 changes for new workflow.
//$c6 TMZ 02/05/08 update btnstats in showpage
//$c5 TMZ 12/22/08 Moved wizard code to data/cwwizard
//$c4 TMZ 11/10/08 PRJ 15008 added onUnLoad
//$c3 TMZ 11/07/08 PRj 15008 made navigation button implementation generic 
//$c2 TMZ 10/31/08 PRj 15008 changes for xpress simualtion wizard
//$c1 TMZ 10/20/08 created.
//
//
//========================================================================//
//              Copyright 2008 (Unpublished Material)                     //
//                  SolidWorks Corp.                                      //
//========================================================================//
//
//
//     Application: Cosmosworks
//
// No part of these files may be reproduced or used outside of the SolidWorks product
// for any purpose, without the express written permission of SolidWorks Corporation.
//
//========================================================================//
//
//  
//

function initPage() 
{
	loadContentStrings();			// Load all strings for the web page
    
    //commonInitPage(0);
    //resizeInfoPane();
    MM_preloadImages('images/close_mo.png','images/back_mo.png')    
    
	var text = GetSectionState(0);
    var arryString = text.split("@");		
    var activeDiv = arryString[0];
    var state = arryString[1];
    if(GetCWState(0))
    {
        showPage('Div_Existing_Study');	    
    }
    else
    {
        showPage('Div_GetStarted_First');	        
    }

	//resetInfoPane();    
    
    setActivateNavBtnState(g_GetStartedNavBtnID, true);    
}

function onUnLoad()
{
    setActivateNavBtnState(g_GetStartedNavBtnID, false);
}

function loadContentStrings() 
{
	var pageStrings = "";
	pageStrings = GetPageText(55920, 55926) + GetPageText(55211, 55211) + GetPageText(55410, 55410) + GetPageText(56063, 56064);
//		alert(pageStrings);

	if(pageStrings == "Error")					// If SW strings not found, then get default English string values.
		return;
    
    writeStrings(pageStrings);
    return;
}

function showPage(whichDiv)
{
    var loadButtonState = GetSavedState(0);
    if(loadButtonState == 0)
        {loadButtonState = 1;}
	
	hideShowAllOf( whichDiv, false );
	//resetInfoPane();
    //resizeInfoPane();
    SetSectionState(0, whichDiv, loadButtonState);	    
    UpdateBtnState(g_GetStartedNavBtnID);        
}


function GotoNextStep()
{   
    //defineStudy( 0, 0 );
    window.navigate("wizfixtures.html");
    doCommand(3, 20, 0);
    UpdateBtnState(g_GetStartedNavBtnID); 
    SetSectionState(0, 'Div_GetStarted_First', 3);	        
 	//resetInfoPane();    
    //UpdateBtnState(g_LoadFixNavBtnID);	    
    //ActivateNavBtn(g_LoadFixNavBtnID);
    //window.navigate("wizfixtures.html"); SPR 659598 - moved before doCommand()
}

function ShowOptionsDlg()
{
    doCommand(3, 25, 0); // hide visible plots if any.
    doCommand(3, 29, 0);
}

function OpenSimCapabilitiesPage()
{
    doCommand(3, 46, 0);
}
