var canislib =
{
	titleMask :
	{
		init : function()
		{
			// Article page specific jQuery functions.
			$("input[type=text]").focus(function(srcc)
			{
				if ($(this).val() == $(this)[0].title)
				{
					$(this).val("");
				}
				return false;
			});

			$("input[type=text]").blur(function()
			{
				if ($(this).val() == "")
				{
					$(this).val($(this)[0].title);
				}
				return false;
			});

			$("input[type=text],input[type=password]").blur();
		}
	},
	showEdit :
	{
		init : function()
		{
			// Traffic light specific jQuery functions.
			  $("a.expandClick").click(function()
			  {
			  	event.preventDefault();
				$('#'+this.name).slideToggle(600);
				$("a.expandClick").hide();

				return false;
			  });

			   $("a.editLink").click(function(event){
				   event.preventDefault();
				   $('#edit'+this.name).show();
				   $('#show'+this.name).hide();

				   return false;
			   });

				$("a.iFrameLink").click(function(event){
				   event.preventDefault();
				   $('#edit'+this.name).show();
				   $('#show'+this.name).hide();

				   return false;
			   });

			   $("a.addLink").click(function(event){
				   event.preventDefault();
				   $('#edit'+this.name).show();
				   $('#show'+this.name).hide();

				   return false;
			   });

				$("a.deleteLink").click(function(){
					if(!confirm("Estas seguro de querer hacer esta eliminacion?"))
						return false;
				});

			   $("input[type=submit].saveButton").click(function(event){
					if(!confirm("Are you sure?"))
						return false;
			   });

			   $("input[type=button].showButton").click(function(event){
				   event.preventDefault();
				   $('#edit'+this.name).hide();
				   $('#show'+this.name).show();
			   });
		}
	},
	standardValidation :
	{
		init : function()
		{
			$('form.standardCocoasForm').ajaxForm({
							beforeSubmit:     validate_standardForm ,
							success: function(responseText, statusText) {

							   	var auxMsg = responseText.substring(0,17);
				   					var index = responseText.search("/script");

								if(auxMsg!="<script language=")
								{
									jQuery.facebox(responseText);
								}
								else
								{
									document.write(responseText);
								}
							}
					});
		}
	}
}