
var modalitystr;
var modalitystr_pt="As comunica&ccedil;&otilde;es poder&atilde;o ser submetidas e apresentadas numa das tr&ecirc;s modalidades seguintes: Comunica&ccedil;&atilde;o Cient&iacute;fica, P&ocirc;ster ou Demonstra&ccedil;&atilde;o de software.<br>O template para essas tr&ecirc;s modalides é o mesmo, somente muda a quantidade de p&aacute;ginas: de 6 a 12 p&aacute;ginas para Comunica&ccedil;&atilde;o Cient&iacute;fica e de 3 a 6 p&aacute;ginas para P&ocirc;ster ou Demonstra&ccedil;&atilde;o de software.";
var modalitystr_fr="Les communications pourront &ecirc;tre faites dans l'une des trois modalit&eacute; suivante: Communications Scientifique, Poster ou D&eacute;monstration de logiciel.<br>Le format piur ces trois modalités de communication est le même, le seul changement est le nombre de pages : de 6 &agrave; 12 pages pour Communications Scientifique et de 3 &agrave; 6 pages pour Poster ou D&eacute;monstration de logiciel";
var modalitystr_en="The comunications can be done in one of the three following modalities: Scientific Comunication, Poster or Software Demo.<br>The template for these three modalities of comunication is the same, just change the quantity of pages: from 6 to 12 pages for Scientific Comunication and 3 to 6 pages for Poster or Software Demo";
var modalitystr_es="The comunications can be done in one of the three following modalities: Scientific Comunication, Poster or Software Demo.<br>The template for these three modalities of comunication is the same, just change the quantity of pages: from 6 to 12 pages for Scientific Comunication and 3 to 6 pages for Poster or Software Demo";

var calendariostr;
var calendariostr_pt=['15 de dezembro de 2009','4 de abril de 2010','7 de maio de 2010','Calend&aacute;rio','Template das comunica&ccedil;&otilde;es','Baixar','ModeloComunicacao-V HTEM.doc','Comunica&ccedil;&atilde;o','Sistem de gerenciamento de comunica&ccedil;&otilde;es do HTEM5'];
var calendariostr_fr=['15 d&eacute;cembre 2009','4 avril 2010','7 mai 2010','Calendrier','Format des communications','T&eacute;l&eacute;charger','ModeleCommunication-V HTEM.doc','Communication','Syst&egrave;me de gestion des communications du HTEM5'];
var calendariostr_en=['December 15th, 2009','April 4th, 2010','May 7th, 2010','Timetable','Template for communications','Download','ComunicationTemplate-V HTEM.doc','Paper','HTEM5 Papers Management System'];
var calendariostr_es=['15 de dezembro de 2009','4 de abril de 2010','7 de mayo de 2010','Calend&aacute;rio','Template das comunica&ccedil;&otilde;es','Baixar','ModeloArticulo-V HTEM.doc','Paper','HTEM5 Papers Management System'];

var calendario2str;
var calendario2str_pt=['Abertura do sistema de submiss&atilde;o de artigos','Data limite para submiss&atilde;o de trabalhos','Data limite para divulga&ccedil;&atilde;o dos trabalhos aceitos'];
var calendario2str_fr=['Ouverture du syst&egrave;me de soumission de communication','Date limite de soumission de communication','Date limite de divulgation des communications accept&eacute;es'];
var calendario2str_en=['Starting day to propose research report, poster and workshop','Deadline for research report proposal, poster and workshop','Deadline for the results of  acceptance of proposals'];
var calendario2str_es=['D&iacute;a inicial para propuesta de reportes de investigaci&oacute;n, p&oacute;sters y talleres','Fecha final para las propuesta de reportes de investigaci&oacute;n, p&oacute;sters y talleres','Fecha limite para la entrega de resultados de aceptaci&oacute;n par a las propuestas'];

