var current="cp_tab_1";function show(A){    $("#"+current).css("display","none");$("#"+A).css("display","block");current=A;}function cp_init_sIFR(){    if(typeof sIFR !='undefined'){    /*        sIFR.replace(header, {            selector: 'div.tab1 span.intro'            ,            css: '.sIFR-root {background-color:#FFFFFF;color:#01b5cc;font-size:33px;}'            ,            wmode: 'transparent'        });        sIFR.replace(header, {            selector: 'div.tab1 h2'            ,            css: '.sIFR-root {background-color:#FFFFFF;color:#01b5cc;font-size:33px;}'            ,            wmode: 'transparent'        });            sIFR.replace(header, {            selector: '.tab_content h2'            ,            css: '.sIFR-root {background-color:#FFFFFF;color:#01b5cc;font-size:33px;}'            ,            wmode: 'transparent'        });    	sIFR.replace(header, {		selector: '#p-rcb h3'		,css: '.sIFR-root {background-color:#FFFFFF;color:#7CBD2A;font-size:20px;}'		,wmode: 'transparent'	});	sIFR.replace(header, {		selector: '#p-rcb h4'		,css: '.sIFR-root {background-color:#FFFFFF;color:#005c1f;font-size:22px;}'		,wmode: 'transparent'	});	sIFR.replace(header, {		selector: '#p-rcb h5'		,css: '.sIFR-root {background-color:#FFFFFF;color:#005c1f;font-size:22px;}'		,wmode: 'transparent'	});	sIFR.replace(header, {		selector: '#p-rcb h6'		,css: '.sIFR-root {background-color:#FFFFFF;color:#FFFFFF;font-size:22px;}'		,wmode: 'transparent'	});*/    }    // get variable from location    var userRequestedTab = $.jget['tab'];    // find index from universal tab names    for (var i = 0; i < universalTabNames.length; i++) {        if (universalTabNames[i] == userRequestedTab)            userRequestedTab = i;    }// needs to wait to make sure sifr has kicked in.setTimeout("cp_setTab('"+userRequestedTab+"')", "10");}/* setup other swf files */function cp_init_swfobject(){}// <TABS LOGIC>var __currentTabIndex;/* * show a tab and hides others * * @var integer || string that can be parsed into a integer */function cp_setTab(value) {    if (typeof value == 'undefined')        value = 0;    if (!parseInt(value))        value = 0;    if (value >= $('#p-rcb #cp_wrap_tab_productdetails li').length)        value = 0;    if (__currentTabIndex == value)        return;    // hide all    for (var i = 0; i < $('#p-rcb #cp_wrap_tab_productdetails li').length; i++) {        if (i == value) {            $('#cp_tab_'+(i+1)).addClass('cp_active');            $('#cp_tab_'+(i+1)).removeClass('cp_inactive');            $('#cp_tab_content_'+(i+1)).show();        } else {            $('#cp_tab_'+(i+1)).addClass('cp_inactive');            $('#cp_tab_'+(i+1)).removeClass('cp_active');            $('#cp_tab_content_'+(i+1)).hide();        //alert("yeah");        }    }        // remember last set index    __currentTabIndex = value;    // change the header    cp_setHeader(value);    // ping statistics    cp_sendStatistics(value);    // replace the title with a sifr one    sifrReplaceWork(value+1);    // show the relevant bottom panels    sortPanels(value);   }var __currentHeaderSRC;/* * changes the header swf * * @var integer, the index of the availableHeadersSRC global */function cp_setHeader(value) {if (typeof availableHeadersSRC[value] == undefined)        return false;    var src = availableHeadersSRC[value];    if (src == __currentHeaderSRC)        return false;    __currentHeaderSRC = src;    var cp_header_animation = new SWFObject(src, "Header Animation", "960", "275", "8");    cp_header_animation.addParam("wmode","transparent");    cp_header_animation.write('flash-inner-wrapper');    }/* * Send statictics when the user interacts with the tabs. */var __statsHaveNotBeenSendViaTabInteraction = true;function cp_sendStatistics(value) {    if (typeof s != 'object')        return;    // normalize tab values;    if (typeof universalTabNames[value] != 'undefined')        value = universalTabNames[value];    else        value = "TAB" + value;    if (!__statsHaveNotBeenSendViaTabInteraction) {        var PRODUCTSUBCATEGORY = cp_getMetrics('PRODUCTSUBCATEGORY');        var DIVISION = cp_getMetrics('DIVISION');        var SECTION = cp_getMetrics('SECTION');        var CATALOGTYPE = cp_getMetrics('CATALOGTYPE');        var PRODUCTGROUP = cp_getMetrics('PRODUCTGROUP');        var PRODUCTCATEGORY = cp_getMetrics('PRODUCTCATEGORY');        if (PRODUCTSUBCATEGORY != "") {            var TABSECTION = PRODUCTSUBCATEGORY + '_' + value;            s.pageName = DIVISION + ":" + SECTION + ":" + TABSECTION + ":" + CATALOGTYPE;        } else if (PRODUCTCATEGORY != "") {            var TABSECTION = PRODUCTCATEGORY + '_' + value;            s.pageName = DIVISION + ":" + SECTION + ":" + TABSECTION + ":" + CATALOGTYPE;        }        s.t();    }    __statsHaveNotBeenSendViaTabInteraction = false;}function cp_getMetrics(metric) {    var content = $("meta[name='PHILIPS.METRICS."+metric+"']").attr("content");    if (typeof content == 'undefined' || content == null)        return '';    else        return content;}// </TABS LOGIC>$(document).ready(function() {    //sIFR needs a timeout for safari or sometimes sIFR won't behave correctly    setTimeout("cp_init_sIFR()", "1000");    cp_init_swfobject();    cp_setTab(0);    evenHighlightBlocks();    });/** * jget plugin * @author Alexandre Magno * @desc get a query string to be accessible for javascript * @version 1.0 * @example * * http://www.foo.com/test.php?var1=test1 * var outputQuery = $.jget['var1']; * $.debug(outputQuery); * //Will show 'test1' * * * @license free * @param bool vertical, bool horizontal * @site http://blog.alexandremagno.net * */jQuery.extend({    //starting the jget object    jget: {},    //get the url    url: window.location.href.replace(/^[^\?]+\??/,''),    //get the queryString    parseQuery: function ( query ) {        var Params = {};        if ( ! query ) {            return Params;        }// return empty object        var Pairs = query.split(/[;&]/);        for ( var i = 0; i < Pairs.length; i++ ) {            var KeyVal = Pairs[i].split('=');            if ( ! KeyVal || KeyVal.length != 2 ) {                continue;            }            var key = unescape( KeyVal[0] );            var val = unescape( KeyVal[1] );            val = val.replace(/\+/g, ' ');            Params[key] = val;        }        return Params;    },    //Make the jget object available to jQuery.extend    getQueryString: function() {        this.jget = this.parseQuery(this.url);    },    //debugging    debug: function(message) {        if(!$.browser.msie) {            console.info(message);        } else if($.browser.safari) {            window.console.log(message);        } else {            alert(message);        }    }});//start the plugin$.getQueryString();// DIV POPUPfunction showOverlay(element, div, left, top)//, text){    var e = document.getElementById(element);    var d = document.getElementById(div);    //var t = document.getElementById('overlay_text');    d.style.display = '';    //t.innerHTML = text;    var divheight = 0;    if(d.offsetHeight) {        divheight = d.offsetHeight;    }    else if(d.style.pixelHeight) {        divheight = d.style.pixelHeight;    }    //left 18 top 50    d.style.left = (findPosX(e) - (-left)) + "px";    d.style.top = (findPosY(e) - (-top) - divheight) + "px";}function hideMe(div){    var d = document.getElementById(div);    d.style.display = 'none';}function findPosX(obj){    var curleft = 0;    if(obj.offsetParent)        while(1)        {            curleft += obj.offsetLeft;            if(!obj.offsetParent)                break;            obj = obj.offsetParent;        }    else if(obj.x)        curleft += obj.x;    return curleft;}function findPosY(obj){    var curtop = 0;    if(obj.offsetParent)        while(1)        {            curtop += obj.offsetTop;            if(!obj.offsetParent)                break;            obj = obj.offsetParent;        }    else if(obj.y)        curtop += obj.y;    return curtop;}/************************************************************************* * Tab 1 - Blocks *************************************************************************/function makeBlocksEvenHeight() {    var x1 = $('div.tab1 div.blocks div.block1').height();    var x2 = $('div.tab1 div.blocks div.block2').height();    var x3 = x2-x1;    if (x3 < 0) {        x3 = x3-(2 * x3);    }    if (x3 != 0){        if(x1 > x2){            $('div.tab1 div.blocks div.block2 div.block2_top').height($('div.tab1 div.blocks div.block2 div.block2_top').height()+x3);        } else if (x2 > x1) {            $('div.tab1 div.blocks div.block1 div.block1_top').height($('div.tab1 div.blocks div.block1 div.block1_top').height()+x3);        }    }}function evenHighlightBlocks() {    var highest = 0;    var i = 0;    $('#p-rcb .block-highlight').each(function(){        i = $(this).children('.block-rep').height();        if(i>highest) highest = i;    });    $('#p-rcb .block-highlight').each(function(){        $(this).children('.block-rep').css('height', highest + 'px');    });}function sifrReplaceWork(tabVal) {    sIFR.replace(header, {        selector: 'div.tab' + tabVal + ' h2'        ,        css: '.sIFR-root {background-color:#FFFFFF;color:#fd901d;font-size:33px;}'        ,        wmode: 'transparent'    });}function makeOverviewBlocksClickable(){    $('div.tab1 div.blocks div.block1, div.tab1 div.blocks div.block2').css('cursor', 'pointer');    $('div.tab1 div.blocks div.block1').click(function(){        $('li#cp_tab_2 a').click();    });    $('div.tab1 div.blocks div.block2').click(function(){        $('li#cp_tab_3 a').click();    });}function sortPanels(value) {    $('div#p-rcb .block-highlight').show().removeClass('no-right-margin');    $('div#p-rcb .block-highlight.hblock' + (value+1)).hide();    if((value+1) == 4) {        $('div#p-rcb .block-highlight.hblock3').addClass('no-right-margin');    } else {        $('div#p-rcb .block-highlight.hblock4').addClass('no-right-margin');    }}
