jQuery(function( $ ){
$.scrollTo.defaults.axis = 'xy'; 
$.easing.elasout = function(x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
};
});

$(document).ready(
function(){
$('ul#imagefader').innerfade({
speed: 2000,
timeout: 8000,
type: 'sequence',
containerheight: '210px'
});
});


$(document).ready(
function(){
$('ul#tempfader').innerfade({
speed: 1000,
timeout: 4000,
type: 'sequence',
containerheight: '210px'
});
});

$(document).ready(
function(){
$('ul#bannerfader').innerfade({
speed: 2000,
timeout: 20000,
type: 'sequence',
containerheight: '220px'
});
});
 
var xto = 0;
var direction = 0;
scroll_content();
setInterval("scroll_content()", 8000);
function scroll_content()
{
	if(direction == 0)
	{
	$('div.scroller').scrollTo('+=940px', 1200, {});
	xto = xto + 940;
		if(xto <= 2820)
		{
		direction = 0;
		}
		else
		{
		direction = 1;
		}
	}	
	else
	{
	$('div.scroller').scrollTo('-=940px', 1200, {});
	xto = xto - 940;
		if(xto > 1880)
		{
		direction = 1;
		}
		else
			{
			direction = 0;
			}
	}
}

$(document).ready(function(){
$("img.a").hover(
function() {
$(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
$(this).stop().animate({"opacity": "1"}, "slow");
});
});

$(document).ready(function(){
$("img.c").hover(
function() {
$(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
$(this).stop().animate({"opacity": "1"}, "slow");
});
});


$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
