    $j(document).ready(function () {
      //$(".top-logo").supersleight({shim: "/imagesg/x.gif"});
    	$j("input[type='checkbox'],input[type='radio']").prettyCheckboxes({checkboxWidth: 15, checkboxHeight: 15});
		$j("select").selectbox();
		$j("input[type='text'], input[type='password'], input[type='submit'], input[type='reset'], input[type='button'], textarea").inputbackground();
		if (!$j.browser.msie) {
			$j(".jquery-selectbox-currentItem").corner("left 3px");
			$j(".jquery-selectbox-moreButton").corner("right 3px");
		}
		$j(".input-wrapper > input[type='submit'], .input-wrapper > input[type='reset'], .input-wrapper > input[type='button']").hover(
				function () {
					$j(this).parent().removeClass("inputButton").addClass("inputButton-hover").parent().addClass("input-border-hover");
				},
				function () {
					$j(this).parent().removeClass("inputButton-hover").addClass("inputButton").parent().removeClass("input-border-hover");
				}
		).parent().addClass("inputButton").parent().addClass("input-wrapper-button-border");
		
		$j(".top-logo, .png-fix, .main-content-box-side-tabs").supersleight({shim: "/images/x.gif"});
		$j(".jquery-selectbox-list, .jquery-selectbox-list-replaced").bgiframe();
		
		$j(".main-content-box-side-tabs-wrap").wrap('<div class="tabs-wrapper-border"></div>').corner("3px").parent().corner("3px");
		$j(".main-content-box-side-tabs").corner("3px");
		
		$j(".main-content-box-side-tabs a").hover(function () {
			$j(this).addClass("tabCenter");
		}, 
		function () {
			$j(this).removeClass("tabCenter");
		});
		
		$j(".main-content-box-side-tabs a:first").removeClass("tabCenter").hover(function () {
			$j(this).addClass("tabFirst");
		}, 
		function () {
			$j(this).removeClass("tabFirst");
		});
		
		$j(".main-content-box-side-tabs a:last").removeClass("tabCenter").hover(function () {
			$j(this).addClass("tabLast");
		}, 
		function () {
			$j(this).removeClass("tabLast");
		});	
		
		$j(".tag-link").corner("3px");
    });
    
    jQuery.fn.inputbackground = function () {
    	jQuery(this).each( function() {
    		jQuery(this).wrap('<div class="input-wrapper"></div>')
    					.parent().width(jQuery(this).outerWidth()).corner("3px")
    					.wrap('<div class="input-wrapper-border"></div>')
    					.parent().width(jQuery(this).outerWidth()).corner("3px");
    	});
    }
    
	function highlight(field) {
	    field.focus();
	    field.select();
	}
	
	function templateLoaded() {
		$j("#template_items textarea").inputbackground();
	}
	function templateLoadedAtToolbox() {
		$j(".form-to-style-with-js textarea").inputbackground();
    	$j(".form-to-style-with-js input[type='checkbox'], .form-to-style-with-js input[type='radio']").prettyCheckboxes({checkboxWidth: 15, checkboxHeight: 15});
		$j(".form-to-style-with-js select").selectbox();
		$j(".form-to-style-with-js input[type='text'],  .form-to-style-with-js input[type='password'], .form-to-style-with-js input[type='submit'], .form-to-style-with-js input[type='reset'], .form-to-style-with-js input[type='button']").inputbackground();
		
		if (!$j.browser.msie) {
			$j(".form-to-style-with-js .jquery-selectbox-currentItem").corner("left 3px");
			$j(".form-to-style-with-js .jquery-selectbox-moreButton").corner("right 3px");
		}

		$j(".form-to-style-with-js .input-wrapper input[type='button'], .form-to-style-with-js .input-wrapper input[type='submit'],.form-to-style-with-js .input-wrapper input[type='reset']").hover(
				function () {
					$j(this).parent().removeClass("inputButton").addClass("inputButton-hover").parent().addClass("input-border-hover");
				},
				function () {
					$j(this).parent().removeClass("inputButton-hover").addClass("inputButton").parent().removeClass("input-border-hover");
				}
		).parent().addClass("inputButton").parent().addClass("input-wrapper-button-border");

	}	
	
	function templateLoadedAtCommentsForm() {
		$j("#add_comment_form textarea").inputbackground();
		$j("#add_comment_form input[type='text'], #add_comment_form input[type='password'], #add_comment_form input[type='submit'], #add_comment_form input[type='reset'], #add_comment_form input[type='button']").inputbackground();
		if (!$j.browser.msie) {
			$j("#add_comment_form  .jquery-selectbox-currentItem").corner("left 3px");
			$j("#add_comment_form  .jquery-selectbox-moreButton").corner("right 3px");
		}

		$j("#add_comment_form  .input-wrapper input[type='button'], #add_comment_form  .input-wrapper input[type='submit'],#add_comment_form  .input-wrapper input[type='reset']").hover(
				function () {
					$j(this).parent().removeClass("inputButton").addClass("inputButton-hover").parent().addClass("input-border-hover");
				},
				function () {
					$j(this).parent().removeClass("inputButton-hover").addClass("inputButton").parent().removeClass("input-border-hover");
				}
		).parent().addClass("inputButton").parent().addClass("input-wrapper-button-border");		
	}	
	