    var ScrollOpen = 0;
    function OpenScroll(){
        if (ScrollOpen == 0) {
        Effect.BlindDown($("SantaMiddle"));
        ScrollOpen = 1;
        } else {
            CloseScroll();
            ScrollOpen = 0;
        }
    }
    function CloseScroll(){
        Effect.BlindUp($("SantaMiddle"));
    }





var imageFadeTimeout = 0;
var imageHeadTimeout = 0;
function autoImageFade() {
   NextFade();
   imageFadeTimeout = setTimeout('autoImageFade()',10000);
}

function autoTestFade() {
   imageFadeTimeout = setTimeout('autoImageFade()',500);
    new Effect.BlindDown($("Heading"));
    new Effect.BlindDown($("Testimonial"));
   //new Effect.toggle("Heading", 'blind', {scaleX: false, scaleY: true, scaleContent: false});   
   //new Effect.toggle("Testimonials", 'blind', {scaleX: false, scaleY: true, scaleContent: false});   

   imageHeadTimeout = setTimeout('HeadAppear()',500);
}
function HeadAppear() {
   $("Head").appear();
}

var Imageon = 1;
function NextFade() {
        if (Imageon != 0) {
        $("stables_"+Imageon+"").fade();
        $("stable_"+Imageon+"").fade();
        }
        Imageon += 1;
        if ($("stables_"+Imageon+"")) {Imageon = Imageon} else {Imageon = 1} 
       
        $("stables_"+Imageon+"").appear();
        $("stable_"+Imageon+"").appear();
}
var Galleryon = 1;
function GalleryView(ID) {
        if (Galleryon != ID) {
        $("Gallery_"+Galleryon+"").hide();
        }
        Galleryon = ID;
        $("Gallery_"+Galleryon+"").show();
}




function open_win(url) 
{
window.open(url, null, "width=420, height=300, toolbar=0, scrollbars=0, titlebar=0, menubar=0, resizable=1")
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2];  val=document.getElementById(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);

	if (errors=='')
	{
		var frm = document.getElementById("Order");
		var command = document.getElementById("command");
		command.value = "SendOrder";
		frm.submit();
	}
	document.MM_returnValue = (errors == '');
}


function MD_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MD_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) { alert('The following error(s) occurred:\n'+errors);}
  document.MD_returnValue = (errors == '');
}



function SelectCategory2(ID)
	{
	var a = document.getElementById('Basket');
	a.CategoryID.value = ID;
	a.action = "/store/index.asp";
	a.submit();
	}

function SelectCategory(ID)
	{
	var a = document.getElementById('Basket');
	a.CategoryID.value = ID;
	a.action = "index.asp";
	a.submit();
	}

function ViewMore(ID)
	{
	var a = document.getElementById('Basket');
	a.ProductID.value = ID;
	a.action = "/store/moreinfo.asp";
	a.submit();
	}
function AddBasket(ID)
	{
	var a = document.getElementById('Basket');
	a.ProductID.value = ID;	
	a.command.value = "AddtoBasket";
	a.submit();
	}

function AddtoBasket(ID)
{
	var b = document.getElementById('Basket');
	b.ProductID.value = ID;
	var a = document.getElementById('Product');
	// set var checkbox_choices to zero
	var checkbox_choices = '';
	alert(a.checkbox);
	if (a.checkbox.length)
	{
		// Loop from zero to the one minus the number of checkbox button selections
		for (counter = 0; counter < a.checkbox.length; counter++)
		{
			// If a checkbox has been selected it will return true
			// (If not it will return false)
			if (a.checkbox[counter].checked)
			{
				checkbox_choices = checkbox_choices + ',' + a.checkbox[counter].value;
			}
		}
	}
	b.Options.value = checkbox_choices;
	b.command.value = "AddtoBasket";
	b.submit();
}
function ClearBasket(ID)
	{
	var a = document.getElementById('Basket');
	a.command.value = "ClearBasket";
	a.submit();
	}

function DeleteFromBasket(ID)
	{
	var a = document.getElementById('Basket');
	a.ProductID.value = ID;
	a.command.value = "DeleteFromBasket";
	a.submit();
	}

function UpdateBasket(ID)
	{
	var a = document.getElementById('Basket');
	a.ProductID.value = ID;
	var d = document.getElementById('Qty'+ID)
	a.Qty.value = d.value;
	a.command.value = "UpdateBasket";
	a.submit();
	}
	
