///   Start 
function UserDataObj ()
{
    this.id = -1;
    this.email='';
    this.firstName='';
    this.lastName='';
    this.emailSignature = '';
    this.userType = -1;
    this.organizationName='';
    this.userTimeFormat = 30;
    this.userStartWeekDay = 1;
    this.userEndWeekDay = 5;
    this.userDateFormatString = 'MM/dd/yy';
    this.userTimeFormatString = 'h:mma';
    this.TimeFormatEnum_Twelve_Hours = -1;
    this.userStartDayHour =8;
    this.userEndDayHour = 17;
    this.userTimeZone = new TimeZoneObj (-1,'UTC','(UTC/GMT)','','',0,false);
}
UserDataObj.prototype.GetFullName = function ()
{
    var ret = this.firstName;
    ret += ' ' + this.lastName;
    return ret;
}

UserDataObj.prototype.toString = function (style)
{
    var ret = '';
    var inner = '';
    if ((this.firstName!='') && (this.firstName!=null))
    {
       inner = this.firstName;
    }
    if ((this.lastName!='') && (this.lastName!=null))
    {
       inner += ' ' + this.lastName;
    }
    if (inner!='')
    {
        ret = inner + ' ('+this.email+ ')';
    }
    else
    {
        ret = this.email;
    }
    
    ret = '<a class="operation" style="'+style+'" href="mailto:'+this.email+'">' + ret + "</a>";
    return ret;
}

var UserTypeEnum_New = 32;
var UserTypeEnum_Registered = 33;
var UserTypeEnum_Invitee = 34;
var UserTypeEnum_Frozen = 35;
var UserTypeEnum_Deleted = 36;
var UserTypeEnum_Admin = 37;
var UserTypeEnum_QuickMeeting = 38;

var currUserData = new UserDataObj();

function SyncUserDataWithParent()
{
    var win =window.parent;
    if (window.GetParentObject)
    {
        win = GetParentObject();
    }
    if (win!=null)
    {
        if (win.currUserData.id!=-1)
        {
            currUserData = win.currUserData;
        }
        else
        {
            currUserData = this.top.currUserData;
        }
    }
}

function SaveUserDateTimeFormatCookie(userDateTimeFormat)
{
    createCookie ('userDateTimeFormat',userDateTimeFormat,1000);
}

function GetUserDateTimeFormatCookie()
{
    var cookieVal = readCookie('userDateTimeFormat');
    if ((cookieVal==null) || (cookieVal==''))
    {
        cookieVal = '0';
        SaveUserDateTimeFormatCookie(cookieVal);
    }
    return parseInt(cookieVal);
}

function FormatDateByUser(date)
{
   switch (GetUserDateTimeFormatCookie())
   {
       case 0:
       case 1:
          return date.formatDate('MM/dd/yyyy');
       break;
       case 2:
       case 3:
          return date.formatDate('dd/MM/yyyy');
       break;
   }
}

function FormatDateWithDayByUser(date)
{
   switch (GetUserDateTimeFormatCookie())
   {
       case 0:
       case 1:
          return date.formatDate('E MM/dd');
       break;
       case 2:
       case 3:
          return date.formatDate('E dd/MM');
       break;
   }
}
function FormatTimeByUser(date,ampmsep)
{
   if (ampmsep==null)
   {
    ampmsep = '';
   }
   
   switch (GetUserDateTimeFormatCookie())
   {
       case 0:
       case 2:
          if (ampmsep.length>0)
          {
            return date.formatDate('h:mm'+ampmsep+'a');
          }
          else
          {
            return date.formatDate('h:mma');
          }
       break;
       case 1:
       case 3:
          return date.formatDate('HH:mm');
       break;
   }
}

function FormatDateTimeByUser(date)
{
    return FormatDateByUser(date) + ' ' + FormatTimeByUser(date);
}
//change new meeting cell tooltip text [# 4237 ]
//return short formatted day
function FormatDay(date) {
    return date.formatDate('E');
}