function paste_string(e, s){
e.value+=s;
e.focus();
}
function see_all(ctr,url){
	var ctr = ctr;
	var url = url;
	function thumbs_xmlrequest(url){
		xmlhttp=null;
		if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); }
		else if (window.ActiveXObject){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
		if (xmlhttp!=null){  xmlhttp.onreadystatechange=thumbs_tbstate_Change;  xmlhttp.open("GET",url,true);  xmlhttp.send(null);  }
		else  {  alert("Your browser does not support XMLHTTP.");  }
	}
	function thumbs_tbstate_Change(){
		if (xmlhttp.readyState==4){ 
			if (xmlhttp.status==200 && (xmlhttp.responseText!='zero' && xmlhttp.responseText!='one' && xmlhttp.responseText!='two')) { document.getElementById('thumbs_request_'+ctr).innerHTML=xmlhttp.responseText; }
			else if (xmlhttp.responseText=='zero'){ alert("You must wait two minutes before you vote again!"); } else if (xmlhttp.responseText=='one'){ alert("You must spread some reputation around before voting on the same author again!"); } else if (xmlhttp.responseText=='two'){ alert("You must vote on a different post before voting on this post again!"); } else { alert("Problem retrieving data:" + xmlhttp.statusText); }
		}
	}
	thumbs_xmlrequest(url);
}
function paste_string2(e, s){
e.value+=s;
}
function youtube_video(e,p1){
paste_string(e, '[youtube]'+prompt(p1,'')+'[/youtube]');
}
function paste_url(e,p1,p2){
paste_string(e, '[url='+prompt(p1,'')+']'+prompt(p2,'')+'[/url]');
}
function paste_email(e,p1,p2){
paste_string(e, '[email='+prompt(p1,'')+']'+prompt(p2,'')+'[/email]');
}
function paste_image(e,p1){
paste_string(e, '[img]'+prompt(p1,'')+'[/img]');
}
function spopup(doc, xwidth, yheight, scrollbar)
{
var _left = eval(screen.width/2 - xwidth/2);
var _top = eval(screen.height/2 - yheight/2);
popupWin = window.open('smilies_popup.php?doc=window.opener.'+doc,"imageWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+scrollbar+",resizable=0,width="+ xwidth +",height="+ yheight +",left="+ _left +",top="+ _top +"");
}
function get_sel()
{
  if (window.getSelection) return window.getSelection(); else if
     (document.getSelection) return document.getSelection(); else if
     (document.selection) return document.selection.createRange().text; else return;
}
function quote_sel(e)
{
  sel = get_sel();
  paste_string(e, '[quote]'+sel+'[/quote]');
}
function centered_popup(page, w, h) {
   var x = (screen.width - w) / 2;
   var y = (screen.height - h) / 2;
   var win;
   var winprops = 'status=no,location=no,resizable=yes,scrollbars=yes,width='+w+',height='+h+',top='+y+',left='+x;
   win = window.open(page,'pointless',winprops);
   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}