var lang;

$(document).ready(function(){
	lang = $.cookie('lang');
	if( lang == null){
		$.cookie('lang', 1);
		lang = 1;
	}
	menuLang();
	setFlag();
})


function menuLang(){
	for(var i = 0; i < menu[lang].length; i++){
		$('#menu_'+i).html(menu[lang][i]);
	}
}

function profileLang(){
	for(var i = 0; i < profile[lang].length; i++){
		$('#profiledata_'+(i+1)).html(profile[lang][i]);
	}
}

function pageTitle(pos){
	$('#pagetitle').html(menu[lang][pos]);
	document.title = "Miguel Ramos Sport: "+ menu[lang][pos];
}



function newsLang(){
	for(var i = 0; i < news[lang].length; i++){
		$('#newstitle_'+i).html(news[lang][i][0]);
		$('#newsbody_'+i).html(news[lang][i][1]);
	}
	if(lang == 2){
		$('.leiamais').html('READ MORE');
	} else {
		$('.leiamais').html('LEIA MAIS');
	}
}

function careerLang(){
	var careerString = '';
	for(var i = 0; i < career[lang].length; i++){
		careerString += '<li>';
		careerString += '<p class="contenttitle">'+career[lang][i][0]+'</p>';
		careerString += '<p class="contentbody">'+career[lang][i][1]+'</p>';
		careerString += '</li>';
	}
	jQuery('#contentlist').html(careerString);
}

function interviewLang(){
	if(lang == 2){
		$('#interviewpt').hide();
		$('#interviewen').show();
	} else {
		$('#interviewpt').show();
		$('#interviewen').hide();
	}
}

function resultsLang(){
	if(lang == 2){
		$('#resultslistpt').hide();
		$('#resultslisten').show();
	} else {
		$('#resultslistpt').show();
		$('#resultslisten').hide();
	}
}



function calendarLang(){
	if(lang == 2){
		$('#calendarpt').hide();
		$('#calendaren').show();
	} else {
		$('#calendarpt').show();
		$('#calendaren').hide();
	}
}

function newscomLang(){
	if(lang == 2){
		$('#newspt').hide();
		$('#newsen').show();
	} else {
		$('#newspt').show();
		$('#newsen').hide();
	}
}



function contactsLang(){
	for(var i = 0; i < contact[lang].length; i++){
		$('#contactdata_'+(i+1)).html(contact[lang][i]);
	}
}

function changeMovieYear(){
	if(lang == 2){
		$('#changeyear').html('2008 and Before');
	} else {
		$('#changeyear').html('2008 e Anteriores');
	}

}

function setFlag(){
	if(lang == 2){
		$('#lang-selector img').removeClass('selected').css('opacity',0.4);;
		$('#en').addClass('selected').css('opacity',1);
	} else {
		$('#lang-selector img').removeClass('selected').css('opacity',0.4);;
		$('#pt').addClass('selected').css('opacity',1);
	}
}

var menu = new Array();
menu[1] = new Array('IN&Iacute;CIO','PERFIL','CARREIRA','RESULTADOS','ENTREVISTAS','FILMES/FOTOS','COMUNICADOS','PRESS REPORTS','CALEND&Aacute;RIO','CONTACTOS/LINKS');
menu[2] = new Array('HOME','PROFILE','CAREER','RESULTS','INTERVIEWS','MOVIES/PHOTOS','NEWS','PRESS REPORTS','CALENDAR','CONTACTS/LINKS');

var news = new Array();

news[1] = new Array(new Array('2 Outubro - International GT Open - 2011','Miguel Ramos n&atilde;o foi feliz em Monza'),new Array('17 Outubro - Campeonato de Espanha GT - 2011','Miguel Ramos teve um S&aacute;bado extraordin&aacute;rio e um Domingo muito amargo.'),new Array('30 Outubro - International GT Open - 2011','Barcelona no cair do pano do GT Open e Espa&ntilde;a GT 2011.'));
news[2] = new Array(new Array('2 October - International GT Open - 2011','Miguel Ramos wasn\'t happy at Monza'),new Array('17 October - Spain GT Open - 2011','Miguel Ramos had an extraordinary Saturday and a very bitter Sunday.'),new Array('30 September - Spanish GT Championship - 2011','Barcelona in the fall of the cloth of the GT 2011 GT Open and Spain.'));


