﻿function LogAdClick(adId, adPageId, productId)
{
    var img = new Image();
	img.src = (productId === undefined) ?
		"http://" + location.host + "/Log.ashx?log=adClick&adId=" + adId + "&adPageId=" + adPageId + "&randNum=" + Math.random() :
		"http://" + location.host + "/Log.ashx?log=adClick&adId=" + adId + "&adPageId=" + adPageId + "&productId=" + productId + "&randNum=" + Math.random();
//    alert("adId: " + adId + "\n"
//         + "adPageId: " + adPageId + "\n"
//         + "img.src: " + img.src + "\n\n"
//         + "domän: " + document.location.href + "\n"
//         + "hostname: " + document.location.hostname + "\n"
//         + "host: " + document.location.host + "\n");
//	alert(img.src);
}

function LogHomepageClick(companyNr, siteId, lang)
{
	var img = new Image();
	img.src = "http://" + location.host + "/Log.ashx?log=homepageClick&companyNr=" + companyNr + "&siteId=" + siteId + "&lang=" + lang + "&randNum=" + Math.random();
}

function LogExternalNewsClick(lang, newsPaperName, url)
{
	var img = new Image();
	img.src = "http://" + location.host + "/Log.ashx?log=externalNewsClick&lang=" + lang + "&newsPaperName=" + newsPaperName + "&url=" + escape(url) + "&randNum=" + Math.random();
}

function LogTop5Click(lang, companyNr, productNr)
{
	var img = new Image();
	img.src = "http://" + location.host + "/Log.ashx?log=top5Click&lang=" + lang + "&companyNr=" + companyNr + "&productNr=" + productNr + "&randNum=" + Math.random();
}

function LogSearchResultCompanyClick(lang, companyNr)
{
	var img = new Image();
	img.src = "http://" + location.host + "/Log.ashx?log=companyClick&lang=" + lang + "&companyId=" + companyNr + "&randNum=" + Math.random();	
}

function LogCompetitorClick(competitorId, companyId)
{
	var img = new Image();
	img.src = "http://" + location.host + "/Log.ashx?log=competitorClick&c1_id=" + companyId + "&c2_id=" + competitorId + "&randNum=" + Math.random();	
}


