var ajax_loading = "<div class='loader'><img src='/images/loader.gif'></div>";


function SearchSuggest(	suggestBoxId,
						gateway,
						inputString,
						inputValue,
						inputShow )
{
    suggestBoxId = '#' + suggestBoxId;
    
	if(inputString.length == 0)
    {
		$(suggestBoxId).fadeOut();
	}
    else
    {
		$.post(
				gateway,
				{
					queryString: ""+inputString+"",
					valueElem: inputValue,
					showElem: inputShow
				}, 
				function(data)
				{
					$(suggestBoxId).fadeIn();
					$(suggestBoxId).html(data);
				});
	}
}

function HideElement( id )
{
    id = '#' + id;
    $(id).fadeOut();
}

function toggleError( elem )
{
	var $elemId = elem.getAttribute('id');
	$('#ERROR_'+$elemId).fadeOut();
}

function novedades( sendData, container )
{
    var $urlPath;

    $urlPath = $basePath+"default/NewsList";
    
    if( $("#"+container).length > 0 )
    {
        $("#"+container).html(ajax_loading);
        $.ajax(
        {
            type: "post",
            url: $urlPath,
            data: sendData,
            success: function(data)
            {
                $('#'+container).html(data);
            }
        });
    }
}