var profile = new Array();
profile[1] = new Array('DADOS PESSOAIS','Nome completo:','Miguel Pedro Caetano Ramos','Morada:','Arcozelo - V. N. de Gaia - Portugal','Nascimento:','26 de Setembro de 1971','Estado Civil:','Casado, com tr&ecirc;s filhos','Nacionalidade:','Portuguesa','HABILITA&Ccedil;&Otilde;ES','1990-1994:','Engenharia Mec&acirc;nica <br />Universidade do Porto, Portugal','1995-1996:','International Business MBA<br/>European University');
profile[2] = new Array('PERSONAL DATA','Fullname:','Miguel Pedro Caetano Ramos','Address:','Arcozelo - V. N. de Gaia - Portugal','Birthdate:','September 26, 1971','Marital status:','Married, with three children','Nationality:','Portuguese','QUALIFICATIONS','1990-1994:','Mechanical Engineering <br />University of Porto, Portugal','1995-1996:','International Business MBA<br/>European University');

var career = new Array();

career[1] = new Array(
new Array('2011','Em 2011 Miguel Ramos disputou dois Campeonatos, o International GT Open e o Campeonato Espa&ntilde;a GT num dos novos Ferrari 458 com a equipa Italiana Edil-Cris. No International GT Open partilhou o Ferrari com o Italiano, Raffaele Giammaria enquanto no Espa&ntilde;a GT o parceiro foi o irm&atilde;o, Jo&atilde;o Ramos.<br/><br />Foi o ano de estreia do novo Ferrari 458 e Miguel Ramos foi por diversas vezes vitima de juventude do carro. Mesmo assim manteve-se na luta pelo titulo do Open GT at&eacute; &agrave; derradeira prova e teve como pontos altos a vit&oacute;ria nas corridas do Estoril e de Portim&atilde;o.'),
new Array('2010','2010 foi o ano de passagem do Campeonato FIA GT para Campeonato do Mundo FIA GT1. Miguel Ramos continuou na Vitaphone Racing Team com os Maserati MC12.<br /><br />Num Campeonato com um ineg&aacute;vel competitividade e muito duro a n&iacute;vel de contacto entre os carros, Ramos foi v&aacute;rias vezes v&iacute;tima desses mesmos contactos sendo essa a principal raz&atilde;o de algumas desistências e lugares menos conseguidos.<br /><br />De qualquer modo o destaque do ano &eacute; sem duvida alguma a conquista do titulo de Campe&otilde;es do Mundo por equipas para a Vitaphone Racing Team.'),
new Array('2009','Um ano muito complicado para Miguel Ramos.<br /><br />Pelo terceiro ano consecutivo na Vitaphone Racing Team tudo fazia prever uma boa temporada no FIA GT. Um sem n&uacute;mero de azares, alguns deles inexplic&aacute;veis, fez com que os objectivos para a &eacute;poca, fossem ficando cada vez mais distantes. O maior desaire foi em SPA quando desistiu na liderança da corrida com "uma jante partida". Tr&ecirc;s pole-position e quatro presenças no p&oacute;dio n&atilde;o foram suficientes para melhor do que um sexto posto na classificaç&atilde;o final. Salvou-se a temporada com o 5º t&iacute;tulo consecutivo destinado &agrave; classificaç&atilde;o por equipas.<br /><br />Em 2009, Miguel Ramos foi convidado pela formaç&atilde;o britânica Aston Martin Racing para fazer parte da equipa como Piloto Oficial no LMS. Um calend&aacute;rio com apenas cinco provas mas no qual a regularidade &eacute; um factor primordial, foi aziago para Miguel Ramos. Depois de uma menos conseguida corrida inicial, e com alguns altos e baixos ao longo da temporada, Miguel Ramos terminou o LMS na sexta posiç&atilde;o. Ainda que tivesse como principal resultado um p&oacute;dio na Alemanha, Ramos terminou o campeonato em sexto lugar, tendo sido peça fundamental da equipa na excelente prestaç&atilde;o da mesma, obtendo os t&iacute;tulos de marcas e de construtores.'),
new Array('2008','Miguel Ramos termina o Campeonato FIA GT num excelente 3&ordm; lugar.<br /><br />Mantendo-se na Vitaphone Racing Team em 2008, Miguel Ramos marcou presen&ccedil;a no Campeonato FIA GT. Fez mais uma temporada brilhante nesta importante disciplina do desporto autom&oacute;vel. Uma excelente vit&oacute;ria em Nogaro no in&iacute;cio de Outubro, foi um dos momentos marcantes da temporada, aliada a mais 3 presen&ccedil;as no p&oacute;dio (3 segundos lugares, entre os quais um excelente 2&ordm; lugar nas 24h de SPA).<br />  De qualquer modo, Miguel Ramos contribuiu indelevelmente para o sucesso da &ldquo;Vitaphone Racing Team&rdquo;, que conseguiu novamente o titulo na categoria destinada &aacute;s equipas (desta feita pelo 4&ordm; ano consecutivo), a conquista do titulo de pilotos pela outra forma&ccedil;&atilde;o da equipa, e o pr&oacute;prio terceiro lugar alcan&ccedil;ado por Miguel Ramos, pelo que dificilmente poderia ser melhor a temporada.'),
new Array('2007','A &eacute;poca de 2007 foi a mais bem conseguida, mas tamb&eacute;m a mais dif&iacute;cil para o piloto Portugu&ecirc;s.<br /><br />Miguel Ramos, terminou o campeonato FIA GT na 4&ordf; posi&ccedil;&atilde;o com 54 pontos, 1 ponto atr&aacute;s do terceiro e a 3 pontos do 2&ordm; lugar. Demonstrando a enorme competitividade o piloto Portugu&ecirc;s, disputou o 1&ordm; lugar at&eacute; &aacute; ultima prova, tendo demonstrado uma enorme competitividade em v&aacute;rias corridas, da qual se destaca a brilhante vit&oacute;ria em Brno (a primeira nos FIA GT), que aliada &aacute; condu&ccedil;&atilde;o limpa e constante, lhe permitiu uma enorme regularidade fazendo com que fosse o &uacute;nico piloto do Mundial a conseguir pontuar em todas as provas (mas nos cinco primeiros lugares em sete delas).'),
new Array('2006','Em 2006, Miguel Ramos integra o mais competitivo campeonato do Mundo de GT &ndash; o FIA GT &ndash; conduzindo um Aston Martin DB9R, na classe GT1. O piloto Portugu&ecirc;s terminou a temporada na 12&ordf; posi&ccedil;&atilde;o, ajudando a equipa &ldquo;BMS Scuderia It&aacute;lia&rdquo; a assegurar o 2&ordm; posto na classifica&ccedil;&atilde;o de equipas.<br /><br />Ainda em 2006, competiu em algumas corridas do campeonato Italiano de GT com um Maserati MC12, conseguindo duas vit&oacute;rias e um segundo lugar, acumulando 38 pontos.'),
new Array('2005','Em 2005 mais um competitivo ano para Miguel Ramos. O Campeonato Italiano de GT reuniu os melhores fabricantes Italianos, demonstrando elevado interesse e n&iacute;vel desta competi&ccedil;&atilde;o e Miguel n&atilde;o defraudou disputando at&eacute; &agrave; ultima corrida a vit&oacute;ria no Campeonato.<br /><br />Com o mesmo Ferrari 550 Maranello, o piloto Portugu&ecirc;s defendeu as cores da bandeira nacional na categoria GT1 das Le Mans Endurance S&eacute;ries, tendo participado em 4 das 5 corridas, conseguido a vit&oacute;ria nos 1000Km de SPA e dois segundos lugares  nos 1000Km de Nurburgring e Istambul.'),
new Array('2003 - 2004','As &eacute;pocas seguintes (2003 e 2004) foram cheias de desafios. Teve como advers&aacute;rios alguns dos melhores pilotos de competi&ccedil;&atilde;o, alguns deles ex-F&oacute;rmula 1. Miguel Ramos participou no prestigiado e medi&aacute;tico Campeonato FIA GT.<br /><br />V&aacute;rios imponder&aacute;veis da competi&ccedil;&atilde;o impediram alguns merecidos p&oacute;dios, mas 7 presen&ccedil;as no Top 10. s&atilde;o prova do seu ineg&aacute;vel valor como piloto. Ainda em 2004 participa no Le Mans Endurance Series Championship com um prot&oacute;tipo do RML Team, um MG Lola, conseguindo para a equipa a 5&ordf; posi&ccedil;&atilde;o no campeonato.'),
new Array('2002','2002 viu novo volte face na carreira, deixando os monolugares, passando para os GT onde conseguiu finalmente a consagra&ccedil;&atilde;o neste dif&iacute;cil e competitivo mundo dos GT. Com um Saleen, Miguel Ramos vence o Campeonato de Espanha de GT, tendo como colega o tamb&eacute;m Portugu&ecirc;s Pedro Matos Chaves.<br /><br />Ainda em 2002, faz a primeira participa&ccedil;&atilde;o nas m&iacute;ticas 24 Horas de Le Mans com o Nash Motorsport Team, conseguindo o 5&ordf; posto nos GT.'),
new Array('2001','Em 2001, Miguel Ramos participou no Campeonato de Formula 3 de Espanha, acabando a temporada no 10&ordm; lugar. Um resultado positivo, levando em linha de conta in&uacute;meros problemas sentidos ao longo do ano, assim como a maior experi&ecirc;ncia de todos os advers&aacute;rios.'),
new Array('1999 - 2000','Em 1999 e 2000, Miguel Ramos faz uma mudan&ccedil;a radical na carreira, pois decide passar para os monologares participando na Toyota Super Formula. A inexperi&ecirc;ncia neste tipo de viaturas aliada ao facto de ter integrado uma equipa muito modesta, n&atilde;o o impediu de conseguir sistematicamente ser um dos dez pilotos mais r&aacute;pidos e conseguir um P&oacute;dio em 2000.'),
new Array('1998','Em 1998, Miguel Ramos decide participar no Campeonato Italiano de Superturismos num BMW 320i. Para al&eacute;m das dificuldades inerentes ao facto todos os circuitos serem novidade e alguns azares ao longo da temporada, consegue terminar no sexto lugar da competi&ccedil;&atilde;o reservadas aos pilotos privados, ap&oacute;s conseguir cinco idas ao p&oacute;dio.'),
new Array('1997','O sucesso alcan&ccedil;ado no Trof&eacute;u BMW M3, motivou-o para participar no Campeonato nacional de Velocidade, ainda com um BMW M3, com o apoio do importador Nacional da marca. Com um sequencia de tr&ecirc;s vit&oacute;rias nesta temporada, acabando o campeonato no terceiro lugar absoluto e ainda vai terminara a &eacute;poca na corrida da Guia em Macau, onde &eacute; o melhor Portugu&ecirc;s em pista.'),
new Array('1994 - 1996','Insatisfeito, em 1994 Miguel Ramos n&atilde;o resistiu ao apelo e fasc&iacute;nio da velocidade em circuitos fechados e &agrave; possibilidade de competir no Trof&eacute;u BMW M3, onde pontificavam os melhores pilotos Portugueses da altura. Este Trof&eacute;u BMW M3, foi a mais competitiva e entusiasmante competi&ccedil;&atilde;o mono marca que alguma vez foi organizada em Portugal. Durante tr&ecirc;s &eacute;pocas (1994/1995 e 1996), Miguel Ramos conduziu o potente BMW M3 nas pistas Nacionais, vendo o seu talento reconhecido em 1996 quando conseguiu almejar a vit&oacute;ria na competi&ccedil;&atilde;o organizada pelo importador da marca germ&acirc;nica e duma forma incontest&aacute;vel e dominadora, pois venceu 9 das provas.'),
new Array('1991 - 1993','Miguel Ramos iniciou a sua carreira desportiva em 1991. Tinha na altura 18 anos e come&ccedil;ou no autocross. Durante tr&ecirc;s &eacute;pocas coleccionou um sem n&uacute;mero de vit&oacute;rias que lhe permitiram a conquista de dois t&iacute;tulos nacionais em 1992 e 1993.')
);

