var sb={
	tags: [], //this sets up a place holder for the tags
	domain: "",
	https: false,
	url: "tag/tag.php",
	v_id: 0,
	referrer: "",
	params: [],
	ScriptTag: null,
	
	SetTags: function() {
		if (this.https) {
			this.url="https://"+this.domain+"/"+this.url;
		} else {
			this.url="http://"+this.domain+"/"+this.url;
		}
		
		if (this.tags!=null && this.tags.length>0) {
			this.url+="?";
			for (i=0; i<this.tags.length; i++) {
				this.url+="tags[]="+this.tags[i]+"&";
			}
			this.url += "id="+this.id ;
			if( this.cv ) {
				this.url += "&cv="+this.cv ;
			}
			if (this.v_id>0) {
				this.url+="&v_id="+this.v_id;
			}
            for (i=0; i< this.params.length; i++) {
                this.params[i]=this.params[i].replace(/\+/g, "ADD");
            }
			if (this.params.length>0) {
				this.url+="&"+this.params.join("&");
			}

			if (this.referrer=="") {
				if (document.referrer!="") {
					this.url+="&referrerURL="+escape(document.referrer);
				}
			} else {
				this.url+="&referrerURL="+escape(this.referrer);
			}
			this._SendTags();
		} else {
			return false;
		}
	},
	
	SetTagsList: function(sbtagslist) {
		var CurPath=window.location.pathname+window.location.search;
                CurPath=CurPath.replace(/\s/g, "");

		for (domain in sbtagslist) {
			var domain_tags={};
			var sbtagslist_domain=sbtagslist[domain];
			for (path in sbtagslist_domain) {
				var sbtagslist_domain_path=sbtagslist_domain[path];
                                path=path.replace(/\s/g, "");
				if (CurPath.indexOf(path)>=0) {
					for (i=0; i<sbtagslist_domain_path.length; i++) {
						domain_tags[sbtagslist_domain_path[i]]=1;
					}					
					if (path=='/thank_you.php') {
						this.params=["convert=y"];
					}
				}
			}
			for (tag in domain_tags) {
				this.tags=this.tags.concat(tag);
			}
			this.domain=domain;
			this.SetTags();
			this._ResetObj();
		}
	},
	
	_ResetObj: function() {
		this.url="tag/tag.php";
		this.tags=[];
		this.ScriptTag=null;
	},
	
	_SendTags: function() {
		var e = document.createElement("script");
		e.src=this.url;
		e.type="text/javascript";
		this.ScriptTag=e;   
		document.getElementsByTagName("head")[0].appendChild(e);
	},
	
	_CleanUp: function() {}
}

var sbtagspaths = {
	'/products/index.php': ['IMS', 'Overview', 'WEB-IMS-Face to Face', 'MS Shopper'],
	'/facetoface/index.php': ['IMS', 'Overview', 'Education', 'WEB-IMS-Features & Benefitzs', 'MS Shopper'],
	'/special_offers/index.php': ['IMS', 'Details', 'Pricing', 'WEB-IMS-Limited Time Offers', 'MS Shopper'],
	'/merchant_accounts/index.php': ['IMS', 'Details', 'Education', 'WEB-IMS-Merchant Account Details', 'MS Shopper'],
	'/compare_pricing/index.php': ['IMS', 'Details', 'Comparison', 'WEB-IMS-Competitive Rates', 'MS Shopper'],
	'/faqs/index.php': ['IMS', 'Details', 'Education', 'WEB-IMS-FAQ', 'MS Shopper'],
	'/testimonials/index.php': ['IMS', 'Details', 'Community', 'WEB-IMS-Testimonials', 'MS Shopper'],
	'/special_offers/index.php': ['IMS', 'Details', 'Pricing', 'WEB-IMS-Limited Time Offers', 'MS Shopper'],
	'/apply/index.php': ['IMS', 'Details', 'Check Out', 'WEB-IMS-Apply Now', 'MS Shopper'],
	'/about_us/index.php': ['IMS', 'Details', 'Education', 'WEB-IMS-About Us', 'MS Shopper'],
	'/support/index.php': ['IMS', 'Details', 'Support', 'WEB-IMS-Solutions Support', 'MS Shopper'],
	'/thank_you.php': ['IMS', 'Details', 'Conversion', 'WEB-IMS-Thank you', 'MS Shopper'],
	'/eCommerce/index.php': ['IMS', 'Details', 'Education', 'WEB-IMS-Ecommerce Overview', 'MS Shopper'],
	'/eCommerce/features.php': ['IMS', 'Details', 'Education', 'WEB-IMS-Ecommerce Features and Benefits', 'MS Shopper'],
	'/phonefaxmail/index.php': ['IMS', 'Details', 'Education', 'WEB-IMS-Phone Fax Overview', 'MS Shopper'],
	'/phonefaxmail/features.php': ['IMS', 'Details', 'Education', 'WEB-IMS-Phone Fax Features and Benefits', 'MS Shopper']
}

/**
 * m360.imsmerchant.com
 */
sb.id=600;
sb.cv="n";
var sbtagslist= {
	"m360.imsmerchant.com" : sbtagspaths
}
sb.SetTagsList(sbtagslist);