
function selectDate(id) {
	//rotate images
	var imgs = document.getElementById('dateSelector') .getElementsByTagName('img');
	for (i = 0; i < imgs.length; i++) imgs[i].src = imgs[i].src.replace('active', 'off');
	
	document.getElementById('date' + id) .src = document.getElementById('date' + id) .src.replace('on', 'active');
	document.getElementById('date' + id) .src = document.getElementById('date' + id) .src.replace('off', 'active');
	
	//rotate locations content
	var divs = document.getElementById('leftInfo') .getElementsByTagName('div');
	for (i = 0; i < divs.length; i++) {
		if (divs[i].className == 'mainbody') divs[i].className = 'mainbody invisible';
		if (divs[i].id == 'location' + id) divs[i].className = 'mainbody';
	}
	
	//rotate body content
	divs = document.getElementById('rightInfo') .getElementsByTagName('div');
	for (i = 0; i < divs.length; i++) {
		if (divs[i].className == 'infobody') divs[i].className = 'infobody invisible';
		if (divs[i].id == 'info' + id) divs[i].className = 'infobody';
	}
	
	//rotate banner images
	imgs = document.getElementById('subBanner') .getElementsByTagName('img');
	for (i = 0; i < divs.length; i++) {
		if (imgs[i].className == 'horseebanner') imgs[i].className = 'horseebanner invisible';
		if (imgs[i].className == 'bigdate') imgs[i].className = 'bigdate invisible';
		if (imgs[i].id == 'bigdate' + id) imgs[i].className = 'bigdate';
		if (imgs[i].id == 'horseebanner' + id) imgs[i].className = 'horseebanner';
	}
	
	return false;
}

function overDate(id) {
	document.getElementById('date' + id) .src = document.getElementById('date' + id) .src.replace('on', 'off');
	return false;
}

function leftDate(id) {
	document.getElementById('date' + id) .src = document.getElementById('date' + id) .src.replace('off', 'on');
	return false;
}


function isInt(sText) {
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char; 
	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) IsNumber = false;
	}
	return IsNumber;
}


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();
    });
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.bind('click', function() {
        carousel.startAuto(0);
    });
};
