﻿//    Removing the padding and margin right from the last li element within the div "signIn"

jQuery(document).ready(function ($) {
    $(".signIn ul li:last-child")

        .css({ marginRight: "0px", marginTop: "0.3em", borderRight: "0px" })

});

//    Removing the padding and margin right from the last li element within the ul "level1"

jQuery(document).ready(function ($) {
    $("#headerTop ul.level0 li:last-child")

        .css({ marginRight: "0px", paddingRight: "0px", borderRight: "0px" })

});


jQuery(document).ready(function ($) {
    $("#headerTop ul.level0 li ul li:last-child")

        .css({ borderBottom: "0px"})

});

jQuery(document).ready(function ($) {
    $("#subRight ul.level0 li:last-child")

        .css({ borderBottom: "1px dotted #bfbfbf" , paddingBottom: "0.4em" })

});






//        Removing the border bottom, padding bottom and margin bottom from the last li element within the ul "newsPost"

jQuery(document).ready(function ($) {
    $("ul.newsPost li:last-child")

            .css({ borderBottom: "0px", paddingBottom: "0px", marginBottom: "0px" })

});

//        Removing the border bottom, padding bottom and margin bottom from the last li element within the ul "eventsPost"

jQuery(document).ready(function ($) {
    $("ul.eventsPost li:last-child")

            .css({ borderBottom: "0px", paddingBottom: "0px", marginBottom: "0px" })

});


//        Removing the padding right from the 1st home banner 2nd label"




jQuery(document).ready(function ($) {
    $(".FirstSlideHomeSelect ul li:last-child")

            .css({ paddingRight: "0px" })

});


//        Removing the border bottom, padding bottom and margin bottom from the last div element within the news post column on the home page

jQuery(document).ready(function ($) {
    $(".newsPost:last-child")

            .css({ borderBottom: "0px"})

});


jQuery(document).ready(function ($) {
    $("ul.footerNav li:last-child")

            .css({ paddingRight: "0px", marginRight: "0px", borderRight: "0px" })

});


jQuery(document).ready(function ($) {
    $("#subHeader ul.level0 li:last-child")

            .css({ marginBottom: "0px", paddingBottom: "0.7em", borderBottom: "1px dotted #bfbfbf" })




});


jQuery(document).ready(function ($) {
    $(".selectionstep2 ul li:last-child")

            .css({ marginRight: "0px" })

});



jQuery(document).ready(function ($) {
    $(".selectionstep3 ul li:last-child")

            .css({ marginBottom: "0px" })

});






jQuery(document).ready(function ($) {
$("img.timberstoneOff").hover(
function() {
$(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
$(this).stop().animate({"opacity": "1"}, "slow");
});

});



jQuery(document).ready(function ($) {
    $("img.homeHomeStylesImg").hover(
function () {
    $(this).stop().animate({ "opacity": "0" }, "slow");
},
function () {
    $(this).stop().animate({ "opacity": "1" }, "slow");
});

});

jQuery(document).ready(function ($) {
    $("img.commHomeImg").hover(
function () {
    $(this).stop().animate({ "opacity": "0" }, "slow");
},
function () {
    $(this).stop().animate({ "opacity": "1" }, "slow");
});

});


jQuery(document).ready(function ($) {
    $("img.moveinHomeImg").hover(
function () {
    $(this).stop().animate({ "opacity": "0" }, "slow");
},
function () {
    $(this).stop().animate({ "opacity": "1" }, "slow");
});

});





jQuery(document).ready(function ($) {
    $("img.lifestyleCalloutOff").hover(
function () {
    $(this).stop().animate({ "opacity": "0" }, "slow");
},
function () {
    $(this).stop().animate({ "opacity": "1" }, "slow");
});

});


jQuery(document).ready(function ($) {
    var imgArr = [];
    function setGallery() {
        $("#pikame li").each(function (i) {
            var img = $(this).find('a').attr('href');
            var title = $(this).find('img').attr('alt');
            imgArr[i] = {
                'href': img,
                'title': title
            }
            $(this).find('a').attr("href", "javascript:;");
            $(this).find('img').attr("title", i);
        });
        //console.log(imgArr);
    }
    setGallery();

    function showGallery(num) {
        $.fancybox(imgArr,
    {
        'index': num,
        'titlePosition': 'inside',
        'type': 'image'
    });
    }

    function updateImage(self) {
        var num = self.active.attr("title");
        //console.log(num, imgArray);
        //self.caption.find("a").click(function(){showGallery(num)}); // Uncomment to activate popup on any links in caption
        self.anchor.click(function () { showGallery(num) });
    }

    $("#pikame").PikaChoose({ autoPlay: true, animationFinished: updateImage, carousel: true });
    /*var a = function (self) {        
        self.anchor.attr("rel","shadowbox").fancybox();
    };

    $("#pikame").PikaChoose({ carousel: true, buildFinished: a });*/
    
});


				sfHover = function () {
				    var sfEls = $(".level0 li");
				    for (var i = 0; i < sfEls.length; i++) {
				        sfEls[i].onmouseover = function () {
				            this.className += " hover";
				        }
				        sfEls[i].onmouseout = function () {
				            this.className = this.className.replace(new RegExp(" hover\\b"), "");
				        }
				    }
				}
				if (window.attachEvent) window.attachEvent("onload", sfHover);



                jQuery(document).ready(function ($) {
				//Shadowbox.init();
});

jQuery(document).ready(function ($) {

    $("a.groupedTestimonials").fancybox();

});
