// JavaScript written by Scott Cate for Richard Hundhausen - summer 2007

function LogClick(hyperlink) {
    //If you want to trap events
    var logService = new Widgets.LogLink();
    logService.LogClick(hyperlink.href);
    //can also be called inline like this
    //RichHyperlink.AjaxWebsite.LogLink.RichHyperlinkLogClick(hyperlink.href);
}

/// what makes this async, is the simple use of a callback
/// even if it's a void method, you still get back a response
/// which can simple be ignored. The signature has to be there
/// so you don't get a javascript runtime error.
///
/// callback, timeout, and Error are optional, but hav eto be used in that order

function LogClickAsync(hyperlink) {
    //If you want to fire and forget
    var logService = new Widgets.LogLink();
    logService.LogClick(hyperlink.href, LogLink_CallBack, LogLink_TimeOut, LogLink_Error);
    
    //can also be called inline like this
    //RichHyperlink.AjaxWebsite.LogLink.RichHyperlinkLogClick(hyperlink.href, LogLink_CallBack);
    //or
    //RichHyperlink.AjaxWebsite.LogLink.RichHyperlinkLogClick(hyperlink.href, LogLink_CallBack, LogLink_TimeOut);
    //or
    //RichHyperlink.AjaxWebsite.LogLink.RichHyperlinkLogClick(hyperlink.href, LogLink_CallBack, LogLink_TimeOut, LogLink_Error);
}

function LogLink_CallBack(loggedURL, originalLink) {
    //alert('in callback');
    //do nothing, the service has allready been hit, the link will continue
    //this is a great place to set a break point, and debug the variables for
    //a great education on what comes back as the response.
}

function LogLink_TimeOut(res) {
    //alert('timeout');
    //do nothing, the service has allready been hit, the link will continue
    //this is a great place to set a break point, and debug the variables for
    //a great education on what comes back as the response.
}

function LogLink_Error(err) {
    //alert('timeout');
    //do nothing, the service has allready been hit, the link will continue
    //this is a great place to set a break point, and debug the variables for
    //a great education on what comes back as the response.
}
