var ptngs =[ "actingfamiliar",
		"cathedral",	
		"crash",	
		"dreamsofflying",	
		"fishdetail",	
		"flutter",	
		"leafpainting",	
		"loveletter",	
		"luck&sam",	
		"santorini",	
		"sargassosea",	
		"silhouette",	
		"tuesday"];
		
var ind = getpageindex();

function pageit(dir){
  switch (dir)
  {
    case "next":
      ind ++;
      if (ind >= ptngs.length){ind = 0;}
      break;
    case "prev":
      ind --;
      if ( ind <0) {ind = ptngs.length - 1;}
      break;
    default:
      ind = 0;
  }
//  alert (ptngs[ind]+".htm");
  document.location.href = ptngs[ind]+".htm";
}

function getpageindex() { 
  // Finds the index of the page in the articles array 
  var url = new String(document.location.href);
  // Find the name of the page minus the extension
  var page = url.match(/.*\/(.*)\..*/);
   // Check for matches in our array.
  for (i=0; i<ptngs.length; i++) {
   if (page[1] == ptngs[i]) {
   break;
    }
  }
  return i;
}


