/////////////////////////////////////////////////////////////////////////////
//
// Function : JOP_FlashContent
// Comments : This is the Spotlight Fragment, it will rotate the spotlight
//            based on a refresh.
//
/////////////////////////////////////////////////////////////////////////////


function JOP_FlashContent(sitepath,pageloc)
{
    this.m_NavPath    = g_navNode_Path;
    this.Sitepath     = sitepath;
    this.pageLocation = pageloc;

    this.urlList      = new Array();
    this.idList       = new Array();
    this.heightList   = new Array();
    this.widthList    = new Array();
    this.locationList = new Array();

    JOP_FlashContent.prototype.DisplayNode         = JOP_FlashContent_DisplayNode; 
    JOP_FlashContent.prototype.Display             = JOP_FlashContent_Display;
    JOP_FlashContent.prototype.pathInList          = JOP_FlashContent_pathInList;
    JOP_FlashContent.prototype.displayFlashContent = JOP_FlashContent_displayFlashContent;
    JOP_FlashContent.prototype.buildFlashList      = JOP_FlashContent_buildFlashList;
}
function JOP_FlashContent_Display (node)
{
    this.buildFlashList();
    this.DisplayNode(node);
}

function JOP_FlashContent_DisplayNode (node)
{

    if ( this.m_NavPath[this.m_NavPath.length-1] == node.m_id ) {
        if ( this.pathInList(node.m_href) > -1 ) {
            this.displayFlashContent(this.pathInList(node.m_href));
        }
    }
    
    if ( (this.m_NavPath[node.m_level] == node.m_id) || (node.m_level == 0) ) {
        for (var i = 0; i < node.m_subNodes.length; i++) {
           this.DisplayNode(node.m_subNodes[i]);
        }
    }
}

function JOP_FlashContent_pathInList (folderPath)
{
    var returncode = -1;

    for (var i = 0; i < this.urlList.length; i++) {
        if ( (folderPath.indexOf(this.urlList[i]) > -1) && (this.pageLocation.indexOf(this.locationList[i]) > -1) ) {
            returncode = i;
        }
    }
    return returncode;
}

function JOP_FlashContent_displayFlashContent (i) {
    if ( i > -1 ) {
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + this.widthList[i] + '" height="' + this.heightList[i] + '">');
        document.write('<param name="movie" value="' + this.Sitepath + this.idList[i] + '">');
        document.write('<param name="quality" value="high">');
        document.write('<embed src="' + this.Sitepath + this.idList[i] + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + this.widthList[i] + '" height="' + this.heightList[i] + '"></embed>');
        document.write('</object>');
    }
}

function JOP_FlashContent_buildFlashList () {

    //sectiontab is the Section Tab Flash on Country Home Page

    this.idList.push('jweb_004053.swf');
    this.urlList.push('us/index.html');
    this.heightList.push('142');
    this.widthList.push('417');
    this.locationList.push('sectiontab');

    this.idList.push('jweb_004054.swf');
    this.urlList.push('ca/index.html');
    this.heightList.push('142');
    this.widthList.push('417');
    this.locationList.push('sectiontab');

    this.idList.push('jweb_004055.swf');
    this.urlList.push('uk/index.html');
    this.heightList.push('142');
    this.widthList.push('417');
    this.locationList.push('sectiontab');

    //frofy is the Find the Right Opportunity flash on the WEJ FROFY Page

    this.idList.push('jweb_004031.swf');
    this.urlList.push('us/wej/FindtheRightOpportunityForYou/index.html');
    this.heightList.push('700');
    this.widthList.push('425');
    this.locationList.push('frofy');

    this.idList.push('jweb_004029.swf');
    this.urlList.push('ca/wej/FindtheRightOpportunityForYou/index.html');
    this.heightList.push('700');
    this.widthList.push('425');
    this.locationList.push('frofy');

    this.idList.push('jweb_004030.swf');
    this.urlList.push('uk/wej/FindtheRightOpportunityForYou/index.html');
    this.heightList.push('700');
    this.widthList.push('425');
    this.locationList.push('frofy');

    //divdesc is the Division Descriptions Flash on the HQ 

    this.idList.push('jweb_004089.swf');
    this.urlList.push('us/headquarters/DivisionDescriptions/index.html');
    this.heightList.push('300');
    this.widthList.push('425');
    this.locationList.push('frofy');

    this.idList.push('jweb_004090.swf');
    this.urlList.push('ca/headquarters/DivisionDescriptions/index.html');
    this.heightList.push('300');
    this.widthList.push('425');
    this.locationList.push('frofy');

    this.idList.push('jweb_004091.swf');
    this.urlList.push('uk/headquarters/DivisionDescriptions/index.html');
    this.heightList.push('300');
    this.widthList.push('425');
    this.locationList.push('frofy');

    //banner is the Banner Flash on all Section and Country Home Pages

    //US
    this.idList.push('jweb_004072.swf');
    this.urlList.push('us/index.html');
    this.heightList.push('240');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004074.swf');
    this.urlList.push('us/wej/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004076.swf');
    this.urlList.push('us/fa/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004075.swf');
    this.urlList.push('us/fa/StartingYourFinancialSalesCareer/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('web063874.swf');
    this.urlList.push('us/fa/ExperiencedFinancialAdvisors/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004079.swf');
    this.urlList.push('us/boa/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004080.swf');
    this.urlList.push('us/headquarters/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004081.swf');
    this.urlList.push('us/students/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    //CA
    this.idList.push('jweb_004366.swf');
    this.urlList.push('ca/index.html');
    this.heightList.push('240');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004367.swf');
    this.urlList.push('ca/wej/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004368.swf');
    this.urlList.push('ca/fa/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004369.swf');
    this.urlList.push('ca/fa/StartingYourFinancialSalesCareer/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004370.swf');
    this.urlList.push('ca/fa/ExperiencedFinancialAdvisors/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004371.swf');
    this.urlList.push('ca/boa/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004372.swf');
    this.urlList.push('ca/headquarters/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004373.swf');
    this.urlList.push('ca/students/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    //UK
    this.idList.push('jweb_004374.swf');
    this.urlList.push('uk/index.html');
    this.heightList.push('240');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004375.swf');
    this.urlList.push('uk/wej/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004376.swf');
    this.urlList.push('uk/fa/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004377.swf');
    this.urlList.push('uk/fa/StartingYourFinancialSalesCareer/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004378.swf');
    this.urlList.push('uk/fa/ExperiencedFinancialAdvisers/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004379.swf');
    this.urlList.push('uk/boa/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004380.swf');
    this.urlList.push('uk/headquarters/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');

    this.idList.push('jweb_004381.swf');
    this.urlList.push('uk/graduates/index.html');
    this.heightList.push('171');
    this.widthList.push('789');
    this.locationList.push('banner');
}
