function changeDiv( ) {
    var hash = window.location.hash;

    if ('' == hash) {
        hash = "#default";
    }

    jQuery("div.boxes").fadeOut( ).filter(hash).fadeIn( );

    $(".links a").removeClass("active").filter("a[href="+hash+"]").addClass("active");
}

jQuery(document).ready( function($) {

    changeDiv( );

	jQuery('ul.sf-menu').superfish();

	$('#slider')
	.after('<div id="nav">')
	.cycle({
//Set in cycle.js	    fx:     'scrollHorz',
//Set in cycle.js	    speed:  2000,
//Set in cycle.js	    timeout: 6000,
	    pager:  '#nav',
		prev: '#prev',
		next: '#next',
		before : function(currSlideElement, nextSlideElement, options, forwardFlag) {
			var clss = $(nextSlideElement).attr('class');
			var myregexp = /slider-\w+/i;
			var match = myregexp.exec(clss);
			$('div.top-sub-nav li.active').removeClass('active');
			$('div.top-sub-nav li.'+match[0]).addClass('active');

			if ('slider-one' == match[0]) {
				$('div.navigation div.cm-title').addClass('active');
			}
			else {
				$('div.navigation div.cm-title').removeClass('active');
			}
		}
	});

});
























