	jQuery.extend({
        numberFormat: function ($number, $decimals, $dec_point, $thousands_sep, $roundType){
            if($dec_point == undefined || $dec_point == null){
                $dec_point = '.';
            }
            if($thousands_sep == undefined || $thousands_sep == null){
                $thousands_sep = ' ';
            }
            if($roundType == undefined || $roundType == null){
                $roundType = 'round';
            }
            if($decimals != undefined && $decimals != null){
                if(typeof $number == 'string'){
                    $number = parseFloat($number);
                }
                var $pow = Math.pow(10, $decimals);
                $number *= $pow;

                if($roundType == 'round'){
                    $number = Math.round($number);
                }else if($roundType == 'ceil'){
                    $number = Math.ceil($number);
                }else if($roundType == 'floor'){
                    $number = Math.floor($number);
                }
                $number /= $pow;
            }

            $number += '';
            var $x = $number.split('.');
            $number = $x[0];
            var $dec = $x[1];

            if($thousands_sep != ''){
                var $i = 0;
                var rgx = /(\d+)(\d{3})/;
                while (rgx.test($number)) {
                    $number = $number.replace(rgx, '$1' + $thousands_sep + '$2');
                    if($i++ > 5){
                        break;
                    }
                }
            }
            if($dec != undefined){
                $dec += '';
                for(var $i = 0; $i < $decimals - $dec.length; $i++){
                    $dec += '0';
                }
                $number = $number + $dec_point + $dec;
            }
            return $number;
        }
	});


        Shadowbox.init({
			language:   "cs",
			players:    ["img"]
		});

        $(document).ready(function(){
			$("#treeview").treeview({
		// 		persist: "cookie",
				persist: "location",
				animated: "fast",
				collapsed: true,
				unique: true
			});


            $('#tabs').tabs();


   $("ul.sf-menu").supersubs({
				minWidth:    10,   // minimum width of sub-menus in em units
				maxWidth:    15,   // maximum width of sub-menus in em units
				extraWidth:  1     // extra width can ensure lines don't sometimes turn over
								// due to slight rounding differences and font-family
			}).superfish({
// 				hoverClass:    'sfHover',          // the class applied to hovered list items
// 				pathClass:     'overideThisToUse', // the class you have applied to list items that lead to the current page
// 				pathLevels:    1,                  // the number of levels of submenus that remain open or are restored using pathClass
//				delay:         100,
				animation:     {opacity:'show', height:'show', width:'show'},   // an object equivalent to first parameter of jQuery’s .animate() method
				speed:         'fast',           // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method
//				autoArrows:    true,               // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance
			    dropShadows:   true,               // completely disable drop shadows by setting this to false
// 				disableHI:     false,              // set to true to disable hoverIntent detection
// 				onInit:        function(){},       // callback function fires once Superfish is initialised – 'this' is the containing ul
// 				onBeforeShow:  function(){},       // callback function fires just before reveal animation begins – 'this' is the ul about to open
// 				onShow:        function(){},       // callback function fires once reveal animation completed – 'this' is the opened ul
// 				onHide:        function(){}        // callback function fires after a sub-menu has closed – 'this' is the ul that just closed
				delay:         500
			});  // call supersubs first, then superfish, so that subs are
							// not display:none when measuring. Call before initialising
							// containing tabs for same reason.


		});

