﻿// JavaScript Document

var titles = new Array();
titles['large_1'] = '<p><strong>D-A-N-C-E</strong></p>';
titles['large_2'] = '<p><strong>Front Row</strong></p>';
titles['large_3'] = '<p><strong>Win One for the Gipper</strong></p>';
titles['large_4'] = '<p><strong>Lovin\' It</strong></p>';
titles['large_5'] = '<p><strong>Read all about it</strong></p>';
titles['large_6'] = '<p><strong>Crowd control</strong></p>';
titles['large_7'] = '<p><strong>E Pluribus Unum</strong></p>';
titles['large_8'] = '<p><strong>Top Notch</strong></p>';
titles['large_9'] = '<p><strong>Rubber Legs</strong></p>';
titles['large_10'] = '<p><strong>On top of the World</strong></p>';
titles['large_11'] = '<p><strong>Monkee Business</strong></p>';
titles['large_12'] = '<p><strong>Air Guitar</strong></p>';
titles['large_14'] = '<p><strong>Hey You</strong></p>';
titles['large_15'] = '<p><strong>Cut the Check</strong></p>';

var captions = new Array();
captions['large_1'] = '<p><strong>coosh gave out 500 free tickets to kids just like this.</strong></p>';
captions['large_2'] = '<p><strong>All the diversity of coosh Crash Test is apparent in the front row.</strong></p>';
captions['large_3'] = '<p><strong>Massive Monkees, the gracious host, huddle during their theatre performance.</strong></p>';
captions['large_4'] = '<p><strong>Fans feel good about coosh.</strong></p>';
captions['large_5'] = '<p><strong>Handbills from the event.</strong></p>';
captions['large_6'] = '<p><strong>Lower floor during a coosh Crash Test battle.</strong></p>';
captions['large_7'] = '<p><strong>The stage consisted of a statue of Atlas, upside down hittin’ a bboy freeze and a ransom note calling for global unity.</strong></p>';
captions['large_8'] = '<p><strong>Bboy Physicx, Rivers Crew South Korea.</strong></p>';
captions['large_9'] = '<p><strong>Casper, of the coosh Crash Test champion Boogie Brats, bends to the beat.</strong></p>';
captions['large_10'] = '<p><strong>Salah was a show-stopper at coosh Crash Test getting several standing ovations.</strong></p>';
captions['large_11'] = '<p><strong>Salah brought the entire 25-person Massive Monkees Crew on stage to acknowledge their efforts getting him to Seattle from his native Paris.</strong></p>';
captions['large_12'] = '<p><strong>Casper, of the coosh Crash Test champion Boogie Brats, strikes a chord with the audience and the judges alike</strong></p>';
captions['large_13'] = '<p><strong>K-mel, of the coosh Crash Test champion Boogie Brats, hits a freeze that defies gravity.</strong></p>';
captions['large_14'] = '<p><strong>Rebirth, a finalist from Miami, is known for his expressive top-rocking</strong></p>';
captions['large_15'] = '<p><strong>Boogie Brats share a moment while BIC USA Inc. thanks the performers and fans for making it a wonderful night in Seattle.</strong></p>';

var moving = false;
var current = 'left';
var timeout;


function hideAll(){
	all_divs = $('esb_large_img').select('div');
	all_divs.each(function(item) {
		$(item).hide();
	});
	return false;
}

function show_layer(num) {
	//alert(model)
	hideAll();
	$(num).show();
	$('title_of_photos').innerHTML = titles[num];
	if (titles[num] == null ) {
		$('title_of_photos').innerHTML = '';
	}
	$('caption_of_photos').innerHTML = captions[num];
	if (captions[num] == null ) {
		$('caption_of_photos').innerHTML = '';
	}
	
	return false
}

function moveLeft(){
	if(!moving){
		var left = $('esb_banner').getStyle('left');	
		left.replace("px","");	
		left = parseInt(left);
		if(left < 0 ){
			slideLeft();
			if(left == -1175){
				clearTimeout(timeout);
			} else if(left == -440){
				clearTimeout(timeout);
			}
		} else {
			clearTimeout(timeout);
		}
	}
	return false;
}

function slideLeft(){
	var left_px = $('esb_banner').getStyle('left');
	left_px.replace("px","");
	left_px = parseInt(left_px) + 20;
	$('esb_banner').setStyle({ left:left_px+'px' });
	timeout = setTimeout ( "moveLeft()", 50 );
}


function moveRight(){
	if(!moving){
		var left = $('esb_banner').getStyle('left');	
		left.replace("px","");	
		left = parseInt(left);
		if(left > -840){
			slideRight();
			if (left == -400) {
				clearTimeout(timeout);
			}else if(left == -840) {
				clearTimeout(timeout);
			}
		} else {
			clearTimeout(timeout);
		}
	}
	return false;
}



function slideRight(){
	var left_px = $('esb_banner').getStyle('left');
	left_px.replace("px","");
	left_px = parseInt(left_px) - 20;
	$('esb_banner').setStyle({ left:left_px+'px' });
	timeout = setTimeout ( "moveRight()", 50 );
}



