// JavaScript Document

function rockstarCallback() {

$('#rockload').hide();
	
	$('#rockstarslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});

}


function wireCallback() {

$('#wireload').hide();
	
	$('#wireslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});
	
}

function fsCallback() {

$('#fsload').hide();
	
	$('#fsslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});

}

function biabCallback() {

$('#biabload').hide();
	
	$('#biabslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});

}

function jeremyCallback() {

$('#jeremyload').hide();
	
	$('#jeremyslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});
	
}

function nfinityCallback() {

$('#nfinityload').hide();
	
	$('#nfinityslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});
}

function swacCallback() {

$('#swacload').hide();
	
	$('#swacslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});
	
}

function waveformCallback() {

$('#waveload').hide();
	
	$('#waveformslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});
	
}


function veerCallback() {

$('#veerload').hide();
	
	$('#veerslider').nivoSlider({
		effect:'fade',
		animSpeed:200,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		controlNav:false, //1,2,3...
		keyboardNav:false, //Use left & right arrows
		manualAdvance:true, //Force manual transitions
		directionNavHide: false //Only show on hover

		
	});

}


$(document).ready(function(){
	
$("#veerslider").find('img').batchImageLoad({
loadingCompleteCallback: veerCallback
});	
							   
$("#rockstarslider").find('img').batchImageLoad({
loadingCompleteCallback: rockstarCallback
});

$("#wireslider").find('img').batchImageLoad({
loadingCompleteCallback: wireCallback
});

$("#fsslider").find('img').batchImageLoad({
loadingCompleteCallback: fsCallback
});

$("#biabslider").find('img').batchImageLoad({
loadingCompleteCallback: biabCallback
});

$("#jeremyslider").find('img').batchImageLoad({
loadingCompleteCallback: jeremyCallback
});

$("#nfinityslider").find('img').batchImageLoad({
loadingCompleteCallback: nfinityCallback
});

$("#swacslider").find('img').batchImageLoad({
loadingCompleteCallback: swacCallback
});

$("#waveformslider").find('img').batchImageLoad({
loadingCompleteCallback: waveformCallback
});
				
$.timer(600, function (timer) {
$('.loading').animate( { backgroundColor: '#999' }, 600)
$('.loading').animate( { backgroundColor: '#000' }, 600);    
});



$('#human').bind('keyup', function() {

var current_value = $('#human').val();

$('#submitbutton').attr('disabled', 'disabled');

if(current_value == 8){

$('#submitbutton').removeAttr("disabled");
$('#submitbutton').css('display', 'block');

} 
else {
$('#submitbutton').css('display', 'none');
$('#submitbutton').attr('disabled', 'disabled');
}
});

$("#ebhform").validate();


$(".greenlink").mouseover(function(){
  
   $(this).animate( { backgroundColor: '#0CF' }, 600);
     
  }).mouseout(function(){
      $(this).animate( { backgroundColor: '#CF0'}, 600);
  });

$(".toplink").mouseover(function(){
	$(this).animate( { color: '#CCC' }, 300);
  }).mouseout(function(){
						  
	$(this).animate( { color: '#000'}, 300);
	 
	}).click(function() {

	$(this).animate( { color: '#CCC'}, 50)
	$(this).animate({ color: '#000'}, 50)
	$(this).animate({ color: '#CCC'}, 50)
	$(this).animate({ color: '#000'}, 50)
	$(this).animate({ color: '#CCC'}, 50)
	$(this).animate({ color: '#000'}, 50);


		   });

$(".textlink").mouseover(function(){
	$(this).animate( { backgroundColor: '#FFF'}, 300)		   
	}).mouseout(function(){
		$(this).animate( { backgroundColor: '#D9D9D9'}, 300);
	});


//FORM SUBMIT

 //if submit button is clicked  
     $('#submitbutton').click(function () {          
           
         //Get the data from all the fields  
         var prefix = $('#prefix');
		 var name = $('input[name=name]');  
         var email = $('input[name=email]');
		 var group1 = $('input[name=group1]:checked').val();
		 var group2 = $('input[name=group2]:checked').val();
       	 var message = $('textarea[name=message]');  
              
         //organize the data properly  
         var data = 'prefix=' + prefix.val() + '&name=' + name.val() + '&email=' + email.val() + '&group1=' + group1 + '&group2=' + group2 + '&message=' + encodeURIComponent(message.val());  
           
        
         //show the loading sign  
        // $('.loading').show();  
           
         //start the ajax  
         $.ajax({  
             //this is the php file that processes the data and send mail  
             url: "process.php",   
               
             //GET method is used  
             type: "GET",  
   
             //pass the data           
             data: data,       
               
             //Do not cache the page  
             cache: false,  
               
             //success  
             success: function (html) {                
                 //if process.php returned 1/true (send mail success)  
                 if (html==1) {                    
                     //hide the form  
                     $('#ebhform, #contactformheader').fadeOut('slow');                   
                       
                     //show the success message  
                     //$('#success').css('display', 'block');
					 $('#success').fadeIn('slow');  
                       
                 //if process.php returned 0/false (send mail failed)  
                 } else alert('ERROR');                 
             }         
         });  
           
         //cancel the submit button default behaviours  
         return false;
     });   
   



});

$(window).load(function() {
	
		$(".nivo-prevNav, .nivo-nextNav").mouseover(function(){
	$(this).animate( { backgroundColor: '#999'}, 200)		   
	}).mouseout(function(){
		$(this).animate( { backgroundColor: '#000'}, 200)
	});

		
});