﻿// JavaScript Document

var titles = new Array();
titles['large_1'] = '<p><strong>Poisonous Venom</strong></p>';
titles['large_2'] = '<p><strong>Air Up There</strong></p>';
titles['large_3'] = '<p><strong>The Jackson</strong></p>';
titles['large_4'] = '<p><strong>Bel-Air</strong></p>';
titles['large_5'] = '<p><strong>Great grab</strong></p>';
titles['large_6'] = '<p><strong>B-girl JessFX</strong></p>';
titles['large_7'] = '<p><strong>Soul Shifter</strong></p>';
titles['large_8'] = '<p><strong>Use the Force</strong></p>';
titles['large_9'] = '<p><strong>Photograph This</strong></p>';
titles['large_10'] = '<p><strong>The Big Payback</strong></p>';
titles['large_11'] = '<p><strong>Crab</strong></p>';
titles['large_12'] = '<p><strong>Salah Shows Love</strong></p>';
titles['large_13'] = '<p><strong>Curtain Call</strong></p>';
titles['large_14'] = '<p><strong>Encore</strong></p>';
titles['large_15'] = '<p><strong>The man with a million voices</strong></p>';
titles['large_16'] = '<p><strong>Yes Flash Photography</strong></p>';

var captions = new Array();
captions['large_1'] = '<p><strong>B-boy Venom, Rock Steady and Skill Methodz, has the hard edged posture</strong></p>';
captions['large_2'] = '<p><strong>Jeromeskee of Massive Monkees rises out of the frame during the performance</strong></p>';
captions['large_3'] = '<p><strong>Ana Banana Freeze ends the Massive Monkee routine called “the Jackson”</strong></p>';
captions['large_4'] = '<p><strong>Cornbread of Massive Monkees plays the “Fresh Prince” during the show</strong></p>';
captions['large_5'] = '<p><strong>Juseboogy of the Massive Monkees gets a nice toe-grab at the height of a freeze</strong></p>';
captions['large_6'] = '<p><strong>Representing Mash Hall crew, and hit her freezes with ease.</strong></p>';
captions['large_7'] = '<p><strong>B-boy FREE caught in mid-air during Circle of Fire’s first round battle</strong></p>';
captions['large_8'] = '<p><strong>HanSolo of Flow Mo Crew (Finland) defies gravity yet again</strong></p>';
captions['large_9'] = '<p><strong>Coosh flew out a top-notch documentation team (left to right) Jamel Shabazz, B+ and Eric Coleman</strong></p>';
captions['large_10'] = '<p><strong>Twixx of Massive Monkees prepares to present the check alongside Coosh executives</strong></p>';
captions['large_11'] = '<p><strong>K-Mel, of the winning Boogie Brats, freaks it with a feat of flexibility</strong></p>';
captions['large_12'] = '<p><strong>Showstopping French entertainer Salah, of Massive Monkees, throws up his sign</strong></p>';
captions['large_13'] = '<p><strong>From left to right: Peanut, Jeromeskee, Rodericko, Lil Lazy and Twixx</strong></p>';
captions['large_14'] = '<p><strong>Salah collapses at the end of his show with fans on their feet cheering</strong></p>';
captions['large_15'] = '<p><strong>Salah incorporates high-pitched vocal filters to his show that he produces naturally</strong></p>';
captions['large_16'] = '<p><strong>Where as most jams charge extra for cameras, Coosh let everyone document the moment in breakdancing history</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 < -920){
				clearTimeout(timeout);
			}else if(left == -860){
				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 > -901){
			slideRight();
			if (left == -400) {
				clearTimeout(timeout);
			}else if(left == -820) {
				clearTimeout(timeout);
			}else if(left == -900){
				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 );
}



