$(document).ready(
	function()
	{
		if ($.browser.version.charAt(0) < 7 && $.browser.msie){$("#mainnav li, #subnav li").hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});}

		
        
        var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;  
        /*
        if(IE6 == false)  
        {  
         $(".galerij").ccgallery();
        }
        */
        
        $('.foto').lightBox();
        

	}
);

$(window).load(function () {
    
    rotatingHeader();
    rotatingHeaderHover();
    $("#header-img").css("background",'none');
});

/*************************************************
Rotating header */
function rotatingHeader()
{
    if($("#header-rotator li.active").length == 0)
    {
        var iIndex = 0;
    }else{
        var iIndex = $("#header-rotator li.active").attr("id").replace("header-rotator","");
        if (iIndex >= 0)
        {
            iIndex++;
            
            if (iIndex >= $(".homeImg").size())
            {
               var iIndex = 0;
            }
        }
    }
      
    changeItem(iIndex);
}

function rotatingHeaderHover()
{
	$("#header-rotator li").click(
		function()
		{
            curID   = $("#header-rotator li.active").attr("id").replace("header-rotator","");
            id      = $(this).attr("id").replace("header-rotator","");
            if(curID != id)
            {
                clearTimeout(rotater);
                changeItem(id);              
            }
		}
	);
}

function changeItem(iIndex)
{          
    $(".header-slogan").fadeOut(500,function(){
        $(".header-slogan").html($("#home"+iIndex).attr("alt"));
    });
    
    $(".homeImg").fadeOut(1000);
    $("#home"+iIndex).fadeIn(1000);


    
    $(".header-slogan").fadeIn(500);
    //$("#home"+iIndex).css('display','block');
    
    $("#header-rotator .active").removeClass("active");
    $("#header-rotator"+iIndex).addClass('active');
    
    
            
    rotater = setTimeout("rotatingHeader()", 5000);	
}