var newdatesstr;
var newdatesstr_pt="Novo calendário para submissão de comunicações:";
var newdatesstr_fr="Nouveau calendrier pour la soumission des comunications:";
var newdatesstr_en="New calendar for paper proposal:";
var newdatesstr_es="Novo calendário para submissão de comunicações:";

var programa_pt = [
	'Domingo<br />25/07/2010', //0
	'Segunda<br />26/07/2010', //1
	'Terça<br />27/07/2010',   //2
	'Quarta<br />28/07/2010',  //3
	'Quinta<br />29/07/2010',  //4
	'8h &agrave;s 10h',              //5
	'10h &agrave;s 10h20',             //6
	'10h20 &agrave;s 12h20',            //7
	'12h20 &agrave;s 14h',              //8
	'14h &agrave;s 16h',            //9
	'16h &agrave;s 16h30',            //10
	'16h30 &agrave;s 18h',            //11
	'19h &agrave;s 21h',          //12
	'21h',            //13
	'Registro',                //14
	'Almoço',                  //15
	'Solenidade e<br />palestra de abertura', //16
	'Coquetel',                //17
	'Café',                    //18
	'Conferência',             //19
	'Coffee-Break',            //20
	'Mesa Redonda',            //21
	'Mini-cursos e<br />oficinas',      //22
	'Comunicações<br />Científicas',     //23
	'Pôsteres e Demonstrações',                         //24
	'Conferência e<br>solenidade de<br />encerramento', //25
	'Pausa',					//26
	'Sexta<br />30/07/2010'     //27
];

var programa_en = [
	'Sunday<br />July&nbsp;25th',
	'Monday<br />July&nbsp;26th',
	'Tuesday<br />July&nbsp;27th',
	'Wednesday<br />July&nbsp;28th',
	'Thursday<br />July&nbsp;29th',
	'8:00 - 10:00',              //5
	'10:00 - 10:20',             //6
	'10:20 - 12:20',            //7
	'12:20 - 14:00',              //8
	'14:00 - 16:00',            //9
	'16:00 - 16:30',            //10
	'16h30 - 18:00',            //11
	'19:00 - 21:00',          //12
	'21:00',            //13
	'Registration',
	'Lunch',
	'Opening Ceremony<br>and Plenary',
	'Cocktail',
	'Coffee',
	'Plenary',
	'Coffee-Break',
	'Plenary panel',
	'Workshops',
	'Research<br />Reports',
	'Posters presentation e Demo',
	'Conference',
	'Break',
	'Friday<br />July&nbsp;30th'
];

var programa_fr = [
	'Dimanche<br />25/07/2010',
	'Lundi<br />26/07/2010',
	'Mardi<br />27/07/2010',
	'Mercredi<br />28/07/2010',
	'Jeudi<br />29/07/2010',
	'8h &agrave; 10h',              //5
	'10h &agrave; 10h20',             //6
	'10h20 &agrave; 12h20',            //7
	'12h20 &agrave; 14h',              //8
	'14h &agrave; 16h',            //9
	'16h &agrave; 16h30',            //10
	'16h30 &agrave; 18h',            //11
	'19h &agrave; 21h',          //12
	'21h',            //13
	'Enregistrement',
	'Déjeuner',
	'Ouverture et<br />conférence d\'ouverture',
	'Reception',
	'Café',
	'Conférence',
	'Café',
	'Table Ronde',
	'Mini-cours e<br />ateliers',
	'Communications<br />Scientifiques',
	'Posters e Demonstrations',
	'Conférence de<br />Clôture',
	'Pause',
	'Vendredi<br />30/07/2010'
];

