function ConfirmDelete(str)
{
    return confirm('Are you sure you want to delete ' + str + '?');
}

function ConfirmDelete1(str)
{
    return confirm(str);
}

function SelectAllCheckboxes(spanChk)
{
   var oItem = spanChk.children;
   var theBox= (spanChk.type=="checkbox") ? spanChk : spanChk.children.item[0];
   xState=theBox.checked;
   elm=theBox.form.elements;

   for(i=0;i<elm.length;i++)
     if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
     {
        var elmChar=elm[i].id;
        if ((elmChar.indexOf('IsDisabled')==-1) && (elm[i].checked!=xState)) 
            elm[i].click();
     }
}
 
function ShowPopup()
{
    document.getElementById("popup").style.visibility = "visible";
}

function HidePopup()
{
    document.getElementById("popup").style.visibility = "hidden";
}

function Popup(s1,s2)
{
    return window.open(s1,s2,'resizable=no,scrollbars=no,width=800,height=550,toolbar=no');
}

// ajax script
function checkDate(sender,args)
{
    if (sender._selectedDate < new Date())
    {
        alert("You have selected a day earlier than today!");
        sender._selectedDate = new Date(); 
        // set the date back to the current date
        sender._textbox.set_Value(sender._selectedDate.format(sender._format))
    }
}