// By VoidPC
if(useDefaultImages){
// Images by Laiam
// Visit http://calledoutdesigns.net
quote = "<img src='http://dev.b1.jcink.com/uploads/dev/common/images/multi.png' />", 
noquote = "<img src='http://dev.b1.jcink.com/uploads/dev/common/images/multi_rm.png' />";
}
var multiQuote = {
quotedPost : '',
savedPost : [],
fn : function(URL, id){
if(id == 1){
if(multiQuote.savedPost[URL]){
multiQuote.quotedPost += multiQuote.savedPost[URL];
} else {
var aJax = XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
aJax.open('GET', URL, true);
aJax.onreadystatechange = function(){
if(aJax.readyState == 4 && aJax.status == 200){
var content = document.createElement('DIV');
content.innerHTML = aJax.responseText;
for(var i = 0, a = content.getElementsByTagName('TEXTAREA'), b = a.length; i < b; i++){
if(a[i].name == "Post" && a[i].className == "textinput"){
var p = a[i].value + '\n';
multiQuote.savedPost[URL] = p;
multiQuote.quotedPost += p;
break;
}}}}
aJax.send(null);
}} else {
multiQuote.quotedPost = multiQuote.quotedPost.replace(multiQuote.savedPost[URL], '');
}},
init : function(){
for(var i = 0, a = document.getElementsByTagName('DIV'), b = a.length; i < b; i++){
if(a[i].align == "right" && a[i].parentNode.className == "darkrow3" && a[i].parentNode.align == "left"){
for(var x = 0, y = a[i].parentNode.parentNode.parentNode.getElementsByTagName('TR')[0].getElementsByTagName('TD')[1].getElementsByTagName('DIV')[1].getElementsByTagName('A'), j = y.length; x < j; x++){
if(y[x].href.match(/act=Post&CODE=06/i)){
var URL = y[x].href,
id = 0;
}}
a[i].innerHTML = "<a onclick='if(id==0){this.innerHTML=noquote;id=1;}else{this.innerHTML=quote;id=0;}multiQuote.fn(\"" + URL + "\", id);' style='cursor: pointer;'>" + quote + "</a>&nbsp;" + a[i].innerHTML;
}}
for(var i = 0, a = document.getElementsByTagName('A'), b = a.length; i < b; i++){
if(a[i].href.match(/act=Post&CODE=02/i) && a[i].parentNode.tagName == "TD" && a[i].parentNode.width == "80%"){
a[i].onclick = function(){
if(multiQuote.quotedPost != ''){
brownie.set('multiquote', multiQuote.quotedPost, 1);
}}}}},
check : function(){
var posts = brownie.get('multiquote');
if(posts != ""){
document.REPLIER.Post.value = posts;
brownie.del('multiquote');
}}}
