//DEFINE ALL VARS//
function toggle(id)
{
    if(document.getElementById(id))
    {
        if(document.getElementById(id).style.display == "none" || document.getElementById(id).style.display === "")
        {
            document.getElementById(id).style.display = "block";
        }
        else
        {
            document.getElementById(id).style.display = "none";
        }
        if(document.getElementById(id + '_link'))
        {
            if(document.getElementById(id + '_link').style.backgroundImage.match("min.png") == "min.png")
            {
                document.getElementById(id + '_link').style.backgroundImage = "url(images/plus.png)";
            }
            else
            {
                document.getElementById(id + '_link').style.backgroundImage = "url(images/min.png)";
            }
        }
        if(document.getElementById(id + '_expand'))
        {
            if(document.getElementById(id + '_expand').innerHTML == "Collapse")
            {
                document.getElementById(id + '_expand').innerHTML = "Expand";
            }
            else
            {
                document.getElementById(id + '_expand').innerHTML = "Collapse";
            }
        }
    }
    else
    {
        alert('Sorry your browser does not support the JS to do this action');
    }
}

function searchToggle(type)
{
    if(document.getElementById('formlink'+type).className == "search_minus")
    {
        document.getElementById('formdiv'+type).style.display = "none";
        document.getElementById('formlink'+type).className = "search_plus";
    }else{
        document.getElementById('formdiv'+type).style.display = "block";
        document.getElementById('formlink'+type).className = "search_minus";
    }
}

function filter(id)
{
    document.getElementById('info_online').className = "info_hide";
    document.getElementById('info_facetoface').className = "info_hide";
    document.getElementById('info_hybrid').className = "info_hide";
    document.getElementById('info_cvit').className = "info_hide";
    document.getElementById('info_openlearning').className = "info_hide";
    document.getElementById('info_help').className = "info_hide";
    document.getElementById('infotab_online').className = "infotab_online";
    document.getElementById('infotab_facetoface').className = "infotab_facetoface";
    document.getElementById('infotab_hybrid').className = "infotab_hybrid";
    document.getElementById('infotab_cvit').className = "infotab_cvit";
    document.getElementById('infotab_openlearning').className = "infotab_openlearning";
    document.getElementById('infotab_help').className = "infotab_help";
    document.getElementById('info_' + id).className = "info_show";
    document.getElementById('infotab_' + id).className = "infotab_" + id + "_selected";
}

//OVERLAY//
function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
        {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}
setTimeout("changeOpac(0, 'overlay_back')", 1000);

