﻿(function(a) { var d = []; a.preLoadImages = function() { for (var b = arguments.length; b--; ) { var c = document.createElement("img"); c.src = arguments[b]; d.push(c) } } })(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 + "glows/yellow.jpg", imgPath + "glows/green.jpg", imgPath + "glows/blue.jpg", imgPath + "glows/purple.jpg", imgPath + localRes.preloadMenuYellow, imgPath + localRes.preloadMenuGreen, imgPath + localRes.preloadMenuBlue, imgPath + localRes.preloadMenuPurple, imgPath + "menu/iconYellow.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 + "btnCallMe.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 + "tagCloud.jpg", imgPath + "treesForTheFutureSeal.jpg", imgPath + "twitter.png", imgPath + "xhtml.png", imgPath + localRes.phoneCall);
if ($.browser.msie) { anchorCheckInterval = 500; logoFadeInValue = 0; menuFadeOutValue = 250; menuFadeInValue = 800; contentFadeOutValue = 250; contentFadeInValue = 800 } else { anchorCheckInterval = 500; logoFadeInValue = 1E3; menuFadeOutValue = 200; menuFadeInValue = 1E3; contentFadeOutValue = 300; contentFadeInValue = 1E3 } colorAnimationValue = 1E3; home = "/home"; 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)"; 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"; greenButtonX = "-90px"; blueButtonX = "-160px"; purpleButtonX = "-258px"; $().ready(function() { setInterval("checkAnchor()", anchorCheckInterval) }); var currentAnchor = null;
function checkAnchor() { if (currentAnchor != document.location.hash) { currentAnchor = document.location.hash; var a = !currentAnchor || currentAnchor == "#" ? home : currentAnchor.substring(1); writeContent(a) } }
function writeContent(a) {
    $("#headerWrap a img").fadeIn(logoFadeInValue, function() { }); $("div#loadingWebsite").css({ display: "none" }); if (a == about) { $("body").animate({ backgroundColor: greenBgColor }, colorAnimationValue); hideContent("#homeContent,#contactsContent,#servicesContent,#bodyBottomWrap"); setTimeout(function() { showDefaulContent(about) }, contentFadeOutValue) } else if (a == services) {
        $("body").animate({ backgroundColor: blueBgColor }, colorAnimationValue); hideContent("#homeContent,#aboutContent,#contactsContent,#bodyBottomWrap");
        setTimeout(function() { showDefaulContent(services) }, contentFadeOutValue)
    } else if (a == contacts) { $("body").animate({ backgroundColor: purpleBgColor }, colorAnimationValue); hideContent("#homeContent,#aboutContent,#servicesContent,#bodyBottomWrap"); setTimeout(function() { showDefaulContent(contacts); $("form").jqTransform() }, contentFadeOutValue) } else {
        $("body").animate({ backgroundColor: yellowBgColor }, colorAnimationValue); hideContent("#aboutContent,#contactsContent,#servicesContent,#bodyBottomWrap"); setTimeout(function() {
            showDefaulContent(home);
            $(".nivoSlider").attr("id") == null && $("#slider").nivoSlider({ effect: "fold", slices: 15, animSpeed: 500, pauseTime: 4E3, startSlide: 0, directionNav: true, directionNavHide: true, controlNav: true, controlNavThumbs: false, keyboardNav: true, pauseOnHover: true, manualAdvance: false, captionOpacity: 0.8 })
        }, contentFadeOutValue)
    } 
}
function showDefaulContent(a) {
    if (a == home) { menuBg = yellowMenuBg; glowBg = yellowGlowBg; contactsBg = yellowContactsBg; buttonY = [selectedButtonY, normalButtonY, normalButtonY, normalButtonY]; content = "#homeContent"; flagsBg = yellowFlagsBg } if (a == about) { menuBg = greenMenuBg; glowBg = greenGlowBg; contactsBg = greenContactsBg; buttonY = [normalButtonY, selectedButtonY, normalButtonY, normalButtonY]; content = "#aboutContent"; flagsBg = greenFlagsBg } if (a == services) {
        menuBg = blueMenuBg; glowBg = blueGlowBg; contactsBg = blueContactsBg; buttonY = [normalButtonY,
normalButtonY, selectedButtonY, normalButtonY]; content = "#servicesContent"; flagsBg = blueFlagsBg
    } if (a == contacts) { menuBg = purpleMenuBg; glowBg = purpleGlowBg; contactsBg = purpleContactsBg; buttonY = [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] }); $("#lbAbout").css({ backgroundPosition: greenButtonX +
" " + buttonY[1]
    }); $("#lbServices").css({ backgroundPosition: blueButtonX + " " + buttonY[2] }); $("#lbContacts").css({ backgroundPosition: purpleButtonX + " " + buttonY[3] }); $("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(a) { $("div#headerWrap ul li a, div#headerWrap ul li a span.hover").fadeOut(menuFadeOutValue, function() { }); $(a).fadeOut(contentFadeOutValue, function() { }) };