/* 
 * FILE: ecomMetric.js
 * PURPOSE: Log user information for statistical purposes
 * AUTHOR: Jacob Fogg
 */
//set some variables
var _djourl;
var _djo;
function ecomMetric(){
	//build the url
	_djourl = _djourl+'&djores='+screen.width + "x" + screen.height+'&djocd='+window.screen.colorDepth+'&djoqs='+escape(window.location.href.split('?')[1]);
	//build the request
	_djo = document.createElement('iframe');//create an iframe
	_djo.style.display = "none";//hide it
	_djo.src = _djourl;//set the url
	_djo.setAttribute('onload','setTimeout("cleanMetric()",10);');//set an onload to timeout in 1 second
	document.body.appendChild(_djo);//add the element to the document
}
function cleanMetric(){//clean up the environment
	//alert('now');
	_djo.parentNode.removeChild(_djo);//remove the iframe
	delete _djo;//remove the _djo variable
	delete _djourl;//remove the _djourl variable
}
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
		if (oldonload) {
			oldonload();
		}
			func();
		}
	}
}
