﻿$(document).ready(function() {
    setMenu();

    $('.sklarz-bio-more').hide();
    $('#sklarz-bio').click(function() {
        $('.sklarz-bio-more').toggle("slow");
        if ($(this).is(".hide")) {
            $(this).html("View Full Bio");
            $(this).removeClass("hide");
        }
        else {
            $(this).addClass("hide");
            $(this).html("Hide Full Bio");
        }
    });

    $('.norm-bio-more').hide();
    $('#norm-bio').click(function() {
        $('.norm-bio-more').toggle("slow");
        if ($(this).is(".hide")) {
            $(this).html("View Full Bio");
            $(this).removeClass("hide");
        }
        else {
            $(this).addClass("hide");
            $(this).html("Hide Full Bio");
        }
    });

    $('.bob-bio-more').hide();
    $('#bob-bio').click(function() {
        $('.bob-bio-more').toggle("slow");
        if ($(this).is(".hide")) {
            $(this).html("View Full Bio");
            $(this).removeClass("hide");
        }
        else {
            $(this).addClass("hide");
            $(this).html("Hide Full Bio");
        }
    });

    $(".tour-content").hide();
    slide();
});

function setMenu() {    
    if ($(".content").find("div").is("#home")) 
    {
        $("#nav1 a").addClass("current_page");
       
    } else if ($(".content").find("div").is("#about")) {
        $("#nav2 a").addClass("current_page");
    } else if ($(".content").find("div").is("#products")) {
        $("#nav3 a").addClass("current_page");
    } else if ($(".content").find("div").is("#news")) {
        $("#nav4 a").addClass("current_page");
    } else if ($(".content").find("div").is("#contact")) {
        $("#nav5 a").addClass("current_page");
    }
}

function slide() {
    if ($("#tab1 a").is(".current")) {        
        $("#t1").show();
    } else if ($("#tab2 a").is(".current")) {
        $("#t2").show();
    } else if ($("#tab3 a").is(".current")) {
        $("#t3").show();
    } else if ($("#tab4 a").is(".current")) {
        $("#t4").show();
    } 
}

function hover($item) {    
    $("#tour-tabs a").removeClass("current");
    $($item).addClass("current");
    $(".tour-content").hide();
    slide();
}

function LoadDynamicFeedControl() {
    var feeds = [
	{ title: 'NY Times Real Estate News',
	    url: 'http://www.nytimes.com/services/xml/rss/nyt/RealEstate.xml'
}];
    var options = {
        stacked: false,
        horizontal: false,
        title: ""
    }

    new GFdynamicFeedControl(feeds, 'feed-control', options);
}

