$(document).ready(function(){
	var cantidad = 11;
	for(i=1;i<cantidad;i++){
		if(i==1){
			valor = true;
		}else{
			valor=false;
		}
		$("#slider"+i).easySlider({
			controlsBefore:	'<p id="controls">',
			controlsAfter:	'</p>',
			auto: valor,
			prevId: 'prevBtn'+i,
			nextId: 'nextBtn'+i,
			prevText: '&nbsp;',
			nextText: '&nbsp;'
		});
	}
	
	$('.t').hide();
	$(".Individuales").show();
	
	var seleccionado = "Individuales";
	
	$('#botonera a').hover(function() {
		if($(this).text()!=seleccionado){
			$(this).css("color","#999");
		}
	}, function() {
		if($(this).text()!=seleccionado){
			$(this).css("color","#666");
		}
	});
		
	$("#botonera a").click(function(){
		seleccionado = $(this).text();
		$("#botonera a").css("color","#666");
		$(this).css("color","#009ee0");
		$('.t').hide();
		num = $(this).text();
		$("."+num).animate({
			opacity: 'show'
		},'slow');	
	});
	
	$('#header a').click(function(){
		$('#botonera').hide();
		$('.t').animate({
			opacity: 'show'
		},'slow');
		//$('h2').show();
	});
	
	var options = {
		clearForm: true,
        beforeSubmit: validate,
        success: showResponse
	};
	$('#mailForm').ajaxForm(options); 
		
	$(".lightbox").lightbox();
	
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:"h1", sFlashSrc:"sifr/sifr.swf", sColor:"#666666", sWmode:"transparent"}));
	};
	
	
});

function validate(formData) { 
    for (var i=0; i < formData.length; i++) { 
        if (!formData[i].value) { 
            $('#estado').html("* Please fill out all fields");
            return false; 
        } 
    }
}
function showResponse(){
	$('#estado').html("Thanks, your message has been sent");
}
