﻿$(document).ready(function () { $("div#headerWrap ul li a, a.btnCallMePt, a.btnCallMeEn").append('<span class="hover"></span>').each(function () { var b = $("> span.hover", this).css("opacity", 0); $(this).hover(function () { b.stop().fadeTo(500, 1) }, function () { b.stop().fadeTo(500, 0) }) }); $("a[rel='BASE']").colorbox({ transition: "elastic" }); $("a[rel='ChildBook']").colorbox({ transition: "elastic" }); $("a[rel='rb']").colorbox({ transition: "elastic" }); $("a[rel='espacoF']").colorbox({ transition: "elastic" }); $("a[rel='greenfizz']").colorbox({ transition: "elastic" }); $("a[rel='matbradford']").colorbox({ transition: "elastic" }); $(".iframe").fancybox({ width: 360, height: 440, opacity: true, scrolling: false, centerOnScroll: true, scrolling: "no", transitionIn: "fade", transitionOut: "fade", overlayColor: "#000", type: "iframe" }); $(".ic_container").capslide({ caption_color: "white", caption_bgcolor: "black", overlay_bgcolor: "black", border: "2px solid #BC4246", showcaption: true }); $("a.iconMenuPhoneCall").qtip({ style: { name: "callMe", tip: true }, content: { text: localRes.callMe_toolTip }, position: { corner: { target: "bottomMiddle", tooltip: "topMiddle" }, adjust: { x: 0, y: 4}} }); $("a#twitter").qtip({ style: { name: "socialNetwork", tip: true }, content: { text: localRes.followUs }, position: { corner: { target: "bottomMiddle", tooltip: "bottomMiddle" }, adjust: { x: 0, y: -30}} }); $("a#facebook").qtip({ style: { name: "socialNetwork", tip: true }, content: { text: localRes.addUs }, position: { corner: { target: "bottomMiddle", tooltip: "bottomMiddle" }, adjust: { x: 0, y: -30}} }) }); var _gaq = _gaq || []; _gaq.push(["_setAccount", "UA-3041801-13"]); _gaq.push(["_trackPageview"]); (function () { var d = document.createElement("script"); d.type = "text/javascript"; d.async = true; d.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js"; var c = document.getElementsByTagName("script")[0]; c.parentNode.insertBefore(d, c) })(); if ($.browser.msie) { anchorCheckInterval = 500; logoFadeInValue = 0; menuFadeOutValue = 250; menuFadeInValue = 800; contentFadeOutValue = 250; contentFadeInValue = 800 } else { anchorCheckInterval = 500; logoFadeInValue = 1000; menuFadeOutValue = 200; menuFadeInValue = 1000; contentFadeOutValue = 300; contentFadeInValue = 1000 } colorAnimationValue = 1000; home = "/home"; portfolio = "/portfolio"; about = "/about"; services = "/services"; contacts = "/contacts"; yellowBgColor = "#f5b700"; yellowMenuBg = localRes.yellowMenuBg; yellowGlowBg = "url(../img/glows/yellow.jpg)"; yellowContactsBg = "url(../img/menu/iconYellow.gif)"; yellowFlagsBg = "url(../img/footer/yellow.png)"; redBgColor = "#E0524D"; redMenuBg = localRes.redMenuBg; redGlowBg = "url(../img/glows/red.jpg)"; redContactsBg = "url(../img/menu/iconRed.gif)"; redFlagsBg = "url(../img/footer/red.png)"; greenBgColor = "#7fd105"; greenMenuBg = localRes.greenMenuBg; greenGlowBg = "url(../img/glows/green.png)"; greenContactsBg = "url(../img/menu/iconGreen.gif)"; greenFlagsBg = "url(../img/footer/green.png)"; blueBgColor = "#30a5df"; blueMenuBg = localRes.blueMenuBg; blueGlowBg = "url(../img/glows/blue.jpg)"; blueContactsBg = "url(../img/menu/iconBlue.gif)"; blueFlagsBg = "url(../img/footer/blue.png)"; purpleBgColor = "#d371c8"; purpleMenuBg = localRes.purpleMenuBg; purpleGlowBg = "url(../img/glows/purple.jpg)"; purpleContactsBg = "url(../img/menu/iconPurple.gif)"; purpleFlagsBg = "url(../img/footer/purple.png)"; selectedButtonY = "0"; normalButtonY = "-30px"; yellowButtonX = "0"; redButtonX = "-87px"; greenButtonX = "-195px"; blueButtonX = "-265px"; purpleButtonX = "-363px"; $().ready(function () { setInterval("checkAnchor()", anchorCheckInterval) }); var currentAnchor = null; function checkAnchor() { if (currentAnchor != document.location.hash) { currentAnchor = document.location.hash; var b = !currentAnchor || currentAnchor == "#" ? home : currentAnchor.substring(1); writeContent(b) } } function writeContent(b) { $("#headerWrap a img").fadeIn(logoFadeInValue, function () { }); $("div#loadingWebsite").css({ display: "none" }); if (b == portfolio) { $("body").animate({ backgroundColor: redBgColor }, colorAnimationValue); hideContent("#homeContent,#aboutContent,#contactsContent,#servicesContent,#bodyBottomWrap"); setTimeout(function () { showDefaulContent(portfolio) }, contentFadeOutValue) } else { if (b == about) { $("body").animate({ backgroundColor: greenBgColor }, colorAnimationValue); hideContent("#homeContent,#portfolioContent,#contactsContent,#servicesContent,#bodyBottomWrap"); setTimeout(function () { showDefaulContent(about) }, contentFadeOutValue) } else { if (b == services) { $("body").animate({ backgroundColor: blueBgColor }, colorAnimationValue); hideContent("#homeContent,#portfolioContent,#aboutContent,#contactsContent,#bodyBottomWrap"); setTimeout(function () { showDefaulContent(services) }, contentFadeOutValue) } else { if (b == contacts) { $("body").animate({ backgroundColor: purpleBgColor }, colorAnimationValue); hideContent("#homeContent,#portfolioContent,#aboutContent,#servicesContent,#bodyBottomWrap"); setTimeout(function () { showDefaulContent(contacts); $("form").jqTransform() }, contentFadeOutValue) } else { $("body").animate({ backgroundColor: yellowBgColor }, colorAnimationValue); hideContent("#portfolioContent,#aboutContent,#contactsContent,#servicesContent,#bodyBottomWrap"); setTimeout(function () { showDefaulContent(home); $(".nivoSlider").attr("id") == null && $("#slider").nivoSlider({ effect: "fold", slices: 15, animSpeed: 500, pauseTime: 4000, startSlide: 0, directionNav: true, directionNavHide: true, controlNav: true, controlNavThumbs: false, keyboardNav: true, pauseOnHover: true, manualAdvance: false, captionOpacity: 0.8 }) }, contentFadeOutValue) } } } } } function showDefaulContent(b) { if (b == home) { menuBg = yellowMenuBg; glowBg = yellowGlowBg; contactsBg = yellowContactsBg; buttonY = [selectedButtonY, normalButtonY, normalButtonY, normalButtonY, normalButtonY]; content = "#homeContent"; flagsBg = yellowFlagsBg } if (b == portfolio) { menuBg = redMenuBg; glowBg = redGlowBg; contactsBg = redContactsBg; buttonY = [normalButtonY, selectedButtonY, normalButtonY, normalButtonY, normalButtonY]; content = "#portfolioContent"; flagsBg = redFlagsBg } if (b == about) { menuBg = greenMenuBg; glowBg = greenGlowBg; contactsBg = greenContactsBg; buttonY = [normalButtonY, normalButtonY, selectedButtonY, normalButtonY, normalButtonY]; content = "#aboutContent"; flagsBg = greenFlagsBg } if (b == services) { menuBg = blueMenuBg; glowBg = blueGlowBg; contactsBg = blueContactsBg; buttonY = [normalButtonY, normalButtonY, normalButtonY, selectedButtonY, normalButtonY]; content = "#servicesContent"; flagsBg = blueFlagsBg } if (b == contacts) { menuBg = purpleMenuBg; glowBg = purpleGlowBg; contactsBg = purpleContactsBg; buttonY = [normalButtonY, normalButtonY, normalButtonY, normalButtonY, selectedButtonY]; content = "#contactsContent"; flagsBg = purpleFlagsBg } $("div#headerWrap ul li.page a").css({ backgroundImage: menuBg }); $("div#headerWrap ul li.page a span.hover").css({ backgroundImage: menuBg }); $("#lbHome").css({ backgroundPosition: yellowButtonX + " " + buttonY[0] }); $("#lbPortfolio").css({ backgroundPosition: redButtonX + " " + buttonY[1] }); $("#lbAbout").css({ backgroundPosition: greenButtonX + " " + buttonY[2] }); $("#lbServices").css({ backgroundPosition: blueButtonX + " " + buttonY[3] }); $("#lbContacts").css({ backgroundPosition: purpleButtonX + " " + buttonY[4] }); $("a.iconMenuPhoneCall, a.iconMenuPhoneCall span.hover").css({ backgroundImage: contactsBg }); $("#flagsWrap").css({ backgroundImage: flagsBg }); $("div#headerWrap ul li a, div#headerWrap ul li a span.hover").fadeIn(menuFadeInValue, function () { }); $(content).fadeIn(contentFadeInValue, function () { }); $("#bodyBottomWrap").fadeIn(contentFadeInValue, function () { }); $.scrollTo(0) } function hideContent(b) { $("div#headerWrap ul li a, div#headerWrap ul li a span.hover").fadeOut(menuFadeOutValue, function () { }); $(b).fadeOut(contentFadeOutValue, function () { }) } (function (b) { var c = []; b.preLoadImages = function () { for (var a = arguments.length; a--; ) { var d = document.createElement("img"); d.src = arguments[a]; c.push(d) } } })(jQuery); var imgPath = "../img/"; $.preLoadImages(imgPath + "bullets/yellow.gif", imgPath + "bullets/blue.gif", imgPath + "footer/yellow.png", imgPath + "footer/green.png", imgPath + "footer/blue.png", imgPath + "footer/purple.png", imgPath + "footer/red.png", imgPath + "glows/yellow.jpg", imgPath + "glows/green.jpg", imgPath + "glows/blue.jpg", imgPath + "glows/purple.jpg", imgPath + "glows/red.jpg", imgPath + localRes.preloadMenuYellow, imgPath + localRes.preloadMenuRed, imgPath + localRes.preloadMenuGreen, imgPath + localRes.preloadMenuBlue, imgPath + localRes.preloadMenuPurple, imgPath + "menu/iconYellow.gif", imgPath + "menu/iconRed.gif", imgPath + "menu/iconGreen.gif", imgPath + "menu/iconBlue.gif", imgPath + "menu/iconPurple.gif", imgPath + localRes.preloadSentencesEntry, imgPath + localRes.preloadSentencesAbout, imgPath + localRes.preloadSentencesService, imgPath + localRes.preloadSentencesContacts, imgPath + "bg1.jpg", imgPath + "bg2.jpg", imgPath + "bg3.jpg", imgPath + "bgFooter.png", imgPath + "bonsai.jpg", imgPath + "btnCallMeEn.jpg", imgPath + "btnCallMePt.jpg", imgPath + localRes.preloadBtnDetails, imgPath + localRes.preloadBtnFormCallMe, imgPath + localRes.preloadBtnSend, imgPath + "bullets.gif", imgPath + "click.png", imgPath + "clock.png", imgPath + "closeContactMessage.png", imgPath + "css.png", imgPath + localRes.preloadEmailSent, imgPath + "en.jpg", imgPath + "facebook.png", imgPath + "house.png", imgPath + "mail.png", imgPath + "map.png", imgPath + "phone.png", imgPath + "pt.jpg", imgPath + "tagCloudPt.jpg", imgPath + "tagCloudEn.jpg", imgPath + "treesForTheFutureSeal.jpg", imgPath + "twitter.png", imgPath + "xhtml.png", imgPath + localRes.phoneCall);
