// JavaScript Document
$(document).ready(function() {
    $('.hpscroller').cycle({
		fx: 'fade',
		timeout: 4000, 
    delay:  -2000
	});
	$('.hpcarousel').jcarousel({
		scroll: 2,
		animation: 600,
		itemLoadCallback: showcarousel()
	});
	if ($('#cscycle').length) { 
		$('.csthumbs img').click(function() { 
			$('#cscycle').cycle(parseInt($(this).attr('id').replace("th", ""))-1); 
			return false; 
		});	
		$('#cscycle').cycle({
			fx: 'fade',
			timeout: 0
		});
	}
	if ($('#polarge').length) { 
		$('#portlist a').mouseenter(function() { 
			$('#polarge').cycle(parseInt($(this).attr('id').replace("l", ""))-1); 
			return false; 
		});	
		$('#polarge').cycle({
			fx: 'none',
			timeout: 0
		});
	}
	
	sfHover = function() {
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" over";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" over\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);	
});
function showcarousel() {
	$(".hpcarouselfader").fadeIn();
}
