function check_cookie(){
	language=getCookie('Language');
	switch (language) 
	{
	case 'Portuguese': {
		document.getElementById("language_selection").innerHTML= "<span class='style14'>Português</span>";
		document.getElementById("div_galleries").innerHTML= "<a href='../Novas Paginas/Animals/index.html'>GALERIAS</a>";
		document.getElementById("div_microstock").innerHTML= "<a href='microstock.html'>MICROSTOCK</a>";
		document.getElementById("div_links").innerHTML= "<a href='links.html'>LINKS</a>";
		document.getElementById("div_contact").innerHTML= "<a href='contact.html'>CONTATO</a>";
		document.getElementById("div_home").innerHTML= "<a href='index.html'>HOME</a>";
		document.getElementById("aboutpage").innerHTML= "<a href='about.html' class='style7'>quem?</a>"
		}
		break;
	default: {
		document.getElementById("language_selection").innerHTML= "<span class='style14'>English</span>";
		document.getElementById("div_galleries").innerHTML= "<a href='../Novas Paginas/Animals/index.html'>GALLERIES</a>";
		document.getElementById("div_microstock").innerHTML= "<a href='microstock.html'>MICROSTOCK</a>";
		document.getElementById("div_links").innerHTML= "<a href='links.html'>LINKS</a>";
		document.getElementById("div_contact").innerHTML= "<a href='contact.html'>CONTACT</a>";
		document.getElementById("div_home").innerHTML= "<a href='index.html'>HOME</a>";
		document.getElementById("aboutpage").innerHTML= "<a href='about.html' class='style7'>who?</a>"
		}
	}
}

	
function getCookie(NameOfCookie){
    if (document.cookie.length > 0) {              
    begin = document.cookie.indexOf(NameOfCookie+"=");       
    if (begin != -1) {           
      begin += NameOfCookie.length+1;       
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    } 
  }
  return null;
}

function setCookie(NameOfCookie, value, expiredays) {
var ExpireDate = new Date();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

  document.cookie = NameOfCookie + "=" + escape(value) + 
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
  window.location.reload()
}

function cookie_menu(menu_field)
{
	switch (language) 
	{
	case 'Portuguese': switch (menu_field) 
		{
		case 'galleries': document.getElementById("text_area").innerHTML= "<p><b>Galerias:</b><p> <p>Uma seleção dos meus trabalhos desde quando eu comecei a estudar fotografia, organizados por tema.";break;
		case 'microstock': document.getElementById("text_area").innerHTML= "<b><p>Microstock:</b> <p>Imagens limpas, sem grão digital, perfeitas para manipulação e design, de objetos isolados a fotografia conceitual. O que você precisa estará em um destes sites.";break;
		case 'links': document.getElementById("text_area").innerHTML= "<p><b>Links:</b></p> Alguns interessantes e outros ridículos - uma seleção pessoal eclética";break;
		case 'contact': document.getElementById("text_area").innerHTML= "<b><p>Contato:</b> <p>Quase todas as fotos no site estão a venda. Para maiores informações, me contate via email mencionando o nome e o tamanho aproximado da imagem pela qual há interesse e o seu país de residência:<p><a href=mailto:mail@nandophoto.com>mail@nandophoto.com</a></p>";break;
		default:document.getElementById("text_area").innerHTML= "<p>Voltar à página inicial";break;
		}
	break;
	default: switch (menu_field) 
		{
		case 'galleries': document.getElementById("text_area").innerHTML= "<p><b>Galleries:</b><p> <p>A selection of my works from when I started studying photography up to now, organized by theme.";break;
		case 'microstock': document.getElementById("text_area").innerHTML= "<b><p>Microstock:</b> <p>Images that are clear, free of noise and grain, suitable for further manipulation, from isolated objects to conceptual photography. Whatever theme, you will find your image in one of these sites.";break;
		case 'links': document.getElementById("text_area").innerHTML= "<p><b>Links:</b></p> Some interesting and some ludicrous links - an ecletic personal selection.";break;
		case 'contact': document.getElementById("text_area").innerHTML= "<b><p>Contact:</b> <p>Nearly all images in the site are for sale. For further information please contact me via email quoting the image that you are interested in, its approximate size and your country of residence:<p><a href=mailto:mail@nandophoto.com>mail@nandophoto.com</a></p>";break;
		default:document.getElementById("text_area").innerHTML= "<p>Back to the Homepage";
		}
	}
}
