$.fn.getIndex = function() { var a = $(this).parent().children(); return a.index(this) }; $.fn.setNav = function() { jQuery("#main_menu li ul").css({ display: "none" }); jQuery("#main_menu li").each(function() { var a = jQuery(this).find("ul:first"); jQuery(this).hover(function() { a.stop().css({ overflow: "hidden", height: "auto", display: "none" }).slideDown(200, function() { jQuery(this).css({ overflow: "visible", height: "auto" }) }) }, function() { a.stop().slideUp(200, function() { jQuery(this).css({ overflow: "hidden", display: "none" }) }) });  }) }; $.fn.pSlider = function(a) { settings = jQuery.extend({ nav: "#slider_nav", navWrapper: ".slider_nav_btn", fadeSpeed: 800, delay: 5000 }, a); var d = $(this); var e = settings.nav + " " + settings.navWrapper; $(this).children("div").css({ display: "none" }); var b = 0; $(this).children("div").each(function() { if ($(this).attr("id") != "slider_nav") { var f = $(this).children("span.title").html(); $(e).append('<a href="javascript:;" rel="' + b + '">' + f + "</a>"); if ($(this).children("span.title").children("img").length > 0) { $(e).children("a[rel=" + b + "]").css({ padding: "6px 15px 0px 15px" }) } b++ } }); $(e).children("a").eq(0).addClass("active"); $(this).children("div").eq(0).css({ display: "block" }); var c = setInterval(function() { if ($(e + " a.active").next().length > 0) { var g = $(e + " a.active").next(); var f = $(e + " a.active").next().attr("rel"); d.children("div").css({ display: "none" }); if (BrowserDetect.browser != "Explorer") { d.children("div").eq(f).fadeIn(settings.fadeSpeed) } else { d.children("div").eq(f).css({ display: "block" }) } $(settings.nav + " a").removeClass("active"); g.addClass("active") } else { d.children("div").css({ display: "none" }); if (BrowserDetect.browser != "Explorer") { d.children("div").eq(0).fadeIn(settings.fadeSpeed) } else { d.children("div").eq(0).css({ display: "block" }) } $(settings.nav + " a").removeClass("active"); $(settings.nav + " a").eq(0).addClass("active") } }, settings.delay); $(e + " a").click(function() { $(settings.nav + " a").removeClass("active"); $(this).addClass("active"); var f = $(this).attr("rel"); d.children("div").css({ display: "none" }); if (BrowserDetect.browser != "Explorer") { d.children("div").eq(f).fadeIn(settings.fadeSpeed) } else { d.children("div").eq(f).css({ display: "block" }) } clearInterval(c); return false }); $(e).children("a").eq(0).addClass("active"); $(this).children("div").eq(0).css({ display: "block" }) };$(document).ready(function() {
$(document).setNav(); $("#content_slider_slide").pSlider({ nav: "#slider_nav", navWrapper: ".slider_nav_btn", fadeSpeed: 800, delay: 5000 }); $(".portfolio_vimeo").fancybox({ padding: 10, overlayColor: "#fff", overlayOpacity: 0.7 }); $(".portfolio_youtube").fancybox({ padding: 10, overlayColor: "#fff", overlayOpacity: 0.7 }); $(".portfolio_image").fancybox({ padding: 10, overlayColor: "#fff", overlayOpacity: 0.7 }); $("#skins_nav").fancybox({ padding: 0, overlayColor: "#fff", overlayOpacity: 0.7, onStart: function() { $("#fancybox-wrap").css({ "z-index": 999 }); $("#fancybox-overlay").css({ "z-index": 999 }) } }); $(".two_third").hover(function() { $(this).find(".gallery1_hover").css({ top: "-411px", visibility: "visible", opacity: 0.8 }).fadeIn(400); $(this).click(function() { $(this).find("a").click() }) }, function() { $(this).find(".gallery1_hover").fadeOut() }); $(".one_half .gallery_image").hover(function() { $(this).find(".gallery2_hover").css({ top: "-301px", visibility: "visible", opacity: 0.8 }).fadeIn(400); $(this).click(function() { $(this).find("a").click() }) }, function() { $(this).find(".gallery2_hover").fadeOut() }); $(".one_third .gallery_image").hover(function() { $(this).find(".gallery3_hover").css({ top: "-193px", visibility: "visible", opacity: 0.8 }).fadeIn(400); $(this).click(function() { $(this).find("a").click() }) }, function() { $(this).find(".gallery3_hover").fadeOut() }); $(".one_fourth .gallery_image").hover(function() { $(this).find(".gallery4_hover").css({ top: "-146px", visibility: "visible", opacity: 0.8 }).fadeIn(400); $(this).click(function() { $(this).find("a").click() }) }, function() { $(this).find(".gallery4_hover").fadeOut() }); if (BrowserDetect.browser == "Explorer" && BrowserDetect.version < 8) { var a = 1000; $("div").each(function() { $(this).css("zIndex", a); a -= 10 }) }

    Cufon.replace("h1.cufon", { textShadow: "1px 1px rgba(255, 255, 255, 1)", fontSize: "32px" });
    Cufon.replace("h2.cufon", { textShadow: "1px 1px rgba(255, 255, 255, 1)", fontSize: "28px" });
    Cufon.replace("h3.cufon", { textShadow: "1px 1px rgba(255, 255, 255, 1)", fontSize: "22px" });
    Cufon.replace("h4.cufon", { textShadow: "1px 1px rgba(255, 255, 255, 1)", fontSize: "20px" });
    Cufon.replace("h5.cufon", { textShadow: "1px 1px rgba(255, 255, 255, 1)", fontSize: "18px" });
    
    Cufon.replace("#footer h2.widgettitle", { fontSize: "16px" });
    
    Cufon.replace("#content_slider_slide h3", { textShadow: "1px 1px rgba(255, 255, 255, 1)", fontSize: "36px" });
    Cufon.replace(".dropcap1", { textShadow: "1px 1px rgba(255, 255, 255, 1)", fontSize: "40px" });

    $('input[title!=""]').hint();


    var current = 0;
    var total = $('.tabTitle').length;
    $('.tabTitle').eq(0).css("margin-left", 40);

    $(".gal_nav_right").click(function(event) {
        if (current < total - 1) {
            var amt = $('.tabTitle').eq(current).width() + 16;
            $('.tabTitle').each(function() {

                $(this).animate({ 'left': parseInt($(this).css('left')) - amt }, 'fast')
            });
            current += 1;
        }
        event.preventDefault();
    });

    $(".gal_nav_left").click(function(event) {
        if (current > 0) {
            var amt = $('.tabTitle').eq(current - 1).width() + 16;
            $('.tabTitle').each(function() {
                $(this).animate({ 'left': parseInt($(this).css('left')) + amt }, 'fast')
            });
            current -= 1;
        }
        event.preventDefault();
    });
    
});
    


