	
	$(document).ready(function(){
							   
							   
	var counter = 0
	// var ocounter = 0
	news = $('#slideone, #slidetwo, #slidethree');
	office = $('#officeone, #officetwo, #officethree, #officefour, #officefive');

	
	function showNews () {
		
     	news.slideUp('fast')	
            .filter(function (index) { return index == counter % 3; }) // figure out correct div to show
			.slideDown('slow');													   
			
        counter++;

    }; // 

	showNews();// show first div    

	setInterval(function () {
        showNews(); // show next div
    }, 8 * 1000); // do this every 10 seconds 
	
	
	//function showOffice () {
//		
//     	office.fadeOut(0)	
//            .filter(function (index) { return index == ocounter % 4; }) // figure out correct div to show
//			.fadeIn('slow');													   
//			
//        ocounter++;
//
//    }; // 
//
//	showOffice();// show first div    
//
//	setInterval(function () {
//        showOffice(); // show next div
//    }, 6 * 1000); // do this every 10 seconds 
//							   
	



							   
		
		$(".propertyPhotoThumb").click(function(){
			$(".propertyPhotoPreview").css({backgroundImage:"url(" + this.href + ")"});
			return false;
		});
		
	});
	
	
var mainScrollX = 0;
	
	function mainScroll() {
		if (mainScrollX > 1421) {
			newScroll = 1;
			$("#officeContainer").scrollTo( newScroll + 'px', 500 );		}
		else
		{
			newScroll = mainScrollX + 474;
			$("#officeContainer").scrollTo( newScroll + 'px', 2500 );
		}
		
		mainScrollX = newScroll;
		setTimeout('mainScroll();', 5000);
	}	
