function adhese() {
	this.host = "http://ads.pebblemedia.adhese.com/ad";
	this.product = "test_home";
	this.hkey = "unknown";
	this.rand = Math.round(Math.random()*10000);
	this.numberOfAdsInStack = 3;
	var a = location.hostname.split(".");
	if (a.length >= 2) 
		this.product = a[a.length-2] + "." + a[a.length-1];
	if (typeof(hky) != "undefined") 
		this.hkey = hky;	
};
adhese.prototype.tag = function(template) {
	var req = "/sl_" + this.product + "_-" + template + "/hk" + this.hkey + "/rn" + this.rand + "?t=" + (Math.random()*10000);
	document.write("<scr"+"ipt type='text/javascript' src=" + this.host + req + "></scri"+"pt>");
};
adhese.prototype.taghc = function(loc, template) {
	this.product = loc;
	var req = "/sl_" + loc + "_-" + template + "/hk" + this.hkey + "/rn" + this.rand + "?t=" + (Math.random()*10000);
	document.write("<scr"+"ipt type='text/javascript' src=" + this.host + req + "></scri"+"pt>");
};
adhese.prototype.taghcs = function(loc, template, num) {
	this.numberOfAdsInStack = num;
	this.product = loc;
	var req = "/sl_" + loc + "_-" + template + "/hk" + this.hkey + "/rn" + this.rand + "?t=" + (Math.random()*10000);
	document.write("<scr"+"ipt type='text/javascript' src=" + this.host + req + "></scri"+"pt>");
};

var adhese = new adhese();

