//=====

// JavaScript Document

// (C) 2000 www.CodeLifter.com

// http://www.codelifter.com

// Free for all users, but leave in this  header

// NS4-6,IE4-6

// Fade effect only in IE; degrades gracefully



// =======================================

// set the following variables

// =======================================



// Set slideShowSpeed (milliseconds)

var slideShowSpeed = 5000



// Duration of crossfade (seconds)

var crossFadeDuration = 3



// Specify the image files

var Pic = new Array() // don't touch this
var BigPic = new Array()

// to add more images, just continue

// the pattern, adding to the array below

var no

var Text = new Array() 


no=Math.random()*2

if(1) // if(Math.floor(no) < 1) 

{

  Pic[0] = 'pix/europe/lores/chrisjenny1.jpg'
  Pic[1] = 'pix/turkey/lores/ephesus.jpg'
  Pic[2] = 'pix/iran/lores/internetcafe.jpg'
  Pic[3] = 'pix/pakistan/lores/cjhyberpass.jpg'
  Pic[4] = 'pix/tibet/lores/J&C sitting Potala.jpg'
  Pic[5] = 'pix/uk/thumbs/ChrisJenny1.jpg'

  BigPic[0] = 'pix/europe/chrisjenny1.jpg'
  BigPic[1] = 'pix/turkey/ephesus.jpg'
  BigPic[2] = 'pix/iran/internetcafe.jpg'
  BigPic[3] = 'pix/pakistan/cjhyberpass.jpg'
  BigPic[4] = 'pix/tibet/J&C sitting Potala.jpg'
  BigPic[5] = 'pix/uk/ChrisJenny1.jpg'


  Text[0] = 'Slideshow: Chris & Jenny in Venice, Italy'
  Text[1] = 'Slideshow: Chris & Jenny in Ephesus, Turkey'
  Text[2] = 'Slideshow: Chris & Jenny in Yazd, Iran'
  Text[3] = 'Slideshow: Chris & Jenny in the Khyber Pass, Pakastan'
  Text[4] = 'Slideshow: Chris & Jenny in Lhasa, Tibet'
  Text[5] = 'Slideshow: Chris & Jenny in Edinburgh, Scotland'



}else{

  Pic[0] = 'pix/europe/lores/chrisjenny1.jpg'
  Pic[1] = 'pix/europe/lores/jenny3.jpg'
  Pic[2] = 'pix/europe/lores/jenny5.jpg'
  Pic[3] = 'pix/europe/lores/jenny1.jpg'
  Pic[4] = 'pix/europe/lores/jenny10.jpg'


  Text[0] = 'Slideshow: Chris & Jenny in Venice'
  Text[1] = 'Slideshow: Jenny'
  Text[2] = 'Slideshow: Jenny'
  Text[3] = 'Slideshow: Jenny'
  Text[4] = 'Slideshow: Jenny'
}



// =======================================

// do not edit anything below this line

// =======================================



var t

var j = 0

var p = Pic.length

var imgcount = 0

var preLoad = new Array()

var retries=0;



LoadAll()





function LoadAll(){



  for (i = 0; i < p; i++){

   preLoad[i] = new Image()

   //preLoad[i].lowsrc = 'pix/europe/lores/' + Pic[i]

   preLoad[i].src = Pic[i]

   preLoad[i].onload = CheckLoad

  }

}



function CheckLoad(){

  imgcount++

}



function runSlideShow(){

   if (document.all){

      document.images.SlideShow.style.filter="blendTrans(duration=2)"

      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"

      document.images.SlideShow.filters.blendTrans.Apply()      

   }

//   if(imgcount == p) {

     j = j + 1

     if (j > (p-1)) 

     	j=0

     document.images.SlideShow.src = preLoad[j].src

     document.images.SlideShow.alt = Text[j]

     if (document.all){

        document.images.SlideShow.filters.blendTrans.Play()

     }

     

//   }else{

//      document.images.SlideShow.alt = 'loading slideshow...'

//   }

   t = setTimeout('runSlideShow()', slideShowSpeed)

}









function SpawnBigImage() {

//launch a new window with a better piccy verision in it

  

  var theImage= new Image()

  theImage.src = BigPic[j]



  var W = theImage.width;

  var H = theImage.height;

  var X = (screen.width/2)-(W/2);

  var Y = (screen.height/2)-(H/2);



  var winPref = 

  "width=" + 500 + ",height=" + 330

  //              + ",innerWidth=" + W + ",innerHeight=" + H

               + ",left=" + X + ",top=" + Y

               + ",screenX=" + X + ",screenY=" + Y

               + ",dependent=yes,titlebar=no,scrollbars=no,resizable=no";



  var myWin = top.open( "", "myWin", winPref )

  myWin.document.open()

  myWin.document.writeln("<HTML><HEAD><TITLE>" + Text[j] + "</TITLE></HEAD><BODY style='margin:0;'>")

  myWin.document.writeln("<IMG src='" + theImage.src + "' height='330' width='500' border='0' /></BODY></HTML>")

  myWin.document.close()

//  myWin.resizeTo(theImage.width,theImage.height + 20) 

  myWin.focus()

}



//=============





//World Clock. Put this in the header

var timerID ;

var months= new Array(12);



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";



function printtimedate(place, hrsoff,minsoff)

{

  var mydate = new Date();



  mydate.setHours(mydate.getHours() + hrsoff);

  mydate.setMinutes(mydate.getMinutes() + minsoff);



  var hours = mydate.getHours();

  var mins = mydate.getMinutes();

  var secs = mydate.getSeconds();

  var ampm = "am";





  if(hours > 12)

  {

    ampm = "pm";

    hours -= 12;

  }

  

//  var day = mydate.getDate();

//  var month = mydate.getMonth();

//  var year = mydate.getFullYear();

  var  minpad = ":";

  var  secpad = ":";

  if(mins < 10)

	minpad = ":0";

  if(secs < 10)

	secpad = ":0";



  return place + hours.toString() + minpad + mins.toString() + ampm;

	//  + secpad + secs.toString() + " on " + months[month] + " " + day + " " + year.toString();

}



var titleoffset = 0;

var title;

function pollclock()

{

 var today = new Date();

 var zone = today.getTimezoneOffset();

 title = "ozbybike.co.uk:-" + printtimedate(" Local: ",0,0) +  printtimedate(" Alice Springs: ",9,30 + zone)  + printtimedate(" GMT: ",0,zone);



// document.all.GMT.innerHTML = printtimedate("GMT: ",0,zone);

// document.all.local.innerHTML = printtimedate("Local: ",0,0);

// document.all.KTM.innerHTML = printtimedate("KTM: ",5,45 + zone);

 document.title = title;

 timerID = window.setTimeout("pollclock()", 1000) ;

}







function jsloader()

{

  pollclock();

  runSlideShow();

}