/**
 * concrete implementation of the metrics interface specifically for SiteCensus
 */
siteCensusEngine = new (function()
{
	var me = this;
	/*
	var domain = "//secure-us.imrworldwide.com/";
	var CG="Billboard";
	var CI="us-emediatop";
	*/
	me.firstTime = true;

	/**
	 * sitecensus calls a page track when the v53 JS is sourced, so the first page load
	 * will already call a 'pageview' and we should ignore the frameworks first 
	 * 'pageLoaded' event
	 */
	me.trackPageView = function( url )
	{
		billboard.info("siteCensusEngine.trackPageView()");
		if ( !me.firstTime ) { 
			try {
				document.getElementById('field2').value = document.getElementById('field1').value;		    
			} 
			catch(ex) { 
			}
			if ( window._rsEvent ) {
				billboard.info("  siteCensus - tracking: " + window.location );
				_rsEvent( window.location );
			}
		}
		else {
			billboard.info("  siteCensus - skippping track (in page JS tracks first hit");
		}
		me.firstTime = false;
	};

	me.trackInteraction = function()
	{
		billboard.info("siteCensusEngine.trackInteraction()");
	};

	me.trackDownload = function()
	{
	};

	/**
	 * on load
	 */
	$(function(){
		billboard.metrics.registerEngine( "siteCensus", me );
	});
})()
