/* Author: Supereight Studio ltd.

*/

/* Remove focus value */
$('input[name=minCost]').focus(function() {
    value=$(this).val();
    if (value == " Min" ) {
	   $(this).attr("value","");
    }
});

$('input[name=minCost]').blur(function() {
    value=$(this).val();
    if (value == "" ) {
	   $(this).attr("value"," Min");
    }
});

$('input[name=maxCost]').focus(function() {
    value=$(this).val();
    if (value == " Max" ) {
	   $(this).attr("value","");
    }
});

$('input[name=maxCost]').blur(function() {
    value=$(this).val();
    if (value == "" ) {
	   $(this).attr("value"," Max");
    }
});

// ie6 form selectors
$(function () {
	$('input[type="text"]').addClass("text");
	$('input[type="checkbox"]').addClass("checkbox");
	$('textarea').addClass("textarea");
});

// :nth-child
$(function () {
	$("#properties_highlight ul li:nth-child(2n+2)").addClass("last");
	$("#properties_highlight ul li:nth-child(2n+1)").addClass("first");
	$("#properties_highlight ul li:nth-child(3n+3)").addClass("first");
	$("#property_images ul#thumbs li:nth-child(3n+3)").addClass("last");
	$("#three_col_layout .col:nth-child(3n+3)").addClass("last");
});

$(function() {
// Fix for IE6 & 7 to maintain input focus styling
	if ($.browser.msie === true) {
        $('input[type="text"]').bind('focus', function() { 
        	$(this).addClass("ieFocus"); })
            .bind('blur', function() { 
            $(this).removeClass("ieFocus"); 
        });
        
        $('textarea').bind('focus', function() { 
        	$(this).addClass("ieFocus"); })
            .bind('blur', function() { 
            $(this).removeClass("ieFocus"); 
        });
        
        $('input[type="password"]').bind('focus', function() { 
        	$(this).addClass("ieFocus"); })
            .bind('blur', function() { 
            $(this).removeClass("ieFocus"); 
        });
    } 
});

// Facebox
jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox({
    loadingImage : '/js/facebox/loading.gif',
    closeImage   : '/js/facebox/closelabel.png'
  })
});













