/* -----------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
	
	nvd.chicodev.com
	Stylesheet: public/main.js
	Author: Brent White, chicowebdesign.com
	Version: November 19, 2009
	
--------------------------------------------------------------------------------------
----------------------------------------------------------------------------------- */
jQuery(document).ready(function(){

	/* -----------------------------------------------------------------------------------
	LAST CHILD / FIRST CHILD : ADD FIRST / LAST CLASSES
	----------------------------------------------------------------------------------- */
	jQuery('li:last-child').addClass('last');
    jQuery('li:first-child').addClass('first');
    
	
	/*jQuery('#banner').cycle();*/
	jQuery('#callcycle').cycle();
	
	jQuery(".colorbox").colorbox({width:"90%", height:"90%", iframe:true});
	
	if(jQuery(".anim-providers").length){
		setInterval("animProviders()",5000);
	}
	
});

function animProviders(){
	var $ap=jQuery(".anim-providers");
	if($ap.length){
		$ap.each(function(){
			var $active=jQuery(this).children(".active");
			if($active.length==0){
				$active=jQuery(jQuery(this).children().last());
			};
			jQuery(this).children().css("z-index","1");
			$active.css("z-index","20");
			var $next=$active.next();
			if($next.length==0){
				$next=jQuery(jQuery(this).children()[0]);
			};
			$active.removeClass("active");
			$next.css({"opacity":"0","z-index":"30"}).addClass("active").animate({"opacity":"1"},400);
			
			
		});
	};
}

function goLeft(){
	jQuery("#choose_provider .holder ul").animate({"marginLeft":"0"},500);
}
function goRight(){
	jQuery("#choose_provider .holder ul").animate({"marginLeft":"-450px"},500);
}

