
String.prototype.beginsWith = function(t, i) { if (i==false) { return
(t == this.substring(0, t.length)); } else { return (t.toLowerCase()
== this.substring(0, t.length).toLowerCase()); } } 


function GetContextualKeys(TheURL) {

    var ConString;

    if (TheURL.beginsWith('/news/applications-os/')) {
        ConString = "applications-os";
    } else if (TheURL.beginsWith('/news/channel-programs/')) {
        ConString = "channel-programs";
    } else if (TheURL.beginsWith('/news/client-devices/')) {
        ConString = "client-devices";
    } else if (TheURL.beginsWith('/news/cloud/')) {
        ConString = "cloud";
    } else if (TheURL.beginsWith('/news/components-peripherals/')) {
        ConString = "components-peripherals";
    } else if (TheURL.beginsWith('/news/data-center/')) {
        ConString = "data-center";
    } else if (TheURL.beginsWith('/news/networking/')) {
        ConString = "networking";
    } else if (TheURL.beginsWith('/news/security/')) {
        ConString = "security";
    } else if (TheURL.beginsWith('/news/storage/')) {
        ConString = "storage";
    } else if (TheURL.beginsWith('/research/')) {
        ConString = "research";
    } else if (TheURL.beginsWith('/reviews/')) {
        ConString = "reviews";
    } else if (TheURL.beginsWith('/rankings-and-lists/')) {
        ConString = "rankings-and-lists";
    } else if (TheURL.beginsWith('/slide-shows/')) {
        ConString = "slide-shows";
    } else if (TheURL.beginsWith('/annual-report-card/')) {
        ConString = "research";
    } else if (TheURL.beginsWith('/state-of-the-market/')) {
        ConString = "research";
    } else if (TheURL.beginsWith('/channel-champions/')) {
        ConString = "research";
    } else {
        ConString = "index.htm";
    }

    var Splits = TheURL.split("/");
    var SplitLen = Splits.length;

    if (ConString == "index.htm") {
        //return ConString;
        return TheURL.substr(0, 59);
    } else {
        if (Splits[SplitLen - 1] == "index.htm") {
            //return ConString.substr(0,59)+"+"+Splits[SplitLen-1].substr(0,59);
            return ConString.substr(0, 59) + "+" + TheURL.substr(0, 59);
        } else {
            return ConString.substr(0, 59) + "+" + Splits[SplitLen - 2].substr(0, 59) + "+" + Splits[SplitLen - 1].substr(0, 59);
        }
    }
    return "Error";
}



