// Google Translate Initialiser
	function googleTranslateElementInit() {
		new google.translate.TranslateElement({
			pageLanguage: 'en',
			layout: google.translate.TranslateElement.InlineLayout.SIMPLE
		}, 'google_translate_element');
	}
// Text Resizer
	function resizeText(multiplier) {
		if (document.body.style.fontSize == "") {
			document.body.style.fontSize = "1.0em";
		}
		document.body.style.fontSize = parseFloat(document.body.style.fontSize) + (multiplier * 0.2) + "em";
	}
// Picture Slideshow
	var totalSlides = 0;
	var currentSlide = 1;
	var contentSlides = "";
	$(document).ready(function(){
		$("#slideshow-previous").click(showPreviousSlide);
		$("#slideshow-next").click(showNextSlide);
		var totalWidth = 0;
		contentSlides = $(".slideshow-content");
		contentSlides.each(function(i){
			totalWidth += this.clientWidth;
			totalSlides++;
		});
		$("#slideshow-holder").width(totalWidth);
		$("#slideshow-scroller").attr({scrollLeft: 0});
		updateButtons();
		window.setInterval('autoScroll()', 8000);
	});
	function autoScroll(){
		if(currentSlide <21) {
			currentSlide++;
			updateContentHolder();
			updateButtons();
		}
		else if (currentSlide == 21){
			currentSlide = 1;
			updateContentHolder();
			updateButtons();
		}
	}
	function showPreviousSlide(){
		currentSlide--;
		updateContentHolder();
		updateButtons();
	}
	function showNextSlide(){
		currentSlide++;
		updateContentHolder();
		updateButtons();
	}
	function updateContentHolder(){
		var scrollAmount = 0;
		contentSlides.each(function(i){
			if(currentSlide - 1 > i) {
				scrollAmount += this.clientWidth;
			}
		});
		$("#slideshow-scroller").animate({scrollLeft: scrollAmount}, 1000);
	}
	function updateButtons(){
		if(currentSlide < totalSlides) {
			$("#slideshow-next").show();
		}
		else {
			$("#slideshow-next").hide();
		}
		if(currentSlide > 1) {
			$("#slideshow-previous").show();
		}
		else {
			$("#slideshow-previous").hide();
		}
	}
// Text Slideshow
	var slideArray = new Array()
	slideArray[0]= "<h3>Trust - We understand that our services only respond to carers' needs when they can trust us to care for the person they support.</h3>";
	slideArray[1]= "<h3>Involvement - Carers and the people they support drive Crossroads Care service design and development.</h3>";
	slideArray[2]= "<h3>Quality - We ensure that our services are high quality, flexible, responsive and continually improving.</h3>";
	slideArray[3]= "<h3>Family Friendly - We recognise that our service impacts on families and friends, not just the carer and the person they support, and so we design our services with that in mind.</h3>";
	slideArray[4]= "<h3>Availability and Accessibility - We work to make our services available and accessible to as many carers and people they support as possible.</h3>";
	slideArray[5]= "<h3>Dignity and Respect - We always treat carers and the people they support with dignity and respect.</h3>";
	slideArray[6]= "<h3>Working for Change - We work proactively with government and policy makers at national and local level to influence legislation and practice.</h3>";
	slideArray[7]= "<h3>Partnership Working - We actively explore opportunities for establishing joint projects and relationships with other organisations that will improve services for carers and the people they support.</h3>";
	slideArray[8]= "<h3>Learning - We learn from the good practice of others in order to improve our services for carers and the people they support and we encourage others to learn from us.</h3>";
	function textSlideShow() {
		var total_slides;
		total_slides=Math.floor(Math.random()*slideArray.length)
		document.getElementById('div_display').innerHTML=slideArray[total_slides];
		setTimeout("textSlideShow()",30000);
	}
// Toggle Visibility
function toggle() {
	var el = document.getElementById("feedback");
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}
