// JavaScript Document


$(document).ready(function() {
						   
	$.watermark.options.className = 'emptygray';
	$('#datefrom').watermark(' date of arrival');
	$('#realname').watermark(' your name');
	$('#email').watermark(' your email');
	$('#email2').watermark(' retype your email');
   
	$("#contactoform").validate({
		rules: { date_of_arrival: { required: true }, 
				 realname: { required: true, minlength: 3 }, 
				 email: { required: true, email: true }, 
				 email2: { required: true, equalTo: "#email" } },

		messages: { date_of_arrival: "Arrival date?",
					realname: "Please give your full name.",
					email: { required: "We need your email <br />address to contact you",
						     email: "Your email address must be in the format of name@domain.com" },
					email2: { required: "please confirm your email.",
							  equalTo: "email addresses don't match" }       },
	errorClass: "lameinput",
	wrapper: "span"
					});

<!-- Discount Click changer -->

		$(".diskounto").click(function() {
			var nochevalue = $('#nightnumero').val();
			var nochenumber = parseInt(nochevalue, 10);			
			if (nochenumber > 3) { 
					<!-- change discount to 15 percent -->
					$("#discount_described").text("Discount: staying 4+ nights");
					$("#discount_number").text("15");
					
					<!-- fade OUT discount advisory in selector area -->
					$('#discount_aviso').hide(); 
					<!-- fade in discount divs in price table -->
					$('#pre_discount_describe').show(); 
					$('#pre_discount_amount').show(); 
					$('#discounttype').show(); 
					$('#discountamount').show();
					$('#discountlabel').show();
					$('#discountcalc').show();
			} else {   if (nochenumber == 3) 
					      { if  ( ! $("#disco1").is(':checked') )  // discount labeled "No Discount" isn't checked
								{   <!--  change the discount describer in the price table  -->
									if ( $("#disco2").is(':checked') ) 
										{ $("#discount_described").text("Discount: Ecuadorian National"); }   
								   if ( $("#disco3").is(':checked') ) 
										{ $("#discount_described").text("Discount: S. American Explorer"); }   
								   if ( $("#disco4").is(':checked') ) 
										{ $("#discount_described").text("Discount: ISIC international student"); }   
								   if ( $("#disco5").is(':checked') ) 
										{ $("#discount_described").text("Discount: ECO Club Member"); }   
								   if ( $("#disco6").is(':checked') ) 
										{ $("#discount_described").text("Discount: 60+ years of age"); }

									<!-- change discount to 10 percent -->
									$("#discount_number").text("10");
									<!-- fade OUT discount advisory in selector area -->
									$('#discount_aviso').hide(); 
									<!-- fade in discount divs in price table -->
									$('#pre_discount_describe').show(); 
									$('#pre_discount_amount').show(); 
									$('#discounttype').show(); 
									$('#discountamount').show();
									$('#discountlabel').show();
									$('#discountcalc').show();

								} else  // if discount button labeled "No Discount" is checked
										{ <!-- change discount to 0 percent -->
										 $("#discount_number").text("0");
										<!-- fade OUT discount advisory in selector area -->
										$('#discount_aviso').hide(); 
										 <!-- fade out discount divs in price table -->
										 $('#pre_discount_describe').hide(); 
										 $('#pre_discount_amount').hide(); 
										 $('#discounttype').hide(); 
										 $('#discountamount').hide();	
										 $('#discountlabel').hide();
										 $('#discountcalc').hide();  }

	          } else // if number of nights is LESS THAN 3  
			  		 { <!-- change discount to 0 percent -->
						$("#discount_number").text("0");
						<!-- fade IN discount advisory in selector area -->
						$('#discount_aviso').show(); 
						<!-- fade out discount divs in price table -->
						$('#pre_discount_describe').hide(); 
						$('#pre_discount_amount').hide(); 
						$('#discounttype').hide(); 
						$('#discountamount').hide();	
						$('#discountlabel').hide();
						$('#discountcalc').hide();       }
					}
				
			moneycalc();

});

<!-- Number of Nights   -->

		$(".descuento").change(function() {
			var nochevalue = $('#nightnumero').val();
			var nochenumber = parseInt(nochevalue, 10);			
			if (nochenumber > 3) { 
					<!-- change discount to 15 percent -->
					$("#discount_described").text("Discount: staying 4+ nights");
					$("#discount_number").text("15");
					
					<!-- fade OUT discount advisory in selector area -->
					$('#discount_aviso').hide(); 
					<!-- fade in discount divs in price table -->
					$('#pre_discount_describe').show(); 
					$('#pre_discount_amount').show(); 
					$('#discounttype').show(); 
					$('#discountamount').show();
					$('#discountlabel').show();
					$('#discountcalc').show();
			} else {   if (nochenumber == 3) 
					      { if  ( ! $("#disco1").is(':checked') )  // discount labeled "No Discount" isn't checked
								{   <!--  change the discount describer in the price table  -->
									if ( $("#disco2").is(':checked') ) 
										{ $("#discount_described").text("Discount: Ecuadorian National"); }   
								   if ( $("#disco3").is(':checked') ) 
										{ $("#discount_described").text("Discount: S. American Explorer"); }   
								   if ( $("#disco4").is(':checked') ) 
										{ $("#discount_described").text("Discount: ISIC international student"); }   
								   if ( $("#disco5").is(':checked') ) 
										{ $("#discount_described").text("Discount: ECO Club Member"); }   
								   if ( $("#disco6").is(':checked') ) 
										{ $("#discount_described").text("Discount: 60+ years of age"); }

									<!-- change discount to 10 percent -->
									$("#discount_number").text("10");
									<!-- fade OUT discount advisory in selector area -->
									$('#discount_aviso').hide(); 
									<!-- fade in discount divs in price table -->
									$('#pre_discount_describe').show(); 
									$('#pre_discount_amount').show(); 
									$('#discounttype').show(); 
									$('#discountamount').show();
									$('#discountlabel').show();
									$('#discountcalc').show();

								} else  // if discount button labeled "No Discount" is checked
										{ <!-- change discount to 0 percent -->
										 $("#discount_number").text("0");
										<!-- fade OUT discount advisory in selector area -->
										$('#discount_aviso').hide(); 
										 <!-- fade out discount divs in price table -->
										 $('#pre_discount_describe').hide(); 
										 $('#pre_discount_amount').hide(); 
										 $('#discounttype').hide(); 
										 $('#discountamount').hide();	
										 $('#discountlabel').hide();
										 $('#discountcalc').hide();  }

	          } else // if number of nights is LESS THAN 3  
			  		 { <!-- change discount to 0 percent -->
						$("#discount_number").text("0");
						<!-- fade IN discount advisory in selector area -->
						$('#discount_aviso').show(); 
						<!-- fade out discount divs in price table -->
						$('#pre_discount_describe').hide(); 
						$('#pre_discount_amount').hide(); 
						$('#discounttype').hide(); 
						$('#discountamount').hide();	
						$('#discountlabel').hide();
						$('#discountcalc').hide();       }
					}
				
			moneycalc();

});
<!-- First Room - Number of Guests   -->

	$("#guestnumero").change(function() {
		if($(this).val() == '1') 
			{   $("#roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#roomtipo").removeOption("Triple Room - 3 occupants");
				$("#roomtipo").removeOption("Double Room - 2 occupants");   
				if (  $("#roomtipo option[value=Single Room - 1 occupant]").length > 0 )
				  { } else {  $("#roomtipo").addOption("Single Room - 1 occupant", "Single -  1 person to a room"); }   }
		if($(this).val() == '2') 
			{   $("#roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#roomtipo").removeOption("Triple Room - 3 occupants");
				$("#roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#roomtipo option[value=Double Room - 2 occupants]").length > 0 )
				  { } else {  $("#roomtipo").addOption("Double Room - 2 occupants", "Double - 2 people to a room"); }   }
		if($(this).val() == '3') 
			{   $("#roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#roomtipo").removeOption("Double Room - 2 occupants");
				$("#roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#roomtipo option[value=Triple Room - 3 occupants]").length > 0 )
				  { } else {  $("#roomtipo").addOption("Triple Room - 3 occupants", "Triple --- 3 people to a room"); }  }
		if($(this).val() == '4') 
			{	$("#roomtipo").removeOption("Triple Room - 3 occupants");
				$("#roomtipo").removeOption("Double Room - 2 occupants");
				$("#roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }
		if($(this).val() == '5') 
			{	$("#roomtipo").removeOption("Triple Room - 3 occupants");
				$("#roomtipo").removeOption("Double Room - 2 occupants");
				$("#roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }
		if($(this).val() == '6') 
			{   $("#roomtipo").removeOption("Triple Room - 3 occupants");
				$("#roomtipo").removeOption("Double Room - 2 occupants");
				$("#roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }

		$("#roomtipo").selectOptions("Bunk House", true);
		$("#bathtipo").selectOptions("shared bathroom", true);
		$("#bathtipo").removeOption("private bathroom");

		var nighto = $("#nightnumero option:selected").val(); $("#nightcount").text(nighto);
		var guesto = $("#guestnumero option:selected").val(); $("#guestcount").text(guesto);
		var roomo = $("#roomtipo option:selected").val();     $("#roomnamer").text(roomo);
		var batho = $("#bathtipo option:selected").val();    $("#bathnamer").text(batho);

	});

<!-- Second Room - Number of Guests   -->
	
	$("#second_guestnumero").change(function() {
		if($(this).val() == '1') 
			{   $("#second_roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#second_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#second_roomtipo").removeOption("Double Room - 2 occupants");   
				if (  $("#second_roomtipo option[value=Single Room - 1 occupant]").length > 0 )
				  { } else {  $("#second_roomtipo").addOption("Single Room - 1 occupant", "Single -  1 person to a room"); }   }
		if($(this).val() == '2') 
			{   $("#second_roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#second_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#second_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#second_roomtipo option[value=Double Room - 2 occupants]").length > 0 )
				  { } else {  $("#second_roomtipo").addOption("Double Room - 2 occupants", "Double - 2 people to a room"); }   }
		if($(this).val() == '3') 
			{   $("#second_roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#second_roomtipo").removeOption("Double Room - 2 occupants");
				$("#second_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#second_roomtipo option[value=Triple Room - 3 occupants]").length > 0 )
				  { } else {  $("#second_roomtipo").addOption("Triple Room - 3 occupants", "Triple --- 3 people to a room"); }  }
		if($(this).val() == '4') 
			{	$("#second_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#second_roomtipo").removeOption("Double Room - 2 occupants");
				$("#second_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#second_roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#second_roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }
		if($(this).val() == '5') 
			{	$("#second_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#second_roomtipo").removeOption("Double Room - 2 occupants");
				$("#second_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#second_roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#second_roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }
		if($(this).val() == '6') 
			{   $("#second_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#second_roomtipo").removeOption("Double Room - 2 occupants");
				$("#second_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#second_roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#second_roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }

		$("#second_roomtipo").selectOptions("Bunk House", true);
		$("#second_bathtipo").selectOptions("shared bathroom", true);
		$("#second_bathtipo").removeOption("private bathroom");

		var second_guesto = $("#second_guestnumero option:selected").val(); $("#second_guestcount").text(second_guesto);
		var second_roomo = $("#second_roomtipo option:selected").val();     $("#second_roomnamer").text(second_roomo);
		var second_batho = $("#second_bathtipo option:selected").val();    $("#second_bathnamer").text(second_batho);

	});

<!-- Third Room - Number of Guests   -->

	$("#third_guestnumero").change(function() {
		if($(this).val() == '1') 
			{   $("#third_roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#third_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#third_roomtipo").removeOption("Double Room - 2 occupants");   
				if (  $("#third_roomtipo option[value=Single Room - 1 occupant]").length > 0 )
				  { } else {  $("#third_roomtipo").addOption("Single Room - 1 occupant", "Single -  1 person to a room"); }   }
		if($(this).val() == '2') 
			{   $("#third_roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#third_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#third_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#third_roomtipo option[value=Double Room - 2 occupants]").length > 0 )
				  { } else {  $("#third_roomtipo").addOption("Double Room - 2 occupants", "Double - 2 people to a room"); }   }
		if($(this).val() == '3') 
			{   $("#third_roomtipo").removeOption("Quad Room - 4+ occupants");
				$("#third_roomtipo").removeOption("Double Room - 2 occupants");
				$("#third_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#third_roomtipo option[value=Triple Room - 3 occupants]").length > 0 )
				  { } else {  $("#third_roomtipo").addOption("Triple Room - 3 occupants", "Triple --- 3 people to a room"); }  }
		if($(this).val() == '4') 
			{	$("#third_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#third_roomtipo").removeOption("Double Room - 2 occupants");
				$("#third_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#third_roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#third_roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }
		if($(this).val() == '5') 
			{	$("#third_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#third_roomtipo").removeOption("Double Room - 2 occupants");
				$("#third_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#third_roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#third_roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }
		if($(this).val() == '6') 
			{   $("#third_roomtipo").removeOption("Triple Room - 3 occupants");
				$("#third_roomtipo").removeOption("Double Room - 2 occupants");
				$("#third_roomtipo").removeOption("Single Room - 1 occupant");
				if (  $("#third_roomtipo option[value=Quad Room - 4+ occupants]").length > 0 )
				  { } else {  $("#third_roomtipo").addOption("Quad Room - 4+ occupants", "Quad --- 4+ people to a room"); }   }

		$("#third_roomtipo").selectOptions("Bunk House", true);
		$("#third_bathtipo").selectOptions("shared bathroom", true);
		$("#third_bathtipo").removeOption("private bathroom");

		var third_guesto = $("#third_guestnumero option:selected").val(); $("#third_guestcount").text(third_guesto);
		var third_roomo = $("#third_roomtipo option:selected").val();     $("#third_roomnamer").text(third_roomo);
		var third_batho = $("#third_bathtipo option:selected").val();    $("#third_bathnamer").text(third_batho);

	});

<!-- First Room - Bathrooms available   -->

		$("#roomtipo").change(function() {
		   if($(this).val() == 'Bunk House') 
			  { $("#bathtipo").removeOption("private bathroom"); 
				$("#bathtipo").selectOptions("shared bathroom", true);
				var batho = $("#bathtipo option:selected").val();   $("#bathnamer").text(batho);		
		   } else 
			  { if (  $("#bathtipo option[value=private bathroom]").length > 0 )
								{   }
				else 			{  $("#bathtipo").addOption("private bathroom", "  Private bathroom & shower ");
								   $("#bathtipo").selectOptions("shared bathroom", true);
								   var batho = $("#bathtipo option:selected").val();   $("#bathnamer").text(batho);  }
		  }    
		});

<!-- Second Room - Bathrooms available   -->

		$("#second_roomtipo").change(function() {
		   if($(this).val() == 'Bunk House') 
			  { $("#second_bathtipo").removeOption("private bathroom"); 
				$("#second_bathtipo").selectOptions("shared bathroom", true);
				var second_batho = $("#second_bathtipo option:selected").val();   
				$("#second_bathnamer").text(second_batho);		
		   } else 
			  { if (  $("#second_bathtipo option[value=private bathroom]").length > 0 )
						{   }
				else 	{  $("#second_bathtipo").addOption("private bathroom", "  Private bathroom & shower ");
						   $("#second_bathtipo").selectOptions("shared bathroom", true);
						   var second_batho = $("#second_bathtipo option:selected").val();   
						   $("#second_bathnamer").text(second_batho);  }
		  }    
		});

<!-- Third Room - Bathrooms available   -->

		$("#third_roomtipo").change(function() {
		   if($(this).val() == 'Bunk House') 
			  { $("#third_bathtipo").removeOption("private bathroom"); 
				$("#third_bathtipo").selectOptions("shared bathroom", true);
				var second_batho = $("#third_bathtipo option:selected").val();   
				$("#third_bathnamer").text(second_batho);		
		   } else 
			  { if (  $("#third_bathtipo option[value=private bathroom]").length > 0 )
						{   }
				else 	{  $("#third_bathtipo").addOption("private bathroom", "  Private bathroom & shower ");
						   $("#third_bathtipo").selectOptions("shared bathroom", true);
						   var third_batho = $("#third_bathtipo option:selected").val();   
						   $("#third_bathnamer").text(third_batho);  }
		  }    
		});

<!-- Turn on and off the SECOND room choices -->

	 $(".opreserv2").click(function () { 
			   if($('#otroroom').is(':checked')) 
			   	  {	$('#second_spacer1').show();  // pricing table
				  	$('#room1subtotal').show();  // pricing table
					$('#second_spacer8').show();  // spacer in pricing table
					$('#room2subtotal').show();  // spacer in pricing table
					$('#second_spacer3').show();  // spacer in guest number selectors
				  	$('#second_spacer4').show();  // spacer in room type selectors
				  	$('#second_spacer5').show();  // spacer below room type selectors
					$('#second_guestno').show();
				    $('#second_room').show();
				    $('#second_roomrow').show();
				    $('#second_roomrow2').show();
				    $('#second_roomfeatures').show();
				    $('#second_roomcost').show();

					<!-- change language in FIRST room to say "1st room" instead of "number of guests" -->
					$('#1stroomtally').html("Guests in 1st Room"); 
				    $('#1stroomguests').html("Guests in 1st Room?"); 
					$('#1stroomtypo').html("1st Room - Type of Lodging:"); }
						else 
				  {					  
					<!-- zero out prices and guests in SECOND and THIRD rooms  -->
					$("#second_roompricer").text("0");
					$("#second_guestcount").text("0");
					$("#third_roompricer").text("0");
					$("#third_guestcount").text("0");
					
					<!-- Recalculate total price -->
					moneycalc();		
					
					<!-- make sure THIRD room checkbox is unchecked -->
					$('#otroroom2').attr('checked',false); 
					
					<!-- Deselect choices in SECOND room -->
					$("#second_guestnumero").selectOptions("0", true);
				  	$('#second_bathtipo').selectOptions("shared bathroom", true);
				  	$('#second_roomtipo').selectOptions("Bunk House", true);

					<!-- Deselect choices in THIRD room -->
					$("#third_guestnumero").selectOptions("0", true);
				  	$('#third_bathtipo').selectOptions("shared bathroom", true);
				  	$('#third_roomtipo').selectOptions("Bunk House", true);

					<!-- reset listings in SECOND room to generic "room" and "bathroom" -->
					$("#second_roomnamer").text("room");
					$("#second_bathnamer").text("bathroom");

					<!-- reset listings in THIRD room to generic "room" and "bathroom" -->
					$("#third_roomnamer").text("room");
					$("#third_bathnamer").text("bathroom");

					<!--fade out SECOND ROOM options -->
					$('#second_guestno').hide();
				    $('#second_room').hide();
				    $('#second_roomrow').hide();
					$('#second_roomrow2').hide();
				    $('#second_roomcost').hide();
				    $('#second_roomfeatures').hide();
				    $('#second_spacer1').hide();  // spacer in pricing table
					$('#second_spacer5').hide();  // spacer BELOW whole mess
				  	$('#room1subtotal').hide();  // pricing table
					$('#second_spacer8').hide();  // spacer in pricing table
					$('#room2subtotal').hide();  // pricing table
					$('#second_spacer3').hide();  // spacer in guest number selectors
				  	$('#second_spacer4').hide();  // spacer in room type selectors
				  	$('#second_spacer5').hide();  // spacer below room type selectors

					<!-- fade out THIRD ROOM options -->
				  	$('#third_guestno').hide();
				    $('#third_room').hide();
				    $('#third_roomrow').hide();
				    $('#third_roomrow2').hide();
				    $('#third_roomcost').hide();
				    $('#third_roomfeatures').hide();
				    $('#second_spacer6').hide();  // spacer in guest number selectors
				    $('#second_spacer7').hide();  // spacer in room type selectors
					$('#second_spacer9').hide();  // spacer in pricing table
					$('#room3subtotal').hide();  // pricing table

					<!-- Return FIRST room descriptions to default (remove "first room" language) -->
					$('#1stroomtally').html("Number of Guests");  
				    $('#1stroomguests').html("Number of Guests?");  
					$('#1stroomtypo').html("Lodging Options:"); }
									  })

<!-- Turn on and off the THIRD room choices -->

	 $(".opreserv3").click(function () { 
			   if($('#otroroom2').is(':checked')) 
			   	  {	$('#second_spacer6').show();  // spacer in guest number selectors
				    $('#second_spacer7').show();  // spacer in room type selectors
					$('#second_spacer8').show();  // spacer in pricing table
					$('#second_spacer9').show();  // spacer in pricing table
					$('#room3subtotal').show();

					$('#third_guestno').show();
				    $('#third_room').show();
				    $('#third_roomrow').show();
				    $('#third_roomrow2').show();
				    $('#third_roomfeatures').show();
				    $('#third_roomcost').show();   }
						else 
				  { 
					<!-- zero out prices of THIRD room -->
					$("#third_roompricer").text("0");
					$("#third_guestcount").text("0");

					<!-- Recalculate total price -->
					moneycalc();		

					<!-- Deselect choices in THIRD room -->
					$("#third_guestnumero").selectOptions("0", true);
				  	$('#third_bathtipo').selectOptions("shared bathroom", true);
				  	$('#third_roomtipo').selectOptions("Bunk House", true);

					<!-- reset listings in THIRD room to generic "room" and "bathroom" -->
					$("#third_roomnamer").text("room");
					$("#third_bathnamer").text("bathroom");

					<!-- Fade out all choices for THIRD room  -->
				  	$('#third_guestno').hide();
				    $('#third_room').hide();
				    $('#third_roomrow').hide();
				    $('#third_roomrow2').hide();
				    $('#third_roomcost').hide();
				    $('#third_roomfeatures').hide();
				    $('#second_spacer6').hide();  // spacer in guest number selectors
				    $('#second_spacer7').hide();  // spacer in room type selectors
					$('#second_spacer8').hide();  // spacer in pricing table
					$('#second_spacer9').hide();  // spacer in pricing table
					$('#room3subtotal').hide();
							}
									  })

<!--  =========================================  -->
<!--    ATTENTION ANDRES                         -->
<!--    If you want to change room prices.       -->
<!--    The following 3 functions                -->
<!--    are where you need to change.            -->
<!--  =========================================  -->

<!--First Room - Assign prices -->
					
	 $(".opreservo").change(function () { 
			   if($("#roomtipo").val() == 'Bunk House') {  $("#roompricer").text("35"); }
				if($("#roomtipo").val() == 'Quad Room - 4+ occupants')  
			   		{  if($("#bathtipo").val() == 'shared bathroom')  
				   		{  $("#roompricer").text("40"); }  else {  $("#roompricer").text("60"); }  }
				if($("#roomtipo").val() == 'Triple Room - 3 occupants')  
			   		{  if($("#bathtipo").val() == 'shared bathroom')  
				   		{  $("#roompricer").text("50"); }  else {  $("#roompricer").text("70"); }  }
				if($("#roomtipo").val() == 'Double Room - 2 occupants')  
			   		{  if($("#bathtipo").val() == 'shared bathroom')  
				   		{  $("#roompricer").text("60"); }  else {  $("#roompricer").text("80"); }  }
				if($("#roomtipo").val() == 'Single Room - 1 occupant')  
			   		{  if($("#bathtipo").val() == 'shared bathroom')  
				   		{  $("#roompricer").text("70"); }  else {  $("#roompricer").text("100"); }  }
				var nighto = $("#nightnumero option:selected").val(); $("#nightcount").text(nighto);
				var guesto = $("#guestnumero option:selected").val(); $("#guestcount").text(guesto);
				var roomo = $("#roomtipo option:selected").val();     $("#roomnamer").text(roomo);
				var batho = $("#bathtipo option:selected").val();    $("#bathnamer").text(batho);
					
				moneycalc();
				
	  })    .change();

<!--Second Room - Assign prices -->

	 $(".second_opreservo").change(function () { 
			   if($("#second_roomtipo").val() == 'Bunk House') {  $("#second_roompricer").text("35"); }
				if($("#second_roomtipo").val() == 'Quad Room - 4+ occupants')  
			   		{  if($("#second_bathtipo").val() == 'shared bathroom')  
				   		{  $("#second_roompricer").text("40"); }  else {  $("#second_roompricer").text("60"); }  }
				if($("#second_roomtipo").val() == 'Triple Room - 3 occupants')  
			   		{  if($("#second_bathtipo").val() == 'shared bathroom')  
				   		{  $("#second_roompricer").text("50"); }  else {  $("#second_roompricer").text("70"); }  }
				if($("#second_roomtipo").val() == 'Double Room - 2 occupants')  
			   		{  if($("#second_bathtipo").val() == 'shared bathroom')  
				   		{  $("#second_roompricer").text("60"); }  else {  $("#second_roompricer").text("80"); }  }
				if($("#second_roomtipo").val() == 'Single Room - 1 occupant')  
			   		{  if($("#second_bathtipo").val() == 'shared bathroom')  
				   		{  $("#second_roompricer").text("70"); }  else {  $("#second_roompricer").text("100"); }  }
				var second_nighto = $("#second_nightnumero option:selected").val(); $("#second_nightcount").text(second_nighto);
				var second_guesto = $("#second_guestnumero option:selected").val(); $("#second_guestcount").text(second_guesto);
				var second_roomo = $("#second_roomtipo option:selected").val();     $("#second_roomnamer").text(second_roomo);
				var second_batho = $("#second_bathtipo option:selected").val();    $("#second_bathnamer").text(second_batho);
					
				moneycalc();
				
	  })    .change();

<!--Third Room - Assign prices -->

	 $(".third_opreservo").change(function () { 
			   if($("#third_roomtipo").val() == 'Bunk House') {  $("#third_roompricer").text("35"); }
				if($("#third_roomtipo").val() == 'Quad Room - 4+ occupants')  
			   		{  if($("#third_bathtipo").val() == 'shared bathroom')  
				   		{  $("#third_roompricer").text("40"); }  else {  $("#third_roompricer").text("60"); }  }
				if($("#third_roomtipo").val() == 'Triple Room - 3 occupants')  
			   		{  if($("#third_bathtipo").val() == 'shared bathroom')  
				   		{  $("#third_roompricer").text("50"); }  else {  $("#third_roompricer").text("70"); }  }
				if($("#third_roomtipo").val() == 'Double Room - 2 occupants')  
			   		{  if($("#third_bathtipo").val() == 'shared bathroom')  
				   		{  $("#third_roompricer").text("60"); }  else {  $("#third_roompricer").text("80"); }  }
				if($("#third_roomtipo").val() == 'Single Room - 1 occupant')  
			   		{  if($("#third_bathtipo").val() == 'shared bathroom')  
				   		{  $("#third_roompricer").text("70"); }  else {  $("#third_roompricer").text("100"); }  }
				var third_nighto = $("#third_nightnumero option:selected").val(); $("#third_nightcount").text(third_nighto);
				var third_guesto = $("#third_guestnumero option:selected").val(); $("#third_guestcount").text(third_guesto);
				var third_roomo = $("#third_roomtipo option:selected").val();     $("#third_roomnamer").text(third_roomo);
				var third_batho = $("#third_bathtipo option:selected").val();    $("#third_bathnamer").text(third_batho);

				moneycalc();
		
	  })    .change();

<!-- END of reservation functions -->

});

function shutwin2() {
					<!-- make sure SECOND and THIRD room checkboxes are unchecked -->
					$('#otroroom').attr('checked',false); 
					$('#otroroom2').attr('checked',false); 

					<!-- zero out prices and guests in SECOND and THIRD rooms  -->
					$("#second_roompricer").text("0");
					$("#second_guestcount").text("0");
					$("#third_roompricer").text("0");
					$("#third_guestcount").text("0");
					
					<!-- Recalculate total price -->
					moneycalc();		
										
					<!-- Deselect choices in SECOND room -->
					$("#second_guestnumero").selectOptions("0", true);
				  	$('#second_bathtipo').selectOptions("shared bathroom", true);
				  	$('#second_roomtipo').selectOptions("Bunk House", true);

					<!-- Deselect choices in THIRD room -->
					$("#third_guestnumero").selectOptions("0", true);
				  	$('#third_bathtipo').selectOptions("shared bathroom", true);
				  	$('#third_roomtipo').selectOptions("Bunk House", true);

					<!-- reset listings in SECOND room to generic "room" and "bathroom" -->
					$("#second_roomnamer").text("room");
					$("#second_bathnamer").text("bathroom");

					<!-- reset listings in THIRD room to generic "room" and "bathroom" -->
					$("#third_roomnamer").text("room");
					$("#third_bathnamer").text("bathroom");

					<!--fade out SECOND ROOM options -->
					$('#second_guestno').hide();
				    $('#second_room').hide();
				    $('#second_roomrow').hide();
					$('#second_roomrow2').hide();
				    $('#second_roomcost').hide();
				    $('#second_roomfeatures').hide();
				    $('#second_spacer1').hide();  // spacer in pricing table
					$('#second_spacer5').hide();  // spacer BELOW whole mess
				  	$('#room1subtotal').hide();  // pricing table
					$('#second_spacer8').hide();  // spacer in pricing table
					$('#room2subtotal').hide();  // pricing table
					$('#second_spacer3').hide();  // spacer in guest number selectors
				  	$('#second_spacer4').hide();  // spacer in room type selectors
				  	$('#second_spacer5').hide();  // spacer below room type selectors

					<!-- fade out THIRD ROOM options -->
				  	$('#third_guestno').hide();
				    $('#third_room').hide();
				    $('#third_roomrow').hide();
				    $('#third_roomrow2').hide();
				    $('#third_roomcost').hide();
				    $('#third_roomfeatures').hide();
				    $('#second_spacer6').hide();  // spacer in guest number selectors
				    $('#second_spacer7').hide();  // spacer in room type selectors
					$('#second_spacer9').hide();  // spacer in pricing table
					$('#room3subtotal').hide();  // pricing table

					<!-- Return FIRST room descriptions to default (remove "first room" language) -->
					$('#1stroomtally').html("Number of Guests");  
				    $('#1stroomguests').html("Number of Guests?");  
					$('#1stroomtypo').html("Lodging Options:");
}

function shutwin3() {
					<!-- make sure THIRD room checkbox is unchecked -->
					$('#otroroom2').attr('checked',false); 

					<!-- zero out prices of THIRD room -->
					$("#third_roompricer").text("0");
					$("#third_guestcount").text("0");

					<!-- Recalculate total price -->
					moneycalc();		

					<!-- Deselect choices in THIRD room -->
					$("#third_guestnumero").selectOptions("0", true);
				  	$('#third_bathtipo').selectOptions("shared bathroom", true);
				  	$('#third_roomtipo').selectOptions("Bunk House", true);

					<!-- reset listings in THIRD room to generic "room" and "bathroom" -->
					$("#third_roomnamer").text("room");
					$("#third_bathnamer").text("bathroom");

					<!-- Fade out all choices for THIRD room  -->
				  	$('#third_guestno').hide();
				    $('#third_room').hide();
				    $('#third_roomrow').hide();
				    $('#third_roomrow2').hide();
				    $('#third_roomcost').hide();
				    $('#third_roomfeatures').hide();
				    $('#second_spacer6').hide();  // spacer in guest number selectors
				    $('#second_spacer7').hide();  // spacer in room type selectors
					$('#second_spacer8').hide();  // spacer in pricing table
					$('#second_spacer9').hide();  // spacer in pricing table
					$('#room3subtotal').hide();
}

// moneycalc function

function moneycalc() {
						var nightmx = $("#nightcount").html(); 
						var guestmx = $("#guestcount").html(); 
						var pricemx = $("#roompricer").html();
						var second_guestmx = $("#second_guestcount").html(); 
						var second_pricemx = $("#second_roompricer").html();
						var third_guestmx = $("#third_guestcount").html(); 
						var third_pricemx = $("#third_roompricer").html();
						var discountmx = $("#discount_number").html();
						var discountindicator =$("#discount_described").html();
						
							var room1price = (guestmx * nightmx * pricemx);
							var room2price = (second_guestmx * nightmx * second_pricemx);
							var room3price = (third_guestmx * nightmx * third_pricemx);
							var totalprice =  room1price + room2price + room3price ;

							var discounttotal = (totalprice * discountmx / 100);
							var totaldiscounted = totalprice - discounttotal;
							var discount2dec = discounttotal.toFixed(2);
							var total2dec = totaldiscounted.toFixed(2);
							var totalnice = "$ " + total2dec; 
							
							var prediscount2dec = totalprice.toFixed(2);
							var prediscountnice = "$ " + prediscount2dec;
							
							var room1nightly = (guestmx * pricemx)
							var room2nightly = (second_guestmx * second_pricemx);
							var room3nightly = (third_guestmx * third_pricemx);

							var room1nice = room1nightly.toFixed(2);
							var room2nice = room2nightly.toFixed(2);
							var room3nice = room3nightly.toFixed(2);

						$("#room1subcuenta").text(room1nice);
						$("#room2subcuenta").text(room2nice);
						$("#room3subcuenta").text(room3nice);
						$("#pre_discount_cuenta").text(prediscountnice);
						
						$("#totalcost").text(totalnice);
						$("#quotedprice").val(totalnice);
						$("#discount_result").text(discount2dec);
						$("#quoteddiscount").val(discount2dec);
						$("#before_diskount").val(prediscountnice);
						$("#quoteddisctype").val(discountindicator);
						$("#percent_diskount").val(discountmx);

}
//
//  END OF FUNCTION  moneycalc()
//
// jquery.datepicker (within for jquery ui )
//

<!-- =======================================================  -->
<!--  ATTENTION ANDRES										  -->
<!-- 														  -->
<!--  Below is where to put your list of blackout dates.	  -->
<!-- =======================================================  -->

  var closedDays = [
					
		"9/15/2010", "9/16/2010", "9/17/2010", "9/18/2010", "9/19/2010", "9/20/2010", "9/21/2010", "9/22/2010",
		"9/23/2010", "9/24/2010", "9/25/2010", "9/26/2010", "9/27/2010", "9/28/2010", "9/29/2010", "9/30/2010",
		
		"10/1/2010", "10/2/2010", "10/3/2010", "10/4/2010", "10/5/2010", "10/6/2010", "10/7/2010", "10/8/2010",
		"10/9/2010", "10/10/2010", "10/11/2010", "10/12/2010", "10/13/2010", "10/14/2010", "10/15/2010", "10/16/2010",
		"10/17/2010", "10/18/2010", "10/19/2010", "10/20/2010", "10/21/2010", "10/22/2010", "10/23/2010", "10/24/2010",
		"10/25/2010", "10/26/2010", "10/27/2010", "10/28/2010", "10/29/2010", "10/30/2010", "10/31/2010",

		"11/1/2010", "11/2/2010", "11/3/2010", "11/4/2010", "11/5/2010", "11/6/2010", "11/7/2010", "11/8/2010",
		"11/9/2010", "11/10/2010", "11/11/2010", "11/12/2010", "11/13/2010", "11/14/2010", "11/15/2010", "11/16/2010",
		"11/17/2010", "11/18/2010", "11/19/2010", "11/20/2010", "11/21/2010", "11/22/2010",

		"3/15/2011", "3/16/2011", "3/17/2011", "3/18/2011", "3/19/2011", "3/20/2011", "3/21/2011", "3/22/2011", 
		"3/23/2011", "3/24/2011", "3/25/2011", "3/26/2011", "3/27/2011", "3/28/2011", "3/29/2011", "3/30/2011",
		"3/31/2011",
		
		"4/1/2011", "4/2/2011", "4/3/2011", "4/4/2011", "4/5/2011", "4/6/2011", "4/7/2011", "4/8/2011", 
		"4/9/2011", "4/10/2011", "4/11/2011", "4/12/2011", "4/13/2011", "4/14/2011", "4/15/2011", "4/16/2011",
		"4/17/2011", "4/18/2011", "4/19/2011", "4/20/2011", "4/21/2011", "4/22/2011", "4/23/2011", "4/24/2011", 
		"4/25/2011", "4/26/2011", "4/27/2011", "4/28/2011", "4/29/2011", "4/30/2011",
		
																							"5/1/2011", "5/2/2011",
		"5/3/2011", "5/4/2011", "5/5/2011", "5/6/2011", "5/7/2011", "5/8/2011", "5/9/2011", "5/10/2011", "5/11/2011",
		"5/12/2011", "5/13/2011", "5/14/2011", "5/15/2011", "5/16/2011", "5/17/2011", "5/18/2011", "5/19/2011",
		"5/20/2011", "5/21/2011", "5/22/2011", "5/23/2011", "5/24/2011", "5/25/2011", "5/26/2011", "5/27/2011",
		"5/28/2011", "5/29/2011", "5/30/2011", "5/31/2011", 

																"6/1/2011", "6/2/2011", "6/3/2011", "6/4/2011",
		"6/5/2011", "6/6/2011", "6/7/2011", "6/8/2011", "6/9/2011", "6/10/2011", "6/11/2011", "6/12/2011",
		"6/13/2011", "6/14/2011", 
		
		"9/1/2011", "9/2/2011", "9/3/2011", "9/4/2011", "9/5/2011", "9/6/2011", "9/7/2011", "9/8/2011", "9/9/2011", 
		"9/10/2011", "9/11/2011", "9/12/2011", "9/13/2011", "9/14/2011", "9/15/2011", "9/16/2011", "9/17/2011", 
		"9/18/2011", "9/19/2011", "9/20/2011", "9/21/2011", "9/22/2011", "9/23/2011", "9/24/2011", "9/25/2011", 
		"9/26/2011", "9/27/2011", "9/28/2011", "9/29/2011", "9/30/2011" ,
		
		"10/1/2011", "10/2/2011", "10/3/2011", "10/4/2011", "10/5/2011", "10/6/2011", "10/7/2011", "10/8/2011", 
		"10/9/2011", "10/10/2011", "10/11/2011", "10/12/2011", "10/13/2011", "10/14/2011", "10/15/2011", "10/16/2011", 
		"10/17/2011", "10/18/2011", "10/19/2011", "10/20/2011", "10/21/2011", "10/22/2011", "10/23/2011", "10/24/2011", 
		"10/25/2011", "10/26/2011", "10/27/2011", "10/28/2011", "10/29/2011", "10/30/2011", "10/31/2011" ,
		
		"11/1/2011", "11/2/2011", "11/3/2011", "11/4/2011", "11/5/2011", "11/6/2011", "11/7/2011", "11/8/2011", 
		"11/9/2011", "11/10/2011", "11/11/2011", "11/12/2011", "11/13/2011", "11/14/2011",
		
		"3/15/2012", "3/16/2012", "3/17/2012", "3/18/2012", "3/19/2012", "3/20/2012", "3/21/2012", "3/22/2012", 
		"3/23/2012", "3/24/2012", "3/25/2012", "3/26/2012", "3/27/2012", "3/28/2012", "3/29/2012", "3/30/2012", 
		"3/31/2012",
		
		"4/1/2012", "4/2/2012", "4/3/2012", "4/4/2012", "4/5/2012", "4/6/2012", "4/7/2012", "4/8/2012", "4/9/2012", 
		"4/10/2012", "4/11/2012", "4/12/2012", "4/13/2012", "4/14/2012", "4/15/2012", "4/16/2012", "4/17/2012", 
		"4/18/2012", "4/19/2012", "4/20/2012", "4/21/2012", "4/22/2012", "4/23/2012", "4/24/2012", "4/25/2012", 
		"4/26/2012", "4/27/2012", "4/28/2012", "4/29/2012", "4/30/2012",
		
		"5/1/2012", "5/2/2012", "5/3/2012", "5/4/2012", "5/5/2012", "5/6/2012", "5/7/2012", "5/8/2012", "5/9/2012", 
		"5/10/2012", "5/11/2012", "5/12/2012", "5/13/2012", "5/14/2012", "5/15/2012", "5/16/2012", "5/17/2012", 
		"5/18/2012", "5/19/2012", "5/20/2012", "5/21/2012", "5/22/2012", "5/23/2012", "5/24/2012", "5/25/2012", 
		"5/26/2012", "5/27/2012", "5/28/2012", "5/29/2012", "5/30/2012", "5/31/2012",
		
		"6/1/2012", "6/2/2012", "6/3/2012", "6/4/2012", "6/5/2012", "6/6/2012", "6/7/2012", "6/8/2012", "6/9/2012", 
		"6/10/2012", "6/11/2012", "6/12/2012", "6/13/2012", "6/14/2012",
		
		"9/1/2012", "9/2/2012", "9/3/2012", "9/4/2012", "9/5/2012", "9/6/2012", "9/7/2012", "9/8/2012", "9/9/2012", 
		"9/10/2012", "9/11/2012", "9/12/2012", "9/13/2012", "9/14/2012", "9/15/2012", "9/16/2012", "9/17/2012", 
		"9/18/2012", "9/19/2012", "9/20/2012", "9/21/2012", "9/22/2012", "9/23/2012", "9/24/2012", "9/25/2012", 
		"9/26/2012", "9/27/2012", "9/28/2012", "9/29/2012", "9/30/2012",
		
		"10/1/2012", "10/2/2012", "10/3/2012", "10/4/2012", "10/5/2012", "10/6/2012", "10/7/2012", "10/8/2012", 
		"10/9/2012", "10/10/2012", "10/11/2012", "10/12/2012", "10/13/2012", "10/14/2012", "10/15/2012", "10/16/2012", 
		"10/17/2012", "10/18/2012", "10/19/2012", "10/20/2012", "10/21/2012", "10/22/2012", "10/23/2012", "10/24/2012", 
		"10/25/2012", "10/26/2012", "10/27/2012", "10/28/2012", "10/29/2012", "10/30/2012", "10/31/2012",
		
		"11/1/2012", "11/2/2012", "11/3/2012", "11/4/2012", "11/5/2012", "11/6/2012", "11/7/2012", "11/8/2012", "11/9/2012", 
		"11/10/2012", "11/11/2012", "11/12/2012", "11/13/2012", "11/14/2012",
		
				];

function blackoutDays(date) {
    var sDate = (date.getMonth()+1).toString() + "/" + date.getDate().toString() + "/" + date.getFullYear().toString();
    if ($.inArray(sDate, closedDays) != -1) return [false,"",
													
<!-- =======================================================      -->
<!--  ATTENTION ANDRES										      -->
<!-- 														      -->
<!--  Below is where to put your popup "We're Closed" message.	  -->
<!-- =======================================================      -->

	"Sorry, Black Sheep Inn has no availability in April and May, 2010."
	
	];

	else return [true, ""];
  }

$(function(){ $('#datefrom').datepicker({ minDate: +1, beforeShowDay: blackoutDays,

<!-- =======================================================      -->
<!--  ATTENTION ANDRES										      -->
<!-- 														      -->
<!--  when you have changed the prices, you can cut and throw     -->
<!--  away the "NEW PRICES IN JUNE" function below                -->
<!-- =======================================================      -->

		/*   begin      onSelect: function(dateText) {	
							var compareDate = new Date('5/31/2010');
								chosenDate = new Date(dateText); 

							if (chosenDate > compareDate) 
								{ $("#notify_blerb").css("display","block")    } 
									else 
								{ $("#notify_blerb").css("display","none")     }
										},     			
										
			end  */	


<!-- =======================================================      -->
<!--  ATTENTION ANDRES										      -->
<!--   end of "NEW PRICES IN JUNE" stuff to cut														      -->
<!-- =======================================================      -->


}); 

//
// END OF FUNCTION -- datepicker for jquery ui.
										  

// END of $(document).ready(function() {
});



//
//  jquery.watermark.min.js
//

(function(e){var c,j="watermark",g="watermarkClass",b="watermarkFocus",h="watermarkSubmit",d="watermarkMaxLength",f="watermarkPassword",k="watermarkText",a=":data("+j+")",i=":text,:password,:search,textarea";e.extend(e.expr[":"],{data:function(m,l,o,q){var n,p=/^((?:[^=!^$*]|[!^$*](?!=))+)(?:([!^$*]?=)(.*))?$/.exec(o[3]);if(p){n=e(m).data(p[1]);if(n!==c){if(p[2]){n=""+n;switch(p[2]){case"=":return(n==p[3]);case"!=":return(n!=p[3]);case"^=":return(n.slice(0,p[3].length)==p[3]);case"$=":return(n.slice(-p[3].length)==p[3]);case"*=":return(n.indexOf(p[3])!==-1)}}return true}}return false}});e.watermark={version:"3.0",options:{className:"watermark",useNative:true},hide:function(l){e(l).filter(a).each(function(){e.watermark._hide(e(this))})},_hide:function(o,m){if(o.val()==o.data(k)){o.val("");if(o.data(f)){if(o.attr("type")==="text"){var n=o.data(f),l=o.parent();l[0].removeChild(o[0]);l[0].appendChild(n[0]);o=n}}if(o.data(d)){o.attr("maxLength",o.data(d));o.removeData(d)}if(m){o.attr("autocomplete","off");window.setTimeout(function(){o.select()},0)}}o.removeClass(o.data(g))},show:function(l){e(l).filter(a).each(function(){e.watermark._show(e(this))})},_show:function(r){var q=r.val(),p=r.data(k),n=r.attr("type");if(((q.length==0)||(q==p))&&(!r.data(b))){if(r.data(f)){if(n==="password"){var o=r.data(f),m=r.parent();m[0].removeChild(r[0]);m[0].appendChild(o[0]);r=o;r.attr("maxLength",p.length)}}if((n==="text")||(n==="search")){var l=r.attr("maxLength");if((l>0)&&(p.length>l)){r.data(d,l);r.attr("maxLength",p.length)}}r.addClass(r.data(g));r.val(p)}else{e.watermark._hide(r)}},hideAll:function(){e.watermark.hide(i)},showAll:function(){e.watermark.show(i)}};e.fn.watermark=function(o,l){var n=(typeof(o)==="string"),m;if(typeof(l)==="object"){m=(typeof(l.className)==="string");l=e.extend({},e.watermark.options,l)}else{if(typeof(l)==="string"){m=true;l=e.extend({},e.watermark.options,{className:l})}else{l=e.watermark.options}}if(typeof(l.useNative)!=="function"){l.useNative=l.useNative?function(){return true}:function(){return false}}return this.each(function(){var s=e(this);if(!s.is(i)){return}if(s.data(j)){if(n||m){e.watermark._hide(s);if(n){s.data(k,o)}if(m){s.data(g,l.className)}}}else{if(l.useNative.call(this,s)){if(((""+s.css("-webkit-appearance")).replace("undefined","")!=="")&&(s.attr("tagName")!=="TEXTAREA")){if(n){s.attr("placeholder",o)}return}}s.data(k,n?o:"");s.data(g,l.className);s.data(j,1);if(s.attr("type")==="password"){var p=s.wrap("<span>").parent();var r=e(p.html().replace(/type=["']?password["']?/i,'type="text"'));r.data(k,s.data(k));r.data(g,s.data(g));r.data(j,1);r.attr("maxLength",o.length);r.focus(function(){e.watermark._hide(r,true)}).bind("dragenter",function(){e.watermark._hide(r)}).bind("dragend",function(){window.setTimeout(function(){r.blur()},1)});s.blur(function(){e.watermark._show(s)}).bind("dragleave",function(){e.watermark._show(s)});r.data(f,s);s.data(f,r)}else{s.focus(function(){s.data(b,1);e.watermark._hide(s,true)}).blur(function(){s.data(b,0);e.watermark._show(s)}).bind("dragenter",function(){e.watermark._hide(s)}).bind("dragleave",function(){e.watermark._show(s)}).bind("dragend",function(){window.setTimeout(function(){e.watermark._show(s)},1)}).bind("drop",function(t){var u=t.originalEvent.dataTransfer.getData("Text");if(s.val().replace(u,"")===s.data(k)){s.val(u)}s.focus()})}var q=e(this.form);if(!q.data(h)){q.data(h,this.form.submit);q.submit(e.watermark.hideAll);this.form.submit=function(){var t=q.data(h);e.watermark.hideAll();if(t.apply){t.apply(q[0],arguments)}else{t()}}}}e.watermark._show(s)}).end()}})(jQuery);

//
//  END OF FUNCTION  jquery.watermark.js
//
//  jquery.selectboxes.packed.js
//  http://www.techiegyan.com/?p=130
//

eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[3-9q-suw-zA-Y]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(6(h){h.w.L=6(){5 j=6(a,f,c,g){5 d=document.createElement("S");d.r=f,d.G=c;5 b=a.C;5 e=b.s;3(!a.z){a.z={};y(5 i=0;i<e;i++){a.z[b[i].r]=i}}3(9 a.z[f]=="T")a.z[f]=e;a.C[a.z[f]]=d;3(g){d.u=8}};5 k=U;3(k.s==0)7 4;5 l=8;5 m=A;5 n,o,p;3(9(k[0])=="D"){m=8;n=k[0]}3(k.s>=2){3(9(k[1])=="M")l=k[1];q 3(9(k[2])=="M")l=k[2];3(!m){o=k[0];p=k[1]}}4.x(6(){3(4.E.B()!="F")7;3(m){y(5 a in n){j(4,a,n[a],l)}}q{j(4,o,p,l)}});7 4};h.w.ajaxAddOption=6(c,g,d,b,e){3(9(c)!="I")7 4;3(9(g)!="D")g={};3(9(d)!="M")d=8;4.x(6(){5 f=4;h.getJSON(c,g,6(a){h(f).L(a,d);3(9 b=="6"){3(9 e=="D"){b.apply(f,e)}q{b.N(f)}}})});7 4};h.w.V=6(){5 d=U;3(d.s==0)7 4;5 b=9(d[0]);5 e,i;3(b=="I"||b=="D"||b=="6"){e=d[0];3(e.H==W){5 j=e.s;y(5 k=0;k<j;k++){4.V(e[k],d[1])}7 4}}q 3(b=="number")i=d[0];q 7 4;4.x(6(){3(4.E.B()!="F")7;3(4.z)4.z=X;5 a=A;5 f=4.C;3(!!e){5 c=f.s;y(5 g=c-1;g>=0;g--){3(e.H==O){3(f[g].r.P(e)){a=8}}q 3(f[g].r==e){a=8}3(a&&d[1]===8)a=f[g].u;3(a){f[g]=X}a=A}}q{3(d[1]===8){a=f[i].u}q{a=8}3(a){4.remove(i)}}});7 4};h.w.sortOptions=6(e){5 i=h(4).Y();5 j=9(e)=="T"?8:!!e;4.x(6(){3(4.E.B()!="F")7;5 c=4.C;5 g=c.s;5 d=[];y(5 b=0;b<g;b++){d[b]={v:c[b].r,t:c[b].G}}d.sort(6(a,f){J=a.t.B(),K=f.t.B();3(J==K)7 0;3(j){7 J<K?-1:1}q{7 J>K?-1:1}});y(5 b=0;b<g;b++){c[b].G=d[b].t;c[b].r=d[b].v}}).Q(i,8);7 4};h.w.Q=6(g,d){5 b=g;5 e=9(g);3(e=="D"&&b.H==W){5 i=4;h.x(b,6(){i.Q(4,d)})};5 j=d||A;3(e!="I"&&e!="6"&&e!="D")7 4;4.x(6(){3(4.E.B()!="F")7 4;5 a=4.C;5 f=a.s;y(5 c=0;c<f;c++){3(b.H==O){3(a[c].r.P(b)){a[c].u=8}q 3(j){a[c].u=A}}q{3(a[c].r==b){a[c].u=8}q 3(j){a[c].u=A}}}});7 4};h.w.copyOptions=6(g,d){5 b=d||"u";3(h(g).size()==0)7 4;4.x(6(){3(4.E.B()!="F")7 4;5 a=4.C;5 f=a.s;y(5 c=0;c<f;c++){3(b=="all"||(b=="u"&&a[c].u)){h(g).L(a[c].r,a[c].G)}}});7 4};h.w.containsOption=6(g,d){5 b=A;5 e=g;5 i=9(e);5 j=9(d);3(i!="I"&&i!="6"&&i!="D")7 j=="6"?4:b;4.x(6(){3(4.E.B()!="F")7 4;3(b&&j!="6")7 A;5 a=4.C;5 f=a.s;y(5 c=0;c<f;c++){3(e.H==O){3(a[c].r.P(e)){b=8;3(j=="6")d.N(a[c],c)}}q{3(a[c].r==e){b=8;3(j=="6")d.N(a[c],c)}}}});7 j=="6"?4:b};h.w.Y=6(){5 a=[];4.R().x(6(){a[a.s]=4.r});7 a};h.w.selectedTexts=6(){5 a=[];4.R().x(6(){a[a.s]=4.G});7 a};h.w.R=6(){7 4.find("S:u")}})(jQuery);',[],61,'|||if|this|var|function|return|true|typeof|||||||||||||||||else|value|length||selected||fn|each|for|cache|false|toLowerCase|options|object|nodeName|select|text|constructor|string|o1t|o2t|addOption|boolean|call|RegExp|match|selectOptions|selectedOptions|option|undefined|arguments|removeOption|Array|null|selectedValues'.split('|'),0,{}))

//
//  END OF FUNCTION  jquery.selectboxes.packed.js
//
