function translate(s)
{
i=s.indexOf('//');
if (i==-1)
  return s
x=s.substring(0,i);
y=s.substring(i+2,s.length);
if (language=='ita')
  return x;
else
  return y;
}
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return ""
}
language=getCookie('language')
if (language==null || language=="")
  language = "eng"
if (language=="eng") 
  lan=0
else
  lan=1
prefix = 'http://' + document.domain
menu=[
['/index.html', '/index.html', 'Home', 'Home'],
['/portfolio/bw/index.html', '/portfolio/bw/index.html', 'Black and white', 'Bianco e nero'],
['/portfolio/color/index.html', '/portfolio/color/index.html', 'Color', 'Colore'],
['/links.html', '/links.html', 'Links', 'Links'],
['/contact.html', '/contact.html', 'Contact', 'Contatti']]
document.write('<div class="header"><a class="header" href="/">sardegnaimmagini.it</a></div>' +
'</div>' +
'<div class="menu">'+
'<hr>')
document.write("")
document.write('| ')
for (x in menu) {
  url1 = prefix+menu[x][lan]
  if (document.URL==url1) {
    document.write(menu[x][2+lan]+' | ')
  }
  else 
  {
    document.write('<a href="'+menu[x][lan]+'">'+menu[x][2+lan]+'</a> | ')
  }
}
document.write('<p><br><br><br></p></div></div>')
function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) +  "; path=/";
window.location.reload()
}
