/**
 *  corner() takes a single string argument:  $('#myDiv').corner("effect corners width")
 *
 *  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 
 *  corners: one or more of: top, bottom, tr, tl, br, or bl.  (default is all corners)
 *  width:   width of the effect; in the case of rounded corners this is the radius. 
 *           specify this value using the px suffix such as 10px (yes, it must be pixels).
 */
 
var $j = jQuery.noConflict();
 
$j(document).ready(function(){
	/* SIDEBAR WIDGETS */
	$j("#primary li.widget div.widget-inner").corner("round 8px").parent().css('padding', '2px').corner("round 10px");
	$j("li#events-list-widget-3 div.widget-inner").corner("round 8px").parent().css('padding', '2px').corner("round 10px");
	
	/* menu dropdowns */
	$j("div#menu ul li ul").corner("bottom");
	
	/* submit buttons */
	$j(".submitButton").corner();
	
	$j("div.button").children().corner("round 8px").parent().css('padding', '4px').corner("round 10px");
	
	$j("a.wp-caption").wrap("<div class='linkBorder' />");
		$j("a.wp-caption").corner("round 8px").parent().css("padding", "4px").corner("round 10px");
	
	$j("li.formProceed label").corner();
	
	/* Services Boxes */
	
	$j(".servicesBox").corner("round 8px").parent().css('padding', '4px').corner("round 10px");

	$j(".entry-content img").each(function() {
		var roundedHeight = $j(this).attr("height");
		var roundedWidth = $j(this).attr("width");
		var roundedImageClass = $j(this).attr("class");
		$j(this).wrap("<div class='image-rounder " + roundedImageClass + "' />");
		$j(this).parent().css("height", roundedHeight).css("width", roundedWidth).append("<b class='topLeft'></b><b class='topRight'></b><b class='botLeft'></b><b class='botRight'></b>");
	});
	
	/* Quiz */
	$j("td td:contains('INCORRECT')").addClass("incorrect");
	
	/* BP Sidebar */
	$j(".sidebar-bp").addClass("hide");
	
	$j(function() {
		var bpSidebar = $j('<div>').append($j("div.sidebar-bp").clone().removeClass("hide").addClass("sidebar-generated")).remove().html();
		
		$j("div#container").append(bpSidebar);
	});

});
