// JavaScript Document

$(function() {

$('#close').click(function() {
  $('#alert').hide();
});

	$('.quote.all').everyTime(30000, function(i) {
		$(this).load("/ajax/random-quote.php", function() {
  $(this).effect("highlight", {}, 3000);
});
	});
		   
	$('.quote.greenwich').everyTime(30000, function(i) {
		$(this).load("/ajax/random-quote.php?cat=" + escape("Greenwich Docklands"), function() {
  $(this).effect("highlight", {}, 3000);
});
	});
		   
	$('.quote.greenwich-party').everyTime(30000, function(i) {
		$(this).load("/ajax/random-quote.php?cat=" + escape("Greenwich Docklands Kids Party"), function() {
  $(this).effect("highlight", {}, 3000);
});
	});
	$('.quote.tolworth-party').everyTime(30000, function(i) {
		$(this).load("/ajax/random-quote.php?cat=" + escape("Tolworth Cadet Party"), function() {
  $(this).effect("highlight", {}, 3000);
});
	});
	$('.quote.hoddesdon').everyTime(30000, function(i) {
		$(this).load("/ajax/random-quote.php?cat=" + escape("Hoddesdon"), function() {
  $(this).effect("highlight", {}, 3000);
});
	});
	$('.quote.streatham').everyTime(30000, function(i) {
		$(this).load("/ajax/random-quote.php?cat=" + escape("Streatham"), function() {
  $(this).effect("highlight", {}, 3000);
});
	});
	$('.quote.tolworth').everyTime(30000, function(i) {
		$(this).load("/ajax/random-quote.php?cat=" + escape("Tolworth"), function() {
  $(this).effect("highlight", {}, 3000);
});
	});
		   
		   
/*	$.PeriodicalUpdater({
      url : '/ajax/random-quote.php',
	  minTimeout: 130000
   },
   function(data){
	   alert($(this));
      $(this).html(data);
      $(this).show();
      $(this).effect("highlight", {}, 3000);
   });*/
	
	$("a.fancybox").fancybox({'hideOnContentClick': false,'frameWidth':640, 'frameHeight':480});
	
	if(typeof page_startup == 'function') { 
		page_startup(); 
	}
});

function RefreshPage(){
	window.location.reload();
}

