

function odczytaj(nr) {

	$.ajax({

		url: '../inc/html/miniaturka.php',

		cache: false,

		data: 'nr='+nr,

		success: function(html){

			$("#ods_tp").html(html);

			sIFR.replace(topicbold, {selector: '.smb',css: '.sIFR-root { font-size: 25px; color: #666666; background: transparent; leading: -8; }', wmode:'transparent' });

		}

	});

}



function stan1(nr, war) {

	var ida = "#dom" + nr + "a";

	var idr = "#dom" + nr + "r";

	var ids = "#dom" + nr + "s";

	$(ida).css({ 'background-position': war});

	$(idr).css({ 'background-position': war});

	$(ids).css({ 'background-position': war});

}

function stan2(nr) {

	var ida = "#dom" + nr + "a";

	var idr = "#dom" + nr + "r";

	var ids = "#dom" + nr + "s";

	$(ida).css({ 'background-position': ''});

	$(idr).css({ 'background-position': ''});

	$(ids).css({ 'background-position': ''});

}





function klik(nr) {

	$.ajax({

		url: '../inc/html/opis-domu.php',

		cache: false,

		data: 'nr='+nr,

		success: function(html){

			$("#opis").html(html);

			sIFR.replace(topicmed, {selector: '.ng2',css: '.sIFR-root { color: #f3cc0f; background: transparent; leading:-8; }', wmode:'transparent' });

			sIFR.replace(topicmed, {selector: '.pl',css: '.sIFR-root { color: #000000; background: transparent; }', wmode:'transparent' });

			sIFR.replace(topicmed, {selector: '.bos',css: '.sIFR-root { color: #f3cc0f; font-size: 20px; background: transparent; cursor: pointer; }', wmode:'transparent' });

			sIFR.replace(topicmed, {selector: '.ndom',css: '.sIFR-root { color: #666666; font-size: 30px; background: transparent; cursor: pointer; leading:-8; }', wmode:'transparent' });

			sIFR.replace(topicbold, {selector: '.cn',css: '.sIFR-root { color: #ffffff; background: transparent; }', wmode:'transparent' });

			sIFR.replace(topicbold, {selector: '.symbol',css: '.sIFR-root { color: #666666; background: transparent; }', wmode:'transparent' });

		}

	});

}

function lista(id) {

	$.ajax({

		url: '../inc/html/standard-wykonania.php',

		cache: false,

		data: 'id='+id,

		success: function(html){

			$("#b_sw3").html(html);

		}

	});

	wylacz();

	var elem = "#s"+id;

	$(elem).addClass('kolor');

}



function wylacz() {

	for (var i=1; i<=16; i++) {

		var el = "#s"+i;

		$(el).removeClass('kolor');

	}

}



function wizualizacja(nr, id) {

	$.ajax({

		type: 'GET',

		url: '../inc/html/wizualizacja.php',

		cache: false,

		data: 'nr='+nr+'&id='+id,

		success: function(html) {

			$("#wizualizacja").html(html);

		}

	});

}



function flashek() {

	$.ajax({

		type: 'GET',

		url: '../script/osiedle.js',

		cache: false,

		dataType: 'script',

		success: function() {

			show_osiedle();

		}

	});

}



function flashdomek(symbol, miejsce,v) {
	switch(v){
	case 'a':
		kat="../"
	break;
	case 'b':
		kat="";
	break;
	}

	switch (symbol) {

		case 'a':

			$.ajax({

				type: 'GET',

				url: kat+'../script/domek.js',

				cache: false,

				dataType: 'script',

				success: function() {

					show_domeka(miejsce, kat);

				}

			});

		break;

		case 'd':

			$.ajax({

				type: 'GET',

				url: kat+'../script/domek.js',

				cache: false,

				dataType: 'script',

				success: function() {

					show_domekd(miejsce, kat);

				}

			});

		break;

		case 'm':

			$.ajax({

				type: 'GET',

				url: kat+'../script/domek.js',

				cache: false,

				dataType: 'script',

				success: function() {

					show_domekm(miejsce, kat);

				}

			});

		break;

	}

}



