//var _gaq = _gaq || [];
//_gaq.push(['_setAccount', 'UA-1007117-3']);
//_gaq.push(['_trackPageview']);

function rightCol(){
	pa = document.getElementById('post-area');
	a = pa.getElementsByTagName('div');
	for(var k=0;k<a.length;k++){
		if(/post-content/i.test(a[k].className)){
			var divs = a[k].getElementsByTagName('div');
			for(var v=0;v<divs.length;v++){
				if(/right-col/i.test(divs[v].className)){
					var rc = divs[v];
				}
			}
			if(rc){
				//var imgs = Array.prototype.slice.call(a[k].getElementsByTagName('img'));
				var imgs = [];
				
				ic = a[k].getElementsByTagName('img');
				for(var i=0;i<ic.length;i++){
					if(!/inline/.test(ic[i].className)){
						imgs.push(ic[i]);
					}
				}
				for(var j=0;j<imgs.length;j++){
					var n = imgs[j];
					//need to strip attributes off image
					n.align = "";
					n.hspace = "";
					n.border = "";
					n.vspace = "";
					
					if(/^a$/i.test(imgs[j].parentNode.nodeName)){
						n = imgs[j].parentNode;
					}
					
					rc.appendChild(n.parentNode.removeChild(n));
				}
				//var bq = Array.prototype.slice.call(a[k].getElementsByTagName('cite'));
				
				var bq = [];
				cc = a[k].getElementsByTagName('cite');
				for(var c=0;c<cc.length;c++){bq.push(cc[c]);}
				for(var t=0;t<bq.length;t++){
					var n = rc.appendChild(bq[t].cloneNode(true));
					var s = document.createElement('span');
					s.appendChild(document.createTextNode(" "));//blah ie
					n.appendChild(s);
				}
			}
		}
	}
}



init = function(){
	if(arguments.callee.doOnce){return;}
	arguments.callee.doOnce=true;
	/*(function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
	})();*/

	if(document.getElementById && document.getElementById("search-box")){
		document.getElementById("search-box").onfocus = function(){
			if(this.value = "[search]"){
				this.value = "";
			}
		}
	}
	if(document.getElementById && document.getElementById("subscribe-box")){
		document.getElementById("subscribe-box").onfocus = function(){
			if(this.value = "[Email Address]"){
				this.value = "";
			}
		}
	}
	if(document.getElementById('post-area')){rightCol();}
}

if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,null);}
window.onload=init;