// JavaScript Document

    

	/////////////////////

$(document).ready(function() {
	
	
	/////////////////////
	var deviceAgent = navigator.userAgent.toLowerCase();
    var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
    
	if (agentID) {
     
	 $('.front-content-left').css("height","auto");

    }
	
	/////////////////////
	var deviceAgent = navigator.userAgent.toLowerCase();
    var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
    
	if (agentID) {
     
	 $('.property-description').css("height","auto");

    }
	
	
	/////////////////////
	
	
	
	if($('.dropper').length > 0 ){
	
		$('.dropper').click(function () {
		
			$(this).prev('.drop').slideToggle();
			
			
			if ( $(this).text() == 'Read More...' ) {
				
				$(this).text('Close')
				
			} else if ( $(this).text() == 'Close') {
				
				$(this).text('Read More...')
				
			}
			return false;
		
		})
	
	};
	
	/////////////////////
	
	if($('.currentdevelopments-bottom').length > 0 ){
		
		
		$(".currentdevelopments-bottom").scrollable({
			
			circular: true,
			next:".front-page-next",
			prev:".front-page-prev"
		
		}).navigator().autoscroll({ interval: 5000	 });; 
		
		
	};
	
	/////////////////////
	
	
	

	
	if($('.image-rotate').length > 0 ){
		
		
		$('.image-rotate').cycle({
			
			fx: 'fade',
			pager:  '.style-pods-left-buttons' ,
			pagerEvent:    'click.cycle',
        	pagerAnchorBuilder: function(idx, slide) {            	return '.style-pods-left-buttons a:eq(' + (idx) + ') ';       		}
			
		});
		
		
	};	
	
	/////////////////////
	
	
	if($('.image-rotate2').length > 0 ){
		
		
		$('.image-rotate2').cycle({
			
			fx: 'fade',
			pager:  '.property-gallery-left' ,
			pagerEvent:    'click.cycle',
        	pagerAnchorBuilder: function(idx, slide) {            	return '.property-gallery-left-buttons a:eq(' + (idx) + ') ';       		}
			
		});
		
		
	};	
	
	/////////////////////
	
	
	/////////////////////
	
	
		if($('.image-rotate-banner').length > 0 ){
		
		
		$('.image-rotate-banner').cycle({
			
			fx: 'fade'
			
			});
		
		
	};	
	
	/////////////////////
	
	if($('.scroll0').length > 0 ){
		
		
		$(".scroll0").scrollable({
			
			//circular: true,
			next:".front-page-next0",
			prev:".front-page-prev0"
		
		}).navigator();
		
		
	};
	
	
	
	if($('.scroll1').length > 0 ){
		
		
		$(".scroll1").scrollable({
			
			//circular: true,
			next:".front-page-next1",
			prev:".front-page-prev1"
		
		}).navigator();
		
		
	};
	
	if($('.scroll2').length > 0 ){
		
		
		$(".scroll2").scrollable({
			
			
			//circular: true,
			next:".front-page-next2",
			prev:".front-page-prev2"
		
		}).navigator();
		
		
	};
	if($('.scroll3').length > 0 ){
		
		
		$(".scroll3").scrollable({
			
			
			//circular: true,
			next:".front-page-next3",
			prev:".front-page-prev3"
		
		}).navigator();
		
		
	};
	if($('.scroll4').length > 0 ){
		
		
		$(".scroll4").scrollable({
			
			
			//circular: true,
			next:".front-page-next4",
			prev:".front-page-prev4"
		
		}).navigator();
		
		
	};
	if($('.scroll5').length > 0 ){
		
		
		$(".scroll5").scrollable({
			
			//circular: true,
			next:".front-page-next5",
			prev:".front-page-prev5"
		
		}).navigator();
		
		
	};
	
	if($('.scroll01').length > 0 ){
		
		
		$(".scroll01").scrollable({
			
			//circular: true,
			next:".front-page-next01",
			prev:".front-page-prev01"
		
		}).navigator();
		
		
	};
	/////////////////////
	
	
	if($('.about-us-more').length > 0 ){
		
		$(".about-us-more li.top:even").addClass("odd");
	};
	
	
	/////////////////////
	
	
	if($('.land-case-study').length > 0 ){
		
		$(".land-case-study li.top:even").addClass("odd");
	};
	
	
	
	
	////////////////////
	
	if($('.tabs').length > 0 ){
		
		if ( $("ul.tabs li:first a").hasClass("active")) {
			$("ul.tabs li:first a").addClass("active").show();
		} else if ( $("ul.tabs li:eq(1) a").hasClass("active")) {
			$("ul.tabs li:eq(1) a").addClass("active").show();
		}
		
		$(".tab_content").hide();
		
		if ( $("ul.tabs li:first a").hasClass("active")) {
			$(".tab_content:first").show(); 
		} else if ( $("ul.tabs li:eq(1) a").hasClass("active")) {
			$(".tab_content:eq(1)").show(); 
		}
		
		
	
		$("ul.tabs li a").click(function() {
	
			$("ul.tabs li a").removeClass("active"); 
			
			$(this).addClass("active");
			
			$(".tab_content").hide(); 
			
			var activeTab = $(this).attr("href"); 
			
			$(activeTab).fadeIn(); 
			
			return false;
			
		});
		
	};
	
	/////////////////////
	
	
	$(".dimension-table tr").mouseover(function(){
		
		$(this).addClass("over");
		
	}).mouseout(function(){
			
		$(this).removeClass("over");
			
	});
   	
	$(".dimension-table tr:even").addClass("even");
	
	
	/////////////////////
	
	
	$(".standard-table tr").mouseover(function(){
		
		$(this).addClass("over");
		
	}).mouseout(function(){
			
		$(this).removeClass("over");
			
	});
   	
	$(".standard-table tr:even").addClass("even");
	
	
	/////////////////////
	
	$(".job-list .row").mouseover(function(){
		
		$(this).addClass("over");
		
	}).mouseout(function(){
			
		$(this).removeClass("over");
			
	});
   	
	$(".job-list .row:even").addClass("even");
	
	
	/////////////////////
	
	$(".member-drop-link").click(function(){
		
		$(".member-drop").slideDown();
		
		return false;
		
	})
	/////////////////////
	
 	
	$('.dev-spec-header .print').click(function() {
  
  		window.print();
  
  		return false;
 
 	});


/////////////////////

	
	
	/*if($('.direction-submit').length > 0 ){
	
		$( ".direction-submit" ).button();
		
		//$( "a", ".direction-submit" ).click(function() { return false; });
	
	};*/
	

/////////////////////
	
 	
	$(".cb-enable").click(function(){
			var parent = $(this).parents('.switch');
			$('.cb-disable',parent).removeClass('selected');
			$(this).addClass('selected');
			$('.checkbox',parent).attr('checked', true);
	});
	
	$(".cb-disable").click(function(){
		var parent = $(this).parents('.switch');
		$('.cb-enable',parent).removeClass('selected');
		$(this).addClass('selected');
		$('.checkbox',parent).attr('checked', false);
	});


	
	/////////////////////
	

	if($('a.info').length > 0 ){
	
		$('a.info').cluetip({local:true, cursor: 'pointer', sticky: true});		

	};

	
	/////////////////////
	
	
	/////////////////////
	

	if($('a.info-sold ').length > 0 ){
	
		$('a.info-sold ').cluetip({local:true, cursor: 'pointer', sticky: true});		

	};

	
	/////////////////////
	
	
	/////////////////////
	

	if($('a.info-coming-soon').length > 0 ){
	
		$('a.info-coming-soon').cluetip({local:true, cursor: 'pointer', sticky: true});		

	};


/////////////////////
	

	if($('a.info-reserved').length > 0 ){
	
		$('a.info-reserved').cluetip({local:true, cursor: 'pointer', sticky: true});		

	};

	
	/////////////////////
	

	 $('input[title!=""]').hint();
	
	
	/////////////////////

});





///////////////////
		
jQuery.fn.hint = function () {
	
	blurClass = 'blur';
  

  return this.each(function () {
	// get jQuery version of 'this'
	var $input = jQuery(this),

	// capture the rest of the variable to allow for reuse
	  title = $input.attr('title'),
	  $form = jQuery(this.form),
	  $win = jQuery(window);

	function remove() {
	  if ($input.val() === title && $input.hasClass(blurClass)) {
		$input.val('').removeClass(blurClass);
	  }
	}

	// only apply logic if the element has the attribute
	if (title) { 
	  // on blur, set value to title attr if text is blank
	  $input.blur(function () {
		if (this.value === '') {
		  $input.val(title).addClass(blurClass);
		}
	  }).focus(remove).blur(); // now change all inputs to title

	  // clear the pre-defined text when form is submitted
	  $form.submit(remove);
	  $win.unload(remove); // handles Firefox's autocomplete
	}
  });
  
};

///////////////////
////////////////////////////
	
Shadowbox.init({

	counterType: 'skip'

});
///////////////////
////////////////////////////
