﻿/// <reference path="/js/jquery-1.3.2.js" />
var curNavSection = "";
var curSubNavSection = "";
var curNavSection = "";
var curSubNavSection = "";

$(document).ready(function () {
    //Initialization code in here.
    //Fade Rollover Code

    //Load up the Join the Project Feed


    //$(".pngfix").pngFix();

    $(".ui-fade-rollover").each(function () {
        if ($(this).attr("ui-fade-rollover-effect_loaded") == "true") return;
        $(this).attr("ui-fade-rollover-effect_loaded", "true");


        if ($(this).attr("alt") != null && curNavSection != "" && $(this).attr("alt").indexOf(curNavSection) != -1) {
            $(this).attr("src", $(this).attr("src").replace("_off", "_over"));
        }

        if ($(this).attr("alt") != null && curSubNavSection != "" && $(this).attr("alt").indexOf(curSubNavSection) != -1) {
            $(this).attr("src", $(this).attr("src").replace("_off", "_over"));
        }

        var wrapper = "<div style='display: block; height: auto; width: auto; background-repeat: no-repeat; background-image: url(" + $(this).attr("src").replace("_off", "_over") + ")'></div>";
        if ($(this).parent().get(0).tagName == "A") {
            $(this).parent().wrap(wrapper);
        }
        else {
            $(this).wrap(wrapper);
        }

        $(this).bind("mouseenter", function (e) {
            $(this).stop().animate({ opacity: 0 }, 300);
        });
        $(this).bind("mouseleave", function (e) {
            $(this).stop().animate({ opacity: 1 }, 300);
        });


        // Product page scrolling
        $("#scrollContent ul li").not(".i").each(function (i) {
            if ($("#scrollContent ul li").index(this) < 9) {
                $(this).addClass("p1");
            }
            else {
                $(this).addClass("p2");
            }

            $(".p2").hide();
            $("#scrollUp").hide();
        });

        $("#scrollDown").click(function () { page2(); })
        $("#scrollUp").click(function () { page1(); })



        function page2() {

            $(".p1").hide();
            $(".p2").slideDown();
            $("li.i").removeClass("pad");
            $("#scrollDown").fadeOut();
            $("#scrollUp").fadeIn();

        }

        function page1() {

            $(".p2").hide();
            $(".p1").slideDown();
            $("li.i").addClass("pad");
            $("#scrollDown").fadeIn();
            $("#scrollUp").fadeOut();

        }


        $('#two').ContentSlider({
            width: '360px',
            height: '303px',
            speed: 400,
            easing: 'easeOutQuad',
            textResize: true
        });

        $(".modal").colorbox({ width: "479px", height: "436px", scrolling: false, iframe: true, opacity: 0.85, close: "" });

        $("#rotateWrap a").colorbox({ width: "479px", height: "436px", scrolling: false, iframe: true, opacity: 0.85, close: "" });



    });
})
