
function bindAlertLinks() {
    $("#cluetip-inner #addButton").bind("click", function(){
        $("#cluetip").hide();
        $("#alerter").html("Alert set").animate( { backgroundColor: 'yellow' }, 200).animate({backgroundColor: '#ffffff'}, 800);
        return false;
    });  
   
 
}


jQuery(document).ready(function() {


 $("a.setAlert").click(function(){
    $("#cluetip").hide();
    $.post('/alerts/create', {'authenticity_token': $('input[name=authenticity_token]').val(), 'query': $("#querykeyword").val(), 'facets': $("#queryfacets").val(), 'count': $("#resultscount").val(), 'alert_type': $("#alert_type").val()}, function(){
        $("#alerter").html("Alert set, <br/><a href='/alerts/'>view your alerts</a>").animate( { backgroundColor: 'yellow' }, 200).animate({backgroundColor: '#ffffff'}, 800);
     });
    return false;
 });



        
    $("a.setAlert").tooltip({showURL: false, left: -80, top: 30});
	/*
	.cluetip({
    showTitle: false,
    width: 300,
    height: 70,
    dropShadowSteps: 5,
    positionBy: "bottomTop",
    topOffset: 20,
    leftOffset: 20,
    sticky: false,
    local: true,
    mouseOutClose: true,
    arrows: false,
    closeText: "", 
    onShow: bindAlertLinks  
    
    }); 
    */
    
 });