/* -*- coding: utf-8-unix -*- */

// fix jquery template with Tidy
$(function(){
    $("script[type='text/x-jquery-tmpl']").each(function(idx){
	var err = false;
	var fun = function(str){ return str.replace(/^\s*<!\[CDATA\[/,'').replace(/\]\]>\s*$/,''); };
	try{
	    $(this).text(fun($(this).text()));
	}catch(ex){ err = true;}
	
	if(err){

	    var txt = fun(this.innerHTML || this.text);

	    try{

		this.innerHTML = txt;

	    }catch(ex){
		this.text = txt;
	    }

	}

    });
});

(function($){
    $.uiform=function(form){
	$(form).find('input:submit').button();
	$(form).find('input:text,input:password').each(
	    function(index,el){
		$(el).css({'padding':'3px'});
	    }
	);
	/*
  .button()
  .css({
          'font' : 'inherit',
         'color' : 'inherit',
    'text-align' : 'left',
       'outline' : 'none',
        'cursor' : 'text'
  });
  */
    };
})(jQuery);
