

$(document).ready(function (){
							
	
	/*- Testimony Person-Company link -*/
	$('#testimonyContainer cite a, .commentBox cite a').attr('target', 'blank');
	
	$("#testimonyItems").easySlider();
	
	/*- Testimony Prev Btn -*/
	$('#prevBtn').hover(function(){
		$(this).addClass('overPrevBtn');},
		function(){
		$(this).removeClass('overPrevBtn');							 
	});
	
	/*- Testimony Next Btn -*/
	$('#nextBtn').hover(function(){
		$(this).addClass('overNextBtn');},
		function(){
		$(this).removeClass('overNextBtn');							 
	});
								 
	
	/*- Normal Btns -*/
	$('button').hover(function(){
		$(this).addClass('overNormalBtn');},
		function(){
		$(this).removeClass('overNormalBtn');							 
	});
	
	/*- Section Phrase -*/
	$('#sectionContent h3').hover(function(){
		$(this).addClass('overPhrase');},
		function(){
		$(this).removeClass('overPhrase');							 
	});
	
	/*- Input + Textareas Focus -*/
	$('input, textarea').focus(function(){
		$(this).addClass('inputOnFocus');			 
	});
	$('input, textarea').blur(function(){
		$(this).removeClass('inputOnFocus');			 
	});
	
	$('.box').each(function (){
		var roundedCorners = '<div class="tlCorner"></div><div class="trCorner"></div><div class="blCorner"></div><div class="brCorner"></div>';
		$(roundedCorners).appendTo(this);
	});
	
	/*- Archivo upload grande -*/
	$('.fieldHint a').click(function(){
		$('#orderExtraFileSpace').show('slow');
	});
				
	/*- Calculo de precios -*/
	$('#mainPagesNum, #subPagesNum').change(function (){
		var mainPagesVal = $('#mainPagesNum').val();
		var subPagesVal = $('#subPagesNum').val();
		var mainPagePrize = (mainPagesVal * 150);
		var subPagePrize = (subPagesVal * 50)
		
		var subTotalPrize = (mainPagePrize + subPagePrize);
		var subTotalText = $('.prizeItem strong span');
		
		$(subTotalText).text(subTotalPrize);
		
		var totalPrize = (subTotalPrize -  (subTotalPrize * 0.20));
		var totalText = $('#finalPrize strong');
		
		$(totalText).text(totalPrize);
		$('input[name="amount"]').val(totalPrize);
					
		var mainPagesDays = (mainPagesVal * 1);
		var subPagesDays = ((subPagesVal * 1) / 2);
		var totalDays = Math.ceil(mainPagesDays + subPagesDays);
		var textDays =  $('.timeItem strong span');
		
		$(textDays).text(totalDays);
		$('input[name="deadline"]').val(totalDays);

	});
	
	/*- Validar formulario de pedido -*/
	$("#orderForm, #contactForm").validate();
	
});