var divs_to_fade = new Array('box-1', 'box-2', 'box-3', 'box-4');
var i = 0;
var wait = 10000;

$(document).ready(function() {

	$(function() {
		console.log($('#main').css('background-image'));
		if($('#main').css('background-image') == 'none') 
		{
			$('#box-1').show();
			setInterval(swapFade, wait);
		} else {
			$('#box-1').hide();
		}
	});
	
	if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
	jQuery(function($) {
		$("a[rel^='colorbox']").colorbox({/* Put custom options here */}, null, function(el) {
			return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
		});
	});
}
    
});

function swapFade() {
	
		$("#" + divs_to_fade[i]).fadeOut(3000);
		i++;
        if (i == 4) i = 0;
        $("#" + divs_to_fade[i]).fadeIn(3000);
	
}

