$(document).ready(function(){
		//start page

<!--loading indicator-->					
		$().ajaxStart(function(){ 
			$("#loader").show(); 
				}).ajaxStop(function() { 
			$("#loader").hide(); 
		}); 




// overlay function
$.nyroModalSettings({
			debug: false,
			width: 654,
			height:	380,
			type: 'iframe'
			
			});
//end page 

// comm btn - front page
		 $("#btn_comm").click(function() {
			
			$('#footer_left').fadeOut("slow");			
			$('#footer_left_comm').delay(800).fadeIn('slow');
			$('#footer_left_comm p').delay(800).fadeIn('slow');
			$("#ta_comm").delay(800).fadeIn('slow');
			
			$('#banner').fadeOut("slow");
			$('#banner_comm').delay(800).fadeIn('slow');
			$('#banner_comm p').delay(800).fadeIn('slow');
			
			$('#tabs').slideUp("slow");
			$('#tabs_comm').delay(800).slideDown("slow");
			
			$("#navDiv").click(function(){
				$('#footer_left_comm').fadeOut('slow');
				$('#footer_left_comm p').fadeOut('slow');
				$("#ta_comm").fadeOut('slow');
				$('#footer_left').delay(800).fadeIn("slow");
				$("#tabs").delay(800).fadeIn('slow');			
			});
			
			$(".navLink").click(function(){
				$('#footer_left_comm').fadeOut('slow');
				$('#footer_left_comm p').fadeOut('slow');
				$("#ta_comm").fadeOut('slow');
				$('#footer_left').delay(800).fadeIn("slow");
				$("#tabs").delay(800).fadeIn('slow');			
			});

			return false;	
		   });
		   
		   
//Fonts	
			Cufon.replace('.header_title', {
			color: '-linear-gradient(#006ab2, #004e83)'
			});
			Cufon.replace('#font_transform', {
				color: '-linear-gradient(#006ab2, #004e83)'
			}); 
			Cufon.replace('#header_thankyou', {
				color: '-linear-gradient(#006ab2, #004e83)'
			}); 
			
			Cufon.replace('.header_checkout', {
				color: '-linear-gradient(#006ab2, #004e83)'
			});
			Cufon.replace('.header_checkout_small', {
				color: '-linear-gradient(#006ab2, #004e83)'
			});		
			
			Cufon.replace('h1', {
			color: 'white'
			});
			Cufon.replace('h2', {
			color: '-linear-gradient(#006ab2, #004e83)'
			});
			
			Cufon.replace('.header_title_small', {
			color: '-linear-gradient(#006ab2, #004e83)'
			});
			
// order page		
		 $("#order_btn").click(function() {
			$('.button_ordernow').hide('slow');
			$('.other_tanks').hide('slow');
			$('#show_form').show('slow');
			return false;	
		   });

// open coupon		
		 $("#open_coupon").click(function() {
			$('#show_coupon').toggle('slow');
			return false;	
		   });
		   
// open pin		
		 $("#Card_Number").click(function() {
			$('#pin').toggle('slow');
			return false;	
		   })
		   		   		   
//account sign up  
       //change by Eduardo
	   $("#shipping_address_btn").click(function() {
		$('#shipping_address_YN').hide();
		$('#shipping_address').html($('#shipping_address_data').html());
		$('#shipping_address').show('fast');
		return false;	
	   });
	   /*$("#shipping_address_btn").click(function() {
		$('#shipping_address_YN').hide();
		$('#shipping_address').show('fast');
		return false;	
	   });*/
	   

//checkout page
			$(".inputText").click(function(){	
			$(".clear textarea").each(function(){
			var pID = $(this).attr("pid"); 
			var $thisTextArea = $(this);
				$(".clear input").each(function(){
				   if($(this).attr("pid") == pID){
				   		$(this).val($thisTextArea.val());
						$thisTextArea.remove();
						$(this).show();
						$("#minusBtn").remove();
				   } 			
				});		
			});		
		    var $thisInput = $(this);
			$thisInput.hide();
			$("#"+$thisInput.attr("pID")).append("<textarea rows='3' pid='"+$thisInput.attr("pID")+"' cols='15' id='textArea'></textarea>");	
			$("#textArea").val($thisInput.val());
			$("#"+$thisInput.attr("pID")).append("<img border='0' src='images/minus.gif' id='minusBtn' class='minus'>");
			$("#minusBtn").click(function(){
				$thisInput.val($("#textArea").val());
				$("#textArea").remove();
				$thisInput.show();
				$(this).remove();
			});	
		});
	});

