function openMW(ID, WIDTH, HEIGHT, URL, TITLE, THEME, CLOSE) {

  Window.keepMultiModalWindow=true;

  var THEMEIS = 'alphacube';
  var CLOSEIS = true;

  if (THEME) {  
    THEMEIS = THEME;  
  }

  if (CLOSE) {  
    CLOSEIS = false;  
  }

  win = new Window(ID, {className: THEMEIS, title:TITLE, recenterAuto:false,
				width:WIDTH, height:HEIGHT, closable:CLOSEIS,
				maximizable:false, minimizable:false,
				zIndex: 100, resizable: true, wiredDrag: true,
				url: URL, showEffectOptions: {duration:.25}});

  win.show(true);	
  win.showCenter();      
  win.setDestroyOnClose();
}

var closeWindows = function(WINID, GOTOURL) {

  Windows.close(WINID);

  if (GOTOURL) {  
    window.location.href = GOTOURL;
  }  
}

jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};


function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.

    
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
     
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    }); 

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });

    carousel.clip.bind('click', function() {
        carousel.startAuto(0);
    });

};

  function disableSubareas() {
	document.getElementById('listingCountyArea_f').disabled="disabled"; 

					jQuery("#countyAreas").css({
						"color": "#cccccc" 
					});
  }
  function enableSubareas() {
	document.getElementById('listingCountyArea_f').disabled=""; 

					jQuery("#countyAreas").css({
						"color": "#000000" 
					});
  }

  function enableDisable() {
    var TblIs = jQuery("#classTbl_f").val();

    if ( TblIs == "rets_active_res" || TblIs == "rets_active_cond" ) {
	document.getElementById('listingHasPool_f').disabled="";

					jQuery("#HasPool").css({
						"color": "#000000" 
					});
    } else {
	document.getElementById('listingHasPool_f').disabled="disabled"; 
					jQuery("#HasPool").css({
						"color": "#cccccc" 
					});
    }

  }


jQuery(document).ready(function(){

  jQuery("a.btnMain").hover(function(){jQuery(this).fadeOut(0);jQuery(this).fadeIn(300);});jQuery("a.btnPaging").hover(function(){jQuery(this).fadeOut(0);jQuery(this).fadeIn(300);});jQuery(".thumb").hover(function(){jQuery(this).fadeOut(0);jQuery(this).fadeIn(300);});

    jQuery('#mycarousel').jcarousel({
        auto: 0,
        start: 3,
        wrap: 'last',
        /*easing: 'BounceEaseOut',*/  
        animation: 800,
	scroll: 1,
        initCallback: mycarousel_initCallback
    });
/**/ 

});


function openConfirm() {
  Dialog.alert("<div style='text-align:left;'><b>Login Required<\/b> -- To access requested feature!<br /><br /><div style='letter-spacing:2px;font-size: 14px;'>Membership Benefits...<\/div><ul style='margin-top:0px;'><li>Access all online Knoxville Tennessee area Listings<\/li><li>Instant access to detailed listing information<\/li><li>Search foreclosures &amp; recently reduced listings<\/li><li>Listings include ALL available photos<\/li><li>Save favorite listings for future 1-click access<\/li><li>Save searches for future 1-click access<\/li><li>Print Flyers &amp; Submit Offers Online<\/li><li>Membership is FREE, Sign up Today!<\/li><\/ul><span style='font-size:95%'>* All listing data on KnoxHouses is provided by the Knoxville Area Association of REALTORS® MLS via RETS (Real Estate Transaction Standard)<\/span><\/div>",{className:"alphacube", top:40, left:30, width:400, height:null, okLabel: "O K"})
}    