function pokaz(nr, id, v) {
	switch(v){
	case 'a':
		url='../../inc/html/pokaz.php';
	break;
	case 'b':
		url='../inc/html/pokaz.php';
	break;
	}
	$.ajax({
		url:url,			
		cache: false,

		data: 'nr='+nr+'&id='+id+'&vaaa='+v,

		success: function(html){

			$("#pokaz").html(html);

		}

	});

}

function domek(id) {

	$.ajax({

		url: '../inc/html/domek.php',

		cache: false,

		data: 'id='+id,

		success: function(html){

			$("#opisdom").html(html);

			sIFR.replace(topicmed, {selector: '.ng2',css: '.sIFR-root { color: #f3cc0f; background: transparent; leading:-8; }', wmode:'transparent' });

			sIFR.replace(topicmed, {selector: '.pl',css: '.sIFR-root { color: #000000; background: transparent; }', wmode:'transparent' });

			sIFR.replace(topicmed, {selector: '.bos',css: '.sIFR-root { color: #f3cc0f; font-size: 20px; background: transparent; cursor: pointer; }', wmode:'transparent' });

			sIFR.replace(topicmed, {selector: '.ndom',css: '.sIFR-root { color: #666666; font-size: 30px; background: transparent; cursor: pointer; leading:-8; }', wmode:'transparent' });
			
			sIFR.replace(topicmed, {selector: '.ndomR',css: '.sIFR-root { color: #cc3333; font-size: 30px; background: transparent; cursor: pointer; leading:-8; }', wmode:'transparent' });

		}

	});

}
function sr(){
		sIFR.replace(topicmed, {selector: '.ndomR',css: '.sIFR-root { color: #cc3333; font-size: 30px; background: transparent; cursor: pointer; leading:-8; }', wmode:'transparent' });
		alert("DZIAĹ�A");

	}


function galeria(id) {

	$.ajax({

		url: '../inc/html/galeria.php',

		cache: false,

		data: 'id='+id,

		success: function(html){

			$("#zdjecie").html(html);

		}

	});

}





