//24/7 Settings
function OAS(sitepage, posList, adCampaign){
	this.sitepage = sitepage;
	this.posList = posList;
	if(adCampaign > 0)
		this.qs = 'adcamp=' + adCampaign;
}

OAS.prototype = {
	url         : 'http://oascentral.virtualtourist.com/RealMedia/ads',
	qs          : '',
	oldVersion  : 10,
	newVersion  : 11,
	rn          : new String(Math.random()),
	rns         : 0,
	sitepage    : null,
	posList     : null,

	getVersion: function(){
		if(navigator.userAgent.indexOf('Mozilla/3') < 0 && navigator.userAgent.indexOf('Mozilla/4.0 WebTV') < 0){
			return this.newVersion;
		}
		else{
			return this.oldVersion;
		}
	},

	jsCall: function(version){
		this.validateRNS();
		if(version >= this.newVersion){
			document.write('<script language=JavaScript1.1 src="'+ this.url + '/adstream_mjx.ads/' + this.sitepage + '/1' + this.rns + '@' + this.posList + '?' + this.qs + '"></script>');
		}
	},
	
	ad: function(pos, version){
		if(version >= this.newVersion){
			OAS_RICH(pos);
		}
		else{
			this.adNormal(pos);
		}
	},
	
	adNormal: function(pos){
		document.write('<A HREF="' + this.url + 'click_nx.ads/' + this.sitepage + '/1' + this.rns + '@' + this.posList + '!' + pos + '?' + this.qs + '" TARGET="_blank">');
  	document.write('<IMG SRC="' + this.url + 'adstream_nx.ads/' + this.sitepage + '/1' + this.rns +  '@' + this.posList + '!' + pos + '?' + this.qs + '" BORDER=0></A>');
	},
	
	validateRNS: function(){
		if(this.rns == 0)
			this.rns = this.rn.substring(2,11);
	}
}