career[2] = new Array(
new Array('2011','In 2011 Miguel Ramos have run two Championships, the International GT Open and the Espa&ntilde;a GT Championship on a new Ferrari GT 458 with the Italian team Edil-Cris. At the International GT Open Miguel have shared the Ferrari with the italian Raffaele Giammaria, while in Espa&ntilde;a GT the partner have been his brother, Jo&atilde;o Ramos.<br /><br />It was the first season for the new Ferrari 458 and Miguel Ramos was repeatedly victim of the youth of the car. Nevertheless he remained in the fight for the GT Open title till the last race and had the highlight of the season, with two home victories during the Portim&atilde;o and Estoril races.'),
new Array('2010','2010 was the year of passage from the FIA GT Championship to the FIA GT1 World Championship. Miguel Ramos continued at the Vitaphone Racing Team with a Maserati MC12.<br/><br/> In a championship with an undeniable competitiveness and very hard on the level of contact between cars, Ramos has often been  victim of such contacts being this the main reason of some dropouts and less advanced places. <br/><br/>Anyway, the highlight of the year is without doubt the conquest of the title of World Champion teams for Vitaphone Racing Team.'),
new Array('2009','A very difficult year for Miguel Ramos.<br/><br/>For the third consecutive year at the Vitaphone Racing Team everything predicted a good season in the FIA GT. A multitude of hazards, some of them inexplicable, made the goals for the season become increasingly distant. The biggest setback was when he withdrew SPA, leading the race, with "a broken wheel  rim." Three pole positions and four presences on the podium were not enough for better than a sixth place in the final standings. The season was saved with the 5th consecutive title for the team classification. <br/><br/>In 2009, Miguel Ramos was invited by the British team Aston Martin Racing to join the team as Official Rider in the LMS. A calendar with only five races, but where consistency is a key factor, was unlucky to Miguel Ramos. After an initial run less achieved, with some ups and downs throughout the season, Miguel Ramos finished the LMS in sixth position. Although the main result was a podium finish in Germany, Ramos finished the tournament in sixth place, having been a key part for  the team excellent performance, earning the titles of brands and manufacturers.'),
new Array('2008','Miguel Ramos completes the FIA GT Championship in an excellent 3rd place.<br/><br/>Keeping in Vitaphone Racing Team in 2008, Miguel Ramos was present at the FIA GT Championship. He made another brilliant season in this important discipline of motor sport. An excellent win at Nogaro in early October, was one of the highlights of the season, coupled with three appearances on the podium (3 second places, including an excellent second place in the 24 hours of SPA).<br/><br/>Anyway, Miguel Ramos contributed indelibly to the success of "Vitaphone Racing Team," which again obtained the title in teams the category  (this time for the 4th consecutive year), won the drivers  title by the other team formation, and the third place achieved by Miguel Ramos, so it could hardly be a better season.'),
new Array('2007','The 2007 season was the best achieved, but also the most difficult for the Portuguese pilot.<br/><br/>Miguel Ramos finished the FIA GT Championship in 4th place with 54 points, one point behind third and 3 points from the 2nd place. Demonstrating an enormous competitiveness, the Portuguese driver, competed the first place until the last race, having demonstrated to be very competitive in various races, standing out a brilliant victory in Brno (the first in the FIA GT), which combined with a clean and constant driving allowed him an enormous consistency so that he was the only driver from the World Cup to score in all races (but in the top five in seven of them).'),
new Array('2006','In 2006, Miguel Ramos integrated the most competitive GT World Championship - the FIA GT - driving an Aston Martin DB9R in the GT1 class. The Portuguese driver finished the season in 12th place, helping the team "BMS Scuderia Italia" to secure the 2nd place in teams category.<br/><br/>Also in 2006 competed in some races of the Italian GT Championship with a Maserati MC12, scoring two wins and one second place, accumulating 38 points.'),
new Array('2005','2005 another competitive year for Miguel Ramos. The Italian GT Championship brought together the best Italian manufacturers, showing the great interest and the level of this competition and Miguel has not defrauded expectations, fighting to the last race to win the championship.<br/><br/>With the same Ferrari 550 Maranello, the Portuguese pilot stood up for the national flag colors on the GT1 category at Le Mans Endurance Series and participated in 4 of 5 races, achieved victory in SPA\'s  1000km and two second places in the 1000km of Nurburgring and Istanbul.'),
new Array('2003 – 2004','The following seasons (2003 and 2004) were filled with challenges. He had as opponents some of the best racing drivers, some of them Formula 1 drivers in the past. Miguel Ramos participated in the prestigious and very popular in the media FIA GT Championship. <br/><br/>Various vagaries of competition prevented some deserved podiums, but seven appearances in the Top 10 was proof of his undeniable value as a pilot. Still in 2004 he participate in the Le Mans Endurance Series Championship with a prototype of the RML Team, an MG Lola, achieving to the team the 5th position in the championship.'),
new Array('2002','2002 was the year of a new switch-over in his career, leaving single-seater and going for GT where he finally consecrated in this difficult and competitive world of GT. With a Saleen, Miguel Ramos wins the Spanish GT Championship, having as his colleague the Portuguese pilot Pedro Matos Chaves.<br/><br/>2002 also marks his first participation in the mythic 24 Hours of Le Mans with the Nash Motorsport Team, getting the 5th position in GT.'),
new Array('2001','In 2001, Miguel Ramos participated in the Spanish Formula 3 Championship, ending the season in 10th place. A positive result, taking into account a number of problems experienced during the year, as well the greatest experience of all opponents.'),
new Array('1999 – 2000','In 1999 and 2000, Miguel Ramos makes a radical change in career; he decides to pass to the single-seater and participates in the Toyota Super Formula. The inexperience in this type of vehicles coupled with the fact that he has integrated a very modest team, did not stop him from consistently being one of the ten fastest drivers and get a podium in 2000.'),
new Array('1998','In 1998, Miguel Ramos decides to participate in the Superturism Italian Championship in a BMW 320i. In addition to the difficulties inherent to all circuits being new and some bad luck throughout the season, he finishes in the sixth place of the competition reserved for private pilots after earning five presences in the podium.'),
new Array('1997','The success achieved in the Trophy BMW M3, motivated him to participate in the national championship of speed, even with a BMW M3, with the support of the national importer of the brand. With a sequence  of three winnings in this season, finishing third absolute place in the championship, he will finish the season in the Guia Race in Macau, where he is the best Portuguese on the track.'),
new Array('1994 – 1996','Unsatisfied, in 1994 Miguel Ramos did not resist the appeal and fascination of speed in closed circuits and the possibility of competing in BMW M3 Trophy, where the best Portuguese drivers of those times pontificated. This Trophy BMW M3 was the most competitive and exciting competition single brand that has ever been organized in Portugal. During three seasons (1994/1995 and 1996), Miguel Ramos drove the powerful BMW M3 on the National tracks and his talent was recognized in 1996 when he got to aim for victory in the  competition organized by the  importer of the German brand in an unquestionably and dominant way as he won nine of the races.'),
new Array('1991 – 1993','Miguel Ramos started his sporting career in 1991. He had at the time 18 years and began in autocross. During three seasons has collected a number of victories that allowed him the conquest of two national titles in 1992 and 1993.')
);

var contact = new Array();
contact[1] = new Array('CONTACTOS','LINKS DE PATROCINADORES','LINKS INSTITUCIONAIS');
contact[2] = new Array('CONTACTS','SPONSORS LINKS','INSTITUTIONAL LINKS');
