/**
*
* The following functions are used by multiple pages
* Written by Bernard Dallaire
* Date July 31st 2009
* Version 1.0
*
**/

// I've removed the onload function so that I can control it whithin the webpage itself
// window.onload = initialLoad;

// Display to come/à venir for page with only one row in the XML file
function putSignOnPage(language) {
	switch (language) {
		case ("e_"):
			document.getElementById("title").innerHTML = document.getElementById("title").innerHTML + " (to come)";
			break;
		case ("f_"):
			document.getElementById("title").innerHTML = document.getElementById("title").innerHTML + " (à venir)";
			break;
	}
}

// Pop a Player's card
function popRosterCard(playerNumber, language) {
	var horizontalPosition = (window.screen.availWidth / 2) - 200;
	var verticalPosition = (window.screen.availHeight / 2) - 300;
	open(language + "rosterCard.html?cardNumber=" + playerNumber,"title", "toolbar=no,menubar=no,left=" + horizontalPosition + ",top=" + verticalPosition + ",width=420,height=600,resizable=yes");
}

// Get cookies
function getCookie(c_name) {
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return "";
}

// Set cookie
function setCookie(c_name,value,expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

// Check cookie
function checkCookie()
{
username=getCookie('username');
if (username!=null && username!="")
  {
  alert('Welcome again '+username+'!');
  }
else
  {
  username=prompt('Please enter your name:',"");
  if (username!=null && username!="")
    {
    setCookie('username',username,365);
    }
  }
}

// Popup
function popupWindow(url)
{
	// This screen will open a window to the maximum user's screen size
	scn_options = "location=0,resizable=1,status=0,scrollbars=0,width=" + screen.width + ",height=" + screen.height;
	mywindow = window.open (url,"Photos",scn_options);
	mywindow.moveTo(0,0);
}

// Build menu
function buildMenu(language) {
	if (language == "e_") {
		beginSTM("castors","static","0","0","center","false","true","310","1000","0","250","","images/blank.gif");
		beginSTMB("auto","0","0","horizontally","images/arrow_r.gif","7","7","0","5","#193763","","tiled","#000000","4","solid","0","Normal","50","0","0","7","7","0","0","0","#7f7f7f","false","#000000","#000000","#000000","none");
		appendSTMI("false","Home","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_home.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","e_home.html","","","tiled","tiled");
		appendSTMI("false","Team","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","","","","tiled","tiled");
		beginSTMB("auto","0","0","vertically","","0","0","0","3","#ffffff","","tiled","#000000","1","solid","0","Normal","50","0","0","0","0","0","0","0","#7f7f7f","false","#000000","#000000","#000000","none");
		appendSTMI("false","Roster","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_roster.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","e_roster.html","","","tiled","tiled");
		appendSTMI("false","Staff","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_staff.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","e_staff.html","","","tiled","tiled");
		appendSTMI("false","Photo&nbsp;Album","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_photos.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","e_photos.html","","","tiled","tiled");
		endSTMB();
		appendSTMI("false","Games","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","","","","tiled","tiled");
		beginSTMB("auto","0","0","vertically","","0","0","0","3","#ffffff","","tiled","#000000","1","solid","0","Normal","50","0","0","0","0","0","0","0","#7f7f7f","false","#000000","#000000","#000000","none");
		appendSTMI("false","Schedule","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_schedule.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","e_schedule.html","","","tiled","tiled");
		appendSTMI("false","Statistics","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_statistics.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","e_statistics.html","","","tiled","tiled");
		appendSTMI("false","Standings","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_standings.php","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","e_standings.php","","","tiled","tiled");
		endSTMB();
		appendSTMI("false","Links","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_links.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#d6d6ce","#d6d6ce","#d6d6ce","#d6d6ce","#ffff00","#d6d6ce","#d6d6ce","#d6d6ce","e_links.html","","","tiled","tiled");
		appendSTMI("false","Sponsors","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_sponsors.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#d6d6ce","#d6d6ce","#d6d6ce","#d6d6ce","#ffff00","#d6d6ce","#d6d6ce","#d6d6ce","e_sponsors.html","","","tiled","tiled");
		appendSTMI("false","Contacts","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","e_contacts.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#d6d6ce","#d6d6ce","#d6d6ce","#d6d6ce","#ffff00","#d6d6ce","#d6d6ce","#d6d6ce","e_contacts.html","","","tiled","tiled");
		endSTMB();
		endSTM();
	} else {
		beginSTM("castors","static","0","0","center","false","true","310","1000","0","250","","images/blank.gif");
		beginSTMB("auto","0","0","horizontally","images/arrow_r.gif","7","7","0","5","#193763","","tiled","#000000","4","solid","0","Normal","50","0","0","7","7","0","0","0","#7f7f7f","false","#000000","#000000","#000000","none");
		appendSTMI("false","Accueil","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_home.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","f_home.html","","","tiled","tiled");
		appendSTMI("false","Équipe","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","","","","tiled","tiled");
		beginSTMB("auto","0","0","vertically","","0","0","0","3","#ffffff","","tiled","#000000","1","solid","0","Normal","50","0","0","0","0","0","0","0","#7f7f7f","false","#000000","#000000","#000000","none");
		appendSTMI("false","Formation","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_roster.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","f_roster.html","","","tiled","tiled");
		appendSTMI("false","Direction","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_staff.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","f_staff.html","","","tiled","tiled");
		appendSTMI("false","Album&nbsp;Photo","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_photos.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","f_photos.html","","","tiled","tiled");
		endSTMB();
		appendSTMI("false","Parties","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","","","","tiled","tiled");
		beginSTMB("auto","0","0","vertically","","0","0","0","3","#ffffff","","tiled","#000000","1","solid","0","Normal","50","0","0","0","0","0","0","0","#7f7f7f","false","#000000","#000000","#000000","none");
		appendSTMI("false","Calendrier","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_schedule.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","f_schedule.html","","","tiled","tiled");
		appendSTMI("false","Statistiques","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_statistics.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","f_statistics.html","","","tiled","tiled");
		appendSTMI("false","Classement","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_standings.php","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#ffff00","#ffff00","#d6d6ce","#d6d6ce","#ffff00","#ffff00","#d6d6ce","#d6d6ce","f_standings.php","","","tiled","tiled");
		endSTMB();
		appendSTMI("false","Liens","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_links.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#d6d6ce","#d6d6ce","#d6d6ce","#d6d6ce","#ffff00","#d6d6ce","#d6d6ce","#d6d6ce","f_links.html","","","tiled","tiled");
		appendSTMI("false","Commanditaires","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_sponsors.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#d6d6ce","#d6d6ce","#d6d6ce","#d6d6ce","#ffff00","#d6d6ce","#d6d6ce","#d6d6ce","f_sponsors.html","","","tiled","tiled");
		appendSTMI("false","Contacts","left","middle","","","-1","-1","0","normal","#0000ff","#000000","","1","-1","-1","images/blank.gif","images/blank.gif","-1","-1","0","","f_contacts.html","_self","Arial","14pt","#ffff00","normal","normal","none","Arial","14pt","#ffff00","normal","normal","none","1","solid","#d6d6ce","#d6d6ce","#d6d6ce","#d6d6ce","#ffff00","#d6d6ce","#d6d6ce","#d6d6ce","f_contacts.html","","","tiled","tiled");
		endSTMB();
		endSTM();
	}
}

function identifyFile() {
	return window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length).substring(2);
}

