$(document).ready(function() {
	$('#menu li').each( function(){
		if( $('ul',this).length>0 ) $(this).addClass('multi').children('a').removeAttr('href');
		$(this).children('a').css('padding-right','0px').wrapInner( '<span class="kleft" />' );
	} ).eq(0).addClass('f')
	$('#menu li').not('#menu ul li').hover( function(){
		$(this).children('a').addClass('hover');
		$(this).children('ul').slideDown(200);
	}, function(){
		if( $(this).children('ul').length==0 ) $(this).children('a').removeClass('hover');
		$(this).children('ul').stop(true,true).slideUp(200,function(){
			$(this).closest('li').children('a').removeClass('hover');
		});
	} );
	img = new Array( 'kaps1l.gif', 'kaps1r.gif', 'kaps2pl.gif', 'kaps2pr.gif' );
	imgTmp = new Array();
	for( i in img ) {
		imgTmp[i] = new Image();
		imgTmp[i].src = 'wp-content/themes/zbench/imag/'+img[i];
	}
	if( $('#all').height()<$(window).height() ) $('#cont').height( $(window).height()-$('#top').outerHeight()-$('#menu').outerHeight()-$('#cont').outerHeight()+$('#cont').height() );
	$('#cont a').each( function(){
		ext = $(this).attr('href').split('.').pop().toLowerCase();
		exts = new Array( 'jpg', 'png', 'gif', 'jpeg' );
		for( i in exts ) {
			if( exts[i] == ext ) $(this).addClass('loghtboxx');
		}
	} );
	$('a.loghtboxx').lightBox();
});
