$(function(){	

//	footer positioning	
//	bottomPosition();
//	$(window).bind('resize', function(){	bottomPosition();	});

//	loading webfonts
/*  WebFontConfig = {
        google: { families: [ 'Helvetica' ] }
      };
(function() {
        var wf = document.createElement('script');
        wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
            '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
        wf.type = 'text/javascript';
        wf.async = 'true';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(wf, s);
      })();
*/
/*
<a class="galeria" rel="g1" href="img_big_1.jpg"><img src="img_small_1.jpg" alt=""/></a>
<a class="galeria" rel="g1" href="img_big_2.jpg"><img src="img_small_2.jpg" alt=""/></a> 	

<a class="galeria" rel="g2" href="img_big_3.jpg"><img src="img_small_3.jpg" alt=""/></a> 
<a class="galeria" rel="g2" href="img_big_4.jpg"><img src="img_small_4.jpg" alt=""/></a> 
*/



	$("IMG.galeria").each(function(){
		var src = $(this).attr("src");
		var title = $(this).attr("title");
		var clas = $(this).attr("class");
		var width = $(this).attr("width");
		var height = $(this).attr("height");
		
               
		$(this).replaceWith('<a class="fancy_group" rel="' + title + '" href="' + src + '">' 
								+ '<img src="' + src + '" alt="" class="' + clas + '"' 
								+ ' width="' + width + '" ' 
								+ ' height="' + height + '" ' 
								+ ' /></a>');	
//		$(this).after('</a>');
//		$(this).before('<a class="fancy_group" rel="' + $(this).attr("title") + '" href="' + $(this).attr("src") + '">');
	});
	$("A.fancy_group").fancybox();
	
//	before('<a class="fancy_group" rel="' + $(this).attr("title") + '" href="' + $(this).attr("src") + '">');
	
	//$("IMG.galeria").after('</a>');
	
	//setTimeout('$("A.fancy_group").fancybox()',200);


//	head-floating menu
	$(".hmenu A").mouseover(function(){
		$(".submenu").css('display','none');
		$("#div_" + $(this).attr('href') ).css('display','block');//.animate({width: 'toggle'})
	});
	$(".head, .wrapper, .leftcol, .rightcol").mouseover(function(){
		$(".submenu").css('display','none');
	});

//	kozepso tab-os blokkokhoz:
	function rbojs(self){
		$('.rbo').attr('class', 'rbo');
		$('.rbd').css('display', 'none');
		_this = self ? $(self) : $('.rbo:first');
		_this.attr('class', 'rbo active');
		id = (_this.attr('id')).replace(/([a-z]+)/i, '');
		$('#rbo'+id+'o').css('display', 'block');
		return false;
	}
	if(document.getElementById('rbtexty')){
		$('.rbo').each(function(){
			$(this).click(function(){
				return rbojs(this);
			});
		});
		rbojs(null);
	} 
//	Alternate row colorize	
	$(".kapcsolat TABLE TR:even TD").css('background','#f5f5f5');

	
});

function bottomPositionTimeout()
{
	//return;
	//alert('w.h: ' + $(window).height() + 'px \nc.h: ' + $('.container').height() + 'px');
	if( $(window).height() > $('.container').height() )
	{
		$('DIV.foot').css('bottom','0').css('position','absolute');
		$('DIV.wrapper').css('height', ($(window).height()-230) + 'px' );
	}
	else
	{
		$('DIV.foot').css('bottom','inherit').css('position','relative');
		$('DIV.wrapper').css('height', 'auto' );
	}
}
function bottomPosition()
{
	setTimeout('bottomPositionTimeout();',100);
}