var showContent = '';
function messageBox(){
    var reg = /(^\d+$)|(^\d+\.\d+$)/
    if (reg.test(arguments[0]))
    {
        var width = arguments[0];
        var height = arguments[1];
        var content = arguments[2];
        id = 'custom';
    }
    else
    {
        id = arguments[0];
    }
    if(id === ''){
        if(showContent == "OtherFilters")
        {
            newSearch();
        }
        changeOpac(0, 'overlay_back');
        document.getElementById('overlay').style.display = "none";
        document.getElementById('overlay_back').style.display = "none";
        showContent = '';
    }else if(id == 'custom'){
        document.getElementById('overlay_content').style.width = width + "px";
        document.getElementById('overlay_content').style.height = height + "px";
        document.getElementById('overlay_content').style.marginLeft = (-1 * parseInt(width)/2) + "px";
        document.getElementById('overlay_content').style.top = (-1 * parseInt(height)/2) + "px";
        document.getElementById('overlay').style.display = "block";
        document.getElementById('overlay_back').style.display = "block";
        changeOpac(60, 'overlay_back');
        showContent = id;
        document.getElementById('overlay_content').innerHTML = decodeURIComponent(content);
    }else if(id == 'Loading'){
        document.getElementById('overlay_content').style.width = "140px";
        document.getElementById('overlay_content').style.height = "33px";
        document.getElementById('overlay_content').style.marginLeft = "-50px";
        document.getElementById('overlay_content').style.top = "-15px";
        document.getElementById('overlay').style.display = "block";
        document.getElementById('overlay_back').style.display = "block";
        changeOpac(60, 'overlay_back');
        showContent = id;
        var data = '<h1 style="text-align:center;padding-top:2px;">Loading...</h1>';
        document.getElementById('overlay_content').innerHTML = data;
    }else if(id == 'Waiting'){
        document.getElementById('overlay_content').style.width = "140px";
        document.getElementById('overlay_content').style.height = "33px";
        document.getElementById('overlay_content').style.marginLeft = "-50px";
        document.getElementById('overlay_content').style.top = "-15px";
        document.getElementById('overlay').style.display = "block";
        document.getElementById('overlay_back').style.display = "block";
        changeOpac(60, 'overlay_back');
        showContent = id;
        var data = '<h1 style="text-align:center;padding-top:2px;">Waiting...</h1>';
        document.getElementById('overlay_content').innerHTML = data;
    }else if(id == 'OtherFilters'){
        document.getElementById('overlay_content').style.width = "600px";
        document.getElementById('overlay_content').style.height = "370px";
        document.getElementById('overlay_content').style.marginLeft = "-300px";
        document.getElementById('overlay_content').style.top = "-185px";
        document.getElementById('overlay').style.display = "block";
        document.getElementById('overlay_back').style.display = "block";
        changeOpac(60, 'overlay_back');
        showContent = id;
        var data = '';
        data += '<ul class="dispro" style="border-right:1px solid #94866F;width:299px;">';
        data += '<li style="background:#FFF;"><h1 style="border-bottom:none;">Distribution Area</h1></li>';
        data += '<li><a id="distribution1a" href="javascript:select(\'distribution1a\')">Area I: Fine Arts</a></li>';
        data += '<li><a id="distribution2a" href="javascript:select(\'distribution2a\')">Area II: Humanities</a></li>';
        data += '<li><a id="distribution3a" href="javascript:select(\'distribution3a\')">Area III: U.S. Cultures</a></li>';
        data += '<li><a id="distribution4a" href="javascript:select(\'distribution4a\')">Area IV: Other Cultures</a></li>';
        data += '<li><a id="distribution5a" href="javascript:select(\'distribution5a\')">Area V:Social & Behavioral Sci</a></li>';
        data += '<li><a id="distribution6a" href="javascript:select(\'distribution6a\')">Area VI:Natural Science w/ Lab</a></li>';
        data += '<li><a id="distribution6b" href="javascript:select(\'distribution6b\')">Area VI:Natural Science-Lec</a></li>';
        data += '<li><a id="distribution6c" href="javascript:select(\'distribution6c\')">Area VI: Natural Science-Lab</a></li>';
        data += '<li><a id="distribution7a" href="javascript:select(\'distribution7a\')">Area VII: Natural Sci & Tech</a></li>';
        data += '<li><a id="distribution8a" href="javascript:select(\'distribution8a\')">Area VIII: Health & Well-Being</a></li>';
        data += '<li class="dispro_all dispro_all_fix"><a style="background-image:url(images/accept.png);border-right:1px solid #94866F;" href="javascript:selectAll(\'distribution\')">Select All</a></li>';
        data += '<li class="dispro_all"><a style="background-image:url(images/delete.png);" href="javascript:deselectAll(\'distribution\')">Deselect All</a></li>';
        data += '</ul>';
        data += '<ul class="dispro">';
        data += '<li style="background:#FFF;"><h1 style="border-bottom:none;">Proficiency</h1></li>';
        data += '<li><a id="proficiency1a" href="javascript:select(\'proficiency1a\')">P1: College Level Writing</a></li>';
        data += '<li><a id="proficiency2a" href="javascript:select(\'proficiency2a\')">P2:Baccalaureate Level Writing</a></li>';
        data += '<li><a id="proficiency3a" href="javascript:select(\'proficiency3a\')">P3: Coll Level Quant Reason</a></li>';
        data += '<li><a id="proficiency4a" href="javascript:select(\'proficiency4a\')">P4: Advanced Writing</a></li>';
        data += '<li><a id="proficiency4b" href="javascript:select(\'proficiency4b\')">P4B: Math/Quant Reasoning</a></li>';
        data += '<li><a id="proficiency4c" href="javascript:select(\'proficiency4c\')">P4C: Critical Thinking</a></li>';
        data += '<li><a id="proficiency4d" href="javascript:select(\'proficiency4d\')">P4D: Oral Communications</a></li>';
        data += '<li><a id="proficiency4e" href="javascript:select(\'proficiency4e\')">P4E: American Sign Language</a></li>';
        data += '<li><a id="proficiency4f" href="javascript:select(\'proficiency4f\')">P4F: Computer Science</a></li>';
        data += '<li><a id="proficiency4g" href="javascript:select(\'proficiency4g\')">P4G: Foreign Languages</a></li>';
        data += '<li class="dispro_all"><a style="background-image:url(images/accept.png);border-right:1px solid #94866F;" href="javascript:selectAll(\'proficiency\')">Select All</a></li>';
        data += '<li class="dispro_all"><a style="background-image:url(images/delete.png);" href="javascript:deselectAll(\'proficiency\')">Deselect All</a></li>';
        data += '</ul>';
        data += '<div style="background-color:#FFF;border-top:1px solid #94866F;padding:6px 6px 22px 6px;clear:both;">';
        data += 'The options marked with <img src="images/accept.png" style="vertical-align:middle;" /> will be included in the search, while those marked with the <img src="images/delete.png" style="vertical-align:middle;" /> will not be included. Click on each to toggle if they should be included or not.';
        data += '</div>';
        setTimeout("updateDisPro()", 100);
        document.getElementById('overlay_content').innerHTML = data;
    }
}

