
var beloldal = false;
var akt_tab = {};

$(document).ready(function ()
{
	$("#tabs_left img").css({display:'block',position:'relative',width:'26px'});
	$("#tabs_right img").css({display:'block',position:'relative',left:'10px',width:'26px'});
	$("#tabs_left img").hover(
		function(){ $(this).animate({"width": "36px","left": "-10px"}, "fast"); },
		function(){ reset_tabs() }
	);
	$("#tabs_right img").hover(
		function(){ $(this).animate({"width": "36px"}, "fast"); },
		function(){ reset_tabs()}
	); 
	if( !beloldal )
	{
		$("a[tab]").each(function ()
		{
			 $(this).click(function ()
			 {
				 var tab = $(this).attr('tab');
				 var target = $(this).attr('tab_target');
				 akt_tab[target] = tab;
				 reset_tabs()
				 // $('#main_content_'+target).html('');
				 $('#main_content_'+target).load('content_'+tab+'.html', '', '');
				 return false;
			 })
		});
	}
	resize()
	window.onresize = resize;
	if( pngfix ) pngfix()
});

var reset_tabs = function ()
{
	$("#tabs_right img, #tabs_left img").each(function ()
	{
		var tab = $(this).parent().attr('tab');
		var target = $(this).parent().attr('tab_target');
		if( akt_tab[target] != tab )
		switch( target )
		{
			case 'left' : $(this).animate({"width": "26px","left": "0px"}, "fast"); break;
			case 'right' : $(this).animate({"width": "26px"}, "fast"); break;
		}
	})
}

function resize()
{
	var head_p = $('#head').position();
	var head_w = $('#head').width();
	var note_w = $('#note').width();
	$('#note').css({
			left: head_p.left+head_w-note_w+10+'px',
			top: head_p.top-10+'px'
	});
}