function doSendEmail()
	{
	var a = document.getElementById('frm');
		a.command.value = "Send Email";
		a.submit();
	}
function doSendOrder()
	{
	var a = document.getElementById('Basket');
	a.action = "SendConfirm.asp";
	a.command.value = "SendOrder";
	a.submit();
	}
function CheckDelivery()
	{
	var a = document.getElementById('Order');
	if (a.Postcode.value.length != 0 )
		{
	a.Post.checked = true;
	a.command.value = "";
	a.action = "Checkout.asp";
	a.submit();
		}
	else	{
		a.Post.checked = false;
		alert("Please enter a delivery postcode");
	}}
















	/***********************************************
	* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
	* This notice MUST stay intact for legal use
	* Visit http://www.dynamicdrive.com/ for this script and 100s more.
	***********************************************/
	
	var delayb4scroll=1000; //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
	var marqueespeed=1; //Specify marquee scroll speed (larger is faster 1-10)
	var pauseit=1; //Pause marquee onMousever (0=no. 1=yes)?
	var tim;
	////NO NEED TO EDIT BELOW THIS LINE////////////
	
	var copyspeed=marqueespeed;
	var pausespeed=(pauseit==0)? copyspeed: 0;
	var actualheight='';
	
	function scrollmarquee(){
		//document.write(parseInt(cross_marquee.style.top));
			//if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) {
		if (document.getElementById('track').value == "") {
			if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) {
				cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px";
				//alert(actualheight);
			}
			else {
				//alert(parseInt(marqueeheight));
				cross_marquee.style.top=parseInt(marqueeheight)-8+"px";
			}
		}
	}
	
	//press down
	function pressdown() {
		document.getElementById('track').value = "yes";
		
			if (parseInt(cross_marquee.style.top)<(actualheight)) {
				cross_marquee.style.top=parseInt(cross_marquee.style.top)+ 10 +"px";
				//alert(parseInt(cross_marquee.style.top) + "---" + actualheight + " marqueeheight: " + parseInt(marqueeheight) );
				//alert(actualheight);
				tim = setTimeout("pressdown()", 150);
			}
			else {
				//alert(parseInt(marqueeheight));
				cross_marquee.style.top=parseInt(marqueeheight)*(-1)+"px";
				tim = setTimeout("pressdown()", 150);
			}
	}
	
	//press up
	function pressup() {
		document.getElementById('track').value = "yes";
		//cross_marquee.style.top=parseInt(cross_marquee.style.top)+10+"px";
		//alert(document.getElementById('track').value);
		
			if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) {
				cross_marquee.style.top=parseInt(cross_marquee.style.top)-10 +"px";
				//alert(parseInt(cross_marquee.style.top) + "---" + actualheight + " marqueeheight: " + parseInt(marqueeheight) );
				//alert(actualheight);
				tim = setTimeout("pressup()", 150);
			}
			else {
				
				cross_marquee.style.top=parseInt(marqueeheight)-8+"px";
				tim = setTimeout("pressup()", 150);
				//alert(cross_marquee.style.top);
			}
	}
	
	//on mouse out
	function mouse_out() {
		document.getElementById('track').value = "";
		clearTimeout(tim);
		//alert(document.getElementById('track').value);
		scrollmarquee;
	}
	
	//init()
	function initializemarquee(){
		cross_marquee=document.getElementById("vmarquee");
		cross_marquee.style.top=0;
		marqueeheight=document.getElementById("marqueecontainer").offsetHeight;
		actualheight=cross_marquee.offsetHeight;
		if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
			cross_marquee.style.height=marqueeheight+"px";
			cross_marquee.style.overflow="scroll";
			return
		}
		setTimeout('lefttime=setInterval("scrollmarquee()",35)', delayb4scroll);
	}


	function getaddress(){
		var Postcode = document.getElementById("QuickPostcode").value;
		
		if (Postcode != "Postcode"){
		emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/modalfiles/addressfinder.asp?Postcode=' + Postcode, '', 'width=270px,height=180px,center=1,resize=0,scrolling=0')

        emailwindow.onclose=function(){ //Define custom code to run when window is closed
	    var theform=this.contentDoc.forms[0] //Access first form inside iframe just for your reference
	    var theemail=this.contentDoc.getElementById("emailfield") //Access form field with id="emailfield" inside iframe
	        if (theemail.value.indexOf("@")==-1){ //crude check for invalid email
		        alert("Please enter a valid email address")
		        return false //cancel closing of modal window
	        }
	        else{ //else if this is a valid email
		        document.getElementById("youremail").innerHTML=theemail.value //Assign the email to a span on the page
		        return true //allow closing of window
	        }
    }}
	}


	function sendMyAddress(){
	
	var sErrors = "";
	var bValid = true;   
	
    	var QuickCompany = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyCompanyName'].value;
        var QuickAddress1 = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyAddress1'].value;
        var QuickAddress2 = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyAddress2'].value;
        var QuickTown = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyTown'].value;
        var QuickPostcode = window.frames['_iframe-EmailBox'].document.forms['MyAddress'].elements['MyPostcode'].value;
	    var Address = ""
	    
	    if(QuickCompany == "Company Name"){QuickCompany = ""}
	
	    
	    if (QuickCompany.length > 0) {Address = Address + QuickCompany + ", "}
	    if (QuickAddress1.length > 0) {Address = Address + QuickAddress1 + ", "}
	    if (QuickAddress2.length > 0) {Address = Address + QuickAddress2 + ", "}
	    if (QuickTown.length > 0) {Address = Address + QuickTown + ", "}
	    if (QuickPostcode.length > 0) {Address = Address + QuickPostcode + ", "}
	    
	    if (Address.length > 0) {  Address = Address.substring(0,(Address.length - 2));}
	    
	  
	    
	if(QuickAddress1.length == 0 || QuickAddress1 == "Address"){sErrors = sErrors + "Please enter your house number and street\n"; bValid = false;}
	if(QuickTown.length == 0 || QuickTown == "Town/City"){sErrors = sErrors + "Please enter your town or city\n"; bValid = false;}
	if(QuickPostcode.length == 0 || QuickPostcode == "Postcode"){sErrors = sErrors + "Please enter your postcode\n"; bValid = false;}
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    	    
	    document.getElementById("EmailBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    document.getElementById("QuickFind").style.display = "none";
	    document.getElementById("QuickPostcode").style.display = "none";
	        
	    document.getElementById("QuickCompany").value = QuickCompany;
	    document.getElementById("QuickAddress1").value = QuickAddress1;
	    document.getElementById("QuickAddress2").value = QuickAddress2;
	    document.getElementById("QuickTown").value = QuickTown;
	    document.getElementById("QuickPostcode").value = QuickPostcode;   
	    
	    document.getElementById("QuickAddress").innerHTML = Address;
	    document.getElementById("button-faded").style.display = "none";
	    document.getElementById("button-full").style.display = "block";
	    }
	    
	    
	    

	}
	
	
	
	function sendCallMe(){
	var sErrors = "";
	var bValid = true;
	var name = document.getElementById("CallMeName");
	var tel = document.getElementById("CallMeTelephone");
	
	
	if(name.value.length == 0 || name.value == "Name"){sErrors = sErrors + "Please enter a contact name\n"; bValid = false;}
	if(tel.value.length == 0 || tel.value == "Telephone"){sErrors = sErrors + "Please enter a telephone number\n"; bValid = false;}
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    document.getElementById("QuickName").value = name.value ;
	    document.getElementById("QuickTelephone").value = tel.value ;
	    document.getElementById("command").value = "CallMeNow";
	    document.getElementById("AddressFinder").submit();
	    }
	    }
	    
	
	    
	    
	function sendCallMeOffer(){
	var sErrors = "";
	var bValid = true;
	var name = document.getElementById("CallMeNameOffer");
	var tel = document.getElementById("CallMeTelephoneOffer");
	
	
	if(name.value.length == 0 || name.value == "Name"){sErrors = sErrors + "Please enter a contact name\n"; bValid = false;}
	if(tel.value.length == 0 || tel.value == "Telephone"){sErrors = sErrors + "Please enter a telephone number\n"; bValid = false;}
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    document.getElementById("QuickName").value = name.value ;
	    document.getElementById("QuickTelephone").value = tel.value ;
	    document.getElementById("command").value = "CallMeNow";
	    document.getElementById("AddressFinder").submit();
	    }
	    }  
	    	
	
	
	function sendMyBrochure(){
	var sErrors = "";
	var bValid = true;
	var name = document.getElementById("QuickName");
	var tel = document.getElementById("QuickTelephone");
	var postcode = document.getElementById("QuickPostcode");
	var QuickAddress = document.getElementById("QuickAddress1");
	
	if(name.value.length == 0 || name.value == "Name"){sErrors = sErrors + "Please enter a contact name\n"; bValid = false;}
	if(tel.value.length == 0 || tel.value == "Telephone"){sErrors = sErrors + "Please enter a telephone number\n"; bValid = false;}
	if(postcode.value.length == 0 || postcode.value == "Postcode"){sErrors = sErrors + "Please enter your address\n"; bValid = false;}
	if(QuickAddress.value.length == 0){sErrors = sErrors + "Please enter your address\n"; bValid = false;}
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    document.getElementById("command").value = "SendBrochure";
	    document.getElementById("AddressFinder").submit();
	    }
	    }
	    
	function sendOfferRequest(){
	var sErrors = "";
	var bValid = true;
	var email = document.getElementById("OffersEmail");


	if(email.value.length == 0 || email.value == "Please enter your email"){sErrors = sErrors + "Please enter an email address\n"; bValid = false;}
	    if(bValid == false)
	    {
		    alert(sErrors);
	    }
	    else {
	    document.getElementById("offercommand").value = "SendOffers";
	    document.getElementById("OfferRequest").submit();
	    }
	    }
	
	function chooseAddress(Company, Address, Address1, Address2, Town){
	var p = document.getElementById("QuickPostcode").value;
	    document.getElementById("EmailBox").style.display = "none";
	    document.getElementById("interVeil").style.display = "none";
	    document.getElementById("QuickFind").style.display = "none";
	    document.getElementById("QuickPostcode").style.display = "none";
	    document.getElementById("QuickPostcode").value = p;    
	    document.getElementById("QuickCompany").value = Company;
	    document.getElementById("QuickAddress1").value = Address1;
	    document.getElementById("QuickAddress2").value = Address2;
	    document.getElementById("QuickTown").value = Town;
	    document.getElementById("QuickAddress").innerHTML = Address;
	    //document.getElementById("button-faded").style.display = "none";
	    //document.getElementById("button-full").style.display = "block";
	}	
	
 function clearMe(formfield){
  if (formfield.defaultValue==formfield.value){
   formfield.value = ""}

  }
 function returnMe(formfield){
   if (formfield.value==""){
   formfield.value = formfield.defaultValue}
  }
  
  
