$j(document).ready(function($) {

    $j('input:text').each(function() {
     	var text;
     	
     	text = $j(this).parent().find("label").attr('alternativetext');
     	if (text == undefined){
     		text = $j(this).parent().find("label").find("span").eq(1).html();
     		}
     		
     	if (text != undefined && $j(this).attr('value') == "" ){	
	     	$j(this).attr('value',text);
	    }
	    
     	$j(this).attr('default',text);
     	
     	$j(this).focus(function() {
			if ($j(this).attr('value') == $j(this).attr('default')){
				$j(this).attr('value', '');	
			}             
        });
        $j(this).blur(function() {
			if ($j(this).attr('value') == ''){
				$j(this).attr('value', $j(this).attr('default')) ;	
			}             
        });
			        
        
    });
});

