function CourseCompleted(id)
{
    $("#completedmessage").show("slow");
    PageMethods.ProcessCompleted(onCourseSucceed, onCourseFailed);
}

function onCourseSucceed(result, usercontext, methodname) {
    
}

function onCourseFailed(error, usercontext, methodname) {
    
}

function shownav(id)
{
    $("#" + id).slideToggle("slow");
}

function showslidelist(id) {
    var item = $("#b" + id)
    if (item.hasClass("zoominicon")) {
        item.addClass("zoomouticon");
        item.removeClass("zoominicon");
        item.text("Collapse");
    }
    else {
        item.removeClass("zoomouticon");
        item.addClass("zoominicon");
        item.text("Expand");
    }
    //item.removeClass(
    $("#" + id).slideToggle("slow");
}

function addNewRow(id)
{
    var table = document.getElementById(id).getElementsByTagName("tbody")[0];
    var rowcount = parseInt(table.getElementsByTagName("input").length / 2);
    var row = document.createElement("tr");
    var td1 = document.createElement("td");
    td1.appendChild(getTextBox(rowcount, "firstname"));
    var td2 = document.createElement("td")
    td2.appendChild(getTextBox(rowcount, "lastname"));
    row.appendChild(td1);
    row.appendChild(td2);
    table.appendChild(row);
}

function getTextBox(count, name)
{
    var textbox = document.createElement("input");
    textbox.setAttribute("name", name + "_" + count);
    textbox.setAttribute("type", "text");
    return textbox;
}

function createEmailLink(user, domain, suffix)
{
    document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + user + '@' + domain + '.' + suffix + '</a>');
}

function changeStyle(obj, classname)
{
    obj.className = classname;
}

$(document).ready(function(){  
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");  
});  