var RecaptchaOptions = {
    theme : 'clean'
};

/*##########################################
######## ANVIL 2.0 PAGE FUNCTIONS/CLASSES
##########################################*/

Date.prototype.getDOY = function() {
	var onejan = new Date(this.getFullYear(),0,1);
	return Math.ceil((this - onejan) / 86400000);
} 

Number.prototype.toOrdinal = function() {
	var n = this % 100;
	var suff = ["th", "st", "nd", "rd", "th"];
	var ord= n<21?(n<4 ? suff[n]:suff[0]): (n%10>4 ? suff[0] : suff[n%10]);
	return this + ord;
}
 
function mycarousel_initCallback(carousel) {
	jQuery('.jcarousel-control a').bind('click', function() {											  
		carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr("title")));
		return false;
	});
};

function mycarousel_itemVisibleInCallbackAfterAnimation(carousel, item, idx, state) {
	jQuery('.jcarousel-control a').removeClass("current");
   	jQuery('.jcarousel-control a[title='+idx+']').addClass("current");
	
	if(idx == 3) {
		setTimeout(function(){carousel.scroll(jQuery.jcarousel.intval(1))},10000);
	}
};

$(document).ready(function(){
	$('.robot-popup').bind('click', function() {
		window.open($(this).attr('href'),'offerterms','width=550,height=380,scrollbars=no');
		return false;
	});
});
