/* = ACCESSIBLE POPUP WINDOWS
----------------------------------------------------------*/

$(document).ready( function() {
    $('A[rel="external"]').click( function() {
        var tools = "resizable,toolbar=no,location=no,scrollbars=yes,menubar=no,width=600,height=580,top=0,left=0";
        var newWindow = window.open( $(this).attr('href'),'newWin',tools );
        newWindow.focus();
        return false;
    });
}); 


/* = TOOLBAR LOGGED IN AS FIX
----------------------------------------------------------*/

/* Used on every page */

$(document).ready(function() {
if($('#loggedIn').length) {
	$("#loginLink").css("border-right","0");
	$("#loggedIn").css("border-right","1px solid #BEC3C9");
}
});


/* = DISABLE TEXT SELECTION
----------------------------------------------------------*/

/* Example usage: $("h3.panelHeading").disableTextSelect(); */

$(function(){
$.extend($.fn.disableTextSelect = function() {
	return this.each(function(){
		if($.browser.mozilla){//Firefox
			$(this).css('MozUserSelect','none');
		}else if($.browser.msie){//IE
			$(this).bind('selectstart',function(){return false;});
		}else{//Opera, etc.
			$(this).mousedown(function(){return false;});
		}
	});
});
$('.noSelect').disableTextSelect();//No text selection on elements with a class of 'noSelect'
});

/* = EXPAND/COLLAPSE
----------------------------------------------------------*/
$(document).ready(function(){
    
        //Expand all comments initially
        $(".commentText").show();
    
        //collapse all messages
        $(".collapse-all").click(function(){
            $(".commentText").slideUp(100);
            $("h4").removeClass("active");
    
            return false;
        });
    
    
        //expand all messages
            $(".expand-all").click(function(){
                $(".commentText").slideDown(100);
                $("h4").addClass("active");
    
                return false;
        });
    
    
    
    });


	
