
function logJsRnWebHit(acc, key, domainEntryCode, builderID, builderCommunityID, adFilterID, clientID) {
	var location = document.location
	var host = location.host
	var path = location.pathname
	
	//if ClientID passed in, lets tack it to the queystring
	var qClientID = clientID ? '&clientID=' + clientID : '';
	
	var sitedirectory = path.substring(0, path.indexOf('/',1))
	var imgpath = 'http://' + host + sitedirectory + '/modules/internet/logging/logwebhit.aspx';
	//prompt('', imgpath + '?acc=' + acc + '&keyname=' + key  + '&domainentrycode=' + domainEntryCode + '&rnd=' + Math.floor(Math.random() * (new Date()) + 1));
	rnImage = new Image();
	rnImage.src = imgpath + '?acc=' + acc + '&keyname=' + key  + '&domainentrycode=' + domainEntryCode + '&bldrID=' + builderID + '&bcID=' + builderCommunityID + '&adfilterid=' + adFilterID + qClientID + '&rnd=' + Math.floor(Math.random() * (new Date()) + 1);
	rnImage.onload = function() {return;}
	return;
}

function logJsRnListingWebHit(acc, key, domainEntryCode, listingCompanyID, listingLag, listPrice, mlsCity, mlsID, mlsNumber, mlsNumberAlpha, stateAbbreviation, builderCommunityID, builderID) {
	var location = document.location;
	var host = location.host;
	var path = location.pathname;
	var builderIDQuerystring='';
	var builderCommunityIDQuerystring='';
	
	if (builderID > 0) {
		builderIDQuerystring = '&bldrID=' + builderID
	}

	if (builderCommunityID > 0) {
		builderCommunityIDQuerystring = '&bcID=' + builderCommunityID
	}
	
	var sitedirectory = path.substring(0, path.indexOf('/',1));
	var imgpath = 'http://' + host + sitedirectory + '/modules/internet/logging/logwebhit.aspx';
	//prompt('', imgpath + '?acc=' + acc + '&keyname=' + key  + '&domainentrycode=' + domainEntryCode + '&listingcompanyid=' + listingCompanyID  + '&listinglag=' + listingLag + '&listprice=' + listPrice  + '&mlscity=' + mlsCity  + '&mlsnumber=' + mlsNumber + '&mlsnumberalpha=' + mlsNumberAlpha + '&stateabbreviation=' + stateAbbreviation +  '&rnd=' + Math.floor(Math.random() * (new Date()) + 1));
	rnImage = new Image();
	rnImage.src = imgpath + '?acc=' + acc + '&keyname=' + key  + '&domainentrycode=' + domainEntryCode + '&listingcompanyid=' + listingCompanyID  + '&listinglag=' + listingLag + '&listprice=' + listPrice  + '&mlscity=' + mlsCity  + '&mlsid=' + mlsID + '&mlsnumber=' + mlsNumber + '&mlsnumberalpha=' + mlsNumberAlpha + '&stateabbreviation=' + stateAbbreviation  + builderIDQuerystring + builderCommunityIDQuerystring + '&rnd=' + Math.floor(Math.random() * (new Date()) + 1);
	rnImage.onload = function() {return;}
	return;
}

function logJsAndAdRedirect(acc, adFilterID, url, domainEntrycode){
	height = window.screen.height * .85;
	width = window.screen.width * .85;
	window.open(url, null, 'toolbar=yes,location=no,scrollbars=yes,menubar=no,status=yes,resizable=yes,width='+width+',height='+height);
	logJsRnWebHit(acc, 'AdClick', domainEntrycode, '', '', adFilterID);
}

// DELETE - AFTER 6/22/09
function logJsRnAdWebHit(acc, key, adFilterID, domainEntryCode) {
	var location = document.location
	var host = location.host
	var path = location.pathname
	var sitedirectory = path.substring(0, path.indexOf('/',1))
	var imgpath = 'http://' + host + sitedirectory + '/modules/internet/logging/logwebhit.aspx';
	//prompt('', imgpath + '?acc=' + acc + '&keyname=' + key  + '&domainentrycode=' + domainEntryCode + '&rnd=' + Math.floor(Math.random() * (new Date()) + 1));
	rnImage = new Image();
	rnImage.src = imgpath + '?acc=' + acc + '&keyname=' + key  + '&domainentrycode=' + domainEntryCode   + '&adfilterid=' + adFilterID + '&rnd=' + Math.floor(Math.random() * (new Date()) + 1);
	rnImage.onload = function() {return;}
	return;
}


function logSearch(acc) {

	var location = document.location
	var host = location.host
	var path = location.pathname
	var sitedirectory = path.substring(0, path.indexOf('/',1))
	var imgpath = 'http://' + host + sitedirectory + '/modules/internet/logging/logsearch.aspx';
	
	rnImage = new Image();
	rnImage.src = imgpath + '?acc=' + acc + '&x=' + Math.floor(Math.random() * (new Date()) + 1);
	rnImage.onload = function() {return;}
	return;
}

function logSearchResultsHistory(mlsIDs, mlsNumbers) {

	var location = document.location
	var host = location.host
	var path = location.pathname
	var sitedirectory = path.substring(0, path.indexOf('/',1))
	var imgpath = 'http://' + host + sitedirectory + '/modules/internet/logging/logsearchresultshistory.aspx';
	
	rnImage = new Image();
	rnImage.src = imgpath + '?M1=' + mlsIDs + '&M2=' + mlsNumbers;
	rnImage.onload = function() {return;}
	return;
}