jQuery(document).ready(function(){
	print_links("#main-content .content a", "http://www.wvrx.org");
	
	// ALT ROW CLASSES APPLY
	<!--jQuery("table > tr:even").addClass("evenRow");-->
	<!--jQuery("table > tr:odd").addClass("oddRow");-->
		
	// ADD FIRSTCHILD CLASS TO ALL LI FIRST CHILD ELEMENTS 
	jQuery("ul li:first-child").addClass("firstChild");

	// REPLACE ALIGN RIGHT/LEFT WITH CLASSES
	jQuery("img[align='left']").addClass("floatLeft").removeAttr('align').removeAttr('hspace').removeAttr('vspace');
	jQuery("img[align='right']").addClass("floatRight").removeAttr('align').removeAttr('hspace').removeAttr('vspace');
	
	jQuery("hr").wrap('<div class="hr"></div>');
	
	$("a").each(function(){
		if($(this).attr("href").indexOf("http://www.youtube.com") > -1){
			var _vidSrc = $(this).attr("href").replace("watch?v=","v/") + "&hl=en&fs=1";
			var _embed = '<object width="425" height="344"><param name="movie" value="' + _vidSrc + '"></param><param name="allowFullScreen" value="true"></param><embed src="' + _vidSrc + '" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>';
			$(this).before(_embed).remove();
		}
	});
});

function print_links(_selector, _root){
	jQuery(_selector).each(function(){
		var _link = jQuery(this).attr("href");
		if((_link.indexOf('http:') != 0) && (_link.indexOf('mailto:') != 0)){
			while(_link.indexOf("../") != -1){
				_link = _link.replace("../","");
			}
			_link = _root + "/" + _link;
		} 
		_link = _link.replace("mailto:","");
		jQuery(this).after('<span class="print-link"> (' + _link + ')</span>'); 
	});
}
