﻿sfHover = function() 
{
    if (!document.getElementsByTagName) return false;
    var sfEls = document.getElementById("nav").getElementsByTagName("li");

    for (var i=0; i<sfEls.length; i++)
    {
	    sfEls[i].onmouseover=function() 
	    {
		    this.className+=" sfhover";
        }		
	    sfEls[i].onmouseout=function()
	    {
		    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
    
function loadGoogleMaps()
{
    var objPostCode = document.getElementById("txtPostCode");
    var strURL = 'http://maps.google.co.uk/maps?f=d&source=s_d&saddr='+escape(objPostCode.value)+'&daddr=53.91245,-2.273569&hl=en&geocode=&mra=ls&sll=53.800651,-4.064941&sspn=12.709674,28.125&ie=UTF8&z=12';    
    windowOpen(strURL);
}
           
function windowOpen(strURL)
{
    objWindow = window.open("","","width=800,height=600,status=yes,scrollbars=yes,resizable=yes");
    objWindow.location.href = strURL;
    if (!objWindow.opener) objWindow.opener = self;
}

function mycarousel_initCallback(carousel) {
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function () {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function () {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function () {
        carousel.stopAuto();
    }, function () {
        carousel.startAuto();
    });
};

jQuery(document).ready(function () {
    jQuery('#mycarousel').jcarousel({
        auto: 3,
        scroll: 1,
        animation: 'slow',
        vertical: true,
        wrap: 'circular',
        initCallback: mycarousel_initCallback
    });
});

