function bookmarksite( title, url )
{
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print)
	{ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
}

$.fn.cleartext = function() {
	return this.focus(function() {
		if( this.value == this.defaultValue )
			this.value = "";
	}).blur(function() {
        if( !this.value.length )
            this.value = this.defaultValue;
	});
};

$(document).ready(function(){
	$("table.striped tr:odd").addClass("alt-row");
	$('#page-listings li').click(function() {
        var href = $(this).find("a").attr("href");
        if(href) {
            window.location = href;
        }
    });
	$('#properties-slider li').click(function() {
        var href = $(this).find("a").attr("href");
        if(href) {
            window.location = href;
        }
    });

    $("#minprice").cleartext();
    $("#maxprice").cleartext();
	$("#search").validate();
	$("a[rel^='facebox']").facebox();
	$("#slideshow").cycle();
    $("#properties-slider").jCarouselLite({
		btnNext: "#btn-next",
		btnPrev: "#btn-prev",
		visible: 5,
		scroll: 5,
		auto: 5000,
		pauseOnHover: true,
		speed: 1000
	});
	$('#gallery-frame').cycle({
		fx:     'fade',
		speed:  'slow',
		timeout: 4000,
		pause: 'true',
		pager:  '#gallery-thumbs',
		pagerAnchorBuilder: function(idx, slide) {
			// return sel string for existing anchor
			return '#gallery-thumbs li:eq(' + (idx) + ') a';
		}
	});
});

