function bindNavigation(){ $('span.navFstEl').hover( function(){ if(fstSel != $(this).attr("id")){ $(this).css('background-image','url(../images/navigation/NavBackgroundTopShort.png)'); $(this).css('background-position','top'); $(this).css('background-repeat','repeat-x'); }}, function(){ if(fstSel != $(this).attr("id")){ $(this).css({'background-image': 'url(../images/white.png)'});}}); $('span.navFstEl').click( function(){ if($(this).attr("id") == "home") $.bbq.pushState({ url: $(this).attr("id")}); $.bbq.pushState({ nav: $(this).attr("id")}); } ); $('span.navSecEl').click( function(){ $.bbq.pushState({ url: $(this).attr("id") }); } ); } var fstopt = new Array("home", "company", "services", "production", "contact"); var secopt = new Array( "companyXteam", "companyXphilosophy", "companyXreferences", "companyXaddress", "servicesXmarketresearch", "servicesXvranimationfilm", "servicesXdesign", "servicesXprototype", "servicesXengineering", "servicesXassembly", "productionXtoolconstruction", "productionXtoolcomponents", "productionXmetal", "productionXwoodtreatment", "productionXhardfoam", "productionXhoneycombprocessing", "productionXfibereinforcedmaterial", "contactXcontact", "contactXimprint" ); var fstSel = "home"; function fstLevelClick(fstclicked){ for (var i = 0; i < fstopt.length; i++) { if(fstopt[i] == fstclicked){ $('#'+fstopt[i]).css('color', '#808285'); $('#'+fstopt[i]).css('background-position','bottom'); $('#'+fstopt[i]).css('background-image','url(../images/navigation/NavBackgroundTop.png)'); if(fstclicked != "home") { var thecontwidth = document.getElementById('nav').offsetWidth; $('#'+fstopt[i]+'List').width(thecontwidth); $('#'+fstopt[i]+'List').show(); $('#'+fstopt[i]+'ListInner').show(); } else{ secLevelClick("non"); } fstSel = fstopt[i]; } else{ $('#'+fstopt[i]).css('color', '#008848'); $('#'+fstopt[i]).css('background-image','url(../images/white.png)'); $('#'+fstopt[i]+'List').hide(); $('#'+fstopt[i]+'ListInner').hide(); } } } function secLevelClick(secclicked){ for (var i = 0; i < secopt.length; i++) { if(secopt[i] == secclicked){ $('#'+secopt[i]).css('color', '#808285'); } else{ $('#'+secopt[i]).css('color', '#008848'); } } }