

var $j = jQuery.noConflict();

$j(document).ready(function(){

    $j('INPUT.auto-hint').each(function(i, el){
        if($j(this).val() == ''){
            $j(this).val($j(this).attr('title'));
        }
        $j(el).focus(function(){
            if ($j(this).val() == $j(this).attr('title')) {
                $j(this).val('');
            }       
        });
        $j(el).blur(function(){
            if ($j(this).val() == '') {
                $j(this).val($j(this).attr('title'));
            }
        });
    });
	
	// error states  
	
	$j('INPUT.auto-hint-error').each(function(i, el){
        if($j(this).val() == ''){
            $j(this).val($j(this).attr('title'));
        }
        $j(el).focus(function(){
            if ($j(this).val() == $j(this).attr('title')) {
                $j(this).val('');
            }       
        });
        $j(el).blur(function(){
            if ($j(this).val() == '') {
                $j(this).val($j(this).attr('title'));
            }
        });
    });
    

	

	

	/** 
	 * Character Counter for inputs and text areas 
	 */  
	$j('.word_count').each(function(){  
		
	
	    // get current number of characters 
	    var length = 11500;
	    // get current number of words  
	   // var length = $j(this).val().split(/\b[\s,\.-:;]*/).length;  
	    // update characters 
	    $j(this).parent().find('.counter').html( length + ' characters');  
	    // bind on key up event  
	    $j(this).keyup(function(){  
	        // get new length of characters  
	        var new_length = (11500 - $j(this).val().length)  
	        // get new length of words  
	        //var new_length = $(this).val().split(/\b[\s,\.-:;]*/).length;  
	        // update  
	        $j(this).parent().find('.counter').html( new_length + ' characters');  
	
		
	    });  
	});  


	$j('.word_count_bio').each(function(){  
		
	
	    // get current number of characters 
	    var length = 850;
	    // get current number of words  
	   // var length = $j(this).val().split(/\b[\s,\.-:;]*/).length;  
	    // update characters 
	    $j(this).parent().find('.counter1').html( length + ' characters');  
	    // bind on key up event  
	    $j(this).keyup(function(){  
	        // get new length of characters  
	        var new_length = (850 - $j(this).val().length)  
	        // get new length of words  
	        //var new_length = $(this).val().split(/\b[\s,\.-:;]*/).length;  
	        // update  
	        $j(this).parent().find('.counter1').html( new_length + ' characters');  
	
		
	    });  
	});  
	
	
	
});
