	/*
	functions:
		function canviIdioma(lang)
		function changeImage()
		function lastMod()
		function textCounter(txtField,txtCount,maxlimit) 

*/
	function canviIdioma(lang)
	{
		pagina = document.location.href.split('?')[0]+'?lang='+lang;
		first = document.location.href.split('?')[1];
		if (first !=null) pagina += '&'+first;
		// ara la resta de parametres
		slash = document.location.href.split('&');
		i=1;
		while (i<slash.length)
		{
					pagina += '&'+slash[i];
			i++;
		}
		sLanguage = lang;
		window.location.reload(pagina);
	}

	function changeImage()
	{
		if (arguments[0] =="") return;
		var image = document.getElementById(arguments[0]);
		currentImage++;
		if (currentImage == images.length) currentImage =0; 
		image.src=images[currentImage];
	}

	function lastMod()
	{
		var monthNames = new Array( 'ene','feb','Mar','Abr','May','Jun','Jul','Ago', 'Sep', 'Oct', 'Nov', 'Dic' );

		var lastDate = new Date( document.lastModified);

		year = y2kYear( lastDate );
		month = lastDate.getUTCMonth();
		day = lastDate.getUTCDate();
		hour = lastDate.getUTCHours();
		minute = lastDate.getUTCMinutes();
		second = lastDate.getUTCSeconds();

		//printDate = zeroPad(day) + " " + monthNames[ month ] + " " + year + "&nbsp;" + zeroPad(hour) + ":" + zeroPad(minute) + ":" + zeroPad(second) + " UTC";
		printDate = zeroPad(day) + " " + monthNames[ month ] + " " + year + "&nbsp;" + zeroPad(hour) + ":" + zeroPad(minute) + ":" + zeroPad(second) + " UTC";
		return printDate;
	}

	function y2kYear( theDate )
	{
		wrongYear = theDate.getUTCFullYear();
		rightYear = wrongYear % 100;
		rightYear += (rightYear < 38) ? 2000 : 1900;
		return rightYear;
	}

	function zeroPad( theNumber )
	{
		if( theNumber < 10 )
		{
			theNumber = "0" + theNumber;
		}
		return theNumber;
	}

	function NovaFinestra(URLStr)
	{
		window.open(URLStr,'','menubar=no,scrollbars=yes,status=no,dependent=yes,toolbar=yes,left=100,top=100,height=500,width=700');
	}

	function NovaFinestra2(URLStr, left, top, width, height)
	{
		window.open(URLStr,'','menubar=no,scrollbars=no,status=no,dependent=yes,toolbar=no,height='+height+',width='+width+',left='+left+',top='+top);
	}


function afegir_favorits() {

  window.external.AddFavorite("http://www.timeforinnovation.com","innovation");

}

///////////////////////////////////
// function to control number of input charactes in textarea fields

	function textCounter(txtField,txtCount,maxlimit) 
	{
		field = document.getElementById(txtField);
		cntfield = document.getElementById(txtCount);
		if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
		else cntfield.value = maxlimit - field.value.length;
	}
/*
	eof
*/