/* v 1.0 ---------------------------------*
 *  Nasmedia Track Object, version 1.0
 *  (c) 2009 nasmedia,mizcom (2009-12-24)
 *---------------------------------------*/
var nasmedia = {};
var NTrackObj = null;
nasmedia.track = function(){
	this.camp = "";
	this.page = "";
	this.turl = "";
	this.sTime = "";
	this.img = null;
	this.div = null;
	this.script = null;
};
nasmedia.track.prototype = {
	callTrackTag : function(p){
		if(this.camp == "" || this.page== "" || this.turl == "") return; 
		if(p)	{
			var tag = this.turl + '/track?camp='+this.camp+'&page='+p+'&r='+Math.random();
			this.img.setAttribute("src", tag);
		} else {
			var tag = this.turl + '/track?camp='+this.camp+'&page='+this.page+'&r='+Math.random();
			this.script.setAttribute("src", tag);
		}
		return false;
	},
	init : function(CAMP, PAGE, TURL) {
		this.camp = CAMP;
		this.page = PAGE;
		this.turl = TURL;
		this.img = document.createElement('img');
		this.img.setAttribute("id","NS_Track_Img");
		this.img.setAttribute("height","0");
		this.img.setAttribute("width","0");
		this.img.setAttribute("border","0");
		
		this.div = document.createElement('div');
		this.div.setAttribute("id","NS_Track_DIV");
		this.div.setAttribute("style","position:absolute;display:;top:-10;left:0;");
		
		this.script = document.createElement('script');
		this.script.setAttribute("type","text/javascript");
		this.script.setAttribute("id","NS_Track_Script");
		
		document.body.appendChild(this.img);
		document.body.appendChild(this.div);
		document.body.appendChild(this.script);
	}
};
(function(){
	NTrackObj = new nasmedia.track();
})();

