// JScript File/*Author: Shrikant ThakareDate: 30 June 2010Purpose: to implement featured funds facility for SEO under  CRM Case: CAS-06871-KLCG*/var FeaturedFunds = new Array();function IsThisFeaturedFund(){     if(FeaturedFunds.length ==0) {return false;}    var list = FeaturedFunds.length;     var thisURL = location.href;        thisURL = getSection(thisURL);       thisURL = thisURL.toLowerCase();        for(i=0; i<list; i++)    {            if(thisURL == FeaturedFunds[i])            {                FeaturedFunds=null;                return true;            }    }   return false;  }function addFeaturedFunctionSection(featuredFundURL){    if(featuredFundURL == undefined || featuredFundURL == null || featuredFundURL=="")    {    return ;}        var i = FeaturedFunds.length;     FeaturedFunds[i] = featuredFundURL.toLowerCase();    }function getSection(urlToProcess){    if(urlToProcess == undefined || urlToProcess == null)    {   return urlToProcess;    }    urlToProcess = urlToProcess.toLowerCase();        if(urlToProcess.lastIndexOf(".aspx")<=-1)    {   return urlToProcess;    }       urlToProcess= urlToProcess.replace("http://","")    var subSections = urlToProcess.split("/");                if(subSections.length<=1){return urlToProcess;}        var i,parentSection;    i=subSections.length;    parentSection="";        for(j=0;j<(i-1);j++)    {        if(j==0){        parentSection = subSections[j];}        else        {            parentSection = parentSection + "/" + subSections[j];        }    }    parentSection= "http://"+parentSection+"/";   return parentSection;}function getFeaturedFundName(fundName){    var OriginalName;    var bIsFeatureFund;        bIsFeatureFund = IsThisFeaturedFund();    if(!bIsFeatureFund){return fundName;}         if(fundName == undefined || fundName == null)    {   return "";    }            OriginalName = fundName;       fundName =fundName.toLowerCase();         if(fundName.length <=2) { return OriginalName; }          if(fundName.substr(0,2) == "ff")     {  return OriginalName;     }     else     {  return "FF " + OriginalName;     }}addFeaturedFunctionSection("http://www.jpmorganassetmanagement.co.uk/Adviser/OurInvestmentRange/FeaturedFunds/");addFeaturedFunctionSection("http://www.jpmorganassetmanagement.co.uk/AssetManager/OurInvestmentRange/FeaturedFunds/");addFeaturedFunctionSection("http://www.jpmorganassetmanagement.co.uk/Investor/OurInvestmentRange/FeaturedInvestments/");
