$(document).ready(function(){
	$('html,body').animate({scrollTop:0},0);
	setBrowser();
	exLinks();
});
$('#rotation').cycle({
	fx: 'fade',
	speed: 500,
	timeout: 10000,
	startingSlide: 1,
	easeIn: 'easeInCirc',
	next: '#nextBtn',
	prev: '#prevBtn'
});
$('#quote-cycle').cycle({
	fx: 'scrollLeft',
	timeout: 5000,
	cleartype: 1,
	speed: 500,
	startingSlide: 1,
	next: '#nextQuote',
	prev: '#prevQuote',
	easeOut: 'easeOutElastic',
	delay: -1000
});
$('#quote-cycle').mouseover(function() {
	$(this).cycle('pause');
}).mouseout(function(){
	$(this).cycle('resume');
});
$('#toTop').click(function(){
	$('body,html').animate({
	scrollTop:0 }, 100);
	return false;
});
function setBrowser(){
	var $mobile = (navigator.userAgent.match(/(?:iPhone|iPad|iPod|Android)/i) != null);
	if(navigator.userAgent.match('MSIE 6')){
		browser = "ie6";
	}else if(navigator.userAgent.match('MSIE 7')){
		browser = "ie7";
	}else if(navigator.userAgent.match('MSIE 8')){
		browser = "ie8";
	}else if(navigator.userAgent.match('MSIE 9')){
		browser = "ie9";
	}else if(navigator.userAgent.match('MSIE')){
		browser = "ie";
	}else if(navigator.userAgent.match('Firefox')){
		browser = "gecko";
	}else if(navigator.userAgent.match('AppleWebKit')){
		browser = "webkit";
	}else if($mobile){
		browser = "mobile";
	}
	$('body').addClass(browser);
}
function exLinks(){
	$('a[rel="ex"]').click(function(){
		var link = $(this).attr('href');
		window.open(link);
		return false;
	});
}
