//SLIDESHOW CODE

//<!-- Web Site:  http://www.codelifter.com -->
// 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
// to add more images, just continue
// the pattern, adding to the array below
Pic[0]="gallery08/ch01.jpg"
Pic[1]="gallery08/ch02.JPG"
Pic[2]="gallery08/ch04.JPG"
Pic[3]="gallery08/ch05.JPG"
Pic[4]="gallery08/g001.JPG"
Pic[5]="gallery08/g002.JPG"
Pic[6]="gallery08/g003.JPG"
Pic[7]="gallery08/g004.JPG"
Pic[8]="gallery08/g005.JPG"
Pic[9]="gallery08/g006.JPG"
Pic[10]="gallery08/g007.JPG"
Pic[11]="gallery08/g008.JPG"
Pic[12]="gallery08/g009.JPG"
Pic[13]="gallery08/g028.JPG"
Pic[14]="gallery08/g011.JPG"
Pic[15]="gallery08/g012.JPG"
Pic[16]="gallery08/g013.JPG"
Pic[17]="gallery08/g014.JPG"
Pic[18]="gallery08/g015.JPG"
Pic[19]="gallery08/g016.JPG"
Pic[20]="gallery08/g017.JPG"
Pic[21]="gallery08/g018.JPG"
Pic[22]="gallery08/g019.JPG"
Pic[23]="gallery08/g020.JPG"
Pic[24]="gallery08/g021.JPG"
Pic[25]="gallery08/g022.JPG"
Pic[26]="gallery08/g023.JPG"
Pic[27]="gallery08/g024.JPG"
Pic[28]="gallery08/g025.JPG"
Pic[29]="gallery08/g026.JPG"
Pic[30]="gallery08/g027.JPG"
Pic[31]="gallery08/g028.JPG"
Pic[32]="gallery08/g029.JPG"
Pic[33]="gallery08/g030.JPG"
Pic[34]="gallery08/g031.JPG"
Pic[35]="gallery08/g032.JPG"
Pic[36]="gallery08/g033.JPG"
Pic[37]="gallery08/tc11.JPG"
Pic[38]="gallery08/pz02.JPG"
Pic[39]="gallery08/pz03.JPG"
Pic[40]="gallery08/pz04.JPG"
Pic[41]="gallery08/pz05.JPG"
Pic[42]="gallery08/pz06.JPG"
Pic[43]="gallery08/pz07.JPG"
Pic[44]="gallery08/pz08.JPG"
Pic[45]="gallery08/pz01.JPG"


// =======================================
// do not edit anything below this line
// =======================================
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}
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()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}


var sendto1="enquiries"; 
var sendto2="karentoft"; 
var sendto3="webmaster";
var dom1="callingtonlions.org"; 
var dom2="btinternet.com";
var dom3="callingtonhoneyfair.org";
var hideat="@";
var subj="Information please"; 
var subj2="Honey Fair Prize Claim"; 
var bodytxt1="Dear Callington Lions";
var bodytxt2="Dear Karen Toft";
var bodytxt3="Dear Callington Lions - I have the winning programme and I wish to claim my 50.00 pound prize";

/* time date function */
var tody=new Date();var year=tody.getYear();if (year<2000){year="19"+year}
var dy=tody.getDay()
var mnth=tody.getMonth()
var dym=tody.getDate()
if (dym<10)
dym="0"+dym
var days=new Array("Sun","Mon","Tues","Wed","Thu","Fri","Sat")
var months=new Array("01","02","03","04","05","06","07","08","09","10","11r","12")
var tdy=(""+dym+"/"+months[mnth]+"/"+year+"")


