$(document).ready(function(){
	var box1 = $(".first .update").height();
	var box2 = $(".second .form-2").height();

/*
	*	   clear  text in search input
	*/	

var fixe = document.getElementById('fixing');
	fixe.value="Type home name or number here.";
	fixe.onfocus = function(){
		if(this.value == "Type home name or number here."){
			this.value =  "";
		}
	};


	fixe.onblur = function(){
		if(this.value == ""){
			this.value =  "Type home name or number here.";
		}
	};

//menu
function mainmenu(){
$(" #manu ul ").css({display: "none"}); // Opera Fix
$(" #menu li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(200);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}
  
 $(document).ready(function(){					
	mainmenu();
});


	$("div.form-2").css("display","none");
	$(".first .links a:first").hover( 							//toggle color for link on  slide menu
    function () {
      $(this).css("color","#19446D");
    }, 
    function () {
      $(this).css("color","#665E4D");
   });

	$(".second .links a:first").hover(
		function () {
		  $(this).css("color","#19446D");
		}, 
		function () {
		  $(this).css("color","#665E4D");
	});

 /*
	*      slideing right menu
	*/		       
		$(".first .links a#beachbag").toggle(          //top menu window
      function () { //close
				$(".first .links a#beachbag em").removeClass("close");
				$(".first .links a#beachbag em").addClass("open");
				$(".first .links").animate({height: box1+53}, { duration: 200,complete:function(){$(".first .links").css("height","auto");} });
				$(".first .update").animate({height: box1},{ duration: 200,complete:function(){$(".first .update").css("height","auto");} });
				$(".first .links a:first").css("color","#19446D");
				$("div.block").css("display","block");
      },

      function () {//open
				$(".first .links a#beachbag em").removeClass("open");
				$(".first .links a#beachbag em").addClass("close");
				$(".first .update").animate({height: "0px"},{ duration: 200,complete:function(){$(".first .update").css("display","none");} });
				$(".first .links").animate({height: "55px"},{ duration: 200,complete:function(){$("div.block").css("display","none");} });
				$(".first .links a:first").css("color","#665E4D");
      }
    );

    	$(".second .links a").toggle(			//bottom menu window
      function () {  //closed
				$(".second .links  em").removeClass("close");
				$(".second .links  em").addClass("open");
				$(".second .links").animate({height: box2+105}, { duration: 200,complete:function(){$(".second .links").css("height","auto");} });
				$(".second .link-3").animate({height: box2+104}, { duration: 200,complete:function(){$(".second .link-3").css("height","auto");} });
				$(".second .form-2").animate({height: box2}, 200 );
				$(".second .links a:first").css("color","#19446D");
				$(".second .links p:first").css("paddingTop","0");
				$(this).css("marginBottom","0");
				$("strong.open span").hide();

      },

      function () {//open
				$(".second .links a em").removeClass("open");
				$(".second .links a em").addClass("close");
				$(".second .form-2").animate({height: "0px"}, 200 );
				$(".second .links").animate({height: "55px"}, 200 );
				$(".second .link-3").animate({height: "51px"}, { duration: 200,complete:function(){$(".second .form-2").css("display","none");} });
				$(".second .links a:first").css("color","#665E4D");
				$(".second .links p:first").css("paddingTop","10px");
				$(this).css("marginBottom","15px");
				$("strong.open span").show();
      }

    );

/*
    *    drop down for custom  selects
    */    
    var select_open = false;
    var selected,top_id;
    $("div.select").click(    //toggle  open - closed
			function () { 
				 top_id = $(this);
			 	$("div.select ul li").click(function(){
					selected = $(this).children("a").text();
					top_id.children("a").text(selected);
			 		top_id.children("input").val(selected);	
				});

				if(select_open){
					$(this).children("ul").css("display","none");
					select_open = false;
					return false;
				}
				else{
					$("div.select ul").css("display","none");
					$(this).children("ul").css("display","block");
					select_open = true;
					return false;
				}
			});

	  $("div.select ul li").hover(   // hover on drop down menu 
			function(){
				$(this).addClass(" hovered")
			},	
			function(){
				$(this).removeClass(" hovered")
			}
		);
});

// tabs
//w/effect
//$(document).ready(function() {  
//$('#availtabs > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });  
 //});  

 $(document).ready(function() {  
$('#availtabs > ul').tabs();  
 });  