var pageTracker;
var session_id;
var sitepath;
var csetHost;
var csetConversion;

$(document).ready(function() {
	/**
	 *
	 * Plaats Flash
	 * 
	 */	 	 	 	
	var so = new SWFObject("swf/Kansenpakker_v14.swf", "tempoteam_kansenpakker", "930", "582", "9", "#ffffff");
	so.addParam("quality", "high");
	so.addParam("wmode", "window");
	so.addParam("scale",'noscale');
	so.addParam("salign","ts");
	so.addVariable("session_id", session_id);
	so.addVariable("sitepath", sitepath);
	so.useExpressInstall("swf/expressInstall.swf");
	so.write("kansenpakker");
});

function ga_count(teller_naam) {
	pageTracker._trackPageview(teller_naam);
	
	if (teller_naam == '/formulier/verzonden') {
		searchenginetracking();
	}
}

function searchenginetracking() {
	var csetDate = new Date();
	var csetImage = new Image();
	
	var csetCounterUrl = 'http://www.searchenginetracking.nl/pageview.ashx?host=' + escape(csetHost);
	if(document.location!=null && document.location.protocol!=null && document.location.protocol == "https:")
	{
	csetCounterUrl = 'https://www.searchenginetracking.nl/pageview.ashx?host=' + escape(csetHost);
	}
	csetCounterUrl += document.location!=null?'&url=' + escape(document.location):'';
	csetCounterUrl += document.referrer!=null?'&referrer=' + escape(document.referrer):'';
	if (typeof csetConversion != "undefined" && csetConversion != null)
	{
	csetCounterUrl += '&conversion=' + csetConversion;
	}
	if (typeof csetCategory != "undefined" && csetCategory != null && csetCategory != "")
	{
	csetCounterUrl += '&category=' + escape(csetCategory.replace(' ', '%20'));
	}
	if (typeof csetQuantity != "undefined" && csetQuantity != null && csetQuantity != 0)
	{
	csetCounterUrl += '&quantity=' + csetQuantity;
	}
	if (typeof csetAmount != "undefined" && csetAmount != null && csetAmount != 0)
	{
	csetCounterUrl += '&amount=' + csetAmount;
	}
	csetCounterUrl += "&time=" + csetDate.getTime();
	csetImage.src = csetCounterUrl;
}
