function ubbc(open, end){ 
var tArea = document.editform.page; 
var isIE = (document.all)? true : false; 
var open = (open)? open : ""; 
var end = (end)? end : ""; 

if(isIE){ 
tArea.focus(); 
var curSelect = document.selection.createRange(); 
if(arguments[2]){ 
curSelect.text = open + arguments[2] + "]" + curSelect.text + end; 
} else { 
curSelect.text = open + curSelect.text + end; 
} 
} else if(!isIE && typeof tArea.selectionStart != "undefined"){ 
var selStart = tArea.value.substr(0, tArea.selectionStart); 
var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length); 
var curSelection = tArea.value.replace(selStart, '').replace(selEnd, ''); 
if(arguments[2]){ 
tArea.value = selStart + open + arguments[2] + "]" + curSelection + end + selEnd; 
} else { 
tArea.value = selStart + open + curSelection + end + selEnd; 
} 
} else { 
tArea.value += (arguments[2])? open + arguments[2] + "]" + end : open + end; 
} 
} 

$(document).ready(function(){
   $('#slideoptions').hide(); // Hide even though it's already hidden
        $(".toggleoptions").click(function(){
            $("#slideoptions").slideToggle();
            return false;
        });
    });



    $(document).ready(function(){
   $('#slidelogin').hide();
        $(".toggleloginform").click(function(){
            $("#slidelogin").slideToggle();
            return false;
        });
    });
	
$(document).ready(function(){
    $("#login-link").click(function(){
        $("#theloginform").slideToggle(200);
    })
})
$(document).keydown(function(e) {
    if (e.keyCode == 27) {
        $("#theloginform").hide(0);
    }
});

 	
$(document).ready(function () {
	$('a.slidecontrol').click(function(){
		var $this = $(this);
		var divID = $this.attr("id").replace("slidecontrol_", "slidedisplay_");
		var $div = $('#'+divID);
		if ($div.is(':visible')) {
			$div.toggle(150);
		} else {
			$div.toggle(150);
		}
		return false;
	});
	
});
