/**
 * @author alexander.farkas
 */
(function($){

	
	$.styleable = (function(style){
		var makerPre, testDiv;
			
		if($.browser.msie){
			makerPre = '-ms-';
		} else if($.browser.mozilla){
			makerPre = '-moz-';
		} else if($.browser.safari || $.browser.webkit){
			makerPre = '-webkit-';
		} else if($.browser.opera){
			makerPre = '-o-';
		}
		
		function check(prop){
			if(!testDiv){
				testDiv = $('<div style="visibility: hidden; position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;" />').appendTo('body');
			}
			
			//insertCSSRule(prop, val);
			//insertCSSRule(makerPre+prop, val);
			
			var curStyle = false;
			
			function camelize(s){
				return s.replace(/\-(\w)/g, function (m, p1){
					return p1.toUpperCase();
				});
			}
			
			var testProp = camelize(prop);
	
			
			
			curStyle = $.curCSS(testDiv[0], testProp);
			if(!curStyle){
				curStyle = $.curCSS(testDiv[0], camelize(makerPre+testProp));
			}
			return curStyle;
		}
		
		return {
			check: check
		};
	})();
	
	$(function(){
		$.support.borderRadius = !!($.styleable.check('border-top-left-radius') || $.styleable.check('border-radius-topleft'));
	});
})(jQuery);