<!--
//With thanks to daxassist http://www.daxassist.com//
  if(document.images) 
  {
  picture = new Array();
  picture[00] = new Image();
  picture[00].src = "../images/clearbluetext.gif";<!--viewbox-->
  picture[01] = new Image();
  picture[01].src = "../images/1st01.JPG"
  picture[02] = new Image();
  picture[02].src = "../images/1st02.JPG"
  picture[03] = new Image();
  picture[03].src = "../images/1st03.JPG"
  picture[04] = new Image();
  picture[04].src = "../images/1st04.JPG"
  picture[05] = new Image();
  picture[05].src = "../images/2nd01.JPG"
  picture[06] = new Image();
  picture[06].src = "../images/2nd02.JPG"
  picture[07] = new Image();
  picture[07].src = "../images/2nd03.JPG"
  picture[08] = new Image();
  picture[08].src = "../images/3rd01.JPG"
  picture[09] = new Image();
  picture[09].src = "../images/3rd02.JPG"
  picture[10] = new Image();
  picture[10].src = "../images/3rd03.JPG"
  picture[11] = new Image();
  picture[11].src = "../images/3rd04.JPG"
  picture[12] = new Image();
  picture[12].src = "../images/3rd05.JPG"
  picture[13] = new Image();
  picture[13].src = "../images/3rd06.JPG"
  picture[14] = new Image();
  picture[14].src = "../images/4th01.JPG"
  picture[15] = new Image();
  picture[15].src = "../images/4th02.JPG"
  picture[16] = new Image();
  picture[16].src = "../images/4th03.JPG"
  picture[17] = new Image();
  picture[17].src = "../images/4th04.JPG"
  picture[18] = new Image();
  picture[18].src = "../images/4th05.JPG"
  picture[19] = new Image();
  picture[19].src = "../images/5th01.JPG"
  picture[20] = new Image();
  picture[20].src = "../images/5th02.JPG"
  picture[21] = new Image();
  picture[21].src = "../images/5th03.JPG"
  picture[22] = new Image();
  picture[22].src = "../images/5th04.JPG"
  picture[23] = new Image();
  picture[23].src = "../images/6th01.JPG"
  picture[24] = new Image();
  picture[24].src = "../images/6th02.JPG"
  picture[25] = new Image();
  picture[25].src = "../images/6th03.JPG"
  picture[26] = new Image();
  picture[26].src = "../images/6th04.JPG"
  picture[27] = new Image();
  picture[27].src = "../images/6th05.JPG"
  picture[28] = new Image();
  picture[28].src = "../images/2007pg03.JPG"
  }
	
function rollpic(a,b,c,d) 
  {
  if(document.images) 
  	{
    document.images[a].src = picture[b].src;
    document.images[c].src = picture[d].src;
    }
	}


var rndno=Math.floor(Math.random()*101)
var whatno=rndno+99
var whatstr = String(whatno);
var whatelse=Math.floor((whatstr*36500.75)/12.9)

function clearsecbox()
{
document.getElementById("securitycode").value='';
}

function clearhistory()
  {
  history.go(0);
  document.getElementById("confsum").value='';
  }

function refresh()
  {
  window.location.reload(true);
  document.getElementById("confsum").value='';
  }
	
function detect()
{
var wdth=screen.width;
var heght=screen.height
}

function state()
{
alert("Your resolution is "+screen.width+" by "+screen.height)
}

