Round('.block', '9px');
Round('.block div.inner', '4px');
Round('.block > h1', '5px 5px 0px 0px');
Round('.block > div', '0px 0px 8px 8px');
Round('.jcarousel-skin-theme .jcarousel-item, .skinned-blocks li', '7px 7px 4px 4px');
Round('.jcarousel-skin-theme .jcarousel-item .image, .skinned-blocks li .image', '4px 4px 0px 0px');
Round('.skinned-blocks li .image img', '3px');
Round('#id-search-bar input.query', '15px 0px 0px 15px');
Round('#id-search-bar .image', '0px 15px 15px 0px ');
Round('.button-theme', '4px');
Round('.better-audio-player', '3px');

Round('#base-page', '10px');
Round('a.button', '3px');
Round('#tooltip', '5px');
Round('#base-footer', '0px 0px 10px 10px');
Round('#base-top', '10px 10px 0px 0px');
//Round('.tabs a', '10px 10px 0px 0px');
Round('.page-link, .page-link-disabled, .page-link-active', '4px');

jq(function(){
	jq('#id-search-bar .image').click(function(){
		jq('#id-search-bar form').submit();
	});
	initStyledContent('body');
});

function initStyledContent(obj) {
	// Apply style to upload fields
	jq(obj).find('input[type="file"]').each(function(){
		var self = jq(this);
		var wrapper = jq('<div class="file-field">');
		self.wrap(wrapper);
		label = jq('<span>');
		self.mouseout(function(){
			jq(this).prev().html(this.value);
		});
		self.before('<a class="button-theme">Browse...</a>');
		self.before(label);
	});
}



(function($) {
    
    $.fn.filestyle = function(options) {
                
        /* TODO: This should not override CSS. */
        var settings = {
            width : 250,
			height : 25,
			imagewidth : 100,
        };
                
        if(options) {
            $.extend(settings, options);
        };
                        
        return this.each(function() {
            
            var self = this;
            var wrapper = $('<div class="button-theme">Choose...</div>')
                            .css({
                                "display": "inline",
                                "position": "absolute",
                                "overflow": "hidden"
                            });
                            
            var filename = $('<input class="file">')
                             .addClass($(self).attr("class"))
                             .css({
                                 "display": "inline",
                                 "width": settings.width + "px"
                             });

            $(self).before(filename);
            $(self).wrap(wrapper);

            $(self).css({
                        "position": "relative",
                        "height": settings.height + "px",
                        "width": settings.width + "px",
                        "display": "inline",
                        "cursor": "pointer",
                        "opacity": "0.0"
                    });

            if ($.browser.mozilla) {
                if (/Win/.test(navigator.platform)) {
                    $(self).css("margin-left", "-142px");                    
                } else {
                    $(self).css("margin-left", "-168px");                    
                };
            } else {
                $(self).css("margin-left", settings.imagewidth - settings.width + "px");                
            };

            $(self).bind("change", function() {
                filename.val($(self).val());
            });
      
        });
        

    };
    
})(jQuery);
