$(document).ready(function(){
	
	$("#header_search").focus(function(){
      	$(this).css("background-image","url(img/search2.gif)");
		$(this).css("color","#444444");
		
		if($(this).val() == "Search..."){
			$(this).val("");
		}
	}).blur(function(){
		$(this).css("background-image","url(img/search1.gif)");
		$(this).css("color","#d4d4d4");
		
		if($(this).val() == ""){
			$(this).val("Search...");
		}
	});
	
	$(".weather-click").click(function() {
		if($("#weather").css("display") == "none") {
			$("#welcome").fadeOut("normal", function() {
				$("#weather").fadeIn("normal");
			});
		} else {
			$("#weather").fadeOut("normal", function() {
				$("#welcome").fadeIn("normal");
			});
		}
		return false;
	});
	
	$("input.myvac").focus(function(){
      	$(this).css("background-image","url(img/field2.png)");
	}).blur(function(){
		$(this).css("background-image","url(img/field1.png)");
	});
	
	$(".myvac_delete").click(function(){
		if (confirm("Are you sure you want to delete this entry?")){
			return true;
		} else {
			return false;
		}
	});
	
	$("#big_search").focus(function(){
		$(this).css("color","#579c94");
		
		if($(this).val() == "Search..."){
			$(this).val("");
		}
	}).blur(function(){
		$(this).css("color","#d4d4d4");
		
		if($(this).val() == ""){
			$(this).val("Search...");
		}
	});
	
	$("#small_go").mouseover(function(){
		$(this).attr({src: "img/go1b.gif"});
	}).mouseout(function(){
		$(this).attr({src: "img/go1a.gif"});
	});
	
	$(".small_login").focus(function(){
		if($(this).attr("name") == "email") {
			if($(this).val() == "Email"){
				$(this).val("");
			}
		} else {
			if($(this).val() == "a"){
				$(this).val("");
			}
		}
	}).blur(function(){
		if($(this).attr("name") == "email") {
			if($(this).val() == ""){
				$(this).val("Email");
			}
		} else {
			if($(this).val() == ""){
				$(this).val("a");
			}
		}
	});
	
	$(".response").fadeOut(8000);
	
	$("a.login").click(function(){
		if($("#login_1").css("display") == "none") {
			$("#login_2").css("display", "none");
			$("#login_1").css("display", "block");
		} else { 
			$("#login_1").css("display", "none");
			$("#login_2").css("display", "block");
		}
	}); 
	
	$("#small_srch").mouseover(function(){
		$(this).attr({src: "img/go2.gif"});
	}).mouseout(function(){
		$(this).attr({src: "img/go1.gif"});
	}); 
	
	$(".rl").click(function () {
		var this_id = $(this).attr("id");
		$("#reg_"+this_id).slideToggle("normal");
	});
	
	$("ul.thumb li").hover(function() {
		$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
		$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
			.animate({
				marginTop: '-65px', /* The next 4 lines will vertically align this image */ 
				marginLeft: '-65px',
				top: '50%',
				left: '50%',
				width: '130px', /* Set new width */
				height: '130px', /* Set new height */
				padding: '2px'
			}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

		} , function() {
		$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
		$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
		.animate({
			marginTop: '0', /* Set alignment back to default */
			marginLeft: '0',
			top: '0',
			left: '0',
			width: '90px', /* Set width back to default */
			height: '90px', /* Set height back to default */
			padding: '2px'
		}, 400);
	});
	
	$("ul.thumb li a").click(function() {
		var mainImage = $(this).attr("href"); //Find Image Name
		$("#main_img img").attr({ src: mainImage });
		return false;		
	});
	
	$("#signup").validate();
}); 

function goto(form) { 
	var index=form.destination_drop.selectedIndex
	if (form.destination_drop.options[index].value != "0") {
		location=form.destination_drop.options[index].value;
	}
}

function openMileagebox() {
	var n=open("http://www.floridainformation.com/florida_milage_chart.html", "mileage", "width=500,height=320,location=top,menubar=no,directories=no,toolbar=no,scrollbars=auto,resizable=no,status=no");
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
} 

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=600,left = 590,top = 225');");
}
	
	
