function showhide(id){
	$("#"+id).slideToggle();
}

function tabclicked(id){
	$("#tabcontent"+id).addClass("tabcontentselected");
	$("#tabcontent"+id).removeClass("tabcontent");
	
	$("#tableft"+id).addClass("tableftselected");
	$("#tableft"+id).removeClass("tableft");
	
	$("#tabright"+id).addClass("tabrightselected");
	$("#tabright"+id).removeClass("tabright");
	
	
	if(id!=1){
		$("#tabcontent1").addClass("tabcontent");
		$("#tabcontent1").removeClass("tabcontentselected");
		
		$("#tableft1").addClass("tableft");
		$("#tableft1").removeClass("tableftselected");
		
		$("#tabright1").addClass("tabright");
		$("#tabright1").removeClass("tabrightselected");
	}
	
	if(id!=2){
		$("#tabcontent2").addClass("tabcontent");
		$("#tabcontent2").removeClass("tabcontentselected");
		
		$("#tableft2").addClass("tableft");
		$("#tableft2").removeClass("tableftselected");
		
		$("#tabright2").addClass("tabright");
		$("#tabright2").removeClass("tabrightselected");
	}
	
	if(id!=3){
		$("#tabcontent3").addClass("tabcontent");
		$("#tabcontent3").removeClass("tabcontentselected");
		
		$("#tableft3").addClass("tableft");
		$("#tableft3").removeClass("tableftselected");
		
		$("#tabright3").addClass("tabright");
		$("#tabright3").removeClass("tabrightselected");
	}
	
	if(id!=4){
		$("#tabcontent4").addClass("tabcontent");
		$("#tabcontent4").removeClass("tabcontentselected");
		
		$("#tableft4").addClass("tableft");
		$("#tableft4").removeClass("tableftselected");
		
		$("#tabright4").addClass("tabright");
		$("#tabright4").removeClass("tabrightselected");
	}
	
	if(id==1){
		$("#destinationmap").hide();
		$("#destinationinfo").hide();
		$("#destinationvid").hide();
		$("#searchresultsdiv").fadeIn();
	}
	
	if(id==2){
		$("#destinationinfo").hide();
		$("#searchresultsdiv").hide();
		$("#destinationvid").hide();
		$("#destinationmap").fadeIn();
	}
	
	if(id==3){
		$("#destinationmap").hide();
		$("#destinationvid").hide();
		$("#searchresultsdiv").hide();
		$("#destinationinfo").fadeIn();
	}
	
	if(id==4){
		$("#destinationmap").hide();		
		$("#searchresultsdiv").hide();
		$("#destinationinfo").hide();
		$("#destinationvid").fadeIn();
	}
}

function setcurrentid(id){
	document.getElementById("currentid").value = id;
}



function tabclickeddest(id){
	$("#tabcontent"+id).addClass("tabcontentselected");
	$("#tabcontent"+id).removeClass("tabcontent");
	
	$("#tableft"+id).addClass("tableftselected");
	$("#tableft"+id).removeClass("tableft");
	
	$("#tabright"+id).addClass("tabrightselected");
	$("#tabright"+id).removeClass("tabright");
	
	
	if(id!=1){
		$("#tabcontent1").addClass("tabcontent");
		$("#tabcontent1").removeClass("tabcontentselected");
		
		$("#tableft1").addClass("tableft");
		$("#tableft1").removeClass("tableftselected");
		
		$("#tabright1").addClass("tabright");
		$("#tabright1").removeClass("tabrightselected");
	}
	
	if(id!=2){
		$("#tabcontent2").addClass("tabcontent");
		$("#tabcontent2").removeClass("tabcontentselected");
		
		$("#tableft2").addClass("tableft");
		$("#tableft2").removeClass("tableftselected");
		
		$("#tabright2").addClass("tabright");
		$("#tabright2").removeClass("tabrightselected");
	}
	
	if(id!=3){
		$("#tabcontent3").addClass("tabcontent");
		$("#tabcontent3").removeClass("tabcontentselected");
		
		$("#tableft3").addClass("tableft");
		$("#tableft3").removeClass("tableftselected");
		
		$("#tabright3").addClass("tabright");
		$("#tabright3").removeClass("tabrightselected");
	}
	
	if(id==1){
		$("#destinationinfo").hide();
		$("#destinationvid").hide();
		$("#destinationmap").fadeIn();
	}
	
	if(id==2){
		$("#destinationmap").hide();
		$("#destinationvid").hide();
		$("#destinationinfo").fadeIn();
	}
	
	if(id==3){
		$("#destinationmap").hide();
		$("#destinationinfo").hide();
		$("#destinationvid").fadeIn();
	}
	
}


function checkWordLen(obj,wordLen){
	var len = obj.value.split(/[\s]+/);
	if(len.length > parseInt(wordLen)){
		obj.value = len[0]+' '+len[1]+' '+len[2];
		return false;
	}
	return true;
}

function isNumberKey(evt){ 
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;
	
	return true;
}

