var loginFlowBoxClickPriority = false;
var calendarClickPriority = false;
var messageWindowPriority = false;

function getNowDateStatement() {
  
  var date=new Date();
  var daystring = '';
  var month=date.getMonth();
  month++;
  
	if(month==1) {month = "January";}
	else if(month==2) {month = "February";}
	else if(month==3) {month = "March";}
	else if(month==4) {month = "April";}
	else if(month==5) {month = "May";}
	else if(month==6) {month = "June";}
	else if(month==7) {month = "July";}
	else if(month==8) {month = "August";}
	else if(month==9) {month = "September";}
	else if(month==10) {month = "October";}
	else if(month==11) {month = "November";}
	else if(month==12) {month = "December";}
  
  if(date.getDay()==0) {daystring = "Sunday";}
	else if(date.getDay()==1) {daystring = "Monday";}
	else if(date.getDay()==2) {daystring = "Tuesday";}
	else if(date.getDay()==3) {daystring = "Wednesday";}
	else if(date.getDay()==4) {daystring = "Thursday";}
	else if(date.getDay()==5) {daystring = "Friday";}
	else if(date.getDay()==6) {daystring = "Saturday";}

  return "<div id=\"dateStatement\"><span id=\"month\">" + month + "</span><span id=\"day\"><h1>" + date.getDate() + "</h1></span><span id=\"year\">" + date.getFullYear() + "</span><span id=\"dayString\"><strong>" + daystring + "</strong></span><div id=\"to_stats\"><a href=\"http://www.daileez.com/yesterday/\"><span class=\"dNone\">&laquo;</span></a></div></div>";
}

function loginBoxVisibilityHidden() {
  document.getElementById("loginFlowBox").style.visibility="hidden";
}

function loginBoxVisibility() {
  if (document.getElementById("loginFlowBox").style.visibility == "hidden") {
    document.getElementById("loginFlowBox").style.visibility="visible";
    document.getElementById('loginForm').getElementsByTagName('input')[1].focus();
  } else {
    document.getElementById("loginFlowBox").style.visibility="hidden";
  }
  loginFlowBoxClickPriority = true;
}

function disallowHiddenLoginBox() {
  loginFlowBoxClickPriority = true;
}

function messageWindowHidden() {
  if (document.getElementById("messageWindow") != null) {
    document.getElementById("messageWindow").style.visibility = "hidden";
  }
}

function visibilityGlobalHidden() {
	
  if (!messageWindowPriority) {
    var messageWindow = document.getElementById("messageWindow"); 
    if (messageWindow != null) {
      messageWindow.style.visibility = "hidden"
    }
  }
  
  messageWindowPriority = false;
  
  if (!calendarClickPriority) {
    calendar = document.getElementById("display");
    if (calendar != null) {
      calendar.style.visibility = "hidden";
    }
  }
  
  calendarClickPriority = false;
  
  if (!loginFlowBoxClickPriority) {
    if (document.getElementById("loginFlowBox") != null) {
      if (document.getElementById("loginFlowBox").style.visibility == "visible") {
        document.getElementById("loginFlowBox").style.visibility="hidden";
      }
    }
  }
  
  loginFlowBoxClickPriority = false;
}
function googleAnalytics() {
  
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  
  try {
    var pageTracker = _gat._getTracker("UA-11279790-1");
    pageTracker._setDomainName(".daileez.com");
	pageTracker._setAllowLinker(true);
	pageTracker._setAllowHash(false);
    pageTracker._trackPageview();
  } catch(err) {alert(err);}
}
