﻿var xmlhttp;
var xmlHttpPath = '/XmlHttp/Select2ListManagerXmlHttp.aspx';
function UpdateList(listName, listEntryID, action){
    xmlhttp=null;
    if (window.XMLHttpRequest){// code for all new browsers
        xmlhttp=new XMLHttpRequest();
    }
    else if (window.ActiveXObject){// code for IE5 and IE6
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (xmlhttp!=null){
        xmlhttp.onreadystatechange=ListUpdated;
        xmlhttp.open("POST",xmlHttpPath + '?listName=' + listName + '&listEntryID=' + listEntryID + '&action=' + action,true);
        xmlhttp.send('listName=' + listName + '&listEntryID=' + listEntryID + '&action=' + action);
    }
}
function ListUpdated(){}
function AddToList(listName, listEntryID){
    UpdateList(listName, listEntryID, 'Add');
}
function RemoveFromList(listName, listEntryID){
    UpdateList(listName, listEntryID, 'Remove');
}
