﻿function SetPageTab(){    var pageName = $('Content').getElementsByTagName('label');    for(var i=0; i<pageName.length; i++){        switch(pageName[i].id){            case "productsPage":                var li = $('Products');                var a = li.firstDescendant();                Tabs(li, a);                break;            case "testimonialsPage":                var li = $('Testimonials');                var a = li.firstDescendant();                Tabs(li, a);                break;            case "healthPage":                var li = $('HealthExperts');                var a = li.firstDescendant();                Tabs(li, a);                break;            case "aboutusPage":                var li = $('AboutUs');                var a = li.firstDescendant();                Tabs(li, a);                break;            case "businessPage":                var li = $('BusinessOpportunity');                var a = li.firstDescendant();                Tabs(li, a);                break;            case "quickPage":                var li = $('QuickLinks');                var a = li.firstDescendant();                Tabs(li, a);                break;        }    }}function Tabs(listItem, link){    listItem.style.backgroundImage = "url('Images/IW_ActivePageLeft.png')";    listItem.style.backgroundPosition = "center left";    listItem.style.backgroundRepeat = "no-repeat";        link.style.backgroundImage = "url('Images/IW_ActivePageRight.gif')";    link.style.backgroundPosition = "center right";    link.style.backgroundRepeat = "no-repeat";    link.style.color = "#ffffff";    link.addClassName("current");}function Menu(){    var childnodes;    var nav = $('Header').getElementsByClassName('main-nav');    try{        childnodes = nav[0].getElementsByTagName('li');    }    catch (e){        //alert(childnodes);        //alert(e);    }        for(var i=0; i<childnodes.length; i++){        var ulList = childnodes[i].getElementsByTagName('ul');        if (ulList.length > 0){            var ul = ulList[0];            ul.onmouseover = function(){HighLight(this)};            ul.onmouseout = function(){RemoveHighLight(this)};        }    }}function HighLight(ul){    try{        var a = $(ul).previous();        if (!(a.hasClassName('current'))) {            a.style.backgroundImage = "url('Images/IW_ActiveTabRight.gif')";            a.style.color = "#5f5e51";            a.style.backgroundRepeat = "no-repeat";            a.style.backgroundPosition = "right center";        }    }    catch (e) {        //alert(e);    }}function RemoveHighLight(ul){    try{        var a = $(ul).previous();        if (!(a.hasClassName('current'))) {            a.style.backgroundImage = "";        }    }    catch (e) {        //alert(e);    }}function ProductImage(text){    if($('productsPage')){        var contentBody = $('Body-Slimming');        var contentSkin = $('Skin-Care');        var contentSupp = $('Supplements');        var contentPack = $('Value-Packages');        var contentFit = $('Fit-Works');                contentBody.style.display = "none";        contentSkin.style.display = "none";        contentSupp.style.display = "none";        contentPack.style.display = "none";        contentFit.style.display = "none";                switch(text){            case "Body Slimming":                var img = $('Product-Image');                img.src = "Images/IW_BodySlimmingImage.jpg"                contentBody.style.display = "block";                break;            case "Skin Care":                var img = $('Product-Image');                img.src = "Images/IW_SkinCareImage.jpg"                contentSkin.style.display = "block";                break;            case "Supplements":                var img = $('Product-Image');                img.src = "Images/IW_SupplementsImage.jpg"                contentSupp.style.display = "block";                break;            case "Value Packages":                var img = $('Product-Image');                img.src = "Images/IW_ValuePacks.jpg"                contentPack.style.display = "block";                break;            case "FIT Works":                var img = $('Product-Image');                img.src = "Images/IW_FitWorksImage.jpg"                contentFit.style.display = "block";                break;        }    }}function LoadSideNav(){    var label = $('Content').getElementsByTagName('label');        for(var i=0; i < label.length; i++){        switch(label[i].id){            case "productsPage":                var li = $('Products');                var div = $('side-nav');                div.innerHTML = li.innerHTML;                break;            case "testimonialsPage":                var li = $('Testimonials');                var div = $('side-nav');                div.innerHTML = li.innerHTML;                break;            case "healthPage":                var li = $('HealthExperts');                var div = $('side-nav');                div.innerHTML = li.innerHTML;                break;            case "aboutusPage":                var li = $('AboutUs');                var div = $('side-nav');                div.innerHTML = li.innerHTML;                break;            case "businessPage":                var li = $('BusinessOpportunity');                var div = $('side-nav');                div.innerHTML = li.innerHTML;                break;            case "quickPage":                var li = $('QuickLinks');                var div = $('side-nav');                div.innerHTML = li.innerHTML;                break;        }    }}function Calendar(link){    ClearEvents();    var div = $(link).up(1);    var divDescription = div.down(0).next(3);        div.style.backgroundColor = "#d4e5ba";    div.style.marginTop = "3px";    div.style.marginBottom = "3px";    divDescription.style.display = "block";}function ClearEvents(){    var divEvents = $('Events');    var divCalls = $('Calls');    var eventList = divEvents.getElementsByTagName('div');    var callList = divCalls.getElementsByTagName('div');        Clear(eventList);    Clear(callList);}function Clear(list){    for(var i=0; i < list.length; i++){        if(list[i].id == "Events-Item" || list[i].id == "Calls-Item"){            list[i].style.backgroundColor = "";        }                if(list[i].id == "Description" && list[i].style.display == "block"){            list[i].style.display = "none";        }    }}function ApplicatorVideo(video){    switch(video){            case "Facial":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=7095349544765211015&hl=en&fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "Chin":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=-2261834002012485679&hl=en&fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "Arms":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=792665752102720337&hl=en&fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "Abs":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=-1698951854596764001&hl=en&fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "Legs":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=-8364447770528045434&hl=en&fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "Preventage":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=5944050586117082392&hl=en&fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "Defining Gel":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=3807513466312447835&hl=en&fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "Repairage":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=-5917373146279261396&hl=en&fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "ProductOverview":                  var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=5624633280596916207&#38;hl=en&#38;fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "WeightLossSolution":                  var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=-4264879964288207294&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"> </embed>";                break;                case "UltimateBodyApplicator":                  var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=-9176837779246869445&#38;hl=en&#38;fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;                   case "UltimateBodyChallenge":                  var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=6985281362913117310&#38;hl=en&#38;fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;               case "FITPackPlus":                  var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" src=\"http://video.google.com/googleplayer.swf?docid=-5418159763772668099&#38;hl=en&#38;fs=true\" type=\"application/x-shockwave-flash\"> </embed>";                break;                                }}function Supplements(video){    switch(video){            case "Vital":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=7635626049671878164&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>";                break;            case "Answer":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=429195279036760718&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>";                break;            case "Greens":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=1950752423134020342&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>";                break;            case "Regular":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=-417112251121217490&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>";                break;            case "FatFighter":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=7910583989626525171&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"></embed>";                break;                        case "WhyChoose":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=5624633280596916207&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"> </embed>";                break;            case "WeightLoss":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=-4264879964288207294&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"> </embed>";                break;                case "Conflanza":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=7864674432608493467&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"> </embed>";                break;               case "NewYou":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=4355394343737716299&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"> </embed>";                break;              case "FITPackValue":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=-2394354892817239579&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"> </embed>";                break;               case "FITPackPlus":                var div = $('applicator-video');                div.innerHTML = "<embed id=\"VideoPlayback\" src=\"http://video.google.com/googleplayer.swf?docid=-5418159763772668099&hl=en&fs=true\" style=\"width:400px;height:326px\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\"> </embed>";                break;                                                                               }}function showLoyaltyInfo(){    var div = $('Loyalty-Info');        if(div.style.display == "none"){        div.style.display = "block";    }else{        div.style.display = "none";    }}