// JavaScript Document

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  //Menu('');
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

MM_preloadImages('images/btn_inicio_off.gif','images/btn_quinta_on.gif','images/btn_vinho_on.gif','images/btn_regiao_on.gif','images/btn_lacalizacao_on.gif','images/btn_reservas_on.gif','images/btn_contactos_on.gif');
	

function Menu(area) { //v1.0
 	document.write("<a href=\"home_p.htm\" onmouseover=\"MM_swapImage('home','','images/btn_inicio_on.gif',1);\" onmouseout=\"MM_swapImgRestore();\"><img src=\"images/btn_inicio_off.gif\" name=\"home\" width=\"62\" height=\"30\" border=\"0\"></a>");
	document.write("<a href=\"quinta_p.htm\" onmouseover=\"MM_swapImage('quinta','','images/btn_quinta_on.gif',1);\" onmouseout=\"MM_swapImgRestore();\"><img src=\"images/btn_quinta_off.gif\" name=\"quinta\" width=\"88\" height=\"30\" border=\"0\"></a>");
	document.write("<a href=\"vinho_p.htm\" onmouseover=\"MM_swapImage('vinho','','images/btn_vinho_on.gif',1);\" onmouseout=\"MM_swapImgRestore();\"><img src=\"images/btn_vinho_off.gif\" name=\"vinho\" width=\"81\" height=\"30\" border=\"0\"></a>");
	document.write("<a href=\"regiao_p.htm\" onmouseover=\"MM_swapImage('regiao','','images/btn_regiao_on.gif',1);\" onmouseout=\"MM_swapImgRestore();\"><img src=\"images/btn_regiao_off.gif\" name=\"regiao\" width=\"87\" height=\"30\" border=\"0\"></a>");
	document.write("<a href=\"localizacao_p.htm\" onmouseover=\"MM_swapImage('localizacao','','images/btn_localizacao_on.gif',1);\" onmouseout=\"MM_swapImgRestore();\"><img src=\"images/btn_localizacao_off.gif\" name=\"localizacao\" width=\"113\" height=\"30\" border=\"0\"></a>");
	document.write("<a href=\"reservas_p.asp\" onmouseover=\"MM_swapImage('reservas','','images/btn_reservas_on.gif',1);\" onmouseout=\"MM_swapImgRestore();\"><img src=\"images/btn_reservas_off.gif\" name=\"reservas\" width=\"84\" height=\"30\" border=\"0\"></a>");
	document.write("<a href=\"contactos_p.asp\" onmouseover=\"MM_swapImage('contactos','','images/btn_contactos_on.gif',1);\" onmouseout=\"MM_swapImgRestore();\"><img src=\"images/btn_contactos_off.gif\" name=\"contactos\" width=\"96\" height=\"30\" border=\"0\"></a>");

	if (area == 'home'){
	MM_swapImage('home','','images/btn_inicio_on.gif',1)}
	else if (area == 'quinta'){
	MM_swapImage('quinta','','images/btn_quinta_on.gif',1)}
	else if (area == 'vinho'){
	MM_swapImage('vinho','','images/btn_vinho_on.gif',1)}
	else if (area == 'regiao'){
	MM_swapImage('regiao','','images/btn_regiao_on.gif',1)}
	else if (area == 'localizacao'){
	MM_swapImage('localizacao','','images/btn_localizacao_on.gif',1)}
	else if (area == 'reservas'){
	MM_swapImage('reservas','','images/btn_reservas_on.gif',1)}
	else if (area == 'contactos'){
	MM_swapImage('contactos','','images/btn_contactos_on.gif',1)}
	else
	area == ''
}

//////////////////////////////////////////
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic.href;
  if (whichpic.title) {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}

//////////////////////////////////////////

var photos=new Array()
var which=0

photos[0]="images/mapa_00.jpg"
photos[1]="images/mapa_01.jpg"
photos[2]="images/mapa_02.jpg"
photos[3]="images/mapa_03.jpg"
photos[4]="images/mapa_04.jpg"
photos[5]="images/mapa_05.jpg"
photos[6]="images/mapa_06.jpg"
photos[7]="images/mapa_07.jpg"
photos[8]="images/mapa_08.jpg"
photos[9]="images/mapa_09.jpg"
photos[10]="images/mapa_10.jpg"
photos[11]="images/mapa_11.jpg"
photos[12]="images/mapa_12.jpg"

function backward(){
if (which>0){
window.status=''
which--
document.images.photoslider.src=photos[which]
}
}

function forward(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which]
}
else window.status='Quinta da Vinha Morta - Tarouca'
}
