/*
Quick Quote v1.1
by Verminox
May not be editted except in certain areas without permission
*/

// Variables: Editable

var boardurl = "http://z4.invisionfree.com/North_Castle/index.php"

var clickable = "+"


// The Code: Do not edit

var xmlhttp

function getquote(url)
{
// code for Mozilla, etc.
if (window.XMLHttpRequest)
 {
 xmlhttp=new XMLHttpRequest()
 xmlhttp.onreadystatechange=xmlhttpChange
 xmlhttp.open("GET",url,true)
 xmlhttp.send(null)
 }
// code for IE
else if (window.ActiveXObject)
 {
 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
   if (xmlhttp)
   {
   xmlhttp.onreadystatechange=xmlhttpChange
   xmlhttp.open("GET",url,true)
   xmlhttp.send()
   }
 }
var itm = document.getElementById('qr_open')
if (itm.style.display == "none") { itm.style.display = ""; }
}

function xmlhttpChange()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
 {
 // if "OK"
 if (xmlhttp.status==200)
   {
   var resp = xmlhttp.responseText
   if(resp.match(/<textarea cols='60' rows='12' wrap='soft' name='QPost' class='textinput'>([\s\S\n]+)<\/textarea>.*<input type='hidden' name='QAuthorN' value='(.*)' \/><input type='hidden' name='QDate'/i))
     {
     document.forms['REPLIER'].Post.value += "[QUOTE=" + RegExp.$2 + "]" + RegExp.$1 + "[/QUOTE]\n"
     }
   }
 }
}




var cells = document.getElementsByTagName('TD')
for(d=0;cells.length;d++){
for(a=0;a<cells[d].getElementsByTagName('A').length;a++){
if(cells[d].className=="row4" && cells[d].getElementsByTagName('A')[a].href.match(/act=report&f=(\d+)&t=(\d+)&p=(\d+)/)){
cells[d].getElementsByTagName('DIV')[1].innerHTML += "<a href='Javascript: getquote(\""+boardurl+"?act=Post&CODE=06&f="+RegExp.$1+"&t="+RegExp.$2+"&p="+RegExp.$3+"\")'>" + clickable + "</a>"
}}}