$(document).ready(function()
{

    // highlight selected page
    var href = document.location.href.toLowerCase();

    $(".top_nav a").each(function()
    {
        var path = $(this).attr("href").toLowerCase();
        path = path.substring(path.lastIndexOf("/") + 1);
        if (href.indexOf(path) > -1)
        {
            $(this).addClass("highlight");
        }
    });

    $(".filter_link").hover(
        function()
        {
            $("ul", this).show();
        },
        function()
        {
            $("ul", this).hide();
        }
    );

    $("#SizeDiv ul.list li").click(function()
    {
        document.location = "Portfolio.aspx?size=" + $(this).attr("id");
    });

    $("#YearDiv ul.list li").click(function()
    {
        document.location = "Portfolio.aspx?year=" + $(this).attr("id");
    });

    $("#MaterialDiv ul.list li").click(function()
    {
        document.location = "Portfolio.aspx?material=" + $(this).attr("id");
    });
});





/////////////////////////////////////////////////////////////////////



var selectedId = "";

if (document.location.href.indexOf("?") > 0)
{
	var qs = document.location.href.split("?"); 
	if (qs.length > 0 && qs[1].indexOf("id=") >= 0)
	{
		selectedId = qs[1].substring(3); 
	}
}



