﻿
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload = startList;


var theInt = null;
var $crosslink, $navthumb;
var curclicked = 0;

theInterval = function(cur) {
    clearInterval(theInt);

    if (typeof cur != 'undefined')
        curclicked = cur;

    $crosslink.removeClass("active-thumb");
    $navthumb.eq(curclicked).parent().addClass("active-thumb");
    $(".stripNav ul li a").eq(curclicked).trigger('click');

    theInt = setInterval(function() {
        $crosslink.removeClass("active-thumb");
        $navthumb.eq(curclicked).parent().addClass("active-thumb");
        $(".stripNav ul li a").eq(curclicked).trigger('click');
        curclicked++;
        if (7 == curclicked)
            curclicked = 0;

    }, 4000);
};

/*
$(function() {

    $("#main-photo-slider").codaSlider();

    $navthumb = $(".nav-thumb");
    $crosslink = $(".cross-link");

    $navthumb
			.click(function() {
			    var $this = $(this);
			    theInterval($this.parent().attr('href').slice(1) - 1);
			    return false;
			});

    theInterval();
});
*/

$(document).ready(function() {

    var parentWidth = $('#thumbScroller').width();
    var liWidth = $('#movers-row li').width(); // individual LI width
    var liCount = $('#movers-row').children().length; // total LI count
    var totalLILength = liWidth * liCount + 2000; // total value
    $('#movers-row').css('width', totalLILength);  // UL width


    var iterator = Math.ceil(liCount / 7);
    var i = 0;
    var j = 1;

    $('.scrollerThumbHolder input#leftBtn').click(function() {
        if (i > 1) {
            i--;
            $('#movers-row').animate({ "left": (parentWidth - parentWidth * i) }, "slow");
        }
    });


    $('.scrollerThumbHolder input#rightBtn').click(function() {
        if (i < iterator - 1) {
            i++;
            $('#movers-row').animate({ "left": -(parentWidth * i) }, "slow");
        }
    });

});
		


