
var url = "http://web.byui.edu/Calendar/";
document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + url + "css/Calendar.css\" />");
document.write("<script type=\"text/javascript\" src=\"//web.byui.edu/Compression/js.axd?files=/js/ajax/ajaxroutine.js\"></script>");

var calendarDiv;
var days;
var pageSize;
var category;
var CalendarListIframe;

var ajaxEvents;

function GetCalendar(cat, daysTemp, pageSizeTemp, cDiv, iFrame)
{
    if(cDiv)
        calendarDiv = document.getElementById(cDiv);
    if(!ajaxEvents)
        ajaxEvents = new ajax();
    days = daysTemp;
    pageSize = pageSizeTemp;
    category = cat
    calendarDiv.innerHTML = "Loading...";
    queryString = "Category=" + category + "&ForDays=" + days + "&PageSize=" + pageSize
    ajaxEvents.getRequest("http://activities.byui.edu/EventsSvc/CalendarListProxy.asp", queryString, ShowCalendar,"string");
      
    return false;
}

function GetCalendar2(page)
{
    calendarDiv.innerHTML = "Loading...";
    queryString = "Category=" + category + "&ForDays=" + days + "&Page="+page + "&PageSize=" + pageSize;
    ajaxEvents.getRequest("http://activities.byui.edu/EventsSvc/CalendarListProxy.asp", queryString, ShowCalendar,"string");
    return false;
}

function ShowCalendar(result)
{   
    if(calendarDiv)
    {
        calendarDiv.innerHTML = result;
    }    
}
function showMore(id, item)
{
    objLess = document.getElementById("less" + id);
    objMore = document.getElementById("more" + id);
    if(objLess.className == "CalendarListEventDescritpionLess CalendarListhide")
    {
        objLess.className = "CalendarListEventDescritpionLess CalendarListshow";
        objMore.className = "CalendarListEventDescritpionMore CalendarListhide";
        item.src = url + "images/Event_Open.gif";
    }
    else
    {
        objLess.className = "CalendarListEventDescritpionLess CalendarListhide";
        objMore.className = "CalendarListEventDescritpionMore CalendarListshow";
        item.src = url + "images/Event_Close.gif";
    }
    return false;
}