var $j = jQuery.noConflict();
$j(document).ready(function() {
	/* Pretty rounded corners everywhere (but IE)! */
/*@cc_on
	/*@if (@_win32)
		var browserTest = 'is IE';
	@else @*/
		$j('.page-template #content, .rounded, .widget-area .menu-navigation-container, .post-content img').corner('keep round 8px');
		$j('#search-bar div').corner('keep top 8px');
	/*@end
@*/
	
	/* Slideshow of homes on Homepage */
	$j('#home-slideshow').children('br,p').remove();
	$j('#home-slideshow').cycle('fade');
	
	/* Lightbox for signups */
	$j('a.alert-signup').colorbox({width:'670px', height:'690px', iframe:true});
	$j('a.virtual-tour').colorbox({width:'780px', height:'600px', iframe:true});
	
	/* Quick Search */
	$j('#quick-search input').attr('readonly','').val('type MLS# and hit enter');
	$j('#quick-search input').focus( function() {
		$j(this).val('');
	});
	$j('#quick-search input').blur( function() {
		$j(this).val('type MLS# and hit enter');
	});
	
	$j('form#quick-search').submit(function() {
		var userInput = $j('form#quick-search input').val();
			if ( isNaN (userInput) ) {
			// search streets here!
				idxUrl = 'street=' + userInput;
			} else {
				if ( userInput.length == 5 ) {
				// if it's 5 numbers, it's a ZIP!
					idxUrl = 'zip=' + userInput;
				} else {
				// if it's more than 5, it's an MLS#!
					idxUrl = 'mls=' + userInput;
				}
			}
		window.location = 'http://rockportproperties.com/interactive-search/?' + idxUrl;
		return false;
	});
	
});
