var interval =6;
var news_ht = 140;
var cur_news = 0;
var isStop = false;
var handle = null;
var vNewsHTML = '';

var vNews = [		
			['Cotton exports may triple in FY10', 'World cotton trade is expected to increase by 8 per cent to 6.5 million tonnes in FY10 with India contributing most to it, the International Cotton Advisory Committee (ICAC) said on Tuesday...', 'The Economic Times (Ahmedabad - 03/06/2009)', '#'],
			['Apparel cos knock on FM’s door ', 'AFTER losing close to 5 lakh skilled workforce to the global economic downturn, the Indian apparel export sector is hoping that finance minister Pranab Mukherjee will attempt revival through the forthcoming budget...', 'The Economic Times (Ahmedabad - 03/06/2009)', '#'],
			['Centre to offer discount on bulk cotton purchase', 'The inability of the Cotton Corporation of India to dispose of 75lakh bales, procured by it in 2008-09 crop year, has prompted the Centre to offer discounts on bulk purchase of cotton...', 'The Economic Times (Ahmedabad - 18/02/2009)', 'http://www.textilereview.com/textile_news/18feb2009.htm'],
			['Textile industry expects third stimulus package', 'Battling a slowdown that has shackled the growth of the industry, the textile industry seems to be betting high on the third stimulus package and the Exim policy announcements...', 'The Economic Times (Ahmedabad - 18/02/2009)', 'http://www.textilereview.com/textile_news/18feb2009.htm'],
			['Textiles sector miffed with lack of sops', 'A 2% tax subvention on pre-shipment and post shipment credit to exporters, as announced in the interim Budget 2009-10, will not help the textile sector ...', 'The Financial Express (Ahmedabad - 17/02/2009)', 'http://www.textilereview.com/textile_news/17feb2009.htm'],
			['Tech textile ind needs platform to capture', 'The domestic technical textile industry needs to create a platform for stronger industry defence ex-changes and partnership to capture a major part in the country outlay of about Rs 2,000 crore on clothing and fabric needs of ...', 'The Financial Express (Ahmedabad - 19/01/2009)', 'http://www.textilereview.com/textile_news/19jan2009.htm'],
			['Cotton arrivals down 17%', 'Cotton arrivals as on January 15 in the cotton year beginning October 2008 fell 17% on year, an official in state-owned Cotton Corp of India said on Friday. Total arrivals of the fibre crop in the country fell to about 14.54 million bales of 170 kg each...', 'The Financial Express (Ahmedabad - 17/01/2009)', 'http://www.textilereview.com/textile_news/17jan2009.htm'],
			['Tech Textiles to grow to Rs 64,000 cr by 2013', 'It is not just branded apparel that is driving the growth of India’s textile sector. As the Indian consumer drapes up her home with exquisite upholstery, introduces baby diapers and tea bags to the family and drives around in four-wheelers...', 'The Financial Express (Ahmedabad - 17/01/2009) ', 'http://www.textilereview.com/textile_news/17jan2009.htm'],
			['Taxes stifle textile growth in Punjab', 'A struggling industry demands roll-back of taxes to revive itself. The textile cluster in Punjab is passing through a rough patch. The industry is grappling simultaneously with high taxes and the high minimum support price of cotton. The revision...', 'The Financial Express (Ahmedabad - 12/01/2009) ', 'http://www.textilereview.com/textile_news/12jan2009.htm'],
			['Apparel exporters seek new steps to boost industry', 'Expressing their disappointment over the government’s second stimulus package announced on January 2, apparel exporters have sought further measures to boost the sector...', 'The Financial Express (Ahmedabad - 10/01/2009) ', 'http://www.textilereview.com/textile_news/10jan2009.htm'],
			['Growth is at home for textile & apparels', 'Slump in demand coupled with higher input prices is taking its toll on textile companies of Gujarat. The demand for textiles and apparels in international market is not expected to grow in...', 'DNA Money(Ahmedabad - 08/01/2009) ', 'http://www.textilereview.com/textile_news/08jan2009.htm'],
			['No silver lining in sight for the textile industry','The Indian textile industry is one of the largest industries in the world with a massive raw material and textile manufacturing base. Our economy is largely dependent...', 'DNA Money(Ahmedabad - 08/01/2009) ', 'http://www.textilereview.com/textile_news/08jan2009.htm'],
			['Textiles, paper to see Rs 10k-cr investment', 'The textiles and paper industries will see a fresh investment of Rs10,000 crore in the state, the MoUs for which will be signed during the forthcoming Vibrant Gujarat summit...', 'The Economic Times(Ahmedabad - 05/01/2009) ', 'http://www.textilereview.com/textile_news/05jan2009.htm'],
			['Textiles paper industries to see Rs.10K cr investment in state', 'The textiles and paper industries will see a fresh investment of Rs 10,000 crore in the state, the MoUs for which will be signed during the forthcoming Vibrant Gujarat summit....', 'The Economic Times(Ahmedabad - 05/01/2009) ', 'http://www.textilereview.com/textile_news/05jan2009.htm'],
			['Nano, Metro coaches main attraction at summit venue', 'Tata Motor’s dream small car Nano and the Canadian Bombardier’s Metro train carriage are going to be the two star attractions at the mega exhibition planned as part of the...', 'The Economic Times(Ahmedabad - 05/01/2009) ', 'http://www.textilereview.com/textile_news/05jan2009.htm'],
			['Textile sector sees hope by Sept ', 'After a calamitous 2008, the Indian textile sector should expect to be on the revival path by September 2009. With the US economy expected to spring back to life by April 2009, the Indian industry...', 'The Economic Times(Ahmedabad - 03/01/2009) ', 'http://www.textilereview.com/textile_news/03jan2009.htm'],
			['Sops for textiles sought as sector’s growth decline', 'Keeping in view the forthcoming second fiscal stimulus package, the Federation of Indian Chambers of Commerce and Industry (FICCI) has urged the government to pay...', 'The Financial Express(Ahmedabad - 02/01/2009) ', 'http://www.textilereview.com/textile_news/02jan2009.htm'],
			['Alok to raise rights issue size by 50 per cent', 'Alok Industries, the Mumbai-based vertically integrated textile firm, has decided to increase its proposed rights issue by 50 per cent to Rs 450 crore from the earlier Rs 300 crore...', 'Business Standard(Ahmedabad - 02/01/2009) ', 'http://www.textilereview.com/textile_news/02jan2009.htm'],
			['Prospects of cotton exports brighten prices low', 'Falling cotton prices has revived hopes among exporters. Prices of cotton have dropped to Rs 20,800 per candy (340 kg), a decline of Rs 5,000 per candy from...', 'The Economic Times(Ahmedabad - 02/01/2009) ', 'http://www.textilereview.com/textile_news/02jan2009.htm']
						
	];

