


var imgSrcLoad_1 = new Image();
imgSrcLoad_1.src = 'grafika/elementy_strony/button_1_1.jpg';

var imgSrcLoad_2 = new Image();
imgSrcLoad_2.src = 'grafika/elementy_strony/button_2_1.jpg';

var imgSrcLoad_3 = new Image();
imgSrcLoad_3.src = 'grafika/elementy_strony/button_3_1.jpg';

var imgSrcLoad_4 = new Image();
imgSrcLoad_4.src = 'grafika/elementy_strony/button_4_1.jpg';

var imgSrcLoad_5 = new Image();
imgSrcLoad_5.src = 'grafika/elementy_strony/button_5_1.jpg';

var imgSrcLoad_6 = new Image();
imgSrcLoad_6.src = 'grafika/elementy_strony/button_6_1.jpg';





function menuZapal(id_) {
	$(id_).src = 'grafika/menu/' + id_ + '_1.jpg';
}

function menuZgas(id_) {
	$(id_).src = 'grafika/menu/' + id_ + '_0.jpg';
}





function pokaz_schowaj_kat(id_) {
	
	if ($('kat_div_' + id_).style.display == 'block') {
		$('kat_div_' + id_).style.display = 'none'
		$('kat_dot_img_' + id_).src = 'grafika/elementy_strony/dot_0.gif';
	}
	else {
		$('kat_div_' + id_).style.display = 'block'
		$('kat_dot_img_' + id_).src = 'grafika/elementy_strony/dot_1.gif';
	}
}





var flag_wyslij_o_nas = 1;

function wyslij_o_nas() {
	
	if (flag_wyslij_o_nas == 1) {
		flag_wyslij_o_nas = 0;
		
		$('a_button').innerHTML = '<span class="Ttekst">...</span>';
		
		$('a1').disabled = 'true';
		$('a2').disabled = 'true';
		$('a3').disabled = 'true';
		$('a4').disabled = 'true';
		$('a5').disabled = 'true';
		
		
		URL_parameters = 'a1=' + encodeURIComponent($('a1').value) + '&a2=' + encodeURIComponent($('a2').value) + '&a3=' + encodeURIComponent($('a3').value) + '&a4=' + encodeURIComponent($('a4').value) + '&a5=' + encodeURIComponent($('a5').value);
		
		
		
		var strURL = "_ajax.kontakt.zapytanie.php";
		new Ajax.Request(strURL, {
			method: 'post',
			parameters: URL_parameters,
			onSuccess: function(transport) {
				var odpowiedz = transport.responseText;
				
				var odpowiedz2 = odpowiedz.charAt(0);
				odpowiedz = odpowiedz2;
				
				if (odpowiedz == 1) {
					action_zapytanie_1_1 = new Animator({
						onComplete: function () {
							$('zapytanie_01').style.display = 'none';
							$('zapytanie_02').style.display = 'block';
							action_zapytanie_2_1.play();
						}
					}).addSubject(new NumericalStyleSubject($('zapytanie_01'),'opacity',1,0))
					
					action_zapytanie_2_1 = new Animator({
					}).addSubject(new NumericalStyleSubject($('zapytanie_02'),'opacity',0,1))
					
					action_zapytanie_1_1.play();
				}
				else {
					action_kontakt_1_1 = new Animator({
						onComplete: function () {
							$('zapytanie_01').style.display = 'none';
							$('zapytanie_03').style.display = 'block';
							action_kontakt_2_1.play();
						}
					}).addSubject(new NumericalStyleSubject($('zapytanie_01'),'opacity',1,0))
					
					action_kontakt_2_1 = new Animator({
					}).addSubject(new NumericalStyleSubject($('zapytanie_03'),'opacity',0,1))
					
					action_kontakt_1_1.play();
				}
			},
			onFailure: function(){
				action_kontakt_1_1 = new Animator({
					onComplete: function () {
						$('zapytanie_01').style.display = 'none';
						$('zapytanie_03').style.display = 'block';
						action_kontakt_2_1.play();
					}
				}).addSubject(new NumericalStyleSubject($('zapytanie_01'),'opacity',1,0))
				
				action_kontakt_2_1 = new Animator({
				}).addSubject(new NumericalStyleSubject($('zapytanie_03'),'opacity',0,1))
				
				action_kontakt_1_1.play();
			}
		});
		
		$('a1').disabled = '';
		$('a2').disabled = '';
		$('a3').disabled = '';
		$('a4').disabled = '';
		$('a5').disabled = '';
	}
}

