function validateforminput() 
{
  var flag = true
  var bar_request = document.forms.barrequest
  if (bar_request.Applicant_Name.value=="")
	{
  alert("Name field is blank")
  flag = false
	bar_request.Applicant_Name.focus();
	return;
  }
	if(bar_request.Address1.value=="") {
   alert("Address Line 1 field is blank ")
   flag = false
	 bar_request.Address1.focus()
	return;
   }
	 if(bar_request.Address2.value=="") {
   alert("Address Line 2 field is blank ")
   flag = false
	 bar_request.Address2.focus()
	return;
   }	
	if(bar_request.TelNo.value=="") {
  alert("Contact Tel No. field is blank ")
  flag = false
	bar_request.TelNo.focus()
	return;
  }
	if(bar_request.PostCode.value=="") {
  alert("Post code field is blank ")
  flag = false
	bar_request.PostCode.focus()
	return;
  }
	if(bar_request.Email.value=="") {
  alert("email field is blank ")
  flag = false
	bar_request.Email.focus()
	return;
    }
  if (bar_request.Confirm_email.value=="")
	{
   alert("Confirm email field is blank")
   flag = false
	 bar_request.Confirm_email.focus()
	return;
   }
	 if(bar_request.NumOfPeople.value=="") {
   alert("Number Of People field is blank ")
  flag = false
	bar_request.NumOfPeople.focus()
	return;
   }	
	if(bar_request.FunctionType.value=="") {
   alert("Function Type field is blank ")
   flag = false
	 bar_request.FunctionType.focus()
	return;
   }
  if (bar_request.FunctionDate.value=="")
	{
   alert("Function Date field is blank")
   flag = false
	 bar_request.FunctionDate.focus()
  return;
   }
	 if(bar_request.FunctionVenue.value=="") {
   alert("FunctionVenue field is blank ")
   flag = false
	 bar_request.FunctionVenue.focus()
	return;
   }
	 if(bar_request.FunctionTime.value=="") {
   alert("Function Time field is blank ")
   flag = false
	 bar_request.FunctionTime.focus()
	return;
   }
  if (bar_request.TodaysDate.value=="")
	{
   alert("Today's Date field is blank")
   flag = false
	 bar_request.TodaysDate.focus()
	return;
   }
	if (bar_request.securitycode.value=="")
	{
   alert("Please confirm the Security Number")
   flag = false
	 bar_request.securitycode.focus()
	return;
   }
	if (bar_request.agree.checked==false)
	{
   alert("Please confirm you have read our Terms & Conditions")
   flag = false
	 bar_request.agree.focus()
	return;
   }
  if (flag) {
	 toggleBox('buttonbox2',1);value="show div";
	 toggleBox('buttonbox1',0);value="hide div";
	 alert("Form validated, please click Submit Form")
	return;
	 }
 }
 

function checkdate()
{
 var bar_request = document.forms.barrequest;
 var datefield=bar_request.TodaysDate.value;
 var valid = "0123456789/";
   if (datefield.length!=10)
	 {
    alert("Invalid date! The correct date format is dd/mm/yyyy");
		return;
		document.getElementById("TodaysDate").value='';
    }
       for (var i=0; i < 10; i++)
			{
        if(datefield.charAt(2)!= '/')
  			{
  			alert("Invalid date! The correct date format is dd/mm/yyyy");
				return;
				document.getElementById("TodaysDate").value='';
				}
  				if(datefield.charAt(5) != '/')
  			{
  			alert("Invalid date! The correct date format is dd/mm/yyyy");
				return;
				document.getElementById("TodaysDate").value='';
				}
		}
		if(datefield!=tdy)
		{
			alert("Right format - wrong date");
			return;			
		}
}


function compare()
{
  var consum=document.getElementById('securitycode').value;
    if(whatelse!=consum)
      {
      alert("The Numbers don't match: Please try again")
    	document.getElementById("securitycode").value="";
      }
}

function cleardatebox()
{
document.getElementById("TodaysDate").value='';
}


function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szbuttonbox2].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

function toggleBox2(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szbuttonbox2].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

function hdsubbut()
{
toggleBox2('buttonbox2',0);value="hide div";
alert("You will shortly receive an acknowledgement - Please be patient")
return;
 }
 
function isNumeric(elem){
var bar_request = document.forms.barrequest
var numericExpression = ['0-9'];
if(bar_request.NumOfPeople.value.match(numericExpression)){
	return true;
}else{
	alert("Must be a number (0-9)");
	return false;
	}
}

 


function checknum()
{
var bar_request = document.forms.barrequest
var nmbr='70';
var numofpeolpe=document.getElementById("NumOfPeople").value;
if(numofpeolpe<nmbr)
		{
		alert("Minimum number is 70");
		bar_request.NumOfPeople.value="";
		bar_request.NumOfPeople.focus();
		return;
		}
}


