var Top = window.Top || {};

Top.sites = new Array
(
"New Sales Office in Silicon Valley and Development Center in Weifang China.",
"Teamsourcing Taiwan: March 10, 2009 expands its territory.",
"Gartner: Look to China for outsourcing services.",
"Teamsourcing recently signed a contract with the Qingdao City Government ...",
"Teamsourcing unveiled the next generation reporting tool.",
"Teamsourcing is moving to a new and larger location.",
"Why Teamsourcing?"
);

var newUrls=new Array();
newUrls[0]='"http://www.teamsourcing.com/news/us-weifang.php?menuId=menu370"'; 
newUrls[1]='"http://www.teamsourcing.com/news/taiwan.php?menuId=menu360"'; 
newUrls[2]='"http://www.teamsourcing.com/news/why.php?menuId=menu350"'; 
newUrls[3]='"http://www.teamsourcing.com/news/about_mianmao.Php?menuId=menu340"'; 
newUrls[4]='"http://www.teamsourcing.com/news/reportingTool.php?menuId=menu330"'; 
newUrls[5]='"http://www.teamsourcing.com/news/qd_gov.php?menuId=menu320"'; 
newUrls[6]='"http://www.teamsourcing.com/news/gartner.php?menuId=menu310"';

var marqueeContent=new Array();                                                                                                
marqueeContent[0]='<a href='+ newUrls[0]+' target="_self">'+Top.sites[0]+'</a><br>';
marqueeContent[1]='<a href='+ newUrls[1]+' target="_self">'+Top.sites[0]+'</a><br>';
marqueeContent[2]='<a href='+ newUrls[2]+' target="_self">'+Top.sites[1]+'</a><br>';
marqueeContent[3]='<a href='+ newUrls[3]+' target="_self">'+Top.sites[2]+'</a><br>';
marqueeContent[4]='<a href='+ newUrls[4]+' target="_self">'+Top.sites[3]+'</a><br>';
marqueeContent[5]='<a href='+ newUrls[5]+' target="_self">'+Top.sites[4]+'</a><br>';
marqueeContent[6]='<a href='+ newUrls[6]+' target="_self">'+Top.sites[5]+'</a><br>';                                                   

var marqueeInterval=new Array();
var marqueeId=0;
var marqueeDelay=5000;
var marqueeHeight=15;
function initMarquee() {
	var str=marqueeContent[0];
	document.getElementById("leftlogo").innerHTML = '<div id="marqueeBox" style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>';

	marqueeId++;
	marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}

function startMarquee(obj) {
	var marqueeBox = document.getElementById("marqueeBox");
	var str=marqueeContent[marqueeId];
		marqueeId++;

	if (marqueeId>=marqueeContent.length) marqueeId=0;
	if (marqueeBox.childNodes.length==1) {
		var nextLine=document.createElement('DIV');
		nextLine.innerHTML=str;
		marqueeBox.appendChild(nextLine);
	} else {
		marqueeBox.childNodes[0].innerHTML=str;
		marqueeBox.appendChild(marqueeBox.childNodes[0]);
		marqueeBox.scrollTop=0;
	}
	clearInterval(marqueeInterval[1]);
	marqueeInterval[1]=setInterval("scrollMarquee()",20);
}

function scrollMarquee() {
	var marqueeBox = document.getElementById("marqueeBox");
	marqueeBox.scrollTop++;
	if (marqueeBox.scrollTop%marqueeHeight==(marqueeHeight-1)){
		clearInterval(marqueeInterval[1]);
	}
}
initMarquee();


function include(sFileName) {
		var objHead = document.getElementsByTagName('head');
		var objScript = document.createElement('script');
		objScript.type = 'text/javascript';
		objScript.src = sFileName;
		objHead[0].appendChild(objScript);
}