$(function() {

	$("#ed1").mouseover(function() { odczytaj('1'); stan1('1', '0 -44px'); }).mouseout(function() { stan2('1'); }).click(function() { klik('1'); });
	$("#ed2").mouseover(function() { odczytaj('2'); stan1('2', '0 -45px'); }).mouseout(function() { stan2('2'); }).click(function() { klik('2'); });
	$("#ed3").mouseover(function() { odczytaj('3'); stan1('3', '0 -44px'); }).mouseout(function() { stan2('3'); }).click(function() { klik('3'); });
	$("#ed4").mouseover(function() { odczytaj('4'); stan1('4', '0 -44px'); }).mouseout(function() { stan2('4'); }).click(function() { klik('4'); });
	$("#ed5").mouseover(function() { odczytaj('5'); stan1('5', '0 -43px'); }).mouseout(function() { stan2('5'); }).click(function() { klik('5'); });
	$("#ed6").mouseover(function() { odczytaj('6'); stan1('6', '0 -44px'); }).mouseout(function() { stan2('6'); }).click(function() { klik('6'); });
	$("#ed7").mouseover(function() { odczytaj('7'); stan1('7', '0 -44px'); }).mouseout(function() { stan2('7'); }).click(function() { klik('7'); });
	$("#ed8").mouseover(function() { odczytaj('8'); stan1('8', '0 -45px'); }).mouseout(function() { stan2('8'); }).click(function() { klik('8'); });
	$("#ed9").mouseover(function() { odczytaj('9'); stan1('9', '0 -46px'); }).mouseout(function() { stan2('9'); }).click(function() { klik('9'); });
	$("#ed10").mouseover(function() { odczytaj('10'); stan1('10', '0 -48px'); }).mouseout(function() { stan2('10'); }).click(function() { klik('10'); });
	$("#ed11").mouseover(function() { odczytaj('11'); stan1('11', '0 -46px'); }).mouseout(function() { stan2('11'); }).click(function() { klik('11'); });
	$("#ed12").mouseover(function() { odczytaj('12'); stan1('12', '0 -46px'); }).mouseout(function() { stan2('12'); }).click(function() { klik('12'); });
	$("#ed13").mouseover(function() { odczytaj('13'); stan1('13', '0 -44px'); }).mouseout(function() { stan2('13'); }).click(function() { klik('13'); });
	$("#ed14").mouseover(function() { odczytaj('14'); stan1('14', '0 -44px'); }).mouseout(function() { stan2('14'); }).click(function() { klik('14'); });
	$("#ed15").mouseover(function() { odczytaj('15'); stan1('15', '0 -44px'); }).mouseout(function() { stan2('15'); }).click(function() { klik('15'); });
	$("#ed16").mouseover(function() { odczytaj('16'); stan1('16', '0 -44px'); }).mouseout(function() { stan2('16'); }).click(function() { klik('16'); });
	$("#ed17").mouseover(function() { odczytaj('17'); stan1('17', '0 -44px'); }).mouseout(function() { stan2('17'); }).click(function() { klik('17'); });
	$("#ed18").mouseover(function() { odczytaj('18'); stan1('18', '0 -44px'); }).mouseout(function() { stan2('18'); }).click(function() { klik('18'); });
	$("#ed19").mouseover(function() { odczytaj('19'); stan1('19', '0 -44px'); }).mouseout(function() { stan2('19'); }).click(function() { klik('19'); });
	$("#ed20").mouseover(function() { odczytaj('20'); stan1('20', '0 -45px'); }).mouseout(function() { stan2('20'); }).click(function() { klik('20'); });
	$("#ed21").mouseover(function() { odczytaj('21'); stan1('21', '0 -44px'); }).mouseout(function() { stan2('21'); }).click(function() { klik('21'); });
	$("#ed22").mouseover(function() { odczytaj('22'); stan1('22', '0 -44px'); }).mouseout(function() { stan2('22'); }).click(function() { klik('22'); });
	$("#ed23").mouseover(function() { odczytaj('23'); stan1('23', '0 -45px'); }).mouseout(function() { stan2('23'); }).click(function() { klik('23'); });
	$("#ed24").mouseover(function() { odczytaj('24'); stan1('24', '0 -47px'); }).mouseout(function() { stan2('24'); }).click(function() { klik('24'); });
	$("#ed25").mouseover(function() { odczytaj('25'); stan1('25', '0 -47px'); }).mouseout(function() { stan2('25'); }).click(function() { klik('25'); });
	$("#ed26").mouseover(function() { odczytaj('26'); stan1('26', '0 -45px'); }).mouseout(function() { stan2('26'); }).click(function() { klik('26'); });
	$("#ed27").mouseover(function() { odczytaj('27'); stan1('27', '0 -47px'); }).mouseout(function() { stan2('27'); }).click(function() { klik('27'); });
	$("#ed28").mouseover(function() { odczytaj('28'); stan1('28', '0 -34px'); }).mouseout(function() { stan2('28'); }).click(function() { klik('28'); });
	$("#ed29").mouseover(function() { odczytaj('29'); stan1('29', '0 -28px'); }).mouseout(function() { stan2('29'); }).click(function() { klik('29'); });
	$("#ed30").mouseover(function() { odczytaj('30'); stan1('30', '0 -38px'); }).mouseout(function() { stan2('30'); }).click(function() { klik('30'); });
	$("#ed31").mouseover(function() { odczytaj('31'); stan1('31', '0 -30px'); }).mouseout(function() { stan2('31'); }).click(function() { klik('31'); });
	$("#ed32").mouseover(function() { odczytaj('32'); stan1('32', '0 -35px'); }).mouseout(function() { stan2('32'); }).click(function() { klik('32'); });
	$("#ed33").mouseover(function() { odczytaj('33'); stan1('33', '0 -29px'); }).mouseout(function() { stan2('33'); }).click(function() { klik('33'); });
	$("#ed34").mouseover(function() { odczytaj('34'); stan1('34', '0 -37px'); }).mouseout(function() { stan2('34'); }).click(function() { klik('34'); });
	$("#ed35").mouseover(function() { odczytaj('35'); stan1('35', '0 -30px'); }).mouseout(function() { stan2('35'); }).click(function() { klik('35'); });
	$("#ed36").mouseover(function() { odczytaj('36'); stan1('36', '0 -33px'); }).mouseout(function() { stan2('36'); }).click(function() { klik('36'); });
	$("#ed37").mouseover(function() { odczytaj('37'); stan1('37', '0 -28px'); }).mouseout(function() { stan2('37'); }).click(function() { klik('37'); });
	$("#ed38").mouseover(function() { odczytaj('38'); stan1('38', '0 -38px'); }).mouseout(function() { stan2('38'); }).click(function() { klik('38'); });
	$("#ed39").mouseover(function() { odczytaj('39'); stan1('39', '0 -29px'); }).mouseout(function() { stan2('39'); }).click(function() { klik('39'); });
	$("#ed40").mouseover(function() { odczytaj('40'); stan1('40', '0 -35px'); }).mouseout(function() { stan2('40'); }).click(function() { klik('40'); });
	$("#ed41").mouseover(function() { odczytaj('41'); stan1('41', '0 -28px'); }).mouseout(function() { stan2('41'); }).click(function() { klik('41'); });
	$("#ed42").mouseover(function() { odczytaj('42'); stan1('42', '0 -38px'); }).mouseout(function() { stan2('42'); }).click(function() { klik('42'); });
	$("#ed43").mouseover(function() { odczytaj('43'); stan1('43', '0 -29px'); }).mouseout(function() { stan2('43'); }).click(function() { klik('43'); });

	//$("#opisdom").html(function() { domek('m'); });
/*
	$("#linkdomek1").click(function() { domek('m'); });
	$("#linkdomek2").click(function() { domek('d'); });
	$("#linkdomek3").click(function() { domek('a'); });
*/

	$("ul#naglowek").innerfade({
		speed: 1000,
		timeout: 3000,
		type: 'random_start',
		containerheight: '407px'
	});

	$("ul#hasla").innerfade({
		speed: 2000,
		timeout: 9000,
		type: 'random',
		containerheight: '304px'
	},function(){sr();});
	
		$("ul#panoramy").innerfade({
		speed: 2000,
		timeout: 4000,
		type: 'sequence',
		containerheight: '180px'
	},function(){sr();});
	
	$(".social").hover(function(){
	$(this).stop(true, false).animate({right:"0"},"medium");
},function(){
	$(this).stop(true, false).animate({right:"-298"},"medium");
 },500);
 
	$("ul#4naj").innerfade({
		speed: 2000,
		timeout: 4000,
		type: 'sequence',
		containerheight: '100px'
	},function(){sr();});
	
	$('#bo_galeria a').lightBox();
	
	
	$("#promocja_main").fadeIn('slow');
	setTimeout(function(){$("#promocja_main").hide()}, 15000);
	
	$("#xclose").click(
	function(){
		$("#promocja_main").hide();
		setTimeout(function(){$("#promocja_main").show()}, 18000);
	});
		//Banner na zakĹ‚adce osiedle - powracajÄ…cy po 3 minutach od klikniÄ™cia	
	
			$(document).ready(
				function(){
					$("#promocja").fadeIn('slow');	
					setTimeout(function(){$("#promocja").hide()}, 7000);
				});
					
			$("#promocja").click(
				function(){
					$(this).hide();
				}
			);
	
});
	

	/*$(document).ready(
		function(){
			$("#promocja_main").fadeIn('slow');	
			setTimeout(function(){$("#promocja_main").hide()}, 15000);
		});
*/
	
	

