menu=new Array;

function load( link,div ){
	status=link;
	if (link=='makarony_dom' || link=='karta') link='catalog,pl,5.html';
	$('loader').style.display = 'block';
	new Ajax.Request( link,
	{
		method: 'post',
		evalScripts: true,
		onComplete: function(transport){
			response = transport.responseText;
			$(div).innerHTML = response;
			initLightbox();
			// pozycja ktora ma sie pojawiac na starcie menu
			if (link=='catalog,pl,5.html')
				{
                    switch (status) {
                        case 'makarony_dom':
                            load('catalog,,11.html', 'menuz2');
                            break;
                        case 'karta':
                            load('catalog,,32.html', 'menuz2');
                            break;
                        default:
                            load('catalog,pl,9.html', 'menuz2');
                    }
				}
                
                if (link == 'catalog,en,37.html') 
                    load('catalog,,43.html', 'menuz2');
                if (link == 'catalog,it,39.html') 
                    load('catalog,,65.html', 'menuz2');
                if ((div == 'menu2')) 
                    if ($('koniec').offsetTop - 140 > 610) 
                        $('ramka_menu').style.height = $('koniec').offsetTop - 140 + 'px';
                    else 
                        $('ramka_menu').style.height = '610px';
                if(link.indexOf('contact') >=0)
				{
					FB.init("e342dc57bb0d93f311630d2f5e8b1c06");
				}
                if (link.indexOf('news') >= 0) 
                    $('ramka_menu2').style.height = $('koniec').offsetTop + 'px';
                if (link.indexOf('catalog') >= 0 || link.indexOf('product') >= 0) 
                    $('ramka_menu').style.height = $('koniec').offsetTop + 'px';
                $('loader').style.display = 'none';
			
			
		}
	}
	);
}

function send( link ){
	$('loader').style.display = 'block';
	new Ajax.Request( link,
	{
		method: 'post',
		parameters: { blnSave:$F('blnSave'), strName:$F('strName'), strCompany:$F('strCompany'),strEmail:$F('strEmail'), strTelefon:$F('strTelefon'),data:$F('theDate'),strHour:$F('strHour'),strSala:$F('strSala'),strMenu:$F('strMenu'),strContent:$F('strContent'), intPeople:$F('intPeople')} ,
		evalScripts: true,
		onComplete: function(transport){
			response = transport.responseText;
			$('content').innerHTML = response;
			$('loader').style.display = 'none';
		}
	}
	);
}

function send3( link ){
	$('loader').style.display = 'block';
	var arrForm = Object.toJSON($('form').serialize(true));
	
		new Ajax.Request( link,
		{
			method: 'POST',
			parameters: { arrForm: arrForm },
			evalScripts: true,
			onComplete: function(transport){
				$('content').innerHTML = transport.responseText;
				$('loader').style.display = 'none';

			}
		});
	} 



function send2( link ){
	$('loader').style.display = 'block';
	new Ajax.Request( link,
	{
		method: 'post',
		parameters: { blnSave:$F('blnSave'), strName:$F('strName'), strEmail:$F('strEmail'), strTelefon:$F('strTelefon'), strContent:$F('strContent')} ,
		evalScripts: true,
		onComplete: function(transport){
			response = transport.responseText;
			$('content').innerHTML = response;
			$('loader').style.display = 'none';
		}
	}
	);
}

function fix(){
if (screen.width<1024) $('banner').style.width='958px';
var Lightbox = Class.create();
}

function show(element)
{
if (menu[element]!='true' && menu[element]!='false') menu[element]='true';
if (menu[element]=='true') {
menu[element]='false';
document.getElementById(element).style.height='auto';
document.getElementById(element).style.overflow='visibility';
}
else
{
menu[element]='true';
document.getElementById(element).style.height='0px';
document.getElementById(element).style.overflow='hidden';

}
}