// rounded corners
window.onload = function() {
	settings = {
  	tl: { radius: 7 },
    tr: { radius: 7 },
    bl: { radius: 7 },
    br: { radius: 7 },
    antiAlias: true,
    autoPad: true,
    validTags: ["div"]
	}
	var myBoxObject = new curvyCorners(settings, "promo");
	var myBoxObject2 = new curvyCorners(settings, "promo-solid");
	var myBoxObject2 = new curvyCorners(settings, "promo-bundle");
  myBoxObject.applyCornersToAll();
	myBoxObject2.applyCornersToAll();
}

$(document).ready(function() {
						   
	//homepage graphics fade					   
	
	var cont1 = 1;
	var cont2 = 2;
		
	function automat() {
		$('#v-fade-' + cont1).fadeOut("slow");
		$('#v-fade-' + cont2).fadeIn("slow");
		cont1++;
		cont2++;
		if(cont1==4) cont1 = 1;
		if(cont2==4) cont2 = 1;
	}
		

	var id = setInterval(automat, 7500);
	
	$('#home-comp').mouseover(function() {
		if($(this).hasClass('this-seg') == false){
			id = window.clearInterval(id);
			$('#v-fade-2, #v-fade-3').fadeOut("slow");
			$('#v-fade-1').fadeIn("slow");
			$(this).toggleClass('this-seg');
			$('#home-bus, #home-ecomm').removeClass('this-seg');
		}
	});
	
	$('#home-bus').mouseover(function() {
		if($(this).hasClass('this-seg') == false){
			id = window.clearInterval(id);
			$('#v-fade-1, #v-fade-3').fadeOut("slow");
			$('#v-fade-2').fadeIn("slow");
			$(this).toggleClass('this-seg');
			$('#home-ecomm, #home-comp').removeClass('this-seg');
		}
	});
		
	$('#home-ecomm').mouseover(function() {
		if($(this).hasClass('this-seg') == false){
			id = window.clearInterval(id);
			$('#v-fade-1, #v-fade-2').fadeOut("slow");
			$('#v-fade-3').fadeIn("slow");
			$(this).toggleClass('this-seg');
			$('#home-comp, #home-bus').removeClass('this-seg');
		}
	});		
});
