/**
 * @author michal
 */
$(document).ready(function(){
	
	//jQuery.preLoadImages("/images/mainmenuH_back.jpg");
	

	//innerfade
	if ($('ul#fadingitems').find('li').length > 1) {
		$('ul#fadingitems').innerfade({
			speed: 2000,
			timeout: 5000,
			//type: 'random',
			containerheight: '86px'
		});
	}
	if ($('ul#fadingitems2').find('li').length > 1) {
		$('ul#fadingitems2').innerfade({
			speed: 2000,
			timeout: 5000,
			//type: 'random',
			containerheight: '86px'
		});
	}
	if ($('ul#fadingitems_home').find('li').length > 1) {
		$('ul#fadingitems_home').innerfade({
			speed: 2000,
			timeout: 8000,
			//type: 'random',
			containerheight: '213px'
		});
	}
	$('.thin').columnize({width:190});
	
});//end document ready

$(window).load(function(){
	if ($.browser.webkit && document.readyState != 'complete'){
    	setTimeout( arguments.callee, 100 );
    	return;
	} 
	if($('.fadingitems').find('li').length > 1) {
		$('.fadingitems').find('img').each(function(){
			
			var nm = 183 - this.width;
			if(nm > 0){
				$(this).css('margin','0px 0px 0px ' + (Math.floor(nm / 2))+ 'px');
			}
			
			
		});
	}
	var nm = Math.floor((773-$('#footerimages').width())/2);
	$('#footerimages').css('left',nm + 'px');
	
	//reflection
	//$('#footerimages img').reflect({opacity:1,height:1});
	//$('.fadingitems li img').reflect({opacity:1,height:1});
		
	
});//end window load

//preload images
// (function($){var cache=[];$.preLoadImages=function(){var args_len=arguments.length;for(var i=args_len;i--;){var cacheImage=document.createElement('img');cacheImage.src=arguments[i];cache.push(cacheImage);}}})(jQuery)
//end preload images

