
/**
 * Cookie Functions from QuirksMode.org
 * Thanks.
 */
function createCookie(name, value, days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}



/*
 * Useful function!
 * Oringally: getelbyid.js
 */
function getElementsByTagNames(list, obj) {
	if (!obj) var obj = document;
	var tagNames = list.split(',');
	var resultArray = new Array();
	for (var i = 0; i < tagNames.length; i++) {
		var tags = obj.getElementsByTagName(tagNames[i]);
		for (var j = 0; j < tags.length; j++) {
			resultArray.push(tags[j]);
		}
	}
	var testNode = resultArray[0];
	if (!testNode) return [];
	if (testNode.sourceIndex) {
		resultArray.sort(function (a, b) {
				return a.sourceIndex - b.sourceIndex;
		});
	}
	else if (testNode.compareDocumentPosition) {
		resultArray.sort(function (a, b) {
				return 3 - (a.compareDocumentPosition(b) & 6);
		});
	}
	return resultArray;
}

/*
 * Functions tp email/aim to a friend
 * Originally send.js
 */
function sendURL(method, url, title) {
	var str = '<a href="';
	if (!title) title = document.title;
	if (!url) url = document.URL;
	switch (method) {
		case "email":
			str += 'mailto:?subject=' + escape(title) + '&body=' + escape(url) + '">Email';
		break;
		case "aim":
			str += 'aim:goim?message=' + escape(title) + '+' + escape(url) + '">AIM';
		break;
	}
	str += ' to a friend</a>';
	document.write(str);
}

function goSendUrl(method, url, title) {
	if (!title) title = document.title;
	if (!url) url = document.URL;
	switch (method) {
		case "email":
			str = 'mailto:?subject=' + escape(title) + '&body=' + escape(url);
		break;
		case "aim":
			str = 'aim:goim?message=' + escape(title) + '+' + escape(url);
		break;
	}
	location.assign(str);
}

/**
 * Bookmark function
 *
 *
 */
function bookmark_us(url, title) {
	if (window.sidebar) // firefox
	    window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
	    var elem = document.createElement('a');
	    elem.setAttribute('href',url);
	    elem.setAttribute('title',title);
	    elem.setAttribute('rel','sidebar');
	    elem.click();
	}
	else if(document.all)// ie
	    window.external.AddFavorite(url, title);
}



/*
 * Web Sniffer
 * TODO: Remove URLs from this code
 * Originally cbds.t.js
 */
