			$(function () {
			    // this initialises the demo scollpanes on the page.
				
				

				
		        $('.scroller_2').jScrollPane();
				$('#idScroller').jScrollPane();

			    reinitialiseScrollPane = function () {
			        $('.scroller_2').jScrollPane();
					$('#idScroller').jScrollPane();
					
			    }



			});
			$(document).ready(function () {
										
										$(function () {
    var tabContainers = $('div.tabs > div');
    var tabs = $('div.tabs > ul > li > a');
    tabContainers.hide();
    tabs.each(function (i, item) {
        if ($(this).parent().hasClass('active')) {
            tabContainers.filter($(item).attr('href')).show();
        }
        //console.log($(item).attr('href'))
        $(item).click(function () {
            tabContainers.hide();
            tabContainers.filter($(item).attr('href')).show();
            $('div.tabs ul.tabNavigation li').removeClass('active');
            $(this).parent().addClass('active');
            return false;
        }).filter('.active');
    })
});


			    // Place ID's of all required fields here.
			    required = ["fbrp__14", "email","fbrp__17", "message"];
			    // If using an ID other than #email or #error then replace it here
				email = $("#fbrp__15_1");
			    errornotice = $("#error");
			    // The text to show up within a field when it is incorrect
			    emptyerror = "Please fill out this field.";
			    emailerror = "Please enter a valid e-mail.";
				
		
				
				

			    $("#cntnt01moduleform_2").submit(function () {
			        //Validate required fields
			        for (i = 0; i < required.length; i++) {
			            var input = $('#' + required[i]);
			            if ((input.val() == "") || (input.val() == emptyerror)) {
			                input.addClass("needsfilled");
			                input.val(emptyerror);
			                errornotice.fadeIn(750);
			            } else {
			                input.removeClass("needsfilled");
			            }
			        }
			        // Validate the e-mail.
			        if (!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email.val())) {
			            email.addClass("needsfilled");
			            email.val(emailerror);
			        }
					

			        //if any inputs on the page have the class 'needsfilled' the form will not submit
			        if ($(":input").hasClass("needsfilled")) {
			            return false;
			        } else {
			            errornotice.hide();
			            return true;
			        }
			    });

			    // Clears any fields in the form when the user clicks on them
			    $(":input").focus(function () {
			        if ($(this).hasClass("needsfilled")) {
			            $(this).val("");
			            $(this).removeClass("needsfilled");
			        }
			    });


			    //  main nav  
			    var fadeDuration = 150; //time in milliseconds
			    $('#nav li').hover(function () {

			        $(this).children('a').animate({
			            color: "#000000"
			        }, fadeDuration);


			    }, function () {

			        $(this).children('a').animate({
			            color: "#333333"
			        }, fadeDuration);
			    });


			    //  sub nav  
			    var fadeDuration = 500; //time in milliseconds
			    $('#subnav li').hover(function () {
			        $(this).animate({
			            paddingLeft: '0px'
			        }, fadeDuration);
			        $(this).children('a').animate({
			            paddingLeft: '20px'
			        }, fadeDuration);
			    }, function () {
			        $(this).animate({
			            paddingLeft: '0px'
			        }, fadeDuration);
			        $(this).children('a').animate({
			            paddingLeft: '10px'
			        }, fadeDuration);
			    });

			    //  searchbutton  
			    var fadeDuration = 150; //time in milliseconds
			    $('#idSearchButton').hover(function () {

			        $(this).animate({
			            backgroundColor: "#ee2f80"
			        }, fadeDuration);

			    }, function () {

			        $(this).animate({
			            backgroundColor: "#00BDE6"
			        }, fadeDuration);
			    });

			    $('#cntnt01fbrp_submit').hover(function () {

			        $(this).animate({
			            backgroundColor: "#ee2f80"
			        }, fadeDuration);

			    }, function () {

			        $(this).animate({
			            backgroundColor: "#00BDE6"
			        }, fadeDuration);
			    });





			    //sIFR H1 replacements
			    if (typeof sIFR == "function") {
			        // replace the school and sixth form h1 tags
			        sIFR.replaceElement(named({
			            sSelector: "#idHomeHolder h1",
			            sFlashSrc: "js/sifr/eurostyle.swf",
			            sColor: "#ffffff",
			            sHoverColor: "#EE2F80",
			            sWmode: "transparent",
			            sCase: "lower"
			        }));
			        // replace homecontent h1 tags
			        sIFR.replaceElement(named({
			            sSelector: "#idHomeContent h1",
			            sFlashSrc: "js/sifr/eurostyle.swf",
			            sColor: "#EE2F80",
			            sHoverColor: "#EE2F80",
			            sWmode: "transparent",
			            sCase: "lower"
			        }));
			        // replace homecontent h1 tags
			        sIFR.replaceElement(named({
			            sSelector: "#idWelcomeHeadContent h1",
			            sFlashSrc: "js/sifr/eurostyle.swf",
			            sColor: "#ffffff",
			            sHoverColor: "#EE2F80",
			            sWmode: "transparent",
			            sCase: "lower"
			        }));
			    };
			    // replace homecontent h1 tags
			    sIFR.replaceElement(named({
			        sSelector: "#idSchoolContent h1",
			        sFlashSrc: "js/sifr/eurostyle.swf",
			        sColor: "#EE2F80",
			        sHoverColor: "#EE2F80",
			        sWmode: "transparent",
			        sCase: "lower"
			    }));


			    // Fading start
			    //alert ('test');
			    $('#idFadingImages').cycle({
			        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			    });

			});


			