var flaga_model;

function zmienModel(xxx,id_) {
	
	if (!flaga_model) {
		flaga_model = xxx;
	}
	
	$('zzz_' + flaga_model).style.display = 'none';
	$('zzz_' + id_).style.display = 'block';
	
	flaga_model = id_;
}




var commercialsRight = 0;
var commercialsFlaga = 0;
var commercialsMove = 168;
function suwak_dalej(c_width) {
	if (((846 + commercialsRight) < c_width) && commercialsFlaga == 0) {
		commercialsFlaga = 1;
		
		
		
		commercialsPrzesunNextAnimation = new Animator({
			onComplete: function () {
				commercialsFlaga = 0;
			}
		}).addSubject(new NumericalStyleSubject($('strzalka_2'), 'right',commercialsRight,commercialsRight + commercialsMove))
		
		commercialsPrzesunNextAnimation.play();
		
		commercialsRight = commercialsRight + commercialsMove;
	}
}

function suwak_wroc(c_width) {
	if (commercialsRight > 0 && commercialsFlaga == 0) {
		commercialsFlaga = 1;
		commercialsPrzesunNextAnimation = new Animator({
			onComplete: function () {
				commercialsFlaga = 0;
			}
		}).addSubject(new NumericalStyleSubject($('strzalka_2'), 'right',commercialsRight,commercialsRight - commercialsMove))
		
		commercialsPrzesunNextAnimation.play();
		
		commercialsRight = commercialsRight - commercialsMove;
		
	}	
}




var przesunFlag = 0;
var przesunMove = 105;

function przesunPrawo(p_width) {
	przesunRight = $('przesunRight_hidden').value;
	
	przesunRight = przesunRight*1;
	
	if (((316 + przesunRight) < p_width) && !przesunFlag) {
		przesunFlag = 1;
		commercialsPrzesunNextAnimation = new Animator({
			onComplete: function () {
				przesunFlag = 0;
				$('przesunRight_hidden').value = ((przesunRight/10)*10) + ((przesunMove/10)*10);
			}
		}).addSubject(new NumericalStyleSubject($('pasekDiv'), 'right',przesunRight,przesunRight + przesunMove))
		
		commercialsPrzesunNextAnimation.play();
	}
}


function przesunLewo(p_width) {
	przesunRight = $('przesunRight_hidden').value;
	
	przesunRight = przesunRight*1;
	
	if ((przesunRight > 0) && !przesunFlag) {
		przesunFlag = 1;
		commercialsPrzesunNextAnimation = new Animator({
			onComplete: function () {
				przesunFlag = 0;
				$('przesunRight_hidden').value = ((przesunRight/10)*10) - ((przesunMove/10)*10);;
			}
		}).addSubject(new NumericalStyleSubject($('pasekDiv'), 'right',przesunRight,przesunRight - przesunMove))
		
		commercialsPrzesunNextAnimation.play();
	}
}


function pokazDymek(id_,tytul) {
	
}


function schowajDymek(id_,tytul) {
	
}


function nastepnaIkona(id_,lang,numer_x) {
	var id_2 = $('numer_' + numer_x).value;
	
	document.location = 'index.php?mod=galeria&pod=jedna&id=' + id_ + '&id2=' + id_2 + '&lang=' + lang + '&numer=' + numer_x + '';
}



