function PrepareNRenderNews()
{
	var obj = document.getElementById('news');

	if(!obj) return;

		for(var i=0; i<vNews.length; i++) vNewsHTML += '<div onmouseover="isStop=true;" onmouseout="isStop=false;"><h1><a target="_new" class="highslide" title="for more information subscribe now..." href="' + vNews[i][3] + '" onclick="return hs.expand(this);" onfocus="isStop=true;" onblur="isStop=false;">' + vNews[i][0] + '</a><br><span class="info">' + vNews[i][2] + '</span></h1><p>' + vNews[i][1] + '</p></div>';

	var obj = document.getElementById('newscontent');
	if(!obj) return;
	obj.innerHTML = vNewsHTML;
	
	ShowNews(0);
}

function Initialize()
{
	PrepareNRenderNews()
}

function ShowNews()
{
	if(cur_news<0 || cur_news>vNews.length-1) cur_news = 0;
	var nPos = (cur_news * news_ht) * -1;
	handle = window.setInterval('PositionNews(' + nPos + ')', interval);
}

function PositionNews(nPos)
{
	var obj = document.getElementById('newscontent');
	if(!obj) return;
	obj = obj.childNodes[0];

	var cPos = (obj.style.marginTop=='') ? 0 : parseInt(obj.style.marginTop.replace('px', ''));

	var dPos = (nPos - cPos);
	dPos += (dPos%2);
	dPos = Math.floor(dPos/5);
	if(cPos-nPos<0) dPos += 1;
	if(cPos==nPos)
	{
		window.clearInterval(handle); cur_news++;
		window.setTimeout(ShowNews, 3000);
		return;
	}

	obj.style.marginTop = (cPos + dPos);
}

if(window.attachEvent) window.attachEvent('onload', Initialize);
else window.addEventListener('load', Initialize, false);
