/* */
var baseURL = 'http://www.brunotti.com/';
/* */

$(document).ready(function() {

	/* switch language */
	$("#lg").mouseover(function(){
		$('#lg-block').show();
	}).mouseout(function(){
		$('#lg-block').hide();
	});

	/* fade actions */
	$(".title").fadeTo("fast", 0.8);
	$(".title").hover(
		function(){ $(this).fadeTo("fast", 0.4); }, 
		function(){	$(this).fadeTo("fast", 0.8); 
	});
	
	$(".riders-item").hover(
		function(){ $(this).fadeTo("fast", 0.8); }, 
		function(){	$(this).fadeTo("fast", 1); 
	});
	// $(".subnav-button").hover(
	//	function(){ $('#extra1').fadeIn(1000); }, 
	//	function(){	$('#extra1').fadeOut(0); 
	// });
	
	$.localScroll();
	$.scrollTo(0);

	/* c33 */
	$(".ceebox").ceebox({
						titles:false, 
						videoWidth: false, 
						fadeIn: false, 
						fadeOut: false, 
						animSpeed:2,
						overlayColor:"#2b3c52", 
						overlayOpacity:0.8, 
						borderColor:'#2b3c52', 
						boxColor:"#fff",
						onload:exitFlash,
						unload:startFlash
						});
	
	function exitFlash() {	
		$('#spotlight-inside').hide();
		$('#boards-flash2-inside').hide();
		$('#boards-flash1').hide();
	}
	function startFlash() {	
		$('#spotlight-inside').show();
		$('#boards-flash2-inside').show();
		$('#boards-flash1').show();
	}
	
	Cufon.replace('h2',{fontFamily: 'vs', hover: true});
	Cufon.replace('h4',{fontFamily: 'vs', hover: false});
	Cufon.replace('.riders-name',{fontFamily: 'vs', hover: true});
	Cufon.replace('.extra-bt',{fontFamily: 'vs', hover: true});
	Cufon.replace('.sublink',{fontFamily: 'vsbold', hover: true});
	Cufon.replace('.cufonthis',{fontFamily: 'vsbold', hover: true});
	Cufon.replace('.button',{fontFamily: 'vsbold', hover: true, textShadow: '1px 2px rgba(0, 0, 0, 0.3)'});
	Cufon.replace('.button-act',{fontFamily: 'vsbold', hover: true, textShadow: '1px 2px rgba(0, 0, 0, 0.3)'});
	
	$("#container").fadeIn();

});

function loadBoard(id) {
	switch(id) {	
		case 1:
		$('#boards-title').html('Onyx');
		break;
		case 2:
		$('#boards-title').html('Pro Princess');
		break;
		case 3:
		$('#boards-title').html('Pro X');
		break;
		case 4:
		$('#boards-title').html('Kite Wave Blue');
		break;
		case 5:
		$('#boards-title').html('Kite Wave Wood');
		break;
		case 6:
		$('#boards-title').html('Youri Zoon Pro X');
		break;
		case 7:
		$('#boards-title').html('Bumblebee');
		break;
		case 8:
		$('#boards-title').html('Low Rider');
		break;
	}

	Cufon.refresh();
	
	$('#board-extra').hide();
	$('#boards-flash2-inside').hide();
	$.scrollTo("#boards-title");
	
	$('#board-extra').load('../inc_boards_select.php?id=' + id, function() {
		$('#board-extra').slideDown(2000, function() {
			//$('#boards-flash2-inside').show();									   
		});
	});
	
	
}

function loadRDP(id) {
	switch(id) {		
		case '1':
		$('#boards-title').html('Ceyboard');
		break;
		case '2':
		$('#boards-title').html('Alfredio');
		break;
	}

	Cufon.refresh();
	
	$('#board-extra').hide();
	$('#boards-flash2-inside').hide();
	$.scrollTo("#boards-title");
	
	$('#board-extra').load('./inc_rdp_select.php?id=' + id, function() {
		$('#board-extra').fadeIn(2000, function() {
			//$('#boards-flash2-inside').show();									   
		});
	});
	
	
}