     
var flashvars = {};
var params = {};

params.bgcolor = "#FFFFFF";
params.wmode = "transparent";

var attributes = {};
swfobject.embedSWF("/flash/home-anim.swf", "embeded-flash", "965", "469", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

// Redirect mobile visitors


if (screen.width <= 699) {
	document.location = "/mobile";
}

$(document).ready(function() {
	
	$('#home-anim').orbit({
		animation: 'horizontal-push',           // fade, horizontal-slide, vertical-slide, horizontal-push
		animationSpeed: 1000,                	// how fast animtions are
		timer: true, 			 				// true or false to have the timer
		advanceSpeed: 8000, 		 			// if timer is enabled, time between transitions 
		pauseOnHover: false, 		 			// if you hover pauses the slider
		startClockOnMouseOut: false, 	 		// if clock should start on MouseOut
		startClockOnMouseOutAfter: 1000,		// how long after MouseOut should the timer start again
		directionalNav: true, 		 			// manual advancing directional navs
		// captions: true, 			 			// do you want captions?
		// captionAnimation: 'fade', 		 	// fade, slideOpen, none
		// captionAnimationSpeed: 800, 	 		// if so how quickly should they animate in
		// bullets: false,			 			// true or false to activate the bullet navigation
		// bulletThumbs: false,		 			// thumbnails for the bullets
		// bulletThumbLocation: '',		 		// location from this file where thumbs will be
		afterSlideChange: function(){}, 	 	// empty function 
		fluid: true                         	// or set a aspect ratio for content slides (ex: '4x3') 
	});

/*
	if(!FlashDetect.installed){
	    
	    $('#featured').orbit({
	    	'bullets' : true,
	    	 directionalNav: false,
	    	 afterSlideChange: function(){
	    	 						$('.slide-message').show();
	    	 					}
	    });
	    $('.orbit-wrapper').append('<div class="slide-message"><a id="slide-message-close-button" href="#" style="height:14px;width:14px;position:absolute;top:17px;left:250px;"><a></div>');
	    
	    $('#home-anim').css('margin','1px 0 0 -11px');
	    $('#embeded-flash, .orbit-wrapper, #featured').css({'width':'965px', 'height':'450px'});
	    
	    if ($.browser.msie && $.browser.version == 8.0) {
	    	$('#home-anim').css('top','-38px');
	    }
	    if ($.browser.msie && $.browser.version == 7.0) {
	    	$('#home-anim').css('top','-29px');
	    }

	    $('.orbit-bullets > li').each(function(index) {
			$(this).html(index + 1);
		});
	}
*/	
	$('#slide-message-close-button').click(function() {
		$('.slide-message').hide();
	});
	
	
	/*** hack for choose location pop up in IE ***/
	if (window.PIE && $.browser.msie) {
			
		$(this).find('.outer-choose-location-pop-up').each(function() {
			PIE.attach(this);	
		});
		$(document).find('.inner-choose-location-pop-up').each(function() {
			PIE.attach(this);	
		});
	}
	
	/*** choose a location pop up ***/
	$('.middle-big-box-placeholder .state').click(function(e) {
		e.preventDefault();
		
		var dataString = 'state=' + $(this).attr('state');
		$(this).parents('.dream-homes').find('.outer-choose-location-pop-up').show(0, function() {

			var outer_container = this;
			
			$.get('/homepage/location-select-flyout',
				dataString,
				function(html_results) {			
					$(outer_container).find('#choose-location-menu-content').html(html_results);
				}
			);
			
		});
				
	});
	/*** /choose a location pop up ***/

	// confirmation to leave orleans page
	$('.watch-now-button').click(function(e) {
		e.preventDefault();
		
		var answer = confirm('You are now leaving the Orleans Homebuilders, Inc. website.\n\nPLEASE NOTE: You are about to leave the Orleans Homebuilders, Inc. website.\nOrleans Homebuilders, Inc. is not responsible for, nor do we control, endorse or guarantee the content,\ntreatment, products and/or services of the subsequent pages.\n\nThank you.')
		if (answer){
			var link = $(this).attr('href');
			window.open(link, '_blank', 'status=0, toolbar=1, location=1, menubar=1');
			//window.location = link;
		}
	});

});

