function getCalendarDate()
{
    var months      = ["January","February","March","April","May","June","July","August","September","October","November","December"];
    var days        = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];
    var now         = new Date();
    var dayname     = days[now.getDay()];
    var monthname   = months[now.getMonth()];
    var monthday    = now.getDate();
    var year        = now.getYear();
    if(year < 2000) { year = year + 1900; }
    var dateString = dayname + ', ' + monthname + ' ' + monthday + ', ' + year;
    return dateString;
}
function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
function AutoSave(key,value)
{
    if (value != "")
    {
        var xmlHttp; 
        xmlHttp = GetXmlHttpObject(); 
        xmlHttp.open("GET","/autosave.aspx?key=" + key + "&value=" + value, true);
        xmlHttp.send(null);
    }
}
function GetXmlHttpObject()
{
    var xmlHttp=null;
    try
    {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {
        // Internet Explorer
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}
function openPopUp(PageName){
	new_window = window.open(PageName,"new_window","width=400,height=400,location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50"); 
	if (new_window.opener == null) { 
		new_window.opener = self; 
	} 
	new_window.focus();
}
function openSizedPopUp(PageName, Width, Height){
	new_window = window.open(PageName,"new_window","width="+Width+",height="+Height+",location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,left=150,top=50,screenx=150,screeny=50"); 
	if (new_window.opener == null) { 
		new_window.opener = self; 
	} 
	new_window.focus();
}
