$(document).ready(function() {
						   
// EDIT BELOW THIS LINE

$('#nc').corner("round 5px bottom");
$('#cc').corner("round 5px");
$('#welcome').corner("round 5px").parent().css('padding', '1px').corner("round 5px")
$('div#ad-section-c').corner("round 5px bottom").parent().css('padding', '0px 1px 1px').corner("round 5px bottom");
$('.section-inside').corner("round 5px").parent().css('padding', '1px').corner("round 5px");
$('.spat-c').corner("round 5px tr br bl").parent().css('padding', '1px').corner("round 5px tr br bl");
$('div.evidence-hdr').corner("round 5px top");
$('div.supporting-evidence-c').find('div.evidence-links').corner("5px bottom");
$('div.opposing-evidence-c').find('div.evidence-links').corner("5px bottom");
$('#fc').corner("round 5px").parent().css('padding', '1px').corner("round 5px");
$('.dialog-content').corner("round 12px").parent().css('padding', '3px').corner("round 12px");
$('.outlined').corner("round 5px").parent().css('padding', '1px').corner("round 5px");
$('.outlined_bright').corner("round 5px").parent().css('padding', '1px').corner("round 5px");
$('.outlinez > div').corner("round 5px").parent().css('padding', '1px').corner("round 5px");
$('.tab-outline > div').corner("round 5px tr br bl").parent().css('padding', '1px').corner("round 5px tr br bl");
$('.rht').corner("round 5px top");
$('.rhb').corner("round 5px bottom");
$('.ri').corner("round 5px").parent().css('padding','1px').corner("round 5px");

$('.feeds-c').corner("round 5px").parent().css('padding','1px').corner("round 5px");

_logoLocation="index.jsp";
$('h1.logo').click(
	function() {
		if (logoLocation!=null) {
			document.location=logoLocation;
		} else {
			document.location="index.jsp";
		}
   }			   
);

$(".nav")
    .superfish({
        animation : { opacity:"show"},
        speed      : "fast"
    })
    .find(">li:has(ul)")
        .mouseover(function(){
            $("ul", this).bgIframe({opacity:false});
        })
        .find("a")
            .focus(function(){
                $("ul", $(".nav>li:has(ul)")).bgIframe({opacity:false});
            });

//
// 2D BUTTON BEHAVIORS
//
$('.btn-2d-off').hover(
	function() {$(this).removeClass("btn-2d-off");$(this).addClass("btn-2d-on");},
	function() {$(this).removeClass("btn-2d-on");$(this).addClass("btn-2d-off");}
);

// Triggers
$('#loginTrigger').click(function() {
	$.extend($.blockUI.defaults.displayBoxCSS, { width:'400px' });
	$('#dialog').displayBox();
	$('#login-c').show();
	return false; 
}); 

$('.errorTrigger').click(function() {
	$.extend($.blockUI.defaults.displayBoxCSS, { width:'400px' });
	$('#dialog').displayBox();
	$('#error-c').show();
	return false; 
});  

$('.closeme').click(function() {
	$('body .displayBox').hide();
	$('.modal').hide();
});

$('#searchbox').focus(function() {
	if ( $(this).val() == "Search Spats" ) {
		$(this).val("");
	}
}).blur(function() { 
	if ( $(this).val() == "" ) {
		$(this).val("Search Spats");
	}
});
var staticText, setText;
$('input[@id$=searchboxTool]').focus(function() {
	var elID = $(this).attr("id");
	if (elID.indexOf("blog") != -1) {
		setText = "Blog";
	} else {
		setText = "Spats";
	}
	staticText = "Search " + setText;
	if ( $(this).val() == staticText ) {
		$(this).val("");
	}
}).blur(function() { 
	if ( $(this).val() == "" ) {
		$(this).val(staticText);
	}
});

// DO NOT EDIT
});
// OKAY TO EDIT BELOW
// EVERYTHING BELOW IS PRE-DOM-READY

// SHOW ERROR MODAL
function errorModal() {
	$('#dialog').displayBox();
	$('#error-c').show();
	return false;
}
