if(window.jQuery){
$(function(){
	$('a.act').each(function(){
		var a = this;
		if($(a).hasClass('delete')){
			$(a).click(function(){
				var url = this.href;
				var link = this;
				if(confirm("Удалить?")){
					$.post(url,{'ajax':1},function(){
						$(link).parent().fadeOut('fast',function(){ $(this).remove(); });
					});
				}
				else{
					$(link).parent().fadeOut('fast',function(){ $(this).fadeIn('fast')});
				}
				return false;
			});
		}
		else if($(a).hasClass('submit')){
			$(a).click(function(){
				var form=$(a).parents('form')[0];
				form.submit();
				return false;
			});
		}
	});

	window.hintList={};
	$('input.hint').each(function(){
		var i=this;
		window.hintList[i.id]=i.value;
		$(i).focus(function(){
			if($(this).hasClass('hint')){
				this.value='';
			}	
			if($(this).hasClass('secret')){
				this.type='password';
				
			}
		
		});
		$(i).blur(function(){
			if(this.value == ''){
				if($(this).hasClass('secret')){
					this.type='text';
				}
				this.value = hintList[this.id];
			}
			else{
				$(this).removeClass('hint');
			}
		});
	});

});
}
