//External Files

// fontsize
//This script will change the font size of any text within a paragraph (<p> tag). If you wish to change text within other tags edit the getElementsByTagName('p'); part. 
//
//In order for this code to work your page must be using pixel sized fonts (px) rather than relative sized fonts using 'em' or '%'. Of course if you do use other font units the code can be easily adapted for these. 
//If the script cannot find the font size of a paragraph it will default it to 12px.


var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}

// -- Preload Button Images Code -->
  var button_images=new Array()

  function preload_images(){
  for (i=0;i<preload_images.arguments.length;i++){
   button_images[i]=new Image()
   button_images[i].src=preload_images.arguments[i]
}
}
// Move Pictures
function movepic(img_name,img_src) {
document[img_name].src=img_src;
}




// copyright begin
       function copyright()
{
     var current = new Date()
                var year=(current.getYear());
      
                                                if (year = 2009)                                                                                   
                                                year = 2009; 
      if (year > 2009)
   
      document.write("&copy; 2009 - ");                                                                                       
                                                document.write(year);

//var copyright = ( "<a href="+"copyright.htm"+">All Rights Reserved."+"</a>");
  // document.write(copyright); 
}
// end copyright function -->


function greeting(){

    datetoday = new Date();
    timenow=datetoday.getTime();
    datetoday.setTime(timenow);
    thehour = datetoday.getHours();
    if (thehour >= 18) display = "Evening ";
    else if (thehour >=12) display = "Afternoon ";
    else display = "Morning ";
    var greeting = ("ood " + display+ "and Welcome ");
    document.write(greeting); 
     
// end greeting -->
}  

//-- Update code-->
 function up_date(){
        var days = new Array(8);
 days[1] = "Sunday";
 days[2] = "Monday";
 days[3] = "Tuesday";
 days[4] = "Wednesday";
 days[5] = "Thursday";
 days[6] = "Friday";
 days[7] = "Saturday";
 var months = new Array(13);
 months[1] = "January";
 months[2] = "February";
 months[3] = "March";
 months[4] = "April";
 months[5] = "May";
 months[6] = "June";
 months[7] = "July";
 months[8] = "August";
 months[9] = "September";
 months[10] = "October";
 months[11] = "November";
 months[12] = "December";
 var dateObj = new Date(document.lastModified)
 var wday = days[dateObj.getDay() + 1]
 var lmonth = months[dateObj.getMonth() + 1]
 var date = dateObj.getDate()
 var fyear = dateObj.getYear()
 if (fyear < 2000) 
 fyear = fyear + 1900
 document.write("Page Last Updated "+wday+" " + date +" " + lmonth + " "+ fyear)
}
// End Update code-->

//-- Citation-->
 function cite(){
      
 var months = new Array(13);
 months[1] = "Jan";
 months[2] = "Feb";
 months[3] = "Mar";
 months[4] = "Apr";
 months[5] = "May";
 months[6] = "Jun";
 months[7] = "Jul";
 months[8] = "Aug";
 months[9] = "Sep";
 months[10] = "Oct";
 months[11] = "Nov";
 months[12] = "Dec";
 var dateObj = new Date()
 
 var lmonth = months[dateObj.getMonth() + 1]
 var date = dateObj.getDate()
 var fyear = dateObj.getYear()
 if (fyear < 2000) 
 fyear = fyear + 1900

 document.write("URL:  http://www.stpeters-selsey.org.uk. Acessed " + date +" " + lmonth + " "+ fyear);
}
// End cite code-->
//-- Update code-->
 function up_date(){
        var days = new Array(8);
 days[1] = "Sunday";
 days[2] = "Monday";
 days[3] = "Tuesday";
 days[4] = "Wednesday";
 days[5] = "Thursday";
 days[6] = "Friday";
 days[7] = "Saturday";
 var months = new Array(13);
 months[1] = "January";
 months[2] = "February";
 months[3] = "March";
 months[4] = "April";
 months[5] = "May";
 months[6] = "June";
 months[7] = "July";
 months[8] = "August";
 months[9] = "September";
 months[10] = "October";
 months[11] = "November";
 months[12] = "December";
 var dateObj = new Date(document.lastModified)
 var wday = days[dateObj.getDay() + 1]
 var lmonth = months[dateObj.getMonth() + 1]
 var date = dateObj.getDate()
 var fyear = dateObj.getYear()
 if (fyear < 2000) 
 fyear = fyear + 1900
 document.write("Page Last Updated "+wday+" " + date +" " + lmonth + " "+ fyear)

}
// End Update code-->