﻿$(function() {

        //Product Links
        $(".lnkEco-Flexx").click(function(){showProductPath("1","2","8-2");});
        $(".lnkEcoUltra").click(function(){showProductPath("1","2","8-2");});
        $(".lnkEcoPoster").click(function(){showProductPath("1","1","2-1");});
        $(".lnkLamaPoster").click(function(){showProductPath("1","1","4-1");});
        $(".lnkEcoBacklit").click(function(){showProductPath("2","10","105-10");});
       $(".lnkVinylMesh").click(function(){showProductPath("6","3","99-3");});
       $(".lnkSuperKingFlexon").click(function(){showProductPath("2","9","44-9");});
       $(".lnkVinylBanner").click(function(){showProductPath("3","14","108-14");});
       $(".lnkSpecial").click(function(){showProductPath("4","6","33-6");});
       $(".lnkPromoBillboardFrames").click(function(){showProductPath("4","7","35-7");});
       $(".lnkEmbelishments").click(function(){showProductPath("4","18","110-18");});
       $(".lnkToteBags").click(function(){showProductPath("4","19","84-19");});
        $(".lnkProducts").click(function(){showProductPath("1","1","2-1");});
        
       
       //Site Map Links
       $(".lnkHome").click(function(){showLinkPath("#HomeContainer", "#","#")});
       $(".lnkWhoWeAre").click(function(){showLinkPath("#AboutUsContainer", "#WhoWeAre","#")});
       $(".lnkOurPhilosophy").click(function(){showLinkPath("#AboutUsContainer", "#OurPhilosophy","#")});
       $(".lnkOurFacility").click(function(){showLinkPath("#AboutUsContainer", "#OurFacility","#")});
       $(".lnkTestimonials").click(function(){showLinkPath("#AboutUsContainer", "#Testimonials","#")});
       $(".lnkPromotionalMaterials").click(function(){showLinkPath("#AboutUsContainer", "#PromotionalMaterials","#")});
       $(".lnkEBlastNews").click(function(){showLinkPath("#AboutUsContainer","#News","#EBlast")});
       
       $(".lnkWorkingTogether").click(function(){showLinkPath("#WorkingTogetherContainer", "#OrderProcess","#Placing")});
       $(".lnkProofingOptions").click(function(){showLinkPath("#WorkingTogetherContainer", "#OrderProcess","#Proofing")});
       $(".lnkOrderFlow").click(function(){showLinkPath("#WorkingTogetherContainer", "#OrderProcess","#Order")});
       $(".lnkPosterFolding").click(function(){showLinkPath("#WorkingTogetherContainer", "#OrderProcess","#Folding")});
       $(".lnkOrderForms").click(function(){showLinkPath("#WorkingTogetherContainer", "#NewCustomers","#Forms")});
       $(".lnkNewCustomers").click(function(){showLinkPath("#WorkingTogetherContainer", "#NewCustomers","#NewCustomerInfo")});
       $(".lnkMyCircleOverview").click(function(){showLinkPath("#WorkingTogetherContainer", "#MyCircleOverview","#")});
       $(".lnkTermsAndConditions").click(function(){showLinkPath("#WorkingTogetherContainer", "#Terms","#Artwork")});
       $(".lnkCustomerProofs").click(function(){showLinkPath("#WorkingTogetherContainer", "#Terms","#CustomerProofs")});
       $(".lnkProductionShipping").click(function(){showLinkPath("#WorkingTogetherContainer", "#Terms","#ProductionShipping")});
       $(".lnkPricingAndPayment").click(function(){showLinkPath("#WorkingTogetherContainer", "#Terms","#PricingAndPayment")});
       $(".lnkCustomerObligation").click(function(){showLinkPath("#WorkingTogetherContainer", "#Terms","#CustomerObligation")});
       $(".lnkAdditionalProvisions").click(function(){showLinkPath("#WorkingTogetherContainer", "#Terms","#AdditionalProvisions")});
       $(".lnkAccounting").click(function(){showLinkPath("#WorkingTogetherContainer", "#Accounting","#SalesTax")});
       $(".lnkLinks").click(function(){showLinkPath("#WorkingTogetherContainer", "#Links","#")});
       
       $(".lnkPosterGallery").click(function(){showLinkPath("#OurWorkContainer", "#Gallery","#GallPoster")});
       $(".lnkWallMuralGallery").click(function(){showLinkPath("#OurWorkContainer", "#Gallery","#WallMural")});
       $(".lnkUniqueGallery").click(function(){showLinkPath("#OurWorkContainer", "#Gallery","#Unique")});
       $(".lnkBrandsWeServe").click(function(){showLinkPath("#OurWorkContainer", "#BrandsWeServe","#Automotive")});
       $(".lnkCustomerService").click(function(){showLinkPath("#OurWorkContainer", "#OurPrinciplesOfCustomerService","#")});
       
       $(".lnkArtInfo").click(function(){showLinkPath("#ArtRequirementsContainer", "#ArtInfo","#ArtFAQ")});
       $(".lnkPrepArt").click(function(){showLinkPath("#ArtRequirementsContainer", "#ArtInfo","#PrepArt")});
       $(".lnkArtTemplates").click(
                 function(){
                   showLinkPath("#ArtRequirementsContainer", "#Template","#TemplatePosters");
                   $("#TemplatePostersItems").show("fast");
                   SetIndividualDefault("#TemplatePostersEco");
             });
       $(".lnkBulletinTemplates").click(
                 function(){
                   showLinkPath("#ArtRequirementsContainer", "#Template","#TemplateBulletins");
                   $("#TemplateBulletinsItems").show("fast");
                   SetIndividualDefault("#TemplateBulletin");
             }); 
       $(".lnkTransitTemplates").click(
                 function(){
                   showLinkPath("#ArtRequirementsContainer", "#Template","#TemplateTransit");
                   $("#TemplateTransitItems").show("fast");
                   SetIndividualDefault("#TemplateTransitBusDisplays");
             }); 
       $(".lnkContactUs").click(function(){showShortLinkPath("#ContactUsContainer", "#Contact")});  
       $(".lnkMap").click(function(){showShortLinkPath("#ContactUsContainer", "#Map")});  
       $(".lnkVisitingUs").click(function(){showLinkPath("#ContactUsContainer", "#VisitingUs","#Directions")});  
       $(".lnkHotels").click(function(){showLinkPath("#ContactUsContainer", "#VisitingUs","#Hotels")});  
       $(".lnkMailingList").click(function(){showShortLinkPath("#ContactUsContainer", "#JoinOurMailingList")});  
        
        //Regular Links 
      
        $(".lnkBulletinGallery").click(function(){showLinkPath("#OurWorkContainer", "#Gallery","#Bulletin")});
        $(".lnkNewsMore").click(function(){showShortLinkPath("#AboutUsContainer","#News")});
        $(".lnkProcjectMore").click(function(){showLinkPath("#OurWorkContainer","#ProjectSpotlights","#Studies")});
        $("#lnkStudyMore").click(function(){showLinkPath("#OurWorkContainer","#ProjectSpotlights","#Studies")});
        $(".lnkGreenInitItem").click(function(){showLinkPath("#OurWorkContainer","#GreenInitiatives","#GreenProducts")});
        $(".lnkGreenInit").click(function(){showLinkPath("#OurWorkContainer","#GreenInitiatives","#CGgreenLife")});
        $(".lnkEcoCalc").click(function(){showLinkPath("#OurWorkContainer","#GreenInitiatives","#EcoCalculator")}); 
        $(".lnkGameChanging").click(function(){showLinkPath("#OurWorkContainer","#Innovation","#Eco-Flexx")});
       $(".lnkTemplateGenerator").click(function(){showShortLinkPath("#ArtRequirementsContainer","#TemplateGenerator")}); 
        $(".lnkUploadArt").click(function(){showLinkPath("#UploadArtContainer","#UploadArtDiv","#WeWant")}); 
       $(".lnkPrivacyPolicy").click(function(){showLinkPath("#PrivacyPolicyContainer","#PrivacyPolicyDiv","#")});  
       $(".lnkTermsofUse").click(function(){showLinkPath("#TermsOfUseContainer","#TermsOfUseDiv","#")});  
       $(".lnkSiteMap").click(function(){showLinkPath("#SiteMapContainer","#SiteMapDiv","#")});  
       $(".lnkArtSpecsPoster").click(function(){
            showLinkPath("#ArtRequirementsContainer","#ArtSpecs","#ArtSpecsAccordion");
             $("#ArtSpecsAcc1Content").show("fast");
            $("#ArtSpecsAcc1Content").addClass("visible");
        });  
        $(".lnkArtSpecsBulletin").click(function(){
            showLinkPath("#ArtRequirementsContainer","#ArtSpecs","#ArtSpecsAccordion");
             $("#ArtSpecsAcc2Content").show("fast");
            $("#ArtSpecsAcc2Content").addClass("visible");
        });  
        $(".lnkArtSpecsTransit").click(function(){
            showLinkPath("#ArtRequirementsContainer","#ArtSpecs","#ArtSpecsAccordion");
             $("#ArtSpecsAcc3Content").show("fast");
            $("#ArtSpecsAcc3Content").addClass("visible");
        });  
        $(".lnkGetUsYourArt").click(function(){
            showLinkPath("#ArtRequirementsContainer","#ArtInfo","#PrepArt");
            $("#artAcc1Content").show("fast");
            $("#artAcc1Content").addClass("visible");            
        }); 
        $(".lnkCableSystem ").click(function(){
            showLinkPath("#OurWorkContainer","#Innovation", "#CGCableSystem");
            clearSelectedCSButtons();
            $("#CGCableIntroBtn").attr("src", "images/GraphicalElements/GSIntroBtnClicked.jpg");            
            $("#CGCableIntro").fadeIn(1000);
        });
        $(".lnkCSVideos").click(
        function(){
            $(".CGCableSystem").hide();
            showLinkPath("#OurWorkContainer","#Innovation", "#CGCableSystem");
            clearSelectedCSButtons();
            $("#CGCableVideoBtn").attr("src", "images/GraphicalElements/GSvideoBtnClicked.jpg");            
            $("#CGCableVideo").fadeIn(1000);
       });
       $(".lnkEcoFlexxSection").click(function(){showLinkPath("#OurWorkContainer", "#Innovation", "#Eco-Flexx");});
       $("#HeaderGraphic").click(
        function(){
            hideEverything();
            $("#HomeContainer").fadeIn(1000);
        });
});

            function showLinkPath(container, parentItem, subItem){
                hideEverything();
                $(container).fadeIn(1000);
                $(parentItem).addClass("liSelected");
                $(parentItem + "Items").fadeIn(1000);
                $(subItem).addClass("liSubSelected");
                $(subItem + "Content").fadeIn(1000);
            }
            
             function showShortLinkPath(container, parentItem){
                hideEverything();
                $(container).fadeIn(1000);
                $(parentItem).addClass("liSelected");
                $(parentItem + "Items").fadeIn(1000);
            }
            
            function hideEverything(){
                $("#FAQBubble").hide();
                $("#TestimonialBubble").hide();
                $("li").removeClass("liSelected");
                $("li").removeClass("liSubSelected");
                $(".SubUlDiv").hide("fast");
                $(".SubDiv").hide("fast");
                $(".ContentContainers").hide();
            }
            
            function showProductPath(ProdParent, ProdType, Product){
                ProdParent = "P" + ProdParent;
                ProdType = "T" + ProdType;
                hideEverything();
                $("#ProductsContainer").fadeIn(1000);
                $("#" + ProdParent).addClass("liSelected");
                $("#" + ProdParent + "Items").fadeIn(1000);
                $("#" + ProdType).addClass("liSelected");
                $("#" + ProdType + "Items").fadeIn(1000);
                $("#" + Product).addClass("liSubSelected");
                $("#" + Product + "Content").fadeIn(1000);
            }         
            
            function showProduct(ProductName){
                var ProdParent = $("#lnkParent" + ProductName).text();
                var ProdType = $("#lnkType" + ProductName).text();
                var Product = $("#lnkProduct" + ProductName).text();
                showProductPath(ProdParent, ProdType, Product);
            }
            
            function checkCablesSystemLink(element){
                if ($(element).text() == "Cable System Hardware")
                {
                    showLinkPath("#OurWorkContainer", "#Innovation", "#CGCableSystem");
                }
            }