function startTicker()
{
	// Define run time values
	theCurrentStory     = -1;
	theCurrentLength    = 0;
	// Locate base objects
	if (document.getElementById) {	
		    theAnchorObject     = document.getElementById("tickerAnchor");
			runTheTicker();   	
		 }
	else {
            document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
            return true;
	}
}

function runTheTicker()
{
	var myTimeout;  
	// Go for the next story data block
	if(theCurrentLength == 0)
	{
		theCurrentStory++;
		theCurrentStory      = theCurrentStory % theItemCount;
		theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');		
		theTargetLink        = theSiteLinks[theCurrentStory];
		theAnchorObject.href = theTargetLink;
		thePrefix 	     = "<span class=\"tickls\">" + theLeadString + "</span>";
	}
	// Stuff the current ticker text into the anchor
	theAnchorObject.innerHTML = thePrefix + 
	theStorySummary.substring(0,theCurrentLength) + whatWidget();
	// Modify the length for the substring and define the timer
	if(theCurrentLength != theStorySummary.length)
	{
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}
	// Call up the next cycle of the ticker
	setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
	if(theCurrentLength == theStorySummary.length)
	{
		return theWidgetNone;
	}

	if((theCurrentLength % 2) == 1)
	{
		return theWidgetOne;
	}
	else
	{
		return theWidgetTwo;
	}
}

	var theCharacterTimeout = 50;
	var theStoryTimeout     = 3000;
	var theWidgetOne        = "_";
	var theWidgetTwo        = "-";
	var theWidgetNone       = "";
	var theLeadString       = "&nbsp;";

	var theSummaries = new Array();
	var theSiteLinks = new Array();

	var theItemCount = 1;

	

	
        theSummaries[0] = "* * * * * * * * * * * * Call us for our latest special offers! * * * * * * * * * * * *";
		theSiteLinks[0] = "/index.asp";