var programa_es = [
	'Domingo<br />25/07/2010',
	'Lunes<br />26/07/2010',
	'Martes<br />27/07/2010',
	'Miercoles<br />28/07/2010',
	'Jueves<br />29/07/2010',
	'8h &agrave;s 10h',              //5
	'10h &agrave;s 10h20',             //6
	'10h20 &agrave;s 12h20',            //7
	'12h20 &agrave;s 14h',              //8
	'14h &agrave;s 16h',            //9
	'16h &agrave;s 16h30',            //10
	'16h30 &agrave;s 18h',            //11
	'19h &agrave;s 21h',          //12
	'21h',            //13
	'Registro',
	'Almuerzo',
	'Apertura y<br />Discurso Inagural',
	'Coctel',
	'Café',
	'Conferencia',
	'Coffee-Break',
	'Mesa Redonda',
	'Cursillos y<br />Workshops',
	'Comunicaciones<br />Cientificas',
	'Pósters e Demonstraciones',
	'Conferencia de<br />Cierre',
	'Pausa',
	'Viernes<br />30/07/2010'
];

var turismo_pt = [
	'Informações Turísticas',
	'Recomendações de Restaurantes',
	'Recomendações de Hospedagem',
	'Clique aqui para obter informações turísticas da cidade do Recife',
	'Agência de Turismo'
];
var turismo_fr = [
	'Informations Touristiques',
	'Recommendations de Restaurants',
	'Recommendations d\'Hôtels',
	'Cliquer ici pour obtenir des informations touristiques sur la ville de Recife',
	'Agence du Tourisme'
];
var turismo_en = [
	'Tourism Informations',
	'Restaurantes Suggestions',
	'Hotels Suggestions',
	'Clic here to get touristics informations about Recife city',
	'Tourism Agency'
];
var turismo_es = [
	'Información Turística',
	'Recomendaciones para restaurantes',
	'Recomendaciones para Hospeje',
	'Click aqui para obtener información turística de la Ciudad de Recife',
	'Agencia de Turismo'
];

var currentlang;

var HTEM5str;
var HTEM5str_pt=["V Col&oacute;quio de Hist&oacute;ria e Tecnologia<br>no Ensino da Matem&aacute;tica",
				 "Recife, Brasil, de 25 a 30 de julho de 2010",
				 "Organiza&ccedil;&atilde;o",
				 "Apoio"];
var HTEM5str_fr=["V Coloque d'Histoire et Technologie<br>dans l'Enseignement des Maths",
				 "Recife, Br&eacute;sil, du 25 au 30 juillet 2010",
				 "Organisation",
				 "Soutien"];
var HTEM5str_en=["Vth History and technology on<br />Mathematics Education Colloquium",
				 "Recife, Brazil, from July 25th to 30th, 2010",
				 "Organization",
				 "Sponsor"];
var HTEM5str_es=["V Coloquio de Historia y Tecnolog&iacute;a<br />de Matematica Educativa",
				 "Recife, Brasil, desde 25 al 30 de Julio  de 2010",
				 "Organizaci&oacute;n",
				 "Auspiciador"];