function identifyLanguage() {
	return window.location.href.substring(window.location.href.lastIndexOf("/")+1,window.location.href.length).substring(0,2);
}

// Used to set the alternate language link and
// set the cookie for the language at the same time.
function setLanguageLink(filename, language) {
	document.write("<a href='");
	var testLanguage = getCookie("language");
	if(language=="e_") {
		document.write("f_");
		if(testLanguage=="" || testLanguage=="f") setCookie("language","e",365);
	} else {
		document.write("e_");
		if(testLanguage=="" || testLanguage=="e") setCookie("language","f",365);
	}
	document.write(filename + "'>");
	if(language=="e_") {
		document.write("Fran&ccedil;ais</a>");
	} else {
		document.write("English</a>");
	}
}

// Convert English to French day and month, and
// convert am/pm to 24 hours format
function translateDateTime(dateTime) {
	dateTimeSplit = dateTime.split(" ");
	var day = "", month = "";
	// Translate day
	switch(dateTimeSplit[0].substring(0,dateTimeSplit[0].length - 1)) {
		case "Sun":
			day = "Dim";
			break;
		case "Mon":
			day = "Lun";
			break;
		case "Tue":
			day = "Mar";
			break;
		case "Wed":
			day = "Mer";
			break;
		case "Thu":
			day = "Jeu";
			break;
		case "Fri":
			day = "Ven";
			break;
		case "Sat":
			day = "Sam";
			break;
	}
	// Translate month
	switch(dateTimeSplit[1]) {
		case "Jan":
			month = "Jan";
			break;
		case "Feb":
			month = "Fev";
			break;
		case "Mar":
			month = "Mar";
			break;
		case "Apr":
			month = "Avr";
			break;
		case "May":
			month = "Mai";
			break;
		case "Jun":
			month = "Jun";
			break;
		case "Jul":
			month = "Jul";
			break;
		case "Aug":
			month = "Aoû";
			break;
		case "Sep":
			month = "Sep";
			break;
		case "Oct":
			month = "Oct";
			break;
		case "Nov":
			month = "Nov";
			break;
		case "Dec":
			month = "Déc";
			break;
	}
	// Translate time in 24h format
	if(dateTimeSplit[5] == "pm") {
		var timeSplit = dateTimeSplit[4].split(":");
		var convertedHour = parseInt(timeSplit[0]) + 12;
		var convertedTime = convertedHour + ":" + timeSplit[1];
	}
	return(day + " " + dateTimeSplit[2] + " " + month + " @ " + convertedTime);
}

