//oil list
var myOilsArray = [
			   'Belfast_Lough.html',
'Can_We_go_Home_Now.html',
'Carrickfergusmarina.html',
'Carrickfergus_Castle.html',
'Cork_Regatta.html',
'Dusk_on_the_Lough.html',
'Evening_Rise_Lough_Altan.html',
'Fishing_the_clady_River.html',
'Head_to_Head.html',
'Its_looking_Good.html',
'Long_Happy_Days.html',
'Must_We_Leave.html',
'Off_the_Maidens.html',
'Reflections_Newcastle.html',
'Solitude.html',
'Sunday_on_Tory_Island.html',
'The_Clady_Co_Donegal.html',
'The_Last_End.html',
'The_Virtuoso.html',
'The_West_of_Ireland.html'];

//watercolours list
var myWcArray = [
			   'A_Good_Day_at_the_Market.html',
'Connemara_Bog.html',
'Errigal_from_Gweedore.html',
'Evening_Dungloe_Co_Donegal.html',
'Geese_Over_Strangford_Lough.html',
'Hard_Works_not_Easy.html',
'Hillwalkers_in_the_Mournes.html',
'Life_in_the_Slow_Lane.html',
'Marble_Hill_Donegal.html',
'Muckish_Donegal.html',
'The_Mournes_from_Rossglass.html',
'The_Stragglers.html',
'The_Mournes_from_Minerstown.html',
'Tory_from_Falcarragh.html',
'Waiting_for_the_Tide_Connemara.html',
'Wigeon_Lough_Neagh.html',
'Winter_Weather_the_Mournes.html'];




//date stuff
var d=new Date();
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();






//next oil function
nextPgOil = function () {

	var str = getFileName();

	thisPage = 0;
	for (var i=0; i<myOilsArray.length; i++){
	 
			if(str == myOilsArray[i]){
				thisPage = i + 1;
			}
	}
	
	var nextPage = 0;
	if(thisPage < myOilsArray.length) 
	{
		nextPage = thisPage;
	}
	str = myOilsArray[nextPage];
	//alert ("next page = " + str + " index = " + nextPage);
	window.location  = str;
	
	return false;
}


// pre oil function
prePgOil = function () {

	var str = getFileName();

	thisPage = 0;
	for (var i=0; i<myOilsArray.length; i++){
	 
			if(str == myOilsArray[i]){
				thisPage = i;
			}
	}
	
	//alert ("thispage page = " + str + " this index = " + thisPage);
	
	var nextPage = 0;
	if(thisPage == 0) 
	{
		nextPage = myOilsArray.length - 1;
	} else {
		nextPage = thisPage - 1;
	}
	str = myOilsArray[nextPage];
	
	//alert ("next page = " + str + " index = " + nextPage);
	window.location  = str;

	return false;
}

//next watercolour function
nextPgWc = function () {

	var str = getFileName();

	thisPage = 0;
	for (var i=0; i<myWcArray.length; i++){
	 
			if(str == myWcArray[i]){
				thisPage = i + 1;
			}
	}
	//alert ("this page = " + str + " index = " + thisPage);
	
	var nextPage = 0;
	if(thisPage < myWcArray.length) 
	{
		nextPage = thisPage;
	}
	str = myWcArray[nextPage];
	//alert ("next page = " + str + " index = " + nextPage);
	window.location  = str;
	
	return false;
}


// pre oil function
prePgWc = function () {

	var str = getFileName();

	thisPage = 0;
	for (var i=0; i<myWcArray.length; i++){
	 
			if(str == myWcArray[i]){
				thisPage = i;
			}
	}
	
	//alert ("thispage page = " + str + " this index = " + thisPage);
	
	var nextPage = 0;
	if(thisPage == 0) 
	{
		nextPage = myWcArray.length - 1;
	} else {
		nextPage = thisPage - 1;
	}
	str = myWcArray[nextPage];
	
	//alert ("next page = " + str + " index = " + nextPage);
	window.location  = str;

	return false;
}


getFileName = function() {
	var tr = window.location.pathname;
	var retval = tr;
	len = tr.length;
	rs = 0;
	for (i = len; i > 0; i--) {
		vb = tr.substring(i,i+1);
		if (vb == "/" && rs == 0) {
		    retVal = tr.substring(i+1,len);
			rs = 1;
		}
	} 
	return retVal;
}

//end oil next stuff

//image swap
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;
}
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('back_light.jpg')
// end image swap