function GetTextAds(TheURL){
var AdSpot="None";


if(TheURL.beginsWith('/blogs-op-ed')){AdSpot='CRN_BlogsandOpEd_BlogsandOpEd_';}

else if(TheURL.beginsWith('/events')){AdSpot='CRN_Events_Events_';}

else if(TheURL.beginsWith('/news/applications-os/application-development')){AdSpot='CRN_News_ApplicationsandOS_ApplicationDevelopment_';}
else if(TheURL.beginsWith('/news/applications-os/business-intelligence')){AdSpot='CRN_News_ApplicationsandOS_BIandAnalyticsSoftware_';}
else if(TheURL.beginsWith('/news/applications-os/collaboration-communications')){AdSpot='CRN_News_ApplicationsandOS_CollaborationandCommunicationsSoftware_';}
else if(TheURL.beginsWith('/news/applications-os/database-system')){AdSpot='CRN_News_ApplicationsandOS_DatabaseandSystemSoftware_';}
else if(TheURL.beginsWith('/news/applications-os/enterprise-applications')){AdSpot='CRN_News_ApplicationsandOS_EnterpriseApplications_';}
else if(TheURL.beginsWith('/news/applications-os/open-source')){AdSpot='CRN_News_ApplicationsandOS_OpenSource_';}
else if(TheURL.beginsWith('/news/applications-os/operating-systems')){AdSpot='CRN_News_ApplicationsandOS_OperatingSystems_';}
else if(TheURL.beginsWith('/news/applications-os/smb-applications')){AdSpot='CRN_News_ApplicationsandOS_SMBApplications_';}
else if(TheURL.beginsWith('/news/applications-os/software-service')){AdSpot='CRN_News_ApplicationsandOS_SoftwareAsAService_';}
else if(TheURL.beginsWith('/news/applications-os')){AdSpot='CRN_News_ApplicationsandOS_HP_';}

else if(TheURL.beginsWith('/news/channel-programs/channel-programs/')){AdSpot='CRN_News_ChannelPrograms_ChannelPrograms_';}
else if(TheURL.beginsWith('/news/channel-programs/distribution')){AdSpot='CRN_News_ChannelPrograms_Distribution_';}
else if(TheURL.beginsWith('/news/channel-programs/enterprise-opportunities')){AdSpot='CRN_News_ChannelPrograms_EnterpriseOpportunities_';}
else if(TheURL.beginsWith('/news/channel-programs/managed-services')){AdSpot='CRN_News_ChannelPrograms_ManagedServices_';}
else if(TheURL.beginsWith('/news/channel-programs/professional-services')){AdSpot='CRN_News_ChannelPrograms_ProfessionalServices_';}
else if(TheURL.beginsWith('/news/channel-programs/smb-midmarket-opportunities')){AdSpot='CRN_News_ChannelPrograms_SMBMidmarketOpportunities_';}
else if(TheURL.beginsWith('/news/channel-programs/vertical-opportunities')){AdSpot='CRN_News_ChannelPrograms_VerticalOpportunities_';}
else if(TheURL.beginsWith('/news/channel-programs')){AdSpot='CRN_News_ChannelPrograms_HP_';}

else if(TheURL.beginsWith('/news/client-devices/desktops')){AdSpot='CRN_News_ClientDevices_Desktops_';}
else if(TheURL.beginsWith('/news/client-devices/netbooks')){AdSpot='CRN_News_ClientDevices_Netbooks_';}
else if(TheURL.beginsWith('/news/client-devices/notebooks')){AdSpot='CRN_News_ClientDevices_Notebooks_';}
else if(TheURL.beginsWith('/news/client-devices/smart-phones')){AdSpot='CRN_News_ClientDevices_SmartPhones_';}
else if(TheURL.beginsWith('/news/client-devices/tablets')){AdSpot='CRN_News_ClientDevices_Tablets_';}
else if(TheURL.beginsWith('/news/client-devices')){AdSpot='CRN_News_ClientDevices_HP_';}

else if(TheURL.beginsWith('/news/cloud/cloud-channel-programs')){AdSpot='CRN_News_Cloud_CloudChannelPrograms_';}
else if(TheURL.beginsWith('/news/cloud/cloud-infrastructure')){AdSpot='CRN_News_Cloud_CloudInfrastructure_';}
else if(TheURL.beginsWith('/news/cloud/cloud-platforms')){AdSpot='CRN_News_Cloud_CloudPlatforms_';}
else if(TheURL.beginsWith('/news/cloud/cloud-security')){AdSpot='CRN_News_Cloud_CloudSecurity_';}
else if(TheURL.beginsWith('/news/cloud/cloud-software')){AdSpot='CRN_News_Cloud_CloudSoftware_';}
else if(TheURL.beginsWith('/news/cloud/cloud-storage')){AdSpot='CRN_News_Cloud_CloudStorage_';}
else if(TheURL.beginsWith('/news/cloud/cloud-vars')){AdSpot='CRN_News_Cloud_CloudVARs_';}
else if(TheURL.beginsWith('/news/cloud')){AdSpot='CRN_News_Cloud_HP_';}

else if(TheURL.beginsWith('/news/components-peripherals/cpus-gpus')){AdSpot='CRN_News_ComponentsandPeripherals_CPUsGPUs_';}
else if(TheURL.beginsWith('/news/components-peripherals/digital-signage-monitors')){AdSpot='CRN_News_ComponentsandPeripherals_DigitalSignageMonitors_';}
else if(TheURL.beginsWith('/news/components-peripherals/hard-drives')){AdSpot='CRN_News_ComponentsandPeripherals_HardDrives_';}
else if(TheURL.beginsWith('/news/components-peripherals/motherboards')){AdSpot='CRN_News_ComponentsandPeripherals_Motherboards_';}
else if(TheURL.beginsWith('/news/components-peripherals/printers')){AdSpot='CRN_News_ComponentsandPeripherals_Printers_';}
else if(TheURL.beginsWith('/news/components-peripherals/white-box')){AdSpot='CRN_News_ComponentsandPeripherals_WhiteBox_';}
else if(TheURL.beginsWith('/news/components-peripherals')){AdSpot='CRN_News_ComponentsandPeripherals_HP_';}

else if(TheURL.beginsWith('/news/data-center/network-system-management')){AdSpot='CRN_News_DataCenter_NetworkandSystemManagement_';}
else if(TheURL.beginsWith('/news/data-center/power-heating-cooling')){AdSpot='CRN_News_DataCenter_PowerHeatingandCooling_';}
else if(TheURL.beginsWith('/news/data-center/servers')){AdSpot='CRN_News_DataCenter_Servers_';}
else if(TheURL.beginsWith('/news/data-center/virtualization')){AdSpot='CRN_News_DataCenter_Virtualization_';}
else if(TheURL.beginsWith('/news/data-center')){AdSpot='CRN_News_DataCenter_HP_';}

else if(TheURL.beginsWith('/news/networking/routers-switches')){AdSpot='CRN_News_Networking_RoutersandSwitches_';}
else if(TheURL.beginsWith('/news/networking/telecom')){AdSpot='CRN_News_Networking_Telecom_';}
else if(TheURL.beginsWith('/news/networking/video')){AdSpot='CRN_News_Networking_Video_';}
else if(TheURL.beginsWith('/news/networking/voip-unified-communications')){AdSpot='CRN_News_Networking_VOIPandUnifiedCommunicationsNews_';}
else if(TheURL.beginsWith('/news/networking/wireless')){AdSpot='CRN_News_Networking_Wireless_';}
else if(TheURL.beginsWith('/news/networking')){AdSpot='CRN_News_Networking_HP_';}

else if(TheURL.beginsWith('/news/security/access-control')){AdSpot='CRN_News_Security_AccessControl_';}
else if(TheURL.beginsWith('/news/security/application-platform-security')){AdSpot='CRN_News_Security_ApplicationandPlatformSecurity_';}
else if(TheURL.beginsWith('/news/security/current-threats')){AdSpot='CRN_News_Security_CurrentThreats_';}
else if(TheURL.beginsWith('/news/security/data-breaches')){AdSpot='CRN_News_Security_DataBreaches_';}
else if(TheURL.beginsWith('/news/security/data-protection-technologies')){AdSpot='CRN_News_Security_DataProtectionTechnologies_';}
else if(TheURL.beginsWith('/news/security/network-security')){AdSpot='CRN_News_Security_NetworkSecurity_';}
else if(TheURL.beginsWith('/news/security/threat-management')){AdSpot='CRN_News_Security_ThreatManagement_';}
else if(TheURL.beginsWith('/news/security/index.htm')){AdSpot='CRN_News_Security_HP_';}
else if(TheURL.beginsWith('/news/security')){AdSpot='CRN_News_Security_';}

else if(TheURL.beginsWith('/news/storage/data-protection-disaster-recovery')){AdSpot='CRN_News_Storage_DataProtectionDisasterRecovery_';}
else if(TheURL.beginsWith('/news/storage/networked-storage')){AdSpot='CRN_News_Storage_NetworkedStorage_';}
else if(TheURL.beginsWith('/news/storage/storage-services')){AdSpot='CRN_News_Storage_StorageServices_';}
else if(TheURL.beginsWith('/news/storage/storage-software')){AdSpot='CRN_News_Storage_StorageSoftware_';}
else if(TheURL.beginsWith('/news/storage')){AdSpot='CRN_News_Storage_HP_';}

else if(TheURL.beginsWith('/news')){AdSpot='CRN_News_HP_';}

else if(TheURL.beginsWith('/rankings-and-lists')){AdSpot='CRN_RankingsandLists_RankingsandLists_';}
else if(TheURL.beginsWith('/research')){AdSpot='CRN_Research_Research_';}
else if(TheURL.beginsWith('/reviews')){AdSpot='CRN_Reviews_Reviews_';}

else if(TheURL.beginsWith('/slide-shows/applications-os')){AdSpot='CRN_Slideshows_ApplicationsandOS_';}
else if(TheURL.beginsWith('/slide-shows/channel-programs')){AdSpot='CRN_Slideshows_ChannelPrograms_';}
else if(TheURL.beginsWith('/slide-shows/cloud')){AdSpot='CRN_Slideshows_Cloud_';}
else if(TheURL.beginsWith('/slide-shows/client-devices')){AdSpot='CRN_Slideshows_ClientDevices_';}
else if(TheURL.beginsWith('/slide-shows/components-peripherals')){AdSpot='CRN_Slideshows_ComponentsandPeripherals_';}
else if(TheURL.beginsWith('/slide-shows/data-center')){AdSpot='CRN_Slideshows_DataCenter_';}
else if(TheURL.beginsWith('/slide-shows/networking')){AdSpot='CRN_Slideshows_Networking_';}
else if(TheURL.beginsWith('/slide-shows/security')){AdSpot='CRN_Slideshows_Security_';}
else if(TheURL.beginsWith('/slide-shows/storage')){AdSpot='CRN_Slideshows_Storage_';}
else if(TheURL.beginsWith('/slide-shows')){AdSpot='CRN_Slideshows_Slideshows_HP_';}

else if(TheURL.beginsWith('/video')){AdSpot='CRN_Video_Video_HP_';}

else if(TheURL.beginsWith('/index.htm')){AdSpot='CRN_HP_HP_';}
else {AdSpot='CRN_HP_HP_';}

return AdSpot;

}




