//here you place the ids of every element you want.
var ids=new Array('a1','a2','a3','a4');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}


function siirryAav(x)
{
myWin=window.open("http://ghostmoorsaave.jalbum.net/Aave/");

}

function siirryBan(x)
{
myWin=window.open("http://ghostmoorsbanza.jalbum.net/Banza/");

}


function siirryVee(x)
{
myWin=window.open("http://ourpointers.jalbum.net/pointterit/");

}

function siirryMui(x)
{
myWin=window.open("http://ghostmoors.jalbum.net/Muistoissa/");

}

function siirryAave(x)
{
myWin=window.open("HTML/pedigree_aave.html","","height=620, width=800, left=50 toolbar=no, location=no, directories=no, status=no, menubar=no");

}

function siirryPentue(x)
{
myWin=window.open("HTML/pentue_1.html","","height=1100, width=900, left=50 toolbar=no, location=no, directories=no, status=no, scrollbars=1, menubar=no");

}

function siirryBanza(x)
{
myWin=window.open("HTML/pedigree_banza.html","","height=620, width=800, left=50 toolbar=no,  location=1, status=1, scrollbars=1, menubar=no");

}

function siirryShiru(x)
{
myWin=window.open("HTML/pedigree_shiru.html","","height=900, width=800, left=50 toolbar=no,  location=1, status=1, scrollbars=1, menubar=no");

}

function siirryKami(x)
{
myWin=window.open("HTML/pedigree_kami.html","","height=750, width=800, left=50 toolbar=no,  location=1, status=1, scrollbars=1, menubar=no");

}

function siirryVeeka(x)
{
myWin=window.open("HTML/pedigree_veeka.html","","height=620, width=800, left=50 toolbar=no, location=1, status=1, scrollbars=1, menubar=no");

}

function siirryDraco(x)
{
myWin=window.open("HTML/pedigree_draco.html","","height=620, width=800, left=50 toolbar=no, location=1, status=1, scrollbars=1, menubar=no");

}

function siirryDrake(x)
{
myWin=window.open("HTML/drake.html","","height=620, width=800, left=50 toolbar=no,  location=1, status=1, scrollbars=1, menubar=no");

}

function siirryKenzie(x)
{
myWin=window.open("HTML/kenzie.html","","height=620, width=700, left=50 toolbar=no,  location=1, status=1, scrollbars=1, menubar=no");

}

function siirryPentue1(x)
{
myWin=window.open("HTML/pedigree_pentue1.html","","height=700, width=850, left=50 toolbar=no,  location=1, status=1, scrollbars=1, menubar=no");

}

function siirryTeri(x)
{
myWin=window.open("HTML/teri.html","","height=620, width=700, left=50 toolbar=no,  location=1, status=1, scrollbars=1, menubar=no");

}




function RandNum(max) {
  key = Math.floor(Math.random() * max);
  return key;
}
function RandomPicture() {

  images = new Array( 10 );

  images[0] = "aave_2008_sorsastus";
  images[1] = "aave_2008_syksy";
  images[2] = "aave_nouto";
  images[3] = "aave_haku";
  images[4] = "aave_hakua";
  images[5] = "aave_2008_ranta";
  images[6] = "vekku_2008";
  images[7] = "vekku_2008_2";
  images[8] = "aave_2008_metsa";
  images[9] = "aave_2008_metsa2";

  key = RandNum( images.length );

  
  document.write( "<img src='", images[ key ], ".jpg' alt='Aave's photo'>" );
}


function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
	
	
}

function modifyDate() {
// assign date to variable ModifyDate
var ModifyDate = new Date(document.lastModified)
// write date to variable showAs
// (note that months are numbered from 0 to 11)
var showAs = ModifyDate.getFullYear() +"-"+ leadZero (ModifyDate.getMonth() + 1) +"-"+ leadZero (ModifyDate.getDate())
// write the result of lastModified function to HTML document
document.write (showAs);

// function to add a lead zero to figures less than 10
function leadZero (fig) {
	if (fig < 10) {
		fig ="0" + fig
	}
	return fig
}
}

function nayta(a,b)
{
	document.getElementById(b).src=a;
}




