﻿var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline = 0;

$(document).ready(function() {
						   
$('#mainContent').show();
$('#mainContent1').hide();
$('#mainContent2').hide();
$('#mainContent3').hide();
$('#events_area').hide();
$('tr.supplier_questions').hide();
						   
$('img#news_tab').click(function() {
	$('#news_events_tabs').css("background-image", "url(images/tab_news.jpg)");
	$('#events_area').hide();
	$('#news_area').show();
});
  
$('img#events_tab').click(function() {
	$('#news_events_tabs').css("background-image", "url(images/tab_events.jpg)");
	$('#events_area').show();
	$('#news_area').hide();
});
  

$("input:radio[name='00N30000000c0rW']").change(function() {
    if ($("input:radio[name='00N30000000c0rW']:checked").val() == 'supplier')
		$('tr.supplier_questions').show();
    else
		$('tr.supplier_questions').hide();
});


$('ul.sf-menu').superfish(); 

  $('a.home1').hover(function() {
		//$('#mainContent').css("background-image", "url(images/center2_01.jpg)");
		$('#mainContent').hide();
		$('#mainContent1').show();
		$('#mainContent2').hide();
		$('#mainContent3').hide();
	    news_headline = 99;
		return false;
  });

  $('a.home2').hover(function() {
		//$('#mainContent').css("background-image", "url(images/center3_01.jpg)");
		$('#mainContent').hide();
		$('#mainContent1').hide();
		$('#mainContent2').show();
		$('#mainContent3').hide();
	    news_headline = 99;
		return false;
  });

  $('a.home3').hover(function() {
		//$('#mainContent').css("background-image", "url(images/center4_01.jpg)");
		$('#mainContent').hide();
		$('#mainContent1').hide();
		$('#mainContent2').hide();
		$('#mainContent3').show();
	    news_headline = 99;
		return false;
  });
  
  
  // change timeline text
  
  $('area#1997').hover(function() {
		$('h1#timeline_h1').html('1997');
		$('p#timeline_p').html('Company founded to develop eCommerce integration services.');
  });
  $('area#1998').hover(function() {
		$('h1#timeline_h1').html('1998');
		$('p#timeline_p').html('Drop ship fulfillment services added to developing connectivity hub.');
  });
  $('area#1999').hover(function() {
		$('h1#timeline_h1').html('1999');
		$('p#timeline_p').html('First major retailer signs on.');
  });
  $('area#2000').hover(function() {
		$('h1#timeline_h1').html('2000');
		$('p#timeline_p').html('First generation Connectivity Hub released, second major retailer signs on.');
  });
  $('area#2001').hover(function() {
		$('h1#timeline_h1').html('2001');
		$('p#timeline_p').html('Successful second-round funding for operations and platform development.');
  });
  $('area#2002').hover(function() {
		$('h1#timeline_h1').html('2002');
		$('p#timeline_p').html('Four Top 20 retailers sign on to connect to the CommerceHub platform, company becomes profitable.');
  });
  $('area#2003').hover(function() {
		$('h1#timeline_h1').html('2003');
		$('p#timeline_p').html('10th major retailer signs on, Company receives major investment.');
  });
  $('area#2004').hover(function() {
		$('h1#timeline_h1').html('2004');
		$('p#timeline_p').html('With over 1,000 suppliers connected, platform processes over 6M orders, 1M in Dec 04.');
  });
  $('area#2005').hover(function() {
		$('h1#timeline_h1').html('2005');
		$('p#timeline_p').html('Partner Relationship Management released, over 2,000 suppliers on platform, over 10M orders processed, 2M in Dec 05.');
  });
  $('area#2006').hover(function() {
		$('h1#timeline_h1').html('2006');
		$('p#timeline_p').html('Six major merchants sign on, CommerceHub opens four regional offices, Steve Hamlin joins company as CEO. The Supply-on-Demand platform now connects over 3,000 suppliers representing 5.2M SKUs and exceeds 12M orders processed in 2006.');
  });
  $('area#2007').hover(function() {
		$('h1#timeline_h1').html('2007');
		$('p#timeline_p').html('Bob Marro joins CommerceHub as CFO, supplier network increases by 30%, company surpasses 50 million transactions, existing business transactions up by 23%.');
  });
  $('area#2008').hover(function() {
		$('h1#timeline_h1').html('2008');
		$('p#timeline_p').html('Five major merchants join CommerceHub, including mega-retailer Best Buy, transactions increase by 27%, supplier network increases by 46%, Canadian network grows by more than 100%.');
  });
  $('area#2009').hover(function() {
		$('h1#timeline_h1').html('2009');
		$('p#timeline_p').html('Two major Canadian retailers join CommerceHub including Sears Canada. Transactions increase by more than 20% amid a tough economy, and more than 2,500 new suppliers join the network.');
  });
  
  $('area#2010').hover(function() {
		$('h1#timeline_h1').html('2010');
		$('p#timeline_p').html('Walmart joined the hub along with 6 other major retailers. Transactions for the holiday season increased by almost 40%, with 4 million transactions in December alone.');
  });
  

  news_headline = 1;
  news_interval = setInterval(news_rotate,7000);
   
})

function news_rotate() {
	  if (news_headline =='1') {
			$('#mainContent').css("background-image", "url(images/center2_01.jpg)");
			news_headline=2;
	  } else if (news_headline =='2') {
			$('#mainContent').css("background-image", "url(images/center3_01.jpg)");
			news_headline=3;
	  } else if (news_headline =='3') {
		$('#mainContent').css("background-image", "url(images/center4_01.jpg)");
			news_headline=4;
	  } else if (news_headline =='4') {
		$('#mainContent').css("background-image", "url(images/home_rem_05.jpg)");
			news_headline=1;
	  }
	
}