function select(id)
{
    if(document.getElementById(id))
    {
        if(document.getElementById(id).style.backgroundImage.match("delete.png") == "delete.png")
        {
            document.getElementById(id).style.backgroundImage = "url(images/accept.png)";
            search[id] = "true";
        }
        else
        {
            document.getElementById(id).style.backgroundImage = "url(images/delete.png)";
            search[id] = "false";
        }
    }
}

function updateDisPro()
{
    for (x in search)
    {
        if (search[x] == "false")
        {
            document.getElementById(x).style.backgroundImage = "url(images/delete.png)";
        }
        else if(search[x] == "true")
        {
            document.getElementById(x).style.backgroundImage = "url(images/accept.png)";
        }
    }
}

function selectAll(id)
{
    if(id == 'distribution')
    {
        search.distribution1a = "true";
        search.distribution2a = "true";
        search.distribution3a = "true";
        search.distribution4a = "true";
        search.distribution5a = "true";
        search.distribution6a = "true";
        search.distribution6b = "true";
        search.distribution6c = "true";
        search.distribution7a = "true";
        search.distribution8a = "true";

    }
    else
    {
        search.proficiency1a = "true";
        search.proficiency2a = "true";
        search.proficiency3a = "true";
        search.proficiency4a = "true";
        search.proficiency4b = "true";
        search.proficiency4c = "true";
        search.proficiency4d = "true";
        search.proficiency4e = "true";
        search.proficiency4f = "true";
        search.proficiency4g = "true";    
    }
    updateDisPro();
}

function deselectAll(id)
{
    if(id == 'distribution')
    {
        search.distribution1a = "false";
        search.distribution2a = "false";
        search.distribution3a = "false";
        search.distribution4a = "false";
        search.distribution5a = "false";
        search.distribution6a = "false";
        search.distribution6b = "false";
        search.distribution6c = "false";
        search.distribution7a = "false";
        search.distribution8a = "false";

    }
    else
    {
        search.proficiency1a = "false";
        search.proficiency2a = "false";
        search.proficiency3a = "false";
        search.proficiency4a = "false";
        search.proficiency4b = "false";
        search.proficiency4c = "false";
        search.proficiency4d = "false";
        search.proficiency4e = "false";
        search.proficiency4f = "false";
        search.proficiency4g = "false";
    }
    updateDisPro();
}

