// JavaScript Document
$(document).ready(function ()
{
	//If javascript is enabled the form action will now point to the right place.
	//This will block most spam bots.
	$("#interestForm").attr('action', "http://www.interestlists.net/uni-handler-mp.htm");

	$("ul#gallery").gallerySlide();
	
	$("body.register form").validate();
	
	$(".glb, .location_map").galleryLightbox();
	
	$("#banner").funBars();
	
	$("#res_links a").click(function () {
		$("#floorplan_module").attr('src', $(this).attr('href'));
		$("#res_links a").removeClass('on');
		$(this).addClass('on');
		return false;
	});

	$("#video").iframeLightbox({width: '600px', height: '340px', scrolling: 'no'});
	$("#video").click(function () {
		$("#funBarOverflow div").stop();
		// clearAllTimeouts
		for(key in window.timeOuts) {
			clearTimeout(window.timeOuts[key]);
		}
		// sweep up
		setInterval(function () {
			// stop all animations
			$("#funBarOverflow div").stop();
			// clearAllTimeouts
			for(key in window.timeOuts) {
				clearTimeout(window.timeOuts[key]);
			}
		}, 1000);
		

	});
	
	$("#page_number1").click(function () { $("#res1").show(); $("#res2, #res3").hide(); });
	$("#page_number2").click(function () { $("#res2").show(); $("#res1, #res3").hide(); });
	$("#page_number3").click(function () { $("#res3").show(); $("#res1, #res2").hide(); });
	
	if($("#main_wrapper").height() < 747) { $("#main_wrapper").css({'height': '747px'}); }
	
	// Replaced with CSS3/PIE.htc for better performance
	// load the dropshadow but for the residences page, lets wait 1.5 seconds first
	/*if($.browser.msie) {
		if(!$("body.residences").length) { 
			$("#main_wrapper").dropShadow({opacity: 0.4, blur: 6, left: 1, top: 1});
			$(".dropShadow").show();
		}
		else {
			setTimeout(function () {
				$("#main_wrapper").dropShadow({opacity: 0.4, blur: 6, left: 1, top: 1});	
				$(".dropShadow").fadeIn();
			}, 1500);
		}
	}*/
	
	/*
	$("#sitemapMap area.qtip").each(function() {
		var theContent = $("#" + $(this).attr('id') + "-info");
		
		var theTooltip = $(this).qtip({
			content: theContent,
			position: {
				corner: {
					target: 'topLeft',
					tooltip: 'bottomRight'
				}
			},
			style: {
				border: {
					radius: 5,
					width: 5,
					padding: 5
				},
				tip: 'bottomRight',
				name: 'cream'
			}
			
		});
	});
	*/

});
