// JavaScript Document

jQuery(document).ready(function(){
	if(jQuery('#search-form select').length > 0 ){
		jQuery('#search-form select').chosen();
	}
	if(jQuery('.box-content').length > 0){
		jQuery('.box-content').equalHeights();
	}
		
	if (!Modernizr.input.placeholder) {
            makePlaceholders();
    }
});

function makePlaceholders(){
	var inputs = jQuery("input[type=text], input[type=email], input[type=tel], input[type=url]");
	inputs.each(
		function(){
			var $this = jQuery(this);
			this.placeholderVal = $this.attr("placeholder");
			$this.val(this.placeholderVal);
		}
	).bind("focus", function(){
		var $this = jQuery(this);
		var val = jQuery.trim($this.val());
		if(val == this.placeholderVal || val == ""){
			$this.val("");
		}
	}).bind("blur", function(){
		var $this = jQuery(this);
		var val = jQuery.trim($this.val());
		if(val == this.placeholderVal || val == ""){
			$this.val(this.placeholderVal);
		}
	});
}
