function show_content( span )
{
displayType = ( document.getElementById( span ).style.display == 'none' ) ? 'inline' : 'none';
document.getElementById( span ).style.display = displayType;
}

function check_all(abox) {
	var table = document.getElementById('my_table');
	var cboxes = table.getElementsByTagName('input');
	var l = cboxes.length;

	for (var i = 0; i < l; i++) {
	var n = cboxes[i];
	n.checked = abox.checked;
	}
	}

function QuotePost(tid)
{
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	    {
		  CKEDITOR.instances['editor1'].setData(xmlhttp.responseText);
		  window.location.hash="reply";
	    }
	  }
	xmlhttp.open("GET","ajax/quotepost.php?tid="+tid,true);
	xmlhttp.send();
}

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
       window.onload = func
    } else {
       window.onload = function() {
           if (oldonload) {
                  oldonload()
          }
          func()
       }
   }
}
/*var enteringdata = 0;
var dummytext;
function CheckReplyBox(){
	//alert(enteringdata);
	 if (enteringdata == 1){
	 dummytext = CKEDITOR.instances['editor1'].getData();	
	 dummytext = dummytext.replace(":)", "lolcats");
	 CKEDITOR.instances['editor1'].setData();
	 }
	
	 CKEDITOR.instances['editor1'].on( 'focus', function( e )
		    {		 
		     enteringdata = 1;		    
		    });

	setTimeout("CheckReplyBox()",5000);
}*/



