 function buddy_pop() { window.open('index.php?act=buddy&s=','BrowserBuddy','width=250,height=500,resizable=yes,scrollbars=yes'); }
function chat_pop(cw,ch)  { window.open('index.php?s=&act=chat&pop=1','Chat','width='+cw+',height='+ch+',resizable=yes,scrollbars=yes'); }
function multi_page_jump( url_bit, total_posts, per_page )
{
pages = 1; cur_st = parseInt(""); cur_page  = 1;
if ( total_posts % per_page == 0 ) { pages = total_posts / per_page; }
 else { pages = Math.ceil( total_posts / per_page ); }
msg = "Please enter a page number to jump to between 1 and" + " " + pages;
if ( cur_st > 0 ) { cur_page = cur_st / per_page; cur_page = cur_page -1; }
show_page = 1;
if ( cur_page < pages )  { show_page = cur_page + 1; }
if ( cur_page >= pages ) { show_page = cur_page - 1; }
 else { show_page = cur_page + 1; }
userPage = prompt( msg, show_page );
if ( userPage > 0  ) {
	if ( userPage < 1 )     {    userPage = 1;  }
	if ( userPage > pages ) { userPage = pages; }
	if ( userPage == 1 )    {     start = 0;    }
	else { start = (userPage - 1) * per_page; }
	window.location = url_bit + "&st=" + start;
}
}

//new 

function copyQ(qinf,pid) 
{
	txt='';
	if (document.getSelection) 
	{
		txt=document.getSelection()
	}
	else if (document.selection) 
	{
		txt=document.selection.createRange().text;
	}
	if (txt.replace(" ","") != "")
	{
		txt='[quote='+qinf+']'+txt+'[/quote]\n\n'
	}
}


function pasteQ()
{
	if(document.REPLIER.Post)document.REPLIER.Post.value += txt
}

var smf_images_url = "style_images";

function bbc_highlight(something, mode)
{
	something.style.backgroundImage = "url(" + smf_images_url + (mode ? "/bbc/bbc_hoverbg.gif)" : "/bbc/bbc_bg.gif)");
}

function surroundText(text1, text2, textarea)
{
	// Can a text range be created?
	if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
	{
		var caretPos = textarea.caretPos, temp_length = caretPos.text.length;

		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text1 + caretPos.text + text2 + ' ' : text1 + caretPos.text + text2;

		if (temp_length == 0)
		{
			caretPos.moveStart("character", -text2.length);
			caretPos.moveEnd("character", -text2.length);
			caretPos.select();
		}
		else
			textarea.focus(caretPos);
	}
	// Mozilla text range wrap.
	else if (typeof(textarea.selectionStart) != "undefined")
	{
		var begin = textarea.value.substr(0, textarea.selectionStart);
		var selection = textarea.value.substr(textarea.selectionStart, textarea.selectionEnd - textarea.selectionStart);
		var end = textarea.value.substr(textarea.selectionEnd);
		var newCursorPos = textarea.selectionStart;
		var scrollPos = textarea.scrollTop;

		textarea.value = begin + text1 + selection + text2 + end;

		if (textarea.setSelectionRange)
		{
			if (selection.length == 0)
				textarea.setSelectionRange(newCursorPos + text1.length, newCursorPos + text1.length);
			else
				textarea.setSelectionRange(newCursorPos, newCursorPos + text1.length + selection.length + text2.length);
			textarea.focus();
		}
		textarea.scrollTop = scrollPos;
	}
	// Just put them on the end, then.
	else
	{
		textarea.value += text1 + text2;
		textarea.focus(textarea.value.length - 1);
	}
}






sms="The link you are clicking is not connected with d2evil Community. Do NOT enter any private d2evil info on the site you're going to visit!\n\nIf the following site asks for any private info such as account name or password please report the link to a d2evil Team immediately.";
function ala()
{
	alert(sms)
}
function link(l)
{
	if(confirm(sms+"\n\nDo you still wish to view this web page?"))
		window.open(l,"_blank")
}




