var curBannerID = 1;
var t;
var skipTime = 7500;
var animateTime = 700;
jQuery(document).ready(function() {
	showBanner(1);
	jQuery('#what_we_can_do_for_you').mouseover(function() {
		jQuery(this).css('backgroundPosition', '0px -35px');
		jQuery(this).css('height','41px');
		jQuery(this).css('marginTop','-3px');
	});
	jQuery('#what_we_can_do_for_you').mouseout(function() {
		jQuery(this).css('backgroundPosition', '0px 0px');
		jQuery(this).css('height','35px');
		jQuery(this).css('marginTop','0px');
	});
	jQuery('#view_demo').mouseover(function() {
		jQuery(this).css('backgroundPosition', '0px -34px');
		jQuery(this).css('height','40px');
		jQuery(this).css('marginTop','-3px');
	});
	jQuery('#view_demo').mouseout(function() {
		jQuery(this).css('backgroundPosition', '0px 0px');
		jQuery(this).css('height','34px');
		jQuery(this).css('marginTop','0px');
	});
	jQuery('#learn_more, #learn_more2').mouseover(function() {
		jQuery(this).css('backgroundPosition', '0px -34px');
		jQuery(this).css('height','40px');
		jQuery(this).css('marginTop','-3px');
	});
	jQuery('#learn_more, #learn_more2').mouseout(function() {
		jQuery(this).css('backgroundPosition', '0px 0px');
		jQuery(this).css('height','34px');
		jQuery(this).css('marginTop','0px');
	});
});
function showBanner(id)
{
	jQuery('#banner #banner'+curBannerID+' .line1').stop();
	jQuery('#banner #banner'+curBannerID+' .line2').stop();
	jQuery('#banner #banner'+curBannerID+' .line3').stop();
	jQuery('#banner #banner'+curBannerID+' .button').stop();

	jQuery('#banner #banner1 .title').width('442px');
	jQuery('#banner #banner2 .title').width('602px');
	jQuery('#banner #banner3 .title').width('624px');

	jQuery('#banner #banner1 .line1').width('465px');
	jQuery('#banner #banner1 .line2').width('465px');

	jQuery('#banner #banner2 .line1').width('557px');
	jQuery('#banner #banner2 .line2').width('323px');
	jQuery('#banner #banner2 .line3').width('547px');

	jQuery('#banner #banner3 .line1').width('588px');
	jQuery('#banner #banner3 .line2').width('325px');
	jQuery('#banner #banner3 .line3').width('643px');

	jQuery('#what_we_can_do_for_you').height('35px');
	jQuery('#view_demo').height('34px');
	jQuery('#learn_more, #learn_more2').height('34px');

	jQuery('#banner #banner'+curBannerID+' .bkg').fadeOut();
	jQuery('#banner #banner'+curBannerID).hide();
	curBannerID = id;
	var line1Width = jQuery('#banner #banner'+curBannerID+' .line1').width();
	jQuery('#banner #banner'+curBannerID+' .line1').width(0);
	var line2Width = jQuery('#banner #banner'+curBannerID+' .line2').width();
	jQuery('#banner #banner'+curBannerID+' .line2').width(0);
	var line3Width = jQuery('#banner #banner'+curBannerID+' .line3').width();
	jQuery('#banner #banner'+curBannerID+' .line3').width(0);
	var buttonHeight = jQuery('#banner #banner'+curBannerID+' .button').height();
	jQuery('#banner #banner'+curBannerID+' .button').height(0);
	jQuery('#banner #banner'+curBannerID).show();
	jQuery('#banner #banner'+curBannerID+' .bkg').fadeIn();
	jQuery('#banner #banner'+curBannerID+' .line1').animate({width:line1Width},animateTime, function() {
		jQuery('#banner #banner'+curBannerID+' .line2').animate({width:line2Width},animateTime, function() {
			if(curBannerID != 1)
			{
				jQuery('#banner #banner'+curBannerID+' .line3').animate({width:line3Width},animateTime, function() {
					jQuery('#banner #banner'+curBannerID+' .button').animate({height:buttonHeight},animateTime);
				});
			}
			else
				jQuery('#banner #banner'+curBannerID+' .button').animate({height:buttonHeight},animateTime);
		});
	});
	clearTimeout(t);
	if(curBannerID < 3)
		t = setTimeout('showBanner('+(curBannerID+1)+');',skipTime);
	else
		t = setTimeout('showBanner(1);',skipTime);
}
