 $().ready(function() {  

	$('.kwicks').kwicks({  
         min : 90,  
         spacing : 9
	});  
	
	$("#Scrollable").tablesorter({
			sortList:[[0,0],[1,0],[2,0]],
			widgets:['zebra']
			});

	$('#NC').click(function() {
		//$("#FlipBox").flip({direction: 'lr', color: '#FFF', content:$("#NCMap") });
		$('#NCMap').slideDown(1000);					
		$('#SCMap').hide();					
		$('#NCList').hide();					
		$('#SCList').hide();					
		$('#NC').attr('src', 'vsImages/Layout09/NorthCarolinaOn.jpg');
		$('#SC').attr('src', 'vsImages/Layout09/SouthCarolinaOff.jpg');
	});  

	$('#SC').click(function() {
		//$("#FlipBox").flip({direction: 'lr', color: '#FFF', content:$("#SCMap") });
		$('#NCMap').hide();					
		$('#SCMap').slideDown(1000);					
		$('#NCList').hide();					
		$('#SCList').hide();					
		$('#NC').attr('src', 'vsImages/Layout09/NorthCarolinaOff.jpg');
		$('#SC').attr('src', 'vsImages/Layout09/SouthCarolinaOn.jpg');
	});  

	$('#List').click(function() {
		$('#NCMap').hide();					
		$('#SCMap').hide();
		if ($('#NC').attr('src')== 'vsImages/Layout09/NorthCarolinaOn.jpg'){
			$('#NCList').slideDown(1000);
		}else{
			$('#SCList').slideDown(1000);
		}
		//$("#FlipBox").flip({direction: 'lr', bgColor: '#CCC', color: '#FFF', content:$("#NCList") });
	});  

	load();

	$('#FlipBox').hide();					
	$('#SCMap').hide();					
	$('#NCList').hide();					
	$('#SCList').hide();					
	$('#NCList table tr:even').addClass('odd');
	$('#SCList table tr:even').addClass('odd');

	$('#m2').hover(function(){
		MM_showMenu(window.mm_menu_2_0,-2,18,null,'a2');
		},
		function(){
		MM_startTimeout();
		});

	$('#m3').hover(function(){
		MM_showMenu(window.mm_menu_3_0,-2,18,null,'a3');
		},
		function(){
		MM_startTimeout();
		});

	$('#m4').hover(function(){
		MM_showMenu(window.mm_menu_4_0,-2,18,null,'a4');
		},
		function(){
		MM_startTimeout();
		});

	$('#m5').hover(function(){
		MM_showMenu(window.mm_menu_5_0,-2,18,null,'a5');
		},
		function(){
		MM_startTimeout();
		});

	$('#m6').hover(function(){
		MM_showMenu(window.mm_menu_6_0,-2,18,null,'a6');
		},
		function(){
		MM_startTimeout();
		});

	$('#RotateImage').show();

	$('#RotateImage').cycle({ 
	fx:    'uncover', 
	timeout: 9000,
	delay: 5000,
	pager: '#pager',	
	cleartype: 'true',
	containerResize: 0,
	pagerAnchorBuilder: function(idx, slide) { 
        return '<a href="#"><img src="vsImages/Layout09/spacer.gif" width="10" height="10" /></a>'; } 
	});

	$('#pager a').click(function() { 
		$('#RotateImage').cycle('pause'); 
	});


	$('#NewsCycle').cycle({ 
	fx:    'blindX', 
	timeout: 8000,
	prev: '#NewsPrev',
	next: '#NewsNext',
	delay: 1000
	});

	$('#NewsPrev').click(function() { 
		$('#NewsCycle').cycle('pause'); 
	});
	$('#NewsNext').click(function() { 
		$('#NewsCycle').cycle('pause'); 
	});

	$('#MoveInHeader').hover(function() { 
		if ($('#MoveInReady').attr('title')== 'Move In Ready'){
			$('#MoveInReady').animate({
			top:'-=100px',
			height:'+=100px'
			},1000); 
			$('#MoveInBody').animate({
			height:'+=100px'
			},1000); 
			$('#MoveInReady').attr('title', 'Move In Ready Homes');
		}else{
			$('#MoveInReady').animate({
			top:'+=100px',
			height:'-=100px'
			},1000); 
			$('#MoveInBody').animate({
			height:'-=100px'
			},1000); 
			$('#MoveInReady').attr('title', 'Move In Ready');
		}
	});
}); 