// dateFormat
var dateFormat = function () {
	var	token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
		timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
		timezoneClip = /[^-+\dA-Z]/g,
		pad = function (val, len) {
			val = String(val);
			len = len || 2;
			while (val.length < len) val = "0" + val;
			return val;
		};

	// Regexes and supporting functions are cached through closure
	return function (date, mask, utc) {
		var dF = dateFormat;

		// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
		if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
			mask = date;
			date = undefined;
		}

		// Passing date through Date applies Date.parse, if necessary
		date = date ? new Date(date) : new Date;
		if (isNaN(date)) throw SyntaxError("invalid date");

		mask = String(dF.masks[mask] || mask || dF.masks["default"]);

		// Allow setting the utc argument via the mask
		if (mask.slice(0, 4) == "UTC:") {
			mask = mask.slice(4);
			utc = true;
		}

		var	_ = utc ? "getUTC" : "get",
			d = date[_ + "Date"](),
			D = date[_ + "Day"](),
			m = date[_ + "Month"](),
			y = date[_ + "FullYear"](),
			H = date[_ + "Hours"](),
			M = date[_ + "Minutes"](),
			s = date[_ + "Seconds"](),
			L = date[_ + "Milliseconds"](),
			o = utc ? 0 : date.getTimezoneOffset(),
			flags = {
				d:    d,
				dd:   pad(d),
				ddd:  dF.i18n.dayNames[D],
				dddd: dF.i18n.dayNames[D + 7],
				m:    m + 1,
				mm:   pad(m + 1),
				mmm:  dF.i18n.monthNames[m],
				mmmm: dF.i18n.monthNames[m + 12],
				yy:   String(y).slice(2),
				yyyy: y,
				h:    H % 12 || 12,
				hh:   pad(H % 12 || 12),
				H:    H,
				HH:   pad(H),
				M:    M,
				MM:   pad(M),
				s:    s,
				ss:   pad(s),
				l:    pad(L, 3),
				L:    pad(L > 99 ? Math.round(L / 10) : L),
				t:    H < 12 ? "a"  : "p",
				tt:   H < 12 ? "am" : "pm",
				T:    H < 12 ? "A"  : "P",
				TT:   H < 12 ? "AM" : "PM",
				Z:    utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
				o:    (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
				S:    ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
			};
		return mask.replace(token, function ($0) {
			return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
		});
	};
}();

// Some common format strings
dateFormat.masks = {
	"default":      "ddd mmm dd yyyy HH:MM:ss",
	shortDate:      "m/d/yy",
	mediumDate:     "mmm d, yyyy",
	longDate:       "mmmm d, yyyy",
	fullDate:       "dddd, mmmm d, yyyy",
	shortTime:      "h:MM TT",
	mediumTime:     "h:MM:ss TT",
	longTime:       "h:MM:ss TT Z",
	isoDate:        "yyyy-mm-dd",
	isoTime:        "HH:MM:ss",
	isoDateTime:    "yyyy-mm-dd'T'HH:MM:ss",
	isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
};

// Internationalization strings
dateFormat.i18n = {
	dayNames: [
		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
		"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
	],
	monthNames: [
		"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
	]
};

// For convenience...
Date.prototype.format = function (mask, utc) {
	return dateFormat(this, mask, utc);
};

// Simple Debug, written by Chris Klimas
// licensed under the GNU LGPL.
// http://www.gnu.org/licenses/lgpl.txt
//
// There are three functions defined here:
//
// log (message)
// Logs a message. Every second, all logged messages are displayed
// in an alert box. This saves you from having to hit Return a ton
// of times as your script executes.
//
// inspect (object)
// Logs the interesting properties an object possesses. Skips functions
// and anything in CAPS_AND_UNDERSCORES.
//
// inspectValues (object)
// Like inspect(), but displays values for the properties. The output
// for this can get very large -- for example, if you are inspecting
// a DOM element.


function log (message)
{
	if (! _log_timeout)
		_log_timeout = window.setTimeout(dump_log, 1000);
	
	_log_messages.push(message);


	function dump_log()
	{
		var message = '';
		
		for (var i = 0; i < _log_messages.length; i++)
			message += _log_messages[i] + '\n';
				
		alert(message);
		
		_log_timeout = null;
		delete _log_messages;
		_log_messages = new Array();
	}
}


function inspect (obj)
{
	var message = 'Object possesses these properties:\n';
	
	if (obj)
	{
		for (var i in obj)
		{
			if ((obj[i] instanceof Function) || (obj[i] == null) ||
					(i.toUpperCase() == i))
				continue;
			
			message += i + ', ';
		}
		
		message = message.substr(0, message.length - 2);
	}
	else
		message = 'Object is null';
	
	log(message);
}

function inspectValues (obj)
{
	var message = '';
	
	if (obj)
		for (var i in obj)
		{
			if ((obj[i] instanceof Function) || (obj[i] == null) ||
					(i.toUpperCase() == i))
				continue;
			
			message += i + ': ' + obj[i] + '\n';
		}
	else
		message = 'Object is null';
	
	log(message);
}

var _log_timeout;
var _log_messages = new Array();
