var interval = 1;
var news_ht = 90;
var cur_news = 0;
var isStop = false;

var handle = null;
var vNewsHTML = '';

var vNews = [
			['Kunal Organics\' new product for textile industries', 'In what could turn out to be a boon for textile industry, Ahmedabad-based Kunal Organics Pvt. Ltd. (KOPL) launched its new product \'SizeCare\' on Wednesday...', 'DNA (Ahmedabad - 03/01/2008)', './images/sizecare/news1.jpg'],
			['Kunal Organics may help textile firms cut cost', 'In what could help textile industry cut down costs by nearly 55 percent, an Ahmedabad based company has come up with an innovation, which promises to benefit the industry...', 'Business Standard (Ahmedabad - 03/01/2008)', './images/sizecare/news2.jpg'],
			['કુનાલ ઓર્ગેનિક્સ રૂ. ૨૦ કરોડ રોકશે', 'અમદાવાદ સ્થિત ટેક્સટાઇલ કંપની કુનાલ ઓર્ગેનિક્સ પ્રા. લી. ચાલુ નાણાંકીય વર્ષમાં રૂ. ૨૦ કરોડનું રોકાણ કરશે. કંપનીએ બુધવારે તેની સાઇઝ કેર સીરીઝ લોન્ચ કરી હતી ...', 'ધી ઇકોનોમિક ટાઇમ્સ (અમદાવાદ - ૦૪/૦૧/૨૦૦૮)', './images/sizecare/news3.jpg'],
			['Kunal Organics unveils new product for textile industry', 'Ahmedabad based textile auxilliaries maker Kunal Organics Pvt. Ltd. (KOPL) has unveiled a new sizing solution \'SizeCare\' for the textile industry...', 'The Times of India (Ahmedabad - 04/01/2008)', './images/sizecare/news4.jpg'],
			['KOPL offer more USPs, to pump in Rs. 20 cr.', 'With an eye on ever growing innovation-driven textile sector, Ahmedabad based auxilliaries player KOPL will pump in Rs. 20 crore to offer more USPs to various players concerned...', 'The Economic Times (Ahmedabad - 03/01/2008)', './images/sizecare/news5.jpg'],
			['કુણાલ ઓર્ગેનિક્સ નવી પ્રોડક્ટ \'સાઇઝ કેર\' દ્વારા ટેક્ષટાઇલ...', 'ત્રણ દાયકાથી વધુ સમયથી ટેક્ષટાઇલ ઓક્ઝિલીયરીઝમાં વ્યાપક અનુભવ ધરાવતી અમદાવાદ ખાતેની કુણાલ ઓર્ગેનિક્સ પ્રા. લી. એ ભારતમાં ટેક્ષટાઇલ ઇન્ડસ્ટ્રી માટે ક્રાંતિકારી સાઇઝીંગ સોલ્યુશન \'સાઇઝ કેર સીરીઝ\'...', 'જનસત્તા (અમદાવાદ - ૦૪/૦૧/૨૦૦૮)', './images/sizecare/news6.jpg'],
			['ટેક્ષટાઇલ સાઇઝીંગમાં કુણાલ ઓર્ગેનિક્સ દ્વારા ક્રાંતિ', 'ત્રણ દાયકાથી વધુ સમયથી ટેક્ષટાઇલ ઓક્ઝિલીયરીઝમાં વ્યાપક અનુભવ ધરાવતી અમદાવાદ ખાતેની કુણાલ ઓર્ગેનિક્સ પ્રા. લી. એ ભારતમાં ટેક્ષટાઇલ ઇન્ડસ્ટ્રી માટે ક્રાંતિકારી સાઇઝીંગ સોલ્યુશન \'સાઇઝ કેર સીરીઝ\'...', 'જય હિન્દ (અમદાવાદ - ૦૩/૦૧/૨૦૦૮)', './images/sizecare/news7.jpg'],
			['Kunal launches Sizecare', 'Kunal Organics Pvt. Ltd. (KOPL) launched its \'Size Care series\' - a revolutionary sizing solution for the textile industry. Sizing - the dipping-in-a-hot-chemical-bath stage of the traditional...', 'The Indian Express (Ahmedabad - 07/01/2008)', './images/sizecare/news8.jpg'],
			['Kunal Organics launched textile sizing products', 'Ahmedabad based Kunal Organics Pvt. Ltd. on Wednesday announced the launch of three new chemical products providing eco-friendly sizing solutions for the extile industry...', 'The Hindu Business Line (Mumbai - 03/01/2008)', './images/sizecare/news9.jpg'],
			['કુણાલ ઓર્ગેનિક્સની વિસ્તરણ યોજના', 'ટેક્ષટાઇલ ઓક્ઝિલીયરી ક્ષેત્રે અમદાવાદની અગ્રણી કંપની કુણાલ ઓર્ગેનિક્સ આગામી ત્રણ વર્ષમાં રૂ. ૩૦૦ કરોડના ખર્ચે વિસ્તરણ યોજના હાથ ધરશે...', 'દિવ્ય ભાસ્કર (અમદાવાદ - ૦૩/૦૧/૨૦૦૮)', './images/sizecare/news10.jpg']
	];

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 class="highslide" title="Read full story..." 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);
