$(function(){
    
   	$(".t1sdoc a").each(function(){
		var hr=$(this).attr("href").toString().toLowerCase();
		if(hr.indexOf(".jpg")>0 || hr.indexOf(".gif")>0 || hr.indexOf(".png")>0){
			$(this).addClass("colorbox");
		}
	});

    $(".colorbox").live("click", function(){
        $(this).colorbox({
            maxHeight:"98%",
            open:true
        });
        return false;
    });

    
    $(".t1sdoc img").each(function(){
        if($(this).attr("id")!="seci"){
            $(this).css("padding","5px"); 
            $(this).css("border","1px solid #d3d3d3");
        } 
    });

    $(".online button").click(function(){

        $(".kell").css("border","1px solid silver");
        var ok = true;
        $(".online .kell").each(function(){
            if($(this).val()=='')
                {
                $(this).css("border","1px dashed red");
                ok=false;
            }
        }
        );
        return ok;
    });

    $(".f2 a").each(function(){
        $(this).parents("div:first").removeClass("f2mc");     
        var aktualisoldal = document.location.toString();
        var iter = $(this).attr("href");

        if(iter != "/" && aktualisoldal.indexOf(iter)>=0){
            $(this).parents("div:first").addClass("f2mc");  
        }

    });
    $(".kats li ul").hide();
    $(".kats a").click(function(){
        if($(this).next("ul").is("ul"))
            {
            $(this).next("ul").slideToggle();
            return false;
        }
    });

    $(".kats a").each(function(){
        var hr = document.location.toString();
        if(hr.indexOf( $(this).attr("href") )>-1 ){
            $(this).parents("ul").show();
        }
    }); 
});
