<!--
<!--~~~ TAVEX ~~~ -->
<!--~~~ Title/Author/Votes EXtraction programme ~~~-->
<!--~~~ For NEPW Gallery Pages ~~~--> 
<!--~~~ Ivan Harris 2005 ~~~-->
<!--~~~ Updated 02/12/06 ~~~-->
<!--~~~ Votes function modified 20/11/2007 ~~~-->
<!--~~~ For use with Gallery Wizard ~~~--> 

//~~~Get Image Title~~~
function photo()
{
var fn=filename;		//filename format(xx-yyy-zzz-???.jpg)
var title= "";
fn = fn.slice(3,-4);                 //Get title less prefix & extension
fn=fn.split("-");                      //remove hyphens
for(i= 0; i <fn.length; i++)	//upper case caps
{
var word= fn[i].slice(0,1).toUpperCase()+fn[i].slice(1).toLowerCase()
title= title+ word+ " "
}
document.write(title + "<br>")   //Print Result (Title)
}
//~~~End Function (Photo) ~~~

//~~Get Author
function author()
{
fn=filename		//filename format(xx-yyy-zzz-???.jpg)
for (i = 0;i <m.length; i++)//Search array loop
{
if(fn.slice(0,2)==m[i].slice(0,2))//Compare array & fn prefix
{
n=m[i].slice(3)		//Get name from array
document.write(n +"<br>")	//Print Result (author)
i = m.length		//Stop loop
}
else if(i== m.length-1) 	//Error check
{
document.write("Author not Listed")
}}}
//~~~End author function ~~~

//~~~Get Votes
function currentv()
{
filename = filename.slice(0,-4);//get image filename less extension

//~~~Get match from votes-array.js
for (i= 0; i<title.length; i++)
{
var tstr = title[i]
var lio =tstr.lastIndexOf(",") //Find vote seperator/comma 
tstr = tstr.slice(0,lio++)
if (tstr == filename) //Check filename/array match
{
votes = title[i].split(",");
votes = votes.slice(1) // Get votes
document.write("Rating " + votes + " points");
i = title.length;
}}}
//~~~End votes function ~~~

//-->

