function doLink(link)
{
    var url = "showEvent.aspx?id=" + link;
    window.opener.location.href = url;
    window.close();
}

function showCal()
{
    var x = window.open("popupCal.aspx", "DatePicker", "width=200px,height=180px,menubar=no,toolbar=no,location=no,status=no");
}

function showAdminCal(sInput)
{   
    var x = window.open("cal1.aspx?formname=" + sInput, "cal", "width=260,height=260,toolbar=no,history=no,address=no");
}

function doLogOff()
{
    var x = confirm("Are you sure you want to log off?");
    if(x)
    {
	    document.location.href = "CalendarLogon.aspx?lo=t"
    }
} 

function doDelete(nID)
{
    var x = confirm("Are you sure you want to delete this event?");
    if(x)
    {
	    document.location.href = "Admin.aspx?id=" + nID;
    }
}

function writeFaceBook()
{
    var hds = document.getElementsByTagName("h1");
    
    var header = hds[0];
    //alert(header.innerHTML);
    
    var earl = document.location.href;
    var earl = earl.replace("http://", "http%3A%2F%2F");
    var earl = earl.replace("default.aspx", "");
    
    var src = "<iframe src='http://www.facebook.com/plugins/like.php?href=" + earl + "&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font&amp;colorscheme=light&amp;height=80' scrolling='no' frameborder='0' style='overflow:hidden;' allowTransparency='true'></iframe>";
    
    header.innerHTML += src;
    
}

if (window.attachEvent)
{
    window.attachEvent("onload", writeFaceBook);
}
else if (window.addEventListener)
{
    window.addEventListener("load", writeFaceBook, false);
}