var menustr;
var menustr_pt=['Home','Apresenta&ccedil;&atilde;o','Organiza&ccedil;&atilde;o','Programa&ccedil;&atilde;o','Mini-cursos','Trabalhos','Inscri&ccedil;&otilde;es','Turismo','Localiza&ccedil;&atilde;o','Creditos'];
var menustr_fr=['Home','Pr&eacute;sentation','Organisation','Programme','Mini-cours','Communications','Inscription','Tourisme','Localisation','Crédits'];
var menustr_en=['Home','Presentation','Organisation','Program','Workshops','Comunications','Inscription','Tourism','Localization','Credits'];
var menustr_es=['Home','Presentaci&oacute;n','Organizaci&oacute;n','Programaci&oacute;n','Mini-cursos','Comunicaciones','Inscripci&oacute;n','Turismo','Ubicaci&oacute;n','Creditos'];

	
//=====Funções======================================================
function loadlang(lg) {
	if(lg==null || lg=="undefined")
		lg='pt';

	if(lg.substring(0,2)=='pt') {
		HTEM5str=HTEM5str_pt;
		menustr=menustr_pt;
		modalitystr=modalitystr_pt;
		calendariostr=calendariostr_pt;
		calendario2str=calendario2str_pt;
		newdatesstr=newdatesstr_pt;
		programastr=programa_pt;
		turismostr=turismo_pt;
		lg='pt';
	}
	else if(lg.substring(0,2)=='fr') {
		HTEM5str=HTEM5str_fr;
		menustr=menustr_fr;
		modalitystr=modalitystr_fr;
		calendariostr=calendariostr_fr;
		calendario2str=calendario2str_fr;
		newdatesstr=newdatesstr_fr;
		programastr=programa_fr;
		turismostr=turismo_fr;
		lg='fr';
	}
	else if(lg.substring(0,2)=='es') {
		HTEM5str=HTEM5str_es;
		menustr=menustr_es;
		modalitystr=modalitystr_es;
		calendariostr=calendariostr_es;
		calendario2str=calendario2str_es;
		newdatesstr=newdatesstr_es;
		programastr=programa_es;
		turismostr=turismo_es;
		lg='es';
	}
	else {
		HTEM5str=HTEM5str_en;
		menustr=menustr_en;
		modalitystr=modalitystr_en;
		calendariostr=calendariostr_en;
		calendario2str=calendario2str_en;
		newdatesstr=newdatesstr_en;
		programastr=programa_en;
		turismostr=turismo_en;
		lg='en';
	}

	if(GetCookie('lang')!=lg) {
		duree_cookie=100;
		expiration = new Date();    // date et heure courante en format texte
		expiration.setTime(expiration.getTime() + (duree_cookie * 24*60*60*1000));
		SetCookie ('lang',lg,expiration,'/');
		window.location.reload();
	}
	currentlang=lg;
}

//******************************************************************************

if(GetCookie('lang')==null) {
	loadlang(navigator.userLanguage);
}
else {
	loadlang(GetCookie('lang'));
}

//******************************************************************************
//  Cookie Functions -- "Night of the Living Cookie" Version (25-Jul-96)
//  Written by:  Bill Dortch, hIdaho Design <bdortch@hidaho.com>


//  "Internal" function to return the decoded value of a cookie
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
	endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}


//  Function to return the value of the cookie specified by "name".
//    name -    String object containing the cookie name.
//    returns - String object containing the cookie value,
//              or null if the cookie does not exist.
//
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
	var j = i + alen;
	if (document.cookie.substring(i, j) == arg)
	  return getCookieVal (j);
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break; 
  }
  return null;
}


//  Function to create or update a cookie.
//    name - String object containing the cookie name.
//    value - String object containing the cookie value.  May contain
//         any valid string characters.
//    [expires] - Date object containing the expiration data of the cookie.  If
//         omitted or null, expires the cookie at the end of the current session.
//    [path] - String object indicating the path for which the cookie is valid.
//         If omitted or null, uses the path of the calling document.
//    [domain] - String object indicating the domain for which the cookie is
//         valid. If omitted or null, uses the domain of the calling document.
//    [secure] - Boolean (true/false) value indicating whether cookie
//         transmission requires a secure channel (HTTPS).  
//
//  The first two parameters are required.  The others, if supplied, must
//  be passed in the order listed above.  To omit an unused optional field,
//  use null as a place holder.  For example, to call SetCookie using name,
//  value and path, you would code:
//
//      SetCookie ("myCookieName", "myCookieValue", null, "/");
//
//  Note that trailing omitted parameters do not require a placeholder.
//
//  To set a secure cookie for path "/myPath", that expires after the
//  current session, you might code:
//
//      SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
//
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}


//  Function to delete a cookie. (Sets expiration date to start of epoch)
//    name -   String object containing the cookie name
//    path -   String object containing the path of the cookie to delete.
//             This MUST be the same as the path used to create the cookie, or
//             null/omitted if no path was specified when creating the cookie.
//    domain - String object containing the domain of the cookie to delete.
//             This MUST be the same as the domain used to create the cookie, or
//             null/omitted if no domain was specified when creating the cookie.
//
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
	document.cookie = name + "=" +
	  ((path) ? "; path=" + path : "") +
	  ((domain) ? "; domain=" + domain : "") +
	  "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

