
/* ----------------------------------------------------------- */
function banner(sectionID) {

    var h1 = $('h1.banner');
    var h5 = $('h5.banner');


    if (typeof (sectionID) != 'undefined') {
        var iconImg = document.getElementById(["icon_" + sectionID]);
        var oldIconSrc = $(iconImg).attr('src');
        var newIconSrc = oldIconSrc.replace('_hue', '_color');
        var activeAnchor = $("a." + sectionID);

        // activeIcon = activeAnchor;

        $(h1).addClass("product");
        $(h5).addClass("product");
        $(iconImg).attr('src', newIconSrc);
        // $(iconImg).animate({ marginTop: '5px' }, 800);
        // $(iconImg).css({ marginTop: '5px' });
        //  activeAnchor.animate({ marginTop: '0px' },800);

    }

    switch (sectionID) {
        case 'td':
            $(h1).html('Designing and delivering <span class="pi_red">customized<br/>training</span> since 1986.');
            $(h5).html("Experience and advanced expertise in multiple content areas drive our strong delivery of performance management, coaching, selling skills, and product training across multiple and diverse therapeutic areas. Click for more ...");
            // $('h2#arrow_td').css({ display: "block" });

            break;
        case 'sv':
            $(h1).html('<span class="pi_red">Instantly identify</span> and address performance, knowledge, and skill gaps.');
            $(h5).html("High-energy, live, competitive process dynamically maximizes participant knowledge and confidence, while providing real-time performance data for individuals, districts, and regions. Click for more ...");
            // $('h2#arrow_sv').css({ display: "block" });                        
            break;
        case 'al':
            $(h1).html('<span class="pi_red">AudienceLink&#153;</span> helps you achieve impact, attention, retention, and results.');
            $(h5).html("Greater audience interaction significantly enhances participative general sessions and workshops, using iPad delivery of audience questions and comments to podium, all captured and archived for complete recall and response. Click for more ...");
            // $('h2#arrow_al').css({ display: "block"});                        
            break;
        case 'mps':
            $(h1).html('We\'re your <span class="pi_red">one-stop shop</span> for integrated meeting production services.');
            $(h5).html("With our in-house staff of multiple award-winning creative and production pros, we understand and deliver impact, dynamics, communication, and recall for a broad range of client meetings, product launches, and other events. Click for more ...");
            // $('h2#arrow_mps').css({ display: "block"});            
            break;
        default:
            // nothing
            $(h1).html("We build the people who<br />build your success.");
            $(h5).html("We work for the best. Are you next?");
            $(h1).removeClass("product");
            $(h5).removeClass("product");
            /*$('h2#arrow_td').css("display", "none");
            $('h2#arrow_sv').css("display", "none");
            $('h2#arrow_al').css("display", "none");
            $('h2#arrow_mps').css("display", "none");
            */
            $("img#icon_td").attr('src', '/_images/products/_td_150x120_hue.png');
            $("img#icon_sv").attr('src', '/_images/products/_sv_150x106_hue.png');
            $("img#icon_al").attr('src', '/_images/products/_al_150x129_hue.png');
            $("img#icon_mps").attr('src', '/_images/products/_mps_150x141_hue.png');

            /*$("a.td").animate({ marginTop: '10px' },500);
            $("a.sv").animate({ marginTop: '10px' }, 500);
            $("a.al").animate({ marginTop: '10px' }, 500);
            $("a.mps").animate({ marginTop: '10px' }, 500);
            */
            // activeIcon.animate({ marginTop: '10px' }, 500);
            // activeIcon = undefined;

            break;
    }

}


function ourvalues(valueIndex, valueObj) {

    var valueText = "From not just stopping at project perimeters, to literally redefining client expectations, we demonstrate fierce commitment rather than just talk about it. " + rollOverText + " each one for more.";
    var valueTitleText = "Seven Unique Performance Impact Values";
    var valueTitleBox = document.getElementById("value_title");
    var valueTextBox = document.getElementById("value_text");

    if (typeof (valueIndex) != 'undefined') {
        var calleeHtml = $(valueObj).html();
        valueTitleText = calleeHtml;
    }

    switch (valueIndex) {
        case 1:
            valueText = "We maintain staff fluidity to swarm clients' urgent challenges.";
            break;
        case 2:
            valueText = "We strategically develop cross-functional awareness and capacity to sharpen communications and cross-client understanding.";
            break;
        case 3:
            valueText = "Our people all understand that client relationships are far more than one-dimensional. In fact, there are six sequential layers to a powerful client-resource relationship.";
            break;
        case 4:
            valueText = "Other resources simply meet their client expectations. We strive for excellence and consistently press to redefine client expectations through our performance.";
            break;
        case 5:
            valueText = "Our teams are not confined within preset project borders. Our goal is always client value, and if necessary, we go beyond perimeters to deliver it.";
            break;
        case 6:
            valueText = "<span style='font-size:16px !important;'>Simply stated, we don't treat all of our clients the same. Every customer we have has a personality, a character, a team dynamic that is always uniquely their own and part of a distinct corporate culture. We engage to understand you, the challenges you face, and how you and your organization define success.</span>";
            break;
        case 7:
            valueText = "We understand when technology should be deployed as part of an overall client solution. Our ability to provide our clients insight on the value, return on investment, and overall impact on the business keeps us focused on your bottom line.";
            break;
    }

    $(valueTextBox).html(valueText);
    $(valueTitleBox).html(valueTitleText);

}


/* menu */
var timeout    = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

function jsddm_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{
    $('#menu-pi-wp-header > li').bind('mouseover', jsddm_open)
    $('#menu-pi-wp-header > li').bind('mouseout',  jsddm_timer)
    $("a[rel='service_popup']").colorbox({ transition: "fade", rel:'nofollow', height: 600, maxWidth: 800, previous: '', next: '', current: '', close: '<br/><span class="readmore">(Close Window)</span>' });    
    // $("a[title='Contact Us']").colorbox({ overlayClose:false, transition: "fade", rel:'nofollow', height: 700, width: 700, previous: '', next: '', current: '', close: 'Close Window' });
    $("a[title='How can we help you?']").colorbox({ overlayClose:false, transition: "fade", rel:'nofollow', height: 700, width: 700, previous: '', next: '', current: '', close: 'Close Window' });
    
    // odd colorbox issues with multiple items using one target method [  $("a[href='/contact-us']").colorbox   ]
    // so just targeting one for now 
    
    $("a[title='Contact Us']").attr("href","#");
    $("a[title='Click here to get in touch with us']").attr("href","#");
    
    $("a[title='Contact Us']").bind("click",function(){
        $("a[title='How can we help you?']").click();
    });
    $("a[title='Click here to get in touch with us']").bind("click",function(){
        $("a[title='How can we help you?']").click();
    });    
    
    // navigation tabs
    $('div#nav a').mouseover(function() {$(this).addClass('active');refreshTabs();});
    $('div#nav a').mouseout(function() {$(this).removeClass('active');refreshTabs();});
       
    refreshTabs();            
});

function refreshTabs(){
    var sPath = window.location.pathname.split("/");
    var sPage = sPath[1];
    // alert(sPath[1] + ' | ' + sPage);
    switch(sPage){
        case 'powered-by-pi':
            $("a[href*='powered-by-pi']").addClass('active');
            break;
        case 'what-we-do':
        case 'training-and-development':
            $("a[href='#What-We-Do']").addClass('active');
            break;        
        case '':
            $("a[href='/']").addClass('active');
            break;
        default:
            $("a[href*='posts']").addClass('active');
            break;
    }     
}



document.onclick = jsddm_close;

