function getdate(){
<!-- Begin
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();

// Y2K Fix by Isaac Powell
// http://onyx.idbsu.edu/~ipowell

if ((navigator.appName == "Microsoft Internet Explorer") && (year < 2000))
year="19" + year;
if (navigator.appName == "Netscape")
year=1900 + year;
document.write("<p class=date>" + lmonth + " ");
document.write(date + ", " + year + "</p>");
// End -->
};



function GetCookie(name) {
var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function checkmenus(){
//Checking for last opened menu if it exists reopen it.
 var realestate = GetCookie("realestate");
  var quicklinks = GetCookie("quicklinks");
   var schools = GetCookie("schools");
    var suburbs = GetCookie("suburbs");
	 var directory = GetCookie("directory");
 if (realestate=="on") {
		toggleSub('realestate'); 
 }
  if (quicklinks=="off") {
		toggleSub('quicklinks'); 
 }
   if (schools=="on") {
		toggleSub('schools');
 }
   if (suburbs=="on") {
		toggleSub('suburbs'); 
 }
   if (directory=="off") {
		toggleSub('directory'); 
 }
};

function getCal(){
var myDays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
var mydate = new Date()
mydate = new Date(mydate.getTime() - 24 * 60 * 60 * 1000 );
var date = mydate.getDate()
var day = mydate.getDay()
var month = mydate.getMonth()
var year = mydate.getFullYear()

document.write ("<ul class=\"calendar\">");
for (var i=1; i <= 14; i++)
{
if (i==1){
document.write ("<li class=\"first\">");
}else if (i==2){
document.write ("<li class=\"on\">");
}else if (i==14){
document.write ("<li class=\"last\">");
}else{
document.write ("<li class=\"off\">");
}
document.write ("<a href=\"index.php?src=events&srctype=lister&m=" + month + "&y=" + year + "&day=" + date + "\">");
document.write (myDays[day]);
document.write ("<br />");
document.write (date);
document.write ("</a>");
document.write ("</li>");



mydate = new Date(mydate.getTime() + 24 * 60 * 60 * 1000 );
var date = mydate.getDate()
var day = mydate.getDay()
var month = mydate.getMonth()
var year = mydate.getFullYear()
}
document.write ("</ul>");
};

function truncate(text,len){
  if (text.length > len) {
    /* Truncate the content of the P, then go back to the end of the
       previous word to ensure that we don't truncate in the middle of
       a word */
    text = text.substring(0, len);
    text = text.replace(/\w+$/, '');

    /* Add an ellipses to the end and make it a link that expands
       the paragraph back to its original size */
    text += '...';
    document.write (text);
  }else {
document.write (text);
}
};