function at(G,value,ad){var I=new Date();I.setDate(I.getDate()+ad);document.cookie=G+"="+escape(value)+((ad==null)?"":";expires="+I.toGMTString());};function aw(G){if(document.cookie.length>0){B=document.cookie.indexOf(G+"=");if(B!= -1){B=B+G.length+1;K=document.cookie.indexOf(";",B);if(K== -1)K=document.cookie.length;return unescape(document.cookie.substring(B,K));}}return 0;};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(aA){var R=this.length;var g=Number(arguments[1])||0;g=(g<0)?Math.ceil(g):Math.floor(g);if(g<0)g+=R;for(;g<R;g++){if(g in this&&this[g]===aA)return g;}return-1;};}var J=function(){this.c={C:{url:'http:\/\/www.niallkennedy.com\/blog\/index.atom',type:'application/atom+xml'},link:null,d:null,m:[]};this.aD={TrainHornsDotNet:'Train Horns dot Net',The2001SaleDepot:'2001 Sale Depot',TrainHornExpress:'Train Horn Express',PBMissions:'PB Missions',PhantomFears:'Phantom Fears',SiegeEngineering:'Siege Engineering',TrainHorn:'Legend Horns (TrainHorn dot Org)',AutoLoc:'AutoLoc (thehoffmangroup.com)',TrainHornKits:'Maximus Horn Systems (trainhornkits.com)',TruckTrainHorns:'Truck Train Horns',AssuredAutomotive:'Assured Automotive',AirHornKitsDotCom:'Air Horn Kits dot Com',Wolo:'Wolo Manufacturing',Kleinn:'Kleinn',eBay:'eBay'};this.ap={aB:[{o:'TrainHornsDotNet',l:['http:\/\/www.trainhorns.net','http:\/\/www.trainhorns.net\/','http:\/\/trainhorns.net','http:\/\/trainhorns.net\/']},{o:'The2001SaleDepot',l:['http:\/\/www.2001saledepot.com','http:\/\/www.2001saledepot.com\/','http:\/\/2001saledepot.com','http:\/\/2001saledepot.com\/','http:\/\/www.2001saledepot.com\/index.php?categoryID=19','http:\/\/www.2001saledepot.com\/index.php?categoryID=2']},{o:'TrainHornExpress',l:['http:\/\/trainhornexpress.com','http:\/\/www.trainhornexpress.com','http:\/\/trainhornexpress.com\/','http:\/\/www.trainhornexpress.com\/']},{o:'PhantomFears',l:['http:\/\/www.phantomfears.com','http:\/\/www.phantomfears.com\/','http:\/\/phantomfears.com','http:\/\/phantomfears.com\/']},{o:'AutoLoc',l:['http:\/\/www.thehoffmangroup.com\/autoloc\/product.lasso?prodinc=horns','http:\/\/thehoffmangroup.com\/autoloc\/product.lasso?prodinc=horns','http:\/\/www.thehoffmangroup.com\/horns','http:\/\/thehoffmangroup.com\/horns','http:\/\/www.aztrucks.com\/product.asp?pr=High_Power_Air_Horns']},{o:'SiegeEngineering',l:['http:\/\/www.siege-engineering.com\/','http:\/\/siege-engineering.com\/','http:\/\/www.siege-engineering.com\/Catalog.aspx','http:\/\/siege-engineering.com\/Catalog.aspx']},{o:'TrainHornKits',l:['http:\/\/www.trainhornkits.com','http:\/\/www.trainhornkits.com\/','http:\/\/trainhornkits.com','http:\/\/trainhornkits.com\/']},{o:'TrainHornWarehouse',l:['http:\/\/www.trainhornwarehouse.com','http:\/\/www.trainhornwarehouse.com\/','http:\/\/trainhornwarehouse.com','http:\/\/trainhornwarehouse.com/\/','http:\/\/www.trainhornwarehouse.com\/index.html']},{o:'AssuredAutomotive',l:['http:\/\/www.assuredautomotiveproducts.com','http:\/\/www.assuredautomotiveproducts\/','http:\/\/www.assuredautomotiveproducts.com\/main.sc','http:\/\/assuredautomotiveproducts.com','http:\/\/assuredautomotiveproducts.com\/','http:\/\/www.assuredautomotiveproducts.com\/category.sc?categoryId=18&gclid=CNHs1_bt3JoCFQWvkgod3AfA2w','http:\/\/www.assuredautomotiveproducts.com\/category.sc?categoryId=18','http:\/\/www.assuredautomotiveproducts.com\/category.sc']},{o:'TrainHornsDelivered',l:['http:\/\/www.trainhornsdelivered.com','http:\/\/www.trainhornsdelivered.com\/','http:\/\/trainhornsdelivered.com','http:\/\/trainhornsdelivered.com\/','http:\/\/www.trainhornsdelivered.com\/trhofortr.html']},{o:'AirHornKitsDotCom',l:['http:\/\/www.airhornkits.com','http:\/\/www.airhornkits.com\/','http:\/\/airhornkits.com','http:\/\/airhornkits.com\/']},{o:'Wolo',l:['http:\/\/www.wolo-mfg.com\/train.htm','http:\/\/wolo-mfg.com\/train.htm']},{o:'Kleinn',l:['http:\/\/www.kleinn.com','http:\/\/www.kleinn.com\/','http:\/\/kleinn.com','http:\/\/kleinn.com\/']},{o:'eBay',l:['http:\/\/search.ebay.com\/search\/search.dll?g=R40&_trksid=m37&satitle=train+horns&category0=','http:\/\/motors.shop.ebay.com\/items\/train-horns_W0QQ_nkwZtrainQ20horns']}]};function f(ax){var link=document.createElement('a');link.href=ax.link+encodeURIComponent(c.C.url);link.appendChild(document.createElement('div'));return link;};return{ar:function(){return false;},ay:function(){if(c.m&&c.m.length>0){return true;}else{return false;}},aE:function(){var t=document.getElementById('webfeed');if(t&&t.tagName.toLowerCase()=='a'){if(t.href&&t.type){c.C.url=t.href;c.C.type=t.type;return true;}}else{var head=document.getElementsByTagName('head')[0];if(head){var links=head.getElementsByTagName('link');if(links){for(var i=0;i<links.length;i++){var link=links[i];if(link.rel&&link.type&&(link.rel=='alternate'&&aC.indexOf(link.type)>=0)){c.C.url=link.href;c.C.type=link.type;return true;}link=null;}}links=null;}}t=null;return false;},az:function(){c.d=document.getElementById('linktest');if(!c.d){c.d=document.createElement('div');c.d.id='linktest';c.d.style.height='1px';c.d.style.width='1px';document.body.appendChild(c.d);}c.link=document.createElement('a');c.link.id='test_link';c.d.appendChild(c.link);if(c.link.currentStyle){this.aj=function(url){var link=document.createElement('a');link.href=url;c.d.appendChild(link);var color=link.currentStyle.color;if(color=='#000000'){c.d.removeChild(link);return true;}else{c.d.removeChild(link);return false;}};}else{this.aj=function(url){var link=document.createElement('a');link.href=url;c.d.appendChild(link);var af=document.defaultView.getComputedStyle(link,null);if(af){if(af.color=='rgb(0, 0, 0)'){c.d.removeChild(link);return true;}}else{c.d.removeChild(link);return false;}};}return true;},am:function(){var links=ap.aB;for(var i=0;i<links.length;i++){var A=links[i];if(A.o&&A.l){var M=A.o;for(var r=0;r<A.l.length;r++){var url=A.l[r];var ae=this.aj(url);if(ae){if(c.m&&c.m.indexOf(M)<0){c.m.push(M);break;}}url=ae=null;}M=null;}A=null;}links=null;c.d.innerHTML='';},ao:function(ai){aq=(ai)?'block':'none';an=(ai)?'none':'inline';var D=document.getElementById('warning-box');D.innerHTML='<div style="width:560px;text-align:right;margin: 4px;  display: '+aq+';" id="warning-box-alert" style="display:none;"><span style="font-weight:bold; font-size:9px; padding:1px 3px 1px 3px;border:1px solid #000000;"><a href="javascript:J.aI()";>You Have 1 Alert!</a></span></div><div id="warning-box-warning" style="display: '+an+';"><table class="bodytext"><tr><td rowspan="3"<img src="http://s4.hornblasters.org/images/stop_sign.png" width="250" height="250" alt="Stop Sign Logo" title="STOP! Before You Go Any Further!"/></td><td colspan="2"><h1>READ THIS IMPORTANT MESSAGE</h1><p>Before you go any further, we wanted to make sure you make an educated decision about your train horn purchase.</p>All cards on the table, our site has detected that you\'ve been to the following site(s):</td></tr><tr><td><ul id="link-list-1"></ul></td><td><ul id="link-list-2"></ul></td></tr><tr><td colspan="2">We want you to make the right decision when purchasing a horn and would like to outline a couple of reasons our kits are not quite what you\'ve seen before.<br/><form id="warningForm" method="post" onsubmit="return J.aJ();" action="/trainhornfacts/"><input type="hidden" value="" id="list" name="list"/><div class="center"><input type="submit" value="Click Here To Read Full Article" style="color: #ffffff; font-weight:bold;background-color:#ff0000;"/><br/>- Or After Reading This Important Message -<br/><input type="button" onclick="javascript:J.aK();" value="Click Here To Hide This Message" style="background-color:#e0e0e0;"/></div></form></td></tr></table></div>';var v=new Array();v[0]=document.getElementById('link-list-1');v[1]=document.getElementById('link-list-2');if(v[0]&&(v[0].tagName.toLowerCase()=='ul'||v[0].tagName.toLowerCase()=='ol')){var aF=document.getElementById('link-list-input');r=0;for(var i=0;i<c.m.length;i++){var li=document.createElement('li');li.innerHTML=c.m[i];v[r].appendChild(li);r++;if(r>1)r=0;li=link=null;}}},aJ:function(){var H=c.m.join(',');var list=document.getElementById('list');list.value=Base64.encode(H);return true;},aH:function(){var H=c.m.join(',');return Base64.encode(H);},aK:function(){var D=document.getElementById('warning-box-warning');D.style.display='none';var L=document.getElementById('warning-box-alert');L.style.display='block';at('hbHideWarning','1',180);},aI:function(){var L=document.getElementById('warning-box-alert');L.style.display='none';var D=document.getElementById('warning-box-warning');D.style.display='inline';},aG:function(){var F=document.getElementById('subscribe-list');if(F&&(F.tagName.toLowerCase()=='ul'||F.tagName.toLowerCase()=='ol')){for(var i=0;i<c.m.length;i++){var li=document.createElement('li');var link=null;switch(c.m[i]){case 'ag':link=f(k.ag);link.id='feedreader-ag';break;case 'ah':link=f(k.ah);link.id='feedreader-ah';break;case 'ac':link=f(k.ac);link.id='feedreader-ac';break;case 'al':link=f(k.al);link.id='feedreader-al';break;case 'ak':link=f(k.ak);link.id='feedreader-ak';break;case 'aa':link=f(k.aa);link.id='feedreader-aa';break;case 'U':link=f(k.U);link.id='feedreader-U';break;case 'V':link=f(k.V);link.id='feedreader-V';break;case 'P':link=f(k.P);link.id='feedreader-P';break;case 'ab':link=f(k.ab);link.id='feedreader-ab';break;case 'T':link=f(k.T);link.id='feedreader-T';break;case 'O':link=f(k.O);link.id='feedreader-O';break;case 'Q':link=f(k.Q);link.id='feedreader-Q';break;default:break;}if(link){link.className='feedreader';li.appendChild(link);F.appendChild(li);}li=link=null;}}},aL:function(){if(!this.ar()&&location.href!='http://www.hornblasters.com/trainhornfacts/'){if(this.az()){this.am();}}if(this.ay()){var as=aw('hbHideWarning');this.ao(as);}}};}();