function newSearch(parm1, parm2, parm3, parm4, parm5)
{
    if(parm1 !== undefined)
    {
        search[parm1] = parm2;
        if(parm3 !== undefined)
        {
            if(parm3 != "semesterbased" && parm3 != "openlearning")
            {
                search[parm3] = parm4;
            }
            else
            {
                search.type = parm3;
            }
        }
    }
    if(parm5 !== undefined)
    {
        search.type = parm5;
    }
    var extra = "";
    var b = false;
    for (x in search)
    {
        if (search[x] == "false")
        {
            if(b)
            {
                extra += ",";
            }
            b = true;
            extra += x.replace("istribution", "").replace("roficiency", "");
        }
    }
    if (extra !== ""){extra = "&filter=" + extra;}
    window.location = "?page=results&semester=" + search.semester + "&year=" + search.year + "&subject=" + search.subject + "&level=" + search.level + extra + "&type=" + search.type;
}

/**
 *
*/
function getRequest()
{
    //GET ARGUMENTS
    url = arguments[0];
    func = arguments[1];
    var parms = '';
    for(var i = 2; i < arguments.length; i++)
    {
        parms += ",'" + arguments[i] + "'";
    }
    //THE REST
    var req = null;
    messageBox('Loading');
    if (window.XMLHttpRequest)
    {
        req = new XMLHttpRequest();
    } 
    else if (window.ActiveXObject) 
    {
        try
        {
            req = new ActiveXObject("Msxml2.XMLHTTP");
	}
        catch (e)
	{
            try
            {
                req = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }
    req.onreadystatechange = function()
    {
	messageBox('Waiting');
	if(req.readyState == 4)
	{
            if(req.status == 200)
            {
                messageBox('');
                eval(func+"('"+req.responseText+"'"+parms+");");
            }
            else
            {
                alert("Error: " + req.status + " " + req.statusText);
            }
        }
    };
    req.open("GET", url, true); 
    req.send(null);
}
function save(action)
{
    
}

function deletes(url)
{
    var r=confirm("Are you sure you want to delete the course?");
    if (r === true)
    {
        window.location = url;
    }
}

function duplicate(url)
{
    var r=confirm("Are you sure you want to duplicate this course?");
    if (r === true)
    {
        window.location = url;
    }
}

function remove(id, type)
{
    var r=confirm("Are you sure you want to remove this " + type + "?");
    if (r === true)
    {
        if(type == "book" && type == "coursePack" && type == "video" && type == "videoStream")
        {
            getRequest("include/external.php?action=hide&id=" + id, "hideAJAX", id);
        }
    }
}

//HIDE COURSE TOGGLE
function hide(id)
{
    if(document.getElementById("hide_"+id).className.indexOf('unhide') == -1)
    {
        //HIDE
        getRequest("include/external.php?action=hide&id=" + id, "hideAJAX", id);
    }
    else
    {
        //UNHIDE
        getRequest("include/external.php?action=unhide&id=" + id, "hideAJAX", id);
    }
}
function hideAJAX(req, id)
{
    if(req == "hide"){
        document.getElementById("hide_"+id).className = "tooltip unhide";
        document.getElementById("hidecaption_"+id).innerHTML = "Unhide";
    }else if(req == "unhide"){
        document.getElementById("hide_"+id).className = "tooltip hide";
        document.getElementById("hidecaption_"+id).innerHTML = "Hide";
    }else{
        alert(req);
    }
}
//UNIVERSAL FOR ALL MEDIAS
function require(id, type)
{
    if(document.getElementById("require_"+id).className.indexOf('unrequire') == -1)
    {
        //REQUIRE
        getRequest("include/external.php?action=mediarequire&id=" + id, type + "RequireAJAX", id);
    }
    else
    {
        //UNREQUIRE
        getRequest("include/external.php?action=mediaunrequire&id=" + id, type + "RequireAJAX", id);
    }
}
/*
 Course
*/
function updateCourseAJAX(req)
{
    messageBox('140', '33', '<h1 style="text-align:center;padding-top:2px;">Updated</h1>');
}
function addCourseAJAX(req)
{
    messageBox('140', '33', '<h1 style="text-align:center;padding-top:2px;">Added</h1>');
    window.location = decodeURIComponent(req);
}
function deleteCourseAJAX(req)
{
    messageBox('140', '33', '<h1 style="text-align:center;padding-top:2px;">Deleted</h1>');
    window.location.reload(true);
}
function duplicateCourseAJAX(req)
{
    messageBox('180', '33', '<h1 style="text-align:center;padding-top:2px;">Duplicated</h1>');
    window.location = decodeURIComponent(req);
}
function seatsInCourseAJAX(req)
{
    req = decodeURIComponent(req);
    var parts = new Array();
    parts = req.split(",");
    document.getElementById("seats_"+parts[0]).innerHTML = parts[1];
}
/*
 Book
*/
function bookRequireAJAX(req, id)
{
    if(req == "mediarequire"){
        document.getElementById("require_"+id).className = "tooltip book_unrequire";
        document.getElementById("requirecaption_"+id).innerHTML = "Require";
    }else if(req == "mediaunrequire"){
        document.getElementById("require_"+id).className = "tooltip book_require";
        document.getElementById("requirecaption_"+id).innerHTML = "Unrequire";
    }else{
        alert(req);
    }
}

function addBookToCourseAJAX(req)
{
    document.getElementById('books').innerHTML = decodeURIComponent(req);
}

function addBookToLibraryAndCourseAJAX(req)
{
    document.getElementById('books').innerHTML = decodeURIComponent(req);
    send('refreshBookList');
}

function removeBookFromCourseAJAX(req)
{
    document.getElementById('books').innerHTML = decodeURIComponent(req);
}

function editBookInCourseAJAX(req)
{
    messageBox('400', '380', req);
}

function updateBookAJAX(req)
{
    document.getElementById('books').innerHTML = decodeURIComponent(req);
    send('refreshBookList');
}

function refreshBookListAJAX(req)
{
    document.getElementById('book_list').innerHTML = decodeURIComponent(req);
}
/*
 Course Pack
*/
function coursePackRequireAJAX(req, id)
{
    if(req == "mediarequire"){
        document.getElementById("require_"+id).className = "tooltip coursepack_unrequire";
        document.getElementById("requirecaption_"+id).innerHTML = "Require";
    }else if(req == "mediaunrequire"){
        document.getElementById("require_"+id).className = "tooltip coursepack_require";
        document.getElementById("requirecaption_"+id).innerHTML = "Unrequire";
    }else{
        alert(req);
    }
}

function addCoursePackToCourseAJAX(req)
{
    document.getElementById('coursepacks').innerHTML = decodeURIComponent(req);
}

function addCoursePackToLibraryAndCourseAJAX(req)
{
    document.getElementById('coursepacks').innerHTML = decodeURIComponent(req);
    send('refreshCoursePackList');
}

function removeCoursePackFromCourseAJAX(req)
{
    document.getElementById('coursepacks').innerHTML = decodeURIComponent(req);
}

function editCoursePackInCourseAJAX(req)
{
    messageBox('400', '280', req);
}

function updateCoursePackAJAX(req)
{
    document.getElementById('coursepacks').innerHTML = decodeURIComponent(req);
    send('refreshCoursePackList');
}

function refreshCoursePackListAJAX(req)
{
    document.getElementById('coursepack_list').innerHTML = decodeURIComponent(req);
}

/*
 Video
*/
function videoRequireAJAX(req, id)
{
    if(req == "mediarequire"){
        document.getElementById("require_"+id).className = "tooltip video_unrequire";
        document.getElementById("requirecaption_"+id).innerHTML = "Require";
    }else if(req == "mediaunrequire"){
        document.getElementById("require_"+id).className = "tooltip video_require";
        document.getElementById("requirecaption_"+id).innerHTML = "Unrequire";
    }else{
        alert(req);
    }
}

function addVideoToCourseAJAX(req)
{
    document.getElementById('videos').innerHTML = decodeURIComponent(req);
}

function addVideoToLibraryAndCourseAJAX(req)
{
    document.getElementById('videos').innerHTML = decodeURIComponent(req);
    send('refreshVideoList');
}

function removeVideoFromCourseAJAX(req)
{
    document.getElementById('videos').innerHTML = decodeURIComponent(req);
}

function editVideoInCourseAJAX(req)
{
    messageBox('400', '270', req);
}

function updateVideoAJAX(req)
{
    document.getElementById('videos').innerHTML = decodeURIComponent(req);
    send('refreshVideoList');
}

function refreshVideoListAJAX(req)
{
    document.getElementById('video_list').innerHTML = decodeURIComponent(req);
}
/*
 Video Stream
*/
function videoStreamRequireAJAX(req, id)
{
    if(req == "mediarequire"){
        document.getElementById("require_"+id).className = "tooltip videostream_unrequire";
        document.getElementById("requirecaption_"+id).innerHTML = "Require";
    }else if(req == "mediaunrequire"){
        document.getElementById("require_"+id).className = "tooltip videostream_require";
        document.getElementById("requirecaption_"+id).innerHTML = "Unrequire";
    }else{
        alert(req);
    }
}

function addVideoStreamToCourseAJAX(req)
{
    document.getElementById('videostreams').innerHTML = decodeURIComponent(req);
}

function addVideoStreamToLibraryAndCourseAJAX(req)
{
    document.getElementById('videostreams').innerHTML = decodeURIComponent(req);
    send('refreshVideoStreamList');
}

function removeVideoStreamFromCourseAJAX(req)
{
    document.getElementById('videostreams').innerHTML = decodeURIComponent(req);
}

function editVideoStreamInCourseAJAX(req)
{
    messageBox('400', '270', req);
}

function updateVideoStreamAJAX(req)
{
    document.getElementById('videostreams').innerHTML = decodeURIComponent(req);
    send('refreshVideoStreamList');
}

function refreshVideoStreamListAJAX(req)
{
    document.getElementById('videostream_list').innerHTML = decodeURIComponent(req);
}

function sem(semester)
{
    value = semester == "Spring" ? "1" : semester == "SummerI" ? "2" : semester == "SummerII" ? "3" : "4";
    document.getElementById('crn_front').innerHTML = '&lsaquo;&nbsp;Start&nbsp;with&nbsp;a&nbsp;&quot;'+value+'&quot;';
    document.getElementById('add_crn').value = value;
}

function clearbox()
{
   var select=document.getElementById("subject");
   
   var options=select.getElementsByTagName("option");
   var i;

   for (i=options.length-1; i>=0; i--)
   {
      select.removeChild(options[i]);
   }
}
function clearboxOpenLearning()
{
    var select=document.getElementById("subject_ol");
    
    var options=select.getElementsByTagName("option");
    var i;
 
    for (i=options.length-1; i>=0; i--)
    {
        select.removeChild(options[i]);
    }
}

function subjectListAJAX(req)
{
    clearbox();
    var subject = document.getElementById('subject');
    var options = decodeURIComponent(req).split(";");
    for(var i in options)
    {
        if(options[i] != '')
        {
            var option = options[i].split(",");
            var anOption = document.createElement("option");
            anOption.text = option[0];
            anOption.value = option[1];
            try
            {
                subject.add(anOption, null); // standards compliant; doesn't work in IE
            }
            catch(ex)
            {
                subject.add(anOption); // IE only
            }
        }
    }
}
function subjectListOpenLearningAJAX(req)
{
    clearboxOpenLearning();
    var subject = document.getElementById('subject_ol');
    var options = decodeURIComponent(req).split(";");
    for(var i in options)
    {
        if(options[i] != '')
        {
            var option = options[i].split(",");
            var anOption = document.createElement("option");
            anOption.text = option[0];
            anOption.value = option[1];
            try
            {
                subject.add(anOption, null); // standards compliant; doesn't work in IE
            }
            catch(ex)
            {
                subject.add(anOption); // IE only
            }
        }
    }
}
function swapCourseType(coursetype)
{
    if(coursetype == "semesterbased")
    {
        document.getElementById('semesterbased_tab').className = "selected";
        document.getElementById('semesterbased').style.display = "block";
        document.getElementById('openlearning_tab').className = "";
        document.getElementById('openlearning').style.display = "none";
    }
    else
    {
        document.getElementById('semesterbased_tab').className = "";
        document.getElementById('semesterbased').style.display = "none";
        document.getElementById('openlearning_tab').className = "selected";
        document.getElementById('openlearning').style.display = "block";
    }
}
/*
 invalid instead of void(0)
*/
function invalid(){}