// analyst_functions.js
// JavaScript functions for insertion of AKQA Analyst Tracking.
//
// http://adserver.akqa.net/
// Copyright (C) 1999-2004 AKQA.  All rights reserved.
//
// Version 3.00a
var bAnalystAlerts = false;
var sURL = "http://adserver.akqa.net/";

document.write('<SCR'+'IPT LANGUAGE="VBScript">\n<!--\n');
document.write('Sub oFlash_FSCommand(ByVal command, ByVal args)\n');
document.write('call oFlash_DoFSCommand(command, args)\n');
document.write('end Sub\n');
document.write('//-->\n</SCR'+'IPT>');

function oFlash_DoFSCommand(command, parameter) {	
	if (command == "impression") { 
		logImpression(parameter); 
		}
	else if (command == "click") { 
		logClick(parameter);
		}
}

function logClick(redirectID) {
	getClickImage = new Image();
	getClickImage.src = sURL+"redirect.dll?"+ redirectID;
	if(bAnalystAlerts) alert("Logged Click: " + getClickImage.src);
}

function logImpression(redirectID) {
	getImpressionImage = new Image();
	getImpressionImage.src = sURL+"ad.dll?"+ redirectID+'&RandomID='+AACreateAUID();
	if(bAnalystAlerts) alert("Logged Impression: " + getImpressionImage.src);
}
