$(document).ready(function() {

    
	$(".res400").mouseenter(function(event){
		$("div#res400txt").slideDown("slow");
	});
	
	$(".res400").mouseleave(function(event){
		setTimeout('$("div#res400txt").slideUp("slow");', 700)
	});
	
	$(".res300").mouseenter(function(event){
		$("div#res300txt").slideDown("slow");
	});
	
	$(".res300").mouseleave(function(event){
		setTimeout('$("div#res300txt").slideUp("slow");', 700)
	});
	
	$("li#site-seeing").css({ 
		height: '34px',
		backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
		backgroundColor: '#523f81',
		zIndex: '20'
	});
	
	$(".map-tab").mouseenter(function(event){
		var tabSelected = "li#"+this.id;
		
		if ($(tabSelected).css('z-index') != '20') {
			if (this.id == 'international-schools') {
				$(tabSelected).animate({ 
					height: '38px'
				}, "fast");
			}
			else {
				$(tabSelected).animate({ 
					height: '30px'
				}, "fast");
			}
		}
	});
	
	$(".map-tab").mouseleave(function(event){
		var tabSelected = "li#"+this.id;
		
		if ($(tabSelected).css('z-index') != '20') {
			if (this.id == 'international-schools') {
				$(tabSelected).animate({ 
					height: '24px'
				}, "fast");
			}
			else {
				$(tabSelected).animate({ 
					height: '24px'
				}, "fast");
			}
		}
	});
	
	$(".map-tab").click(function(event){
		var mapSelected = "div#map-"+this.id;
		var tabSelected = "li#"+this.id;
		
		if (tabSelected != 'site-seeing') {
			$("li#site-seeing").animate({ 
				height: '24px'
			}, "fast");
			
			$("li#site-seeing").css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-off.gif)',
				backgroundColor: '#403166',
				zIndex: '10'
			});
		}
		if (tabSelected != 'beaches') {
			$("li#beaches").animate({ 
				height: '24px'
			}, "fast");
			
			$("li#beaches").css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-off.gif)',
				backgroundColor: '#771f6d',
				zIndex: '10'
			});
		}
		if (tabSelected != 'international-schools') {
			$("li#international-schools").animate({ 
				height: '24px'
			}, "fast");
			
			$("li#international-schools").css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-off.gif)',
				backgroundColor: '#771f24',
				zIndex: '10'
			});
		}
		if (tabSelected != 'hotels') {
			$("li#hotels").animate({ 
				height: '24px'
			}, "fast");
			
			$("li#hotels").css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-off.gif)',
				backgroundColor: '#77631f',
				zIndex: '10'
			});
		}
		if (tabSelected != 'golf') {
			$("li#golf").animate({ 
				height: '24px'
			}, "fast");
			
			$("li#golf").css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-off.gif)',
				backgroundColor: '#40771f',
				zIndex: '10'
			});
		}
		if (tabSelected != 'sport-facilities') {
			$("li#sport-facilities").animate({ 
				height: '24px'
			}, "fast");
			
			$("li#sport-facilities").css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-off.gif)',
				backgroundColor: '#1f7763',
				zIndex: '10'
			});
		}
		if (tabSelected != 'kids') {
			$("li#kids").animate({ 
				height: '24px'
			}, "fast");
			
			$("li#kids").css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-off.gif)',
				backgroundColor: '#1f4f77',
				zIndex: '10'
			});
		}
			
		
		
		if (this.id == 'international-schools') {
			$(tabSelected).animate({ 
				height: '42px'
			}, 'fast');
			
			$(tabSelected).css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
				backgroundColor: '#96292e',
				zIndex: '20'
			});
		}
		
		if (this.id == 'site-seeing') {
			$(tabSelected).animate({ 
				height: '42px'
			}, 'fast');
			
			$(tabSelected).css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
				backgroundColor: '#523f81',
				zIndex: '20'
			});
		}
		
		if (this.id == 'beaches') {
			$(tabSelected).animate({ 
				height: '42px'
			}, 'fast');
			
			$(tabSelected).css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
				backgroundColor: '#962988',
				zIndex: '20'
			});
		}
		
		if (this.id == 'hotels') {
			$(tabSelected).animate({ 
				height: '42px'
			}, 'fast');
			
			$(tabSelected).css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
				backgroundColor: '#967f29',
				zIndex: '20'
			});
		}
		
		if (this.id == 'golf') {
			$(tabSelected).animate({ 
				height: '42px'
			}, 'fast');
			
			$(tabSelected).css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
				backgroundColor: '#529629',
				zIndex: '20'
			});
		}
		
		if (this.id == 'sport-facilities') {
			$(tabSelected).animate({ 
				height: '42px'
			}, 'fast');
			
			$(tabSelected).css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
				backgroundColor: '#29967f',
				zIndex: '20'
			});
		}
		
		if (this.id == 'kids') {
			$(tabSelected).animate({ 
				height: '42px'
			}, 'fast');
			
			$(tabSelected).css({ 
				backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
				backgroundColor: '#296496',
				zIndex: '20'
			});
		}
//		else {
//			$(tabSelected).animate({ 
//				height: '34px'
//			}, 'fast');
//			
//			$(tabSelected).css({ 
//				backgroundImage: 'url(/Images/capfalco/tabs/tab-on.gif)',
//				backgroundColor: '#523f81',
//				zIndex: '20'
//			});
//		}
		
		$(".map-overall").fadeOut("slow");
		$(mapSelected).fadeIn("slow");
	});
	
	//$("a.iframe").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': false, 'frameWidth': 979, 'frameHeight': 551, 'overlayShow': true, 'hideOnContentClick': false });
});