function quote_post(pid){
	// reply textarea id = reply

	// get html from the div the user's post is in
	var quoteContent = $('#postcontent-'+pid).html();
	quoteContent = jQuery.trim(quoteContent);
	html2bb(quoteContent);
}


function html2bb(content) {
	var content; //inital content
	content = content.replace(/<br>/g,'');  //replace brs
	content = content.replace(/<a href="(.*)" class="fb"><img src="/g,'[img]').replace(/" alt=""><\/a>/g,'[/img]');  //replace images
	content = content.replace(/<object width="600" height="360"><param name="movie" value="http:\/\/www.youtube.com\/v\/(.*)"><param name="wmode" value="transparent"><embed src="http:\/\/www.youtube.com\/v\/(.*)" type="application\/x-shockwave-flash" wmode="transparent" width="600" height="360"><\/object>/g,'[youtube]$1[/youtube]');  //replace youtube
	//content = content.replace(/<div align="left">/,'').replace(/<div align="right">/,'').replace(/<div align="center">/,'').replace(/<\/div>/,'').replace(/">/g,']').replace(/<\/a>/g,'[/url]').replace(/<img src="\/images\/icons\/smileys\//,'').replace(/alt="\*\*/,'}').replace(/<!--EMO-->(.*)" }/g,'').replace(/"<!--eEMO-->/g,'').replace(/" class="smiley]<!--eEMO-->/g,'').replace(/a href="/g,'url=').replace(/del/g,'s').replace(/u/g,'u').replace(/em/g,'i').replace(/strong/g,'b').replace(/blockquote/g,'quote').replace(/<\//g,'[/').replace(/>/g,']').replace(/</g,'[');
	quote(content);

}

function quote(newContent) {
	// add the above into the reply textarea
	var tVal = $('#reply').val();
	$('#reply').val(tVal + '[quote]' +newContent+ '[/quote]');
}