﻿var glowna = 1;
var kolekcje = 0;
var marka = 0;
var salony = 0;
var b2b = 0;
var strefa = 0;
var kontakt = 0;

﻿var glownaAJX = 1;
var kolekcjeAJX = 0;
var markaAJX = 0;
var salonyAJX = 0;
var b2bAJX = 0;
var strefaAJX = 0;
var kontaktAJX = 0;

var mapaOk = 0;
var map;

$(document).ready(function(){
									
    contentWysokosc();
    
    $("#fbON").fadeIn(function(){
	$("#fbON").fadeOut(function(){
	    $("#fbON").fadeIn(function(){
		$("#fbON").fadeOut(function(){
		     $("#fbON").fadeIn(function(){
			 $("#fbON").fadeOut(function(){
			     $("#fbON").fadeIn(function(){
				$("#fbON").fadeOut(function(){
				     $("#fbON").fadeIn(function(){
					 $("#fbON").fadeOut();
				     });
				}); 
			     });
			 });
		     })
		});
	    });
	});
    });
    
    $("#fb").mouseover(function(){
	$("#fbON").fadeIn();
    })
    
    $("#fb").mouseout(function(){
	$("#fbON").fadeOut();
    })
    
    
    $("#uniaButton").click(function(){
	    $("#uniaPopup").fadeIn();
    })
    
    $("#uniaClose").click(function(){
	    $("#uniaPopup").fadeOut();
    })
    
		
    $("#mainMenu").find("a").mouseover(function(){
	$(this).css("color","#ffffff");
    })
    $("#mainMenu").find("a").mouseout(function(){
	if ($(this).hasClass("opened")) 
	{
    
	}
	else
	{
	   $(this).css("color","#b1b1b1"); 
	}
	
    })
    
    var wys = $(window).height();
    var szer = $(window).width();
									
    $("#wrap").css("height",wys);
    $("#salony").css("top",wys);
									
    $("#kolekcjeImages").css("width",szer);
    $("#kolekcjeWrap").css("top",wys+"px");
    $("#casualImages").css("width",szer);
    $("#weddingImages").css("width",szer);
									
    var poza = (szer-980)/2 + 980;
    $("#casualWrap").css("left",-poza+"px");
    $("#weddingWrap").css("left",-poza+"px");
									
    $("#whiteBackground").css("width",szer).css("top",wys+"px").css("height",wys);
    $("#blackBackground").css("width",szer).css("height",wys);
	
    $("#salonyLeft").find("li").live('click',function(){
	$("#salonyMain").fadeOut();
	if ($(this).hasClass("checked")) 
	{
    
	}
	else
	{

	    $(".salonyName").find(".salonyZamien").html("ZOBACZ WNĘTRZE");
	    $(".salonyName").find(".active").removeClass("active");
	    $("#salonyRight").find(".rightFoto").fadeOut();
	    $("#salonyRight").find("#map_div").fadeIn();

	    var id = $(this).attr("id");
	    var id2 = $("#salonyLeft").find(".checked").attr("id");
	    $("#salonyCenter").find("#"+id2).fadeOut();
	    $("#salonyCenter").find("#"+id).fadeIn();
	    $("#salonyLeft").find(".checked").removeClass("checked");
	    $(this).addClass("checked");
	        
	    var namiar1 = $(this).attr("name1");
	    var namiar2 = $(this).attr("name2");
	    
	    if ($(this).attr("id") == "leszno" ) 
	    {
		map.setZoom(13);
	    }
	    else if ($(this).attr("id") == "poznan") 
	    {
		map.setZoom(12);
	    }
	    else if ($(this).attr("id") == "zielona") 
	    {
		map.setZoom(15);
	    }
	    else
	    {
		map.setZoom(15);
	    }
	    
	    map.panTo(new google.maps.LatLng(namiar1,namiar2));
	}
    });
    
									
    // background strona główna
    cycleMain();
									
    // działanie menu
									
    $("#mainMenu").find("#logo").click(function()
    {
	    $("#uniaButton").fadeIn();
	window.location.hash = "";
	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();
	
	$(".opened").removeClass("opened");
	$("#mainMenu").find('span').css("color","#b1b1b1");
	
	var wys = $(window).height();
	
	$("#mainMenu").animate({
	    top: wys-270+"px"
	},1500, function(){
	    $("#mainMenu").find("#logo").animate({
		top: "0px"
	    },500);
	});
	
	cycleMain();
	
	if (kolekcje == 1) 
	{
	    kolekcje = 0;
	    glowna = 1;
	    
	    var poza = (parentWidth-980)/2 + 980;
	    
	    $("#mainBackground").fadeIn("600");
	    
	    $("#whiteBackground").animate({
		top: parentHeight+"px"
	    },2000, function(){
		$("#whiteBackground").css("display","none");
	    });
	    
	    var kolekcjeOn = 0;
	    var weddingOn = 0;
	    var casualOn = 0;
	    if ($("#kolekcjeWrap").hasClass("kolekcjeOn")) 
	    {
		var kolekcjeOn = 1;
		$("#kolekcjeWrap").removeClass("kolekcjeOn");
		$("#kolekcjeImages").fadeOut("600");
		$("#kolekcjeTopTekst").fadeOut("600");
		$("#kolekcjeWrap").fadeOut("slow");
		$("#kolekcjeWrap").animate({
		    top: parentHeight+"px"
		},2000,function(){
		    $('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px").css("display","none");
		    $('#casualWrap').css("top","550px").css("left",-poza+"px").css("display","none");
		    $('#weddingWrap').css("top","550px").css("left",-poza+"px").css("display","none");
		});
		$("#kolekcjeImages").cycle('stop');
		$("#kolekcjeNav").css("display","none");
	    }
	    else if ($("#weddingWrap").hasClass("kolekcjeOn")) 
	    {
		var weddingOn = 1;
		$("#weddingWrap").removeClass("kolekcjeOn");
		$("#weddingImages").fadeOut("600");
		$("#weddingTopTekst").fadeOut("600");
		$("#weddingWrap").fadeOut("slow");
		$("#weddingWrap").animate({
		    top: parentHeight+"px"
		},2000,function(){
		    $('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px").css("display","none");
		    $('#casualWrap').css("top","550px").css("left",-poza+"px").css("display","none");
		    $('#weddingWrap').css("top","550px").css("left",-poza+"px").css("display","none");
		});
		$("#weddingImages").cycle('stop');
		$("#weddingNav").css("display","none");
		$("#kolekcjeNav").css("display","none");
		
	    }
	    else if ($("#casualWrap").hasClass("kolekcjeOn")) 
	    {
		var casualOn = 1;
		$("#casualWrap").removeClass("kolekcjeOn");
		$("#casualImages").fadeOut("600");
		$("#casualTopTekst").fadeOut("600");
		$("#casualWrap").fadeOut("slow");
		$("#casualWrap").animate({
		    top: parentHeight+"px"
		},2000, function(){
		    $('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px").css("display","none");
		    $('#casualWrap').css("top","550px").css("left",-poza+"px").css("display","none");
		    $('#weddingWrap').css("top","550px").css("left",-poza+"px").css("display","none");
		});
		$("#casualImages").cycle('stop');
		$("#casualNav").css("display","none");
		$("#kolekcjeNav").css("display","none");
	    }																									 																																																																		 
	}
	else if (marka == 1) 
	{
	    marka = 0;
	    glowna = 1;
	   
	    $("#mainBackground").fadeIn("600");

	    $("#markaBackground").animate({
		opacity: '0'
	    },1500);
	    $("#marka").animate({
		opacity: '0'
	    },1000, function(){
		$("#marka").css("display","none").css("opacity","1");
		$("#markaLeftTop").css("opacity","0");
		$("#markaRightTop").css("opacity","0");
		$("#markaLeftBottom").css("opacity","0");
		$("#markaRightBottom").css("opacity","0");
	    }); 
	}
	else if (salony == 1)
	{
	    salony = 0;
	    glowna = 1;
																	
	    $("#mainBackground").fadeIn("600");
	    
	    $("#salonyBackground").animate({
		opacity: '0'
	    },1500);
	    
	    $("#salony").animate({
		opacity: '0'
	    },1000, function(){
		$("#salony").css("display","none").css("opacity","1");
		$("#salonyLeft").css("opacity","0");
		$("#salonyRight").css("opacity","0");
		$("#salonyCenter").css("opacity","0");
	    });
	}
	else if (b2b == 1) 
	{
	    b2b = 0;
	    glowna = 1;
	    
	    $("#mainBackground").fadeIn("600");
	    
	    $("#b2bBackground").animate({
		opacity: '0'
	    },1500);
	    
	    $("#b2b").animate({
		opacity: '0'
	    },1000, function(){
		$("#b2b").css("display","none").css("opacity","1");
		$("#b2bLeftTop").css("opacity","0");
		$("#b2bRightTop").css("opacity","0");
		$("#b2bLeftBottom").css("opacity","0");
	    });
	}
	else if (strefa == 1) 
	{
	    strefa = 0;
	    glowna = 1;
	    
	    $("#mainBackground").fadeIn("600");
	    
	    $("#strefaBackground").animate({
		opacity: '0'
	    },1500);
	    
	    $("#strefa").animate({
		opacity: '0'
	    },1000, function(){
		$("#strefa").css("display","none").css("opacity","1");
		$("#strefaLeftTop").css("opacity","0");
		$("#strefaRightTop").css("opacity","0");
		$("#strefaLeftBottom").css("opacity","0");
	    });
	}
	else if (kontakt == 1) 
	{
	    kontakt = 0;
	    glowna = 1;
	    
	    $("#mainBackground").fadeIn("600");
	    
	    $("#kontaktBackground").animate({
		opacity: '0'
	    },1500);
	    
	    $("#kontakt").animate({
		opacity: '0'
	    },1000, function(){
		$("#kontakt").css("display","none").css("opacity","1");
		$("#kontaktLeftTop").css("opacity","0");
		$("#kontaktRightTop").css("opacity","0");
		$("#kontaktLeftBottom").css("opacity","0");
		$("#kontaktRightBottom").css("opacity","0");
	    });
	}
	return false;
    })
									
    $("#menu1").click(function()
    {
	    
	    $("#uniaPopup").fadeOut();
	    $("#uniaButton").fadeOut();
	    
	if (kolekcje == 0) 
	{
	    window.location.hash = "kolekcje";
	    $(".opened").removeClass("opened");
	    $("#mainMenu").find('a').css("color","#b1b1b1");
	    $(this).css("color","#ffffff").addClass('opened');
	    if (kolekcjeAJX == 0) 
	    {
		kolekcjeAJX = 1;
		$.ajax({
		    url: 'kolekcja-content.php',
		    type: "POST",
		    success:function(data){
			$("#wrap").append(data);
			$.ajax({
				url: 'kolekcja-bg.php',
				type: "POST",
				success:function(data){
				    $("body").append(data);

				    contentWysokosc();
				    kolekcjaShow();
				}
			});
		    }
		});
	    }
	    else
	    {
		kolekcjaShow();
	    }
	}
	return false;	
    })
    
    $("#menu2").click(function()
    {
	    $("#uniaPopup").fadeOut();
	    $("#uniaButton").fadeOut();
	if(marka == 0)
	{
	    window.location.hash = "o_marce";
	    $(".opened").removeClass("opened");
	    $("#mainMenu").find('a').css("color","#b1b1b1");
	    $(this).css("color","#ffffff").addClass('opened');
	    if (markaAJX == 0) 
	    {
		markaAJX = 1;
		$.ajax({
		    url: 'o_marce-content.php',
		    type: "POST",
		    success:function(data){
			$("#wrap").append(data);
			$.ajax({
			    url: 'o_marce-bg.php',
			    type: "POST",
			    success:function(data){
				$("body").append(data);

				markaShow();
			    }
			});
		    }
		});
	    }
	    else
	    {
		markaShow();
	    }
		
	}
	return false;
    })
    
    $("#menu3").click(function()
    {
	    $("#uniaPopup").fadeOut();
	    $("#uniaButton").fadeOut();
	if(salony == 0)
	{
	    window.location.hash = "salony_mody";
	    $(".opened").removeClass("opened");
	    $("#mainMenu").find('a').css("color","#b1b1b1");
	    $(this).css("color","#ffffff").addClass('opened');
	    if (salonyAJX == 0) 
	    {
		salonyAJX = 1;
		$.ajax({
		    url: 'salony_mody-content.php',
		    type: "POST",
		    success:function(data){
			$("#wrap").append(data);
			$.ajax({
			    url: 'salony_mody-bg.php',
			    type: "POST",
			    success:function(data){
				$("body").append(data);

				salonyShow();
			    }
			});
		    }
		});
	    }
	    else
	    {
		salonyShow();
	    }    
	}
	return false;
    })
    
    $("#menu4").click(function()
    {
	    $("#uniaPopup").fadeOut();
	    $("#uniaButton").fadeOut();
	if(b2b == 0)
	{
	    window.location.hash = "b2b";
	    $(".opened").removeClass("opened");
	    $("#mainMenu").find('a').css("color","#b1b1b1");
	    $(this).css("color","#ffffff").addClass('opened');
	    if (b2bAJX == 0) 
	    {
		b2bAJX = 1;
		$.ajax({
		    url: 'b2b-content.php',
		    type: "POST",
		    success:function(data){
			$("#wrap").append(data);
			$.ajax({
			    url: 'b2b-bg.php',
			    type: "POST",
			    success:function(data){
				$("body").append(data);

				b2bShow();
			    }
			});
		    }
		});
	    }
	    else
	    {
		b2bShow();
	    }
	}
	return false;
    })
    
    
    
    $("#menu5").click(function()
    {	
	$("#uniaPopup").fadeOut();
	    $("#uniaButton").fadeOut();
	if (strefa == 0) 
	{
	    window.location.hash = "strefa_klienta";
	    $(".opened").removeClass("opened");
	    $("#mainMenu").find('a').css("color","#b1b1b1");
	    $(this).css("color","#ffffff").addClass('opened');
	    if (strefaAJX == 0) 
	    {
		strefaAJX = 1;
		$.ajax({
		    url: 'strefa_klienta-content.php',
		    type: "POST",
		    success:function(data){
			$("#wrap").append(data);
			$.ajax({
			    url: 'strefa_klienta-bg.php',
			    type: "POST",
			    success:function(data){
				$("body").append(data);

				strefaShow();
			    }
			});
		    }
		});
	    }
	    else
	    {
		strefaShow();
	    }
	}
	
	return false;
    })
    
     $("#menu6").click(function()
     { 
	     $("#uniaPopup").fadeOut();
	    $("#uniaButton").fadeOut();
	if (kontakt == 0) 
	{
	    window.location.hash = "kontakt";
	    $(".opened").removeClass("opened");
	    $("#mainMenu").find('a').css("color","#b1b1b1");
	    $(this).css("color","#ffffff").addClass('opened');
	    if (kontaktAJX == 0) 
	    {
		kontaktAJX = 1;
		$.ajax({
		    url: 'kontakt-content.php',
		    type: "POST",
		    success:function(data){
			$("#wrap").append(data);
			$.ajax({
			    url: 'kontakt-bg.php',
			    type: "POST",
			    success:function(data){
				$("body").append(data);

				kontaktShow();
			    }
			});
		    }
		});
	    }
	    else
	    {
		kontaktShow();
	    }
	}
	return false;
    })
    
    
    $("#strefaRightTop").find("#klikSzcz").live('click',function(){
	$("#strefaSzcz").animate({
		width : "922px",
		height : "573px"
	},1000,function(){
		$("#strefaX").css("display","block");
		$("#strefaFB").css("display","block");
	});
    })
    
    $("#strefaX").live('click',function(){
	$("#strefaSzcz").fadeOut("slow",function(){
		$("#strefaSzcz").css("width","0px").css("height","0px").css("display","block");
		$("#strefaX").css("display","none");
		$("#strefaFB").css("display","none");
	})
    })
    
    $("#strefaFB").live('mouseenter',function(){
	    $(this).find("#faceON").css("display","none");
	    $(this).find("#faceOFF").css("display","block");
    })
    
    $("#strefaFB").live('mouseleave',function(){
	    $(this).find("#faceON").css("display","block");
	    $(this).find("#faceOFF").css("display","none");
    })
  
    
    $("#strefaLeftTop").find("#klikPow").live('click',function(){
		$("#strefaLeftTop").find("iframe").css("display","none");
		$("#strefaLeftTop").find("#klikPow").css("display","none").removeClass("videoOn");
    })
    
    $("#strefaCycle").find(".cycleStrefa").live('mouseenter',function(){
	$(this).find(".off").css("opacity","1");
	$(this).find(".on").css("opacity","0");
    })
    
    $("#strefaCycle").find(".cycleStrefa").live('mouseleave',function(){
	$(this).find(".off").css("opacity","0");
	$(this).find(".on").css("opacity","1");
    })
    
    $("#strefaLeftTop").find("iframe").live('mouseenter',function(){
	if ($("#strefaLeftTop").find("#klikPow").hasClass("videoOn"))
	{
		$("#strefaLeftTop").find("#klikPow").css("display","block");
	}
	
    })
    
    $("#strefaLeftTop").find("#klikPow").live('hover',function(){
	    if ($(this).hasClass("videoOn"))
	    {
		$("#strefaLeftTop").find("#klikPow").css("display","block");
	    }
    })
    
    $("#strefaLeftTop").find("iframe").live('mouseleave',function(){
	$("#strefaLeftTop").find("#klikPow").css("display","none");
    })
    
    $("#strefaCycle").find(".cycleStrefa").live('click',function(){
	var id = $(this).attr("id");
	if (id == "cycleStrefa2")
	{
		$("#strefaLeftTop").find("#videoStrefa2").css("display","block");
		$("#strefaLeftTop").find("#klikPow").addClass("videoOn");
		//$("#vimeoplayer2").api_play();
	}
	else if (id == "cycleStrefa1")
	{
		$("#strefaLeftTop").find("#videoStrefa1").css("display","block");
		$("#strefaLeftTop").find("#klikPow").addClass("videoOn");
	}
    })
    
    $(".salonyZamien").live('click',function(){
	if ($(this).hasClass("active")) 
	{
	    $(this).removeClass("active");
	    $(this).html("ZOBACZ WNĘTRZE");
	    $("#salonyRight").find(".rightFoto").fadeOut();
	    $("#salonyRight").find("#map_div").fadeIn();
	}
	else
	{
	    var id = $(this).parent().attr("id");
	    $(this).addClass("active");
	    $(this).html("ZOBACZ MAPĘ");
	    $("#salonyRight").find("#"+id+"Foto").fadeIn();
	    $("#salonyRight").find("#map_div").fadeOut();
	}
    })
    
    $("#skontaktujButton").live('click',function(){
	if (kontakt == 0) 
	{
	    window.location.hash = "kontakt";
	    $(".opened").removeClass("opened");
	    $("#mainMenu").find('a').css("color","#b1b1b1");
	    $("#mainMenu").find('a[href="kontakt.php"]').css("color","#ffffff").addClass('opened');
	    if (kontaktAJX == 0) 
	    {
		kontaktAJX = 1;
		$.ajax({
		    url: 'kontakt-content.php',
		    type: "POST",
		    success:function(data){
			$("#wrap").append(data);
			$.ajax({
			    url: 'kontakt-bg.php',
			    type: "POST",
			    success:function(data){
				$("body").append(data);

				kontaktShow();
			    }
			});
		    }
		});
	    }
	    else
	    {
		kontaktShow();
	    }
	}
	return false;
    })
    
    $(".starszeAktualnosci").live('click',function(){
	$jest = 0;
	$("#aktualnosciContent").find(".aktualnosciContainer").each(function(){
	    if ($jest == 0) 
	    {
		if ($(this).hasClass("shown")) 
		{
		    $(this).removeClass("shown");
		    var id = $(this).attr("id");
		    id = id.substr(4,2);
		    id++;

		    //$(this).css("top","0px");
		    var height = 387;
		    var nazwa = "cont"+id;
		    if ($("#"+nazwa).length > 0) 
		    {

		    }
		    else
		    {
			nazwa = "cont1";
		    }
		    $("#"+nazwa).css("top",height+20+"px");
		    $("#"+nazwa).addClass("shown");
		    $("#"+nazwa).animate({
			top : "0px"
		    },1000);
		    $(this).animate({
			top : -height+"px"
		    },1000);
		    $jest = 1;
		}
	    }
	    
	})
    });
    
    $(".newsletterInput").live('focus',function(){
	if ($(this).val() == "Adres e-mail") 
	{
	    $(this).val("");
	}
    })
	
    $(".newsletterInput").live('focusout',function(){
	if ($(this).val() == "") 
	{
	    $(this).val("Adres e-mail");
	}
    })
    
    $("#kontaktLeftBottom").find("#materialy").live('click',function(){
	$(this).css("background","#b20838");
	$(this).find("h1").fadeOut();
	$(this).find("p").fadeOut();
	$(this).find("a").fadeIn();
    })
    
    $("#wyslij").live('click',function()
    {
	var name = $("#formName").val();
	var mail = $("#formMail").val();
	var content = $("#formContent").val();
	
	var data = "name="+name+"&mail="+mail+"&content="+content;
	
	if (name != '' && name != 'Podaj imię i nazwisko' && mail != '' && mail != 'Podaj adres e-mail' && content != 'Podaj treść wiadomości'  && content != '') 
	{
	    var TestEmail = /^(.[A-Za-z0-9\-]*\w)+@+([A-Za-z0-9\-]*\w)+(\.[A-Za-z]*\w)+$/;
	    var Wynik = mail.match(TestEmail);
	    if (Wynik == null)
	    {
		$("#formMail").css("border","solid 1px red").css("width","188px").css("height","27px").css("color","red");
	    }
	    else
	    {
		$("#formMail").css("border","none").css("width","190px").css("height","29px").css("color","#000000");
		
		$.ajax({
		    url: 'sendForm.php',
		    type: "POST",
		    data: data,
		    success:function(data)
		    {
			alert(data);
		    }
		}); 
	    }
	   
	}
	else
	{
	    if (name == '' || name == 'Podaj imię i nazwisko') 
	    {
		$("#formName").css("border","solid 1px red").css("width","188px").css("height","27px").css("color","red");
		$("#formName").val("Podaj imię i nazwisko");
	    }
	    else
	    {
		$("#formName").css("border","none").css("width","190px").css("height","29px").css("color","#000000");
	    }
	    
	    if (mail == '' || mail == 'Podaj adres e-mail') 
	    {
		$("#formMail").css("border","solid 1px red").css("width","188px").css("height","27px").css("color","red");
		$("#formMail").val("Podaj adres e-mail");
	    }
	    else
	    {
		var TestEmail = /^(.[A-Za-z0-9\-]*\w)+@+([A-Za-z0-9\-]*\w)+(\.[A-Za-z]*\w)+$/;
		var Wynik = mail.match(TestEmail);
		if (Wynik == null)
		{
		    $("#formMail").css("border","solid 1px red").css("width","188px").css("height","27px").css("color","red");
		}
		else
		{
		    $("#formMail").css("border","none").css("width","190px").css("height","29px").css("color","#000000");
		}
	    }
	    
	    if (content == '' || content == 'Podaj treść wiadomości') 
	    {
		$("#formContent").css("border","solid 1px red").css("width","288px").css("height","208px").css("color","red");
		$("#formContent").val("Podaj treść wiadomości");
	    }
	    else
	    {
		$("#formContent").css("border","none").css("width","290px").css("height","210px").css("color","#000000");
	    }
	}
	
    })
    
    $("#formName").live('focus',function()
    {
	if ($(this).val() == 'Podaj imię i nazwisko') 
	{
	    $(this).val("");
	    $(this).css("color","#000000");
	}
    })
    
    $("#formMail").live('focus',function()
    {
	if ($(this).val() == 'Podaj adres e-mail') 
	{
	    $(this).val("");
	    $(this).css("color","#000000");
	}
    })
    
    $("#formContent").live('focus',function()
    {
	if ($(this).val() == 'Podaj treść wiadomości') 
	{
	    $(this).val("");
	    $(this).css("color","#000000");
	}
    })
	
    $(".goCasual").live('click',function(){
	var kolekcjeOn = 0;
	var weddingOn = 0;
	if ($("#kolekcjeWrap").hasClass("kolekcjeOn")) 
	{
	    var kolekcjeOn = 1;
	    $("#kolekcjeWrap").removeClass("kolekcjeOn");
	}
	else if ($("#weddingWrap").hasClass("kolekcjeOn")) 
	{
	    var weddingOn = 1;
	    $("#weddingWrap").removeClass("kolekcjeOn");
	}
	
	$("#casualWrap").addClass("kolekcjeOn");
	
	$("#blackBackground").css("display","block");
	$("#blackBackground").animate({
	    opacity : 1
	},1500);
	
	
	if (kolekcjeOn == 1) 
	{
	    $("#kolekcjeTopTekst").animate({
		opacity : 0
	    },1500, function(){
		$("#kolekcjeTopTekst").css("display","none").css("opacity","1");
	    });
	}
	else if (weddingOn == 1)
	{
    	    $("#weddingTopTekst").animate({
		opacity : 0
	    },1500, function(){
		$("#weddingTopTekst").css("display","none").css("opacity","1");
	    });
	}

																		 
	
																			 
	setTimeout(function(){
	    var width  = 1600;
	    var height = 550;
	    var parentWidth  = $(window).width();
	    var parentHeight = 550;

	    if(width/parentWidth < height/parentHeight)
	    {
		newWidth  = parentWidth;
		newHeight = newWidth/width*height;
	    }
	    else
	    {
		newHeight = parentHeight;
		newWidth  = newHeight/height*width;
	    }
	    $("#casualImages").css("width",parentWidth);
	    $("#casualImages").find("#casualImage1").css("width",newWidth).css("height",newHeight);
	    $("#casual").css("display","block");
	    var szer = $(window).width();
	    var poza = (szer-980)/2 + 980;
	    $("#casualWrap").css("left",-poza+"px").css("opacity","1").css("display","block");
	    $("#casualWrap").animate({
		left : 0
	    },1000);
	    if (kolekcjeOn == 1) 
	    {
		$("#kolekcjeWrap").animate({
		    left : poza+"px"
		},1000, function(){
		    $("#kolekcjeImages").css("display","none");
		    $("#weddingImages").css("display","none");
		    $("#blackBackground").css("display","none").css("opacity","0");
		    $("#casualImages").fadeIn("600");
		    $("#casualTopTekst").fadeIn("600");
		    $("#kolekcjeWrap").css("left",-poza+"px");
		    $("#kolekcjeImages").cycle('stop');
		    $("#kolekcjeNav").html("");
		    $("#kolekcje").css("display","none");
		});
	    }
	    else if (weddingOn == 1)
	    {
		$("#weddingWrap").animate({
		    left : poza+"px"
		},1000, function(){
		    $("#weddingImages").css("display","none");
		    $("#kolekcjeImages").css("display","none");
		    $("#blackBackground").css("display","none").css("opacity","0");
		    $("#casualImages").fadeIn("600");
		    $("#casualTopTekst").fadeIn("600");
		    $("#weddingWrap").css("left",-poza+"px");
		    $("#weddingImages").cycle('stop');
		    $("#weddingNav").html("");
		    $("#wedding").css("display","none");
		});
	    }
	    
	    cycleCasual();
	    $("#casualNav").css("display","block");
	    
	},500);
    })
    
    $(".goWedding").live('click',function(){
	var kolekcjeOn = 0;
	var casualOn = 0;
	if ($("#kolekcjeWrap").hasClass("kolekcjeOn")) 
	{
	    var kolekcjeOn = 1;
	    $("#kolekcjeWrap").removeClass("kolekcjeOn");
	}
	else if ($("#casualWrap").hasClass("kolekcjeOn")) 
	{
	    var casualOn = 1;
	    $("#casualWrap").removeClass("kolekcjeOn");
	}
	
	$("#weddingWrap").addClass("kolekcjeOn");
	
	$("#blackBackground").css("display","block");
	$("#blackBackground").animate({
	    opacity : 1
	},1500);
	
	if (kolekcjeOn == 1) 
	{
	    $("#kolekcjeTopTekst").animate({
		opacity : 0
	    },1500, function(){
		$("#kolekcjeTopTekst").css("display","none").css("opacity","1");
	    });
	}
	else if (casualOn == 1) 
	{
	    $("#casualTopTekst").animate({
		opacity : 0
	    },1500, function(){
		$("#casualTopTekst").css("display","none").css("opacity","1");
	    });
	}
		
	//alert(casualOn);

																			 
	setTimeout(function(){
	    var width  = 1600;
	    var height = 550;
	    var parentWidth  = $(window).width();
	    var parentHeight = 550;

	    if(width/parentWidth < height/parentHeight)
	    {
		newWidth  = parentWidth;
		newHeight = newWidth/width*height;
	    }
	    else
	    {
		newHeight = parentHeight;
		newWidth  = newHeight/height*width;
	    }
	    $("#weddingImages").css("width",parentWidth);
	    $("#weddingImages").find("#weddingImage1").css("width",newWidth).css("height",newHeight);
	    $("#wedding").css("display","block");
	    var szer = $(window).width();
	    var poza = (szer-980)/2 + 980;
	    $("#weddingWrap").css("left",-poza+"px").css("opacity","1").css("display","block");
	    $("#weddingWrap").animate({
		left : 0
	    },1000);
	    
	    if (kolekcjeOn == 1) 
	    {
		$("#kolekcjeWrap").animate({
		    left : poza+"px"
		},1000, function(){
		    $("#kolekcjeImages").css("display","none");
		    $("#casualImages").css("display","none");
		    $("#blackBackground").css("display","none").css("opacity","0");
		    $("#weddingImages").fadeIn("600");
		    $("#weddingTopTekst").fadeIn("600");
		    $("#kolekcjeWrap").css("left",-poza+"px");
		    $("#kolekcjeImages").cycle('stop');
		    $("#kolekcjeNav").html("");
		    $("#kolekcje").css("display","none");
		});
	    }
	    else if (casualOn == 1)
	    {
		$("#casualWrap").animate({
		    left : poza+"px"
		},1000, function(){
		    $("#casualImages").css("display","none");
		    $("#kolekcjeImages").css("display","none");
		    $("#blackBackground").css("display","none").css("opacity","0");
		    $("#weddingImages").fadeIn("600");
		    $("#weddingTopTekst").fadeIn("600");
		    $("#casualWrap").css("left",-poza+"px");
		    $("#casualImages").cycle('stop');
		    $("#casualNav").html("");
		    $("#casual").css("display","none");
		});
	    }
	    
	    cycleWedding();
	    $("#weddingNav").css("display","block");
	    
	},500);
    })
	
    $(".goBusiness").live('click',function(){
	var casualOn = 0;
	var weddingOn = 0;
	if ($("#casualWrap").hasClass("kolekcjeOn")) 
	{
	    var casualOn = 1;
	    $("#casualWrap").removeClass("kolekcjeOn");
	}
	else if ($("#weddingWrap").hasClass("kolekcjeOn")) 
	{
	    var weddingOn = 1;
	    $("#weddingWrap").removeClass("kolekcjeOn");
	}
	
	$("#kolekcjeWrap").addClass("kolekcjeOn");
	
	$("#blackBackground").css("display","block");
	$("#blackBackground").animate({
	    opacity : 1
	},1500);
	
	
	if (casualOn == 1) 
	{
	    $("#casualTopTekst").animate({
		opacity : 0
	    },1500, function(){
		$("#casualTopTekst").css("display","none").css("opacity","1");
	    });
	}
	else if (weddingOn == 1)
	{
    	    $("#weddingTopTekst").animate({
		opacity : 0
	    },1500, function(){
		$("#weddingTopTekst").css("display","none").css("opacity","1");
	    });
	}

																		 
																			 
	setTimeout(function(){
	    var width  = 1600;
	    var height = 550;
	    var parentWidth  = $(window).width();
	    var parentHeight = 550;

	    if(width/parentWidth < height/parentHeight)
	    {
		newWidth  = parentWidth;
		newHeight = newWidth/width*height;
	    }
	    else
	    {
		newHeight = parentHeight;
		newWidth  = newHeight/height*width;
	    }
	    $("#kolekcjeImages").css("width",parentWidth);
	    $("#kolekcjeImages").find("#kolekcjeImage1").css("width",newWidth).css("height",newHeight);
	    $("#kolekcje").css("display","block");
	    var szer = $(window).width();
	    var poza = (szer-980)/2 + 980;
	    $("#kolekcjeWrap").css("left",-poza+"px").css("opacity","1").css("display","block");
	    $("#kolekcjeWrap").animate({
		left : 0
	    },1000);
	    
	    if (casualOn == 1) 
	    {
		$("#casualWrap").animate({
		    left : poza+"px"
		},1000, function(){
		    $("#casualImages").css("display","none");
		    $("#weddingImages").css("display","none");
		    $("#blackBackground").css("display","none").css("opacity","0");
		    $("#kolekcjeImages").fadeIn("600");
		    $("#kolekcjeTopTekst").fadeIn("600");
		    $("#casualWrap").css("left",-poza+"px");
		    $("#casualImages").cycle('stop');
		    $("#casualNav").html("");
		    $("#casual").css("display","none");
		});
	    }
	    else if (weddingOn == 1)
	    {
		$("#weddingWrap").animate({
		    left : poza+"px"
		},1000, function(){
		    $("#weddingImages").css("display","none");
		    $("#casualImages").css("display","none");
		    $("#blackBackground").css("display","none").css("opacity","0");
		    $("#kolekcjeImages").fadeIn("600");
		    $("#kolekcjeTopTekst").fadeIn("600");
		    $("#weddingWrap").css("left",-poza+"px");
		    $("#weddingImages").cycle('stop');
		    $("#weddingNav").html("");
		    $("#wedding").css("display","none");
		});
	    }
	    
	    cycleKolekcja();
	    $("#kolekcjeNav").css("display","block");
	    
	},500);
    })
	
	
	
    if (window.location.hash == "#kolekcje") 
    {
	$("#menu1").click();
    }
    else if (window.location.hash == "#o_marce") 
    {
	$("#menu2").click();
    }
    else if (window.location.hash == "#salony_mody") 
    {
	$("#menu3").click();
    }
    else if (window.location.hash == "#b2b") 
    {
	$("#menu4").click();
    }
    else if (window.location.hash == "#strefa_klienta") 
    {
	$("#menu5").click();
    }
    else if (window.location.hash == "#kontakt") 
    {
	$("#menu6").click();
    }

});







// koniec document ready


contentWysokosc = function()
{
    /* mainBackground */
    var wys = $(window).height();
    var szer = $(window).width();
	
    $("#wrap").css("height",wys);

    var width  = 1600;
    var height = 931;
    var parentWidth  = $(window).width();
    var parentHeight = $(window).height()

    if(width/parentWidth < height/parentHeight)
    {
	newWidth  = parentWidth;
	newHeight = newWidth/width*height;
    }
    else
    {
	newHeight = parentHeight;
	newWidth  = newHeight/height*width;
    }
    
    if (kolekcje == 1) 
    {
	
	$("#whiteBackground").css("width",szer).css("height",wys);
	var width2  = 1600;
	var height2 = 550;
	var parentWidth2  = $(window).width();
	var parentHeight2 = 550;

	if(width2/parentWidth2 < height2/parentHeight2)
	{
	    newWidth2  = parentWidth2;
	    newHeight2 = newWidth2/width2*height2;
	}
	else
	{
	    newHeight2 = parentHeight2;
	    newWidth2  = newHeight2/height2*width2;
	}
	
	$("#kolekcjeImages").css("width",parentWidth2);
	$("#kolekcjeImages").find("img").css("width",newWidth2).css("height",newHeight2);
    }
    else if (marka == 1) 
    {
	
	$("#markaBackground").css("width",parentWidth).css("height",parentHeight);
	$("#markaBackground").find("img").css("width",newWidth).css("height",newHeight);
	
	if (parentHeight-336 >= 337) 
	{
	    $("#markaLeft").find("#markaTekst").css("height",parentHeight-336+"px");
	    //$("#markaLeft").find("#markaTekst-sliderVer").css("height",parentHeight-336+"px");
	    $("#markaTekst").adslider('destroy').adslider({
		buttons : 0,
		wheelscroll_step : 10,
		slider_size : "box"
	    }); 
	}
    }
    else if (salony == 1) 
    {
	
	$("#salonyBackground").css("width",parentWidth).css("height",parentHeight);
	$("#salonyBackground").find("img").css("width",newWidth).css("height",newHeight);

    }
    else if (b2b == 1) 
    {

	$("#b2bBackground").css("width",parentWidth).css("height",parentHeight);
	$("#b2bBackground").find("img").css("width",newWidth).css("height",newHeight);
	
	if (parentHeight-336 >= 337) 
	{
	    if ($("#b2bLeft").find("#b2bTekst").height() > parentHeight-336) 
	    {
		$("#b2bLeft").find("#b2bTekst").css("height",parentHeight-336+"px");
	    }
	    
	    //$("#markaLeft").find("#markaTekst-sliderVer").css("height",parentHeight-336+"px");
	    $("#b2bTekst").adslider('destroy').adslider({
		buttons : 0,
		wheelscroll_step : 10,
		slider_size : "box"
	    }); 
	}
    }
    else if (strefa == 1) 
    {

	$("#strefaBackground").css("width",parentWidth).css("height",parentHeight);
	$("#strefaBackground").find("img").css("width",newWidth).css("height",newHeight);
    }
    else if (kontakt == 1) 
    {

	$("#kontaktBackground").css("width",parentWidth).css("height",parentHeight);
	$("#kontaktBackground").find("img").css("width",newWidth).css("height",newHeight);
    }

    if ($("#mainBackground").css("display") != "none")
    {
	$("#mainBackground").css("height",wys+"px").css("width",szer+"px");
    }
    //$("#podstrona").css("height",wys+"px").css("width",szer+"px");
    if ($("#podstrona").css("display") == "none")
    {
	$("#podstrona").css("top",wys+"px");
    }
    $("#wrap").css("height",wys+"px");
	
    var width  = 1400;
    var height = 931;
    var parentWidth  = $(window).width();
    var parentHeight = $(window).height();
	
    if(width/parentWidth < height/parentHeight)
    {
	newWidth  = parentWidth;
	newHeight = newWidth/width*height;
    }
    else
    {
	newHeight = parentHeight;
	newWidth  = newHeight/height*width;
    }
    margin_top  = (parentHeight - newHeight) / 5;
    margin_left = (parentWidth  - newWidth ) / 2;
	
    $("#mainBackground").find("img").css({
	'margin-top' :margin_top  + 'px',
	'margin-left':margin_left + 'px',
	'height'     :newHeight   + 'px',
	'width'      :newWidth    + 'px'
	});
	
    /* menu */
	
    if ($("#mainBackground").css("display") != "none")
    {
	if (wys < 270)
	{
	    $("#mainMenu").css("top","0px");
	}
	if (wys > 270)
	{
	    $("#mainMenu").css("top",wys-270+"px");
	}
    }
	
/* podstrona */
	
	
	
}

function findPosX(obj)
{
    obj = obj[0];
    var curleft = 0;
    if(obj.offsetParent)
	while(1) 
	{
	    curleft += obj.offsetLeft;
	    if(!obj.offsetParent)
		break;
	    obj = obj.offsetParent;
	}
    else if(obj.x)
	curleft += obj.x;
    return curleft;
}

function findPosY(obj)
{
    obj = obj[0];
    var curleft = 0;
    if(obj.offsetParent)
	while(1) 
	{
	    curleft += obj.offsetTop;
	    if(!obj.offsetParent)
		break;
	    obj = obj.offsetParent;
	}
    else if(obj.x)
	curleft += obj.x;
    return curleft;
}

/**
 * animacja strona główna
 */
function cycleMain() 
{
    var kolejnosc = 1;
    $("#mainBackground").cycle({
	fx: 'fade',
	speed : 600,
	timeout: 6000,
	after: function(){
														 
	},
	before: function(){
	    var width  = 1400;
	    var height = 931;
	    var parentWidth  = $(window).width();
	    var parentHeight = $(window).height();
														 
	    if(width/parentWidth < height/parentHeight)
	    {
		newWidth  = parentWidth;
		newHeight = newWidth/width*height;
	    }
	    else
	    {
		newHeight = parentHeight;
		newWidth  = newHeight/height*width;
	    }
	    kolejnosc ++;
	    var mod = kolejnosc%3;
	    //alert(mod);
	    if (mod == 0) 
	    {
		$("#mainBackground").find("#mainBackground3").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 1) 
	    {
		$("#mainBackground").find("#mainBackground1").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 2) 
	    {
		$("#mainBackground").find("#mainBackground2").css("width",newWidth).css("height",newHeight);
	    }
	    var width = $(this).find('img').width()*1.1;
	    var height = $(this).find('img').height()*1.1;
	    $(this).find('img').animate({
		width : width,
		height : height
	    },8000);
	}
    });
}



function cycleKolekcja() 
{
    var kolejnoscKolekcje = 1;
    $("#kolekcjeImages").cycle({
	fx: 'fade',
	speed : 600,
	timeout: 9000,
	pager: '#kolekcjeNav',
	pagerAnchorBuilder: function(idx, slide) { 
	    return '<li><a href="#"></a></li>'; 
	},
	after: function(){
														 
	},
	before: function(){
	    var width  = 1600;
	    var height = 550;
	    var parentWidth  = $(window).width();
	    var parentHeight = 550;
														 
	    if(width/parentWidth < height/parentHeight)
	    {
		newWidth  = parentWidth;
		newHeight = newWidth/width*height;
	    }
	    else
	    {
		newHeight = parentHeight;
		newWidth  = newHeight/height*width;
	    }
	    kolejnoscKolekcje ++;
	    var mod = kolejnoscKolekcje%4;
	    //alert(mod);
	    if (mod == 0) 
	    {
		$("#kolekcjeImages").find("#kolekcjeImage4").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 1) 
	    {
		$("#kolekcjeImages").find("#kolekcjeImage1").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 2) 
	    {
		$("#kolekcjeImages").find("#kolekcjeImage2").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 3) 
	    {
		$("#kolekcjeImages").find("#kolekcjeImage3").css("width",newWidth).css("height",newHeight);
	    }
	    var width = $(this).find('img').width()*1.1;
	    var height = $(this).find('img').height()*1.1;
	    $(this).find('img').animate({
		width : width,
		height : height
	    },11000);
	}
    });
}

function cycleCasual() 
{
    var kolejnoscCasual = 1;
    $("#casualImages").cycle({
	fx: 'fade',
	speed : 600,
	timeout: 9000,
	pager: '#casualNav',
	pagerAnchorBuilder: function(idx, slide) { 
	    return '<li><a href="#"></a></li>'; 
	},
	after: function(){
														 
	},
	before: function(){
	    var width  = 1600;
	    var height = 550;
	    var parentWidth  = $(window).width();
	    var parentHeight = 550;
														 
	    if(width/parentWidth < height/parentHeight)
	    {
		newWidth  = parentWidth;
		newHeight = newWidth/width*height;
	    }
	    else
	    {
		newHeight = parentHeight;
		newWidth  = newHeight/height*width;
	    }
	    kolejnoscCasual ++;
	    var mod = kolejnoscCasual%4;
	    //alert(mod);
	    if (mod == 0) 
	    {
		$("#casualImages").find("#casualImage4").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 1) 
	    {
		$("#casualImages").find("#casualImage1").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 2) 
	    {
		$("#casualImages").find("#casualImage2").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 3) 
	    {
		$("#casualImages").find("#casualImage3").css("width",newWidth).css("height",newHeight);
	    }
	    var width = $(this).find('img').width()*1.1;
	    var height = $(this).find('img').height()*1.1;
	    $(this).find('img').animate({
		width : width,
		height : height
	    },11000);
	}
    });
}

function cycleWedding() 
{
    var kolejnoscWedding = 1;
    $("#weddingImages").cycle({
	fx: 'fade',
	speed : 600,
	timeout: 9000,
	pager: '#weddingNav',
	pagerAnchorBuilder: function(idx, slide) { 
	    return '<li><a href="#"></a></li>'; 
	},
	after: function(){
														 
	},
	before: function(){
	    var width  = 1600;
	    var height = 550;
	    var parentWidth  = $(window).width();
	    var parentHeight = 550;
														 
	    if(width/parentWidth < height/parentHeight)
	    {
		newWidth  = parentWidth;
		newHeight = newWidth/width*height;
	    }
	    else
	    {
		newHeight = parentHeight;
		newWidth  = newHeight/height*width;
	    }
	    kolejnoscWedding ++;
	    var mod = kolejnoscWedding%4;
	    //alert(mod);
	    if (mod == 0) 
	    {
		$("#weddingImages").find("#weddingImage4").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 1) 
	    {
		$("#weddingImages").find("#weddingImage1").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 2) 
	    {
		$("#weddingImages").find("#weddingImage2").css("width",newWidth).css("height",newHeight);
	    }
	    else if (mod == 3) 
	    {
		$("#weddingImages").find("#weddingImage3").css("width",newWidth).css("height",newHeight);
	    }
	    var width = $(this).find('img').width()*1.1;
	    var height = $(this).find('img').height()*1.1;
	    $(this).find('img').animate({
		width : width,
		height : height
	    },11000);
	}
    });
}


function kolekcjaShow() 
{
    $("#kolekcjeWrap").addClass("kolekcjeOn");

    $("#blackBackground").css("display","block").css("opacity","0");

    setTimeout(function(){

	$("#mainMenu").find("#logo").animate({
	    top: "-60px"
	},500, function(){
	    $("#mainMenu").animate({
		top: "0px"
	    },1000)
	});

	var width  = 1600;
	var height = 550;
	var parentWidth  = $(window).width();
	var parentHeight = 550;

	if(width/parentWidth < height/parentHeight)
	{
	    newWidth  = parentWidth;
	    newHeight = newWidth/width*height;
	}
	else
	{
	    newHeight = parentHeight;
	    newWidth  = newHeight/height*width;
	}

	$("#kolekcjeImages").css("width",parentWidth);
	$("#kolekcjeImages").find("#kolekcjeImage1").css("width",newWidth).css("height",newHeight);

	$("#kolekcjeWrap").css("top",$(window).height()+"px").css("display","block").css("opacity","1");
	$("#kolekcje").css("display","block");
	$("#kolekcjeWrap").animate({
	    top: "550px"
	},1500);

	$("#whiteBackground").css("top",$(window).height()+"px").css("display","block").css("opacity","1").css("width",$(window).width()+"px");
	$("#whiteBackground").animate({
	    top: "550px"
	},1500, function(){
	    $("#mainBackground").fadeOut("600");
	    $("#kolekcjeImages").fadeIn("600");
	    $("#kolekcjeTopTekst").fadeIn("600");
	    $("#mainBackground").css("display","none");
	});																					 

	$("#kolekcjeNav").css("display","block");	

	cycleKolekcja();

    },500);

    if (glowna == 1) 
    {
	kolekcje = 1;
	glowna = 0;

	$("#mainBackground").cycle('stop');

	$("#blackBackground").animate({
	    opacity : 1
	},2000, function(){
	    $("#mainBackground").css("display","none");
	    $(this).css("display","none").css("opacity","0");
	});

    }
    else if (marka == 1) 
    {
	kolekcje = 1;
	marka = 0;

	$("#blackBackground").animate({
	    opacity : 1
	},2000, function(){
	    $(this).css("display","none").css("opacity","0");
	});

	$("#marka").animate({
	    opacity : 0
	},2000, function(){
	    $("#marka").css("display","none").css("opacity","1");
	    $("#markaLeftTop").css("opacity","0");
	    $("#markaRightTop").css("opacity","0");
	    $("#markaLeftBottom").css("opacity","0");
	    $("#markaRightBottom").css("opacity","0");
	});

	$("#markaBackground").animate({
	    opacity : 0
	},2000, function(){
	    $("#markaBackground").css("display","none");
	});

    }
    else if (salony == 1) 
    {
	salony = 0;
	kolekcje = 1;

	$("#blackBackground").animate({
	    opacity : 1
	},2000, function(){
	    $(this).css("display","none").css("opacity","0");
	});

	$("#salony").animate({
	    opacity : 0
	},1000, function(){
	    $("#salony").css("display","none").css("opacity","1");
	    $("#salonyLeft").css("opacity","0");
	    $("#salonyRight").css("opacity","0");
	    $("#salonyCenter").css("opacity","0");
	});

	$("#salonyBackground").animate({
	    opacity : 0
	},2000, function(){
	    $("#salonyBackground").css("display","none");
	});  																 
    }
    else if (b2b == 1) 
    {
	b2b = 0;
	kolekcje = 1;

	$("#blackBackground").animate({
	    opacity : 1
	},2000, function(){
	    $(this).css("display","none").css("opacity","0");
	});

	$("#b2b").animate({
	    opacity: '0'
	},1000, function(){
	    $("#b2b").css("display","none").css("opacity","1");
	    $("#b2bLeftTop").css("opacity","0");
	    $("#b2bRightTop").css("opacity","0");
	    $("#b2bLeftBottom").css("opacity","0");
	});

	$("#b2bBackground").animate({
	    opacity : 0
	},2000, function(){
	    $("#b2bBackground").css("display","none");
	});  
    }
    else if (strefa == 1) 
    {
	strefa = 0;
	kolekcje = 1;

	$("#blackBackground").animate({
	    opacity : 1
	},2000, function(){
	    $(this).css("display","none").css("opacity","0");
	});

	$("#strefa").animate({
	    opacity: '0'
	},1000, function(){
	    $("#strefa").css("display","none").css("opacity","1");
	    $("#strefaLeftTop").css("opacity","0");
	    $("#strefaRightTop").css("opacity","0");
	    $("#strefaLeftBottom").css("opacity","0");
	});

	$("#strefaBackground").animate({
	    opacity : 0
	},2000, function(){
	    $("#strefaBackground").css("display","none");
	});  
    }
    else if (kontakt == 1) 
    {
	kontakt = 0;
	kolekcje = 1;

	$("#blackBackground").animate({
	    opacity : 1
	},2000, function(){
	    $(this).css("display","none").css("opacity","0");
	});

	$("#kontakt").animate({
	    opacity: '0'
	},1000, function(){
	    $("#kontakt").css("display","none").css("opacity","1");
	    $("#kontaktLeftTop").css("opacity","0");
	    $("#kontaktRightTop").css("opacity","0");
	    $("#kontaktLeftBottom").css("opacity","0");
	    $("#kontaktRightBottom").css("opacity","0");
	});

	$("#kontaktBackground").animate({
	    opacity : 0
	},2000, function(){
	    $("#kontaktBackground").css("display","none");
	});  
    }
}


function markaShow() 
{
    $("#marka").css("display","none").css("opacity","1");
    $("#markaLeftTop").css("opacity","0");
    $("#markaRightTop").css("opacity","0");
    $("#markaLeftBottom").css("opacity","0");
    $("#markaRightBottom").css("opacity","0");

    var width  = 1600;
    var height = 931;
    var parentWidth  = $(window).width();
    var parentHeight = $(window).height();

    if(width/parentWidth < height/parentHeight)
    {
	newWidth  = parentWidth;
	newHeight = newWidth/width*height;
    }
    else
    {
	newHeight = parentHeight;
	newWidth  = newHeight/height*width;
    }
    $("#markaBackground").css("width",parentWidth).css("height",parentHeight).css("top","0px");
    $("#markaBackground").find("img").css("width",newWidth).css("height",newHeight);

    initSlider = function(){
	$("#markaTekst").adslider({
		buttons : 0,
		wheelscroll_step : 10,
		slider_size : "box"
	    });  
    }

    setTimeout(function(){  
	var parentHeight = $(window).height();
	$("#marka").css("display","block");
	$("#markaLeft").find("#markaTekst").css("height",parentHeight-336+"px");
	$("#markaTekst").adslider({
	    buttons : 0,
	    wheelscroll_step : 10,
	    slider_size : "box"
	}); 
	$("#markaLeftBottom").animate({
		opacity : '1'
	    },1000);
	setTimeout(function(){
	    $("#markaRightTop").animate({
		opacity : '1'
	     },1000);
	},500);
	setTimeout(function(){
	    $("#markaLeftTop").animate({
		opacity : '1'
	     },1000);
	},1000);
	setTimeout(function(){
	    $("#markaRightBottom").animate({
		opacity : '1'
	     },1000,function(){
		var width2 = $("#markaBackground").find("img").width()*1.05;
		var height2 = $("#markaBackground").find("img").height()*1.05;
		$("#markaBackground").find('img').animate({
		    width : width2,
		    height : height2
		},8000);
	    });
	    var contHeight = $("#aktualnosciContent").find(".shown").height();
	    var contWidth = $("#aktualnosciContent").find(".shown").width();
	    $("#contBg").css("height",contHeight+"px").css("width",contWidth+"px");
	    $(".aktualnosciContainer").css("top",contHeight+"px");
	    $("#aktualnosciContent").find(".shown").css("top","0px");
	},1500);
    },1000);

    if (glowna == 1) 
    {
	marka = 1;
	glowna = 0;

	$("#mainBackground").cycle('stop');

	setTimeout(function(){																					 
	    $("#mainMenu").find("#logo").animate({
		top: "-60px"
	    },500, function(){
		$("#mainMenu").animate({
		    top: "0px"
		},1000);
	    });																					 																					 																				 
	},500);		

	$("#markaBackground").css("display","block").css("opacity","0");
	$("#markaBackground").animate({
	    opacity : 1
	},2000, function(){
	    $("#mainBackground").css("display","none");
	});

    }
    else if (kolekcje == 1) 
    {
	kolekcje = 0;
	marka = 1;

	var szer = $(window).width();
	var poza = (szer-980)/2 + 980;
	var parentHeight  = $(window).height();

	$("#whiteBackground").animate({
	    top: parentHeight+"px"
	},1500);

	$("#markaBackground").css("display","block").css("opacity","0");
	$("#markaBackground").animate({
	    opacity : 1
	},2000);

	var kolekcjeOn = 0;
	var weddingOn = 0;
	var casualOn = 0;
	if ($("#kolekcjeWrap").hasClass("kolekcjeOn")) 
	{
	    var kolekcjeOn = 1;
	    $("#kolekcjeWrap").removeClass("kolekcjeOn");
	    $("#kolekcjeImages").fadeOut("600");
	    $("#kolekcjeTopTekst").fadeOut("600");
	    $("#kolekcjeWrap").fadeOut("slow");
	    $("#kolekcjeWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#kolekcjeImages").cycle('stop');
	    $("#kolekcjeNav").css("display","none");
	}
	else if ($("#weddingWrap").hasClass("kolekcjeOn")) 
	{
	    var weddingOn = 1;
	    $("#weddingWrap").removeClass("kolekcjeOn");
	    $("#weddingImages").fadeOut("600");
	    $("#weddingTopTekst").fadeOut("600");
	    $("#weddingWrap").fadeOut("slow");
	    $("#weddingWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#weddingImages").cycle('stop');
	    $("#weddingNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");

	}
	else if ($("#casualWrap").hasClass("kolekcjeOn")) 
	{
	    var casualOn = 1;
	    $("#casualWrap").removeClass("kolekcjeOn");
	    $("#casualImages").fadeOut("600");
	    $("#casualTopTekst").fadeOut("600");
	    $("#casualWrap").fadeOut("slow");
	    $("#casualWrap").animate({
		top: parentHeight+"px"
	    },2000, function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#casualImages").cycle('stop');
	    $("#casualNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");
	}			  
    }
    else if (salony == 1) 
    {
	salony = 0;
	marka = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#markaBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#salonyBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#salony").animate({
	    opacity : 0
	},1000, function(){
	    $("#salony").css("display","none").css("opacity","1");
	    $("#salonyLeft").css("opacity","0");
	    $("#salonyRight").css("opacity","0");
	    $("#salonyCenter").css("opacity","0");
	});
    }
    else if (b2b == 1) 
    {
	b2b = 0;
	marka = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#markaBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#b2bBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#b2b").animate({
	    opacity: '0'
	},1000, function(){
	    $("#b2b").css("display","none").css("opacity","1");
	    $("#b2bLeftTop").css("opacity","0");
	    $("#b2bRightTop").css("opacity","0");
	    $("#b2bLeftBottom").css("opacity","0");
	});
    }
    else if (strefa == 1) 
    {
	strefa = 0;
	marka = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#markaBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#strefaBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#strefa").animate({
	    opacity: '0'
	},1000, function(){
	    $("#strefa").css("display","none").css("opacity","1");
	    $("#strefaLeftTop").css("opacity","0");
	    $("#strefaRightTop").css("opacity","0");
	    $("#strefaLeftBottom").css("opacity","0");
	});
    }
    else if (kontakt == 1) 
    {
	kontakt = 0;
	marka = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#markaBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#kontaktBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#kontakt").animate({
	    opacity: '0'
	},1000, function(){
	    $("#kontakt").css("display","none").css("opacity","1");
	    $("#kontaktLeftTop").css("opacity","0");
	    $("#kontaktRightTop").css("opacity","0");
	    $("#kontaktLeftBottom").css("opacity","0");
	    $("#kontaktRightBottom").css("opacity","0");
	}); 
    }
}


function salonyShow() 
{
    $("#salonyLeft").css("opacity","0");
    $("#salonyRight").css("opacity","0");
    $("#salonyCenter").css("opacity","0");
    $("#salony").css("display","block").css("opacity","1");

    var width  = 1600;
    var height = 931;
    var parentWidth  = $(window).width();
    var parentHeight = $(window).height();

    if(width/parentWidth < height/parentHeight)
    {
	newWidth  = parentWidth;
	newHeight = newWidth/width*height;
    }
    else
    {
	newHeight = parentHeight;
	newWidth  = newHeight/height*width;
    }

    $("#salonyBackground").css("width",parentWidth).css("height",parentHeight);
    $("#salonyBackground").find("img").css("width",newWidth).css("height",newHeight);

    setTimeout(function(){	
	$("#salonyLeft").animate({
	    opacity : '1'
	},1000);
	setTimeout(function(){
	    $("#salonyCenter").animate({
		opacity : '1'
	     },1000);
	},500);
	setTimeout(function(){
	    $("#salonyRight").animate({
		opacity : '1'
	     },1000,function(){
		var width2 = $("#salonyBackground").find("img").width()*1.05;
		var height2 = $("#salonyBackground").find("img").height()*1.05;
		$("#salonyBackground").find('img').animate({
		    width : width2,
		    height : height2
		},8000);

		if (mapaOk == 0) 
		{
		    mapaOk = 1;

		    var myLatlng = new google.maps.LatLng(52.465423,18.986092);
		    var myOptions = {
			zoom: 5,
			center: myLatlng,
			mapTypeId: google.maps.MapTypeId.ROADMAP
		    }
		    map = new google.maps.Map(document.getElementById("map_div"), myOptions);

		    var image = new google.maps.MarkerImage('templates/images/marker.png',
			new google.maps.Size(43, 48),
			new google.maps.Point(0,0),
			new google.maps.Point(18, 42)
		    );

		    var pos1 = new google.maps.LatLng(54.318926,18.55123);
		    var pos2 = new google.maps.LatLng(52.560686,17.6125)
		    var pos3 = new google.maps.LatLng(51.878251,17.013719);
		    var pos5 = new google.maps.LatLng(50.028227,19.95144);
		    var pos6 = new google.maps.LatLng(51.69599,17.437449);
		    var pos7 = new google.maps.LatLng(52.316835,16.13187);
		    var pos8 = new google.maps.LatLng(50.668958,17.922549);
		    var pos9 = new google.maps.LatLng(51.649878,17.81736);
		    var pos10 = new google.maps.LatLng(52.534407,19.758182);
		    var pos11 = new google.maps.LatLng(51.609629,16.855581);
		    var pos12 = new google.maps.LatLng(52.655382,19.064247);
		    var pos13 = new google.maps.LatLng(50.311551,18.787497);
		    var pos14 = new google.maps.LatLng(52.353652,16.88869);
		    var pos15 = new google.maps.LatLng(51.842457,16.575077);
		    var pos16 = new google.maps.LatLng(51.827503,16.600106);
		    var pos17 = new google.maps.LatLng(52.441284,16.919053);
		    var pos18 = new google.maps.LatLng(52.410666,16.861525);
		    var pos19 = new google.maps.LatLng(51.9399,15.507181);
		    var pos20 = new google.maps.LatLng(51.936473,15.511537);
		    var pos21 = new google.maps.LatLng(49.749518,18.629004);
		    var pos22 = new google.maps.LatLng(54.187176,19.404473);
		    var pos23 = new google.maps.LatLng(51.970519,17.500766);
		    var pos24 = new google.maps.LatLng(50.681961,17.877729);
		    var pos25 = new google.maps.LatLng(50.940231,21.378011);
		    var pos26 = new google.maps.LatLng(52.229246,17.279123);
		    var pos27 = new google.maps.LatLng(50.041244,21.00307);
		    var pos28 = new google.maps.LatLng(50.106598,19.84924);
		    var pos29 = new google.maps.LatLng(50.028682,22.012213);
		    
		    
		    

		    var positions = new Array(pos1,pos2,pos3,pos5,pos6,pos7,pos8,pos9,pos10,pos11,pos12,pos13,pos14,pos15,pos16,pos17,pos18,pos19,pos20,pos21,pos22,pos23,pos24,pos25,pos26,pos27,pos28,pos29);

		    setTimeout(function(){

			var i = 0;
			var inter =  setInterval(function(){
			    marker1 = new google.maps.Marker({
				position: positions[i],
				map: map,
				icon: image
			    });
			    i++;
			    if (i > 29) 
			    {
				clearInterval(inter);
			    }
			},200);

		    },1000);
		}
	    });
	},1000);
    },1000);	    

    if (glowna == 1) 
    {
	salony = 1;
	glowna = 0;

	$("#mainBackground").cycle('stop');

	setTimeout(function(){																					 
	    $("#mainMenu").find("#logo").animate({
		top: "-60px"
	    },500, function(){
		$("#mainMenu").animate({
		    top: "0px"
		},1000);
	    });																					 																					 																				 
	},500);

	$("#salonyBackground").css("display","block").css("opacity","0").css("top","0px");
	$("#salonyBackground").animate({
	    opacity : 1
	},2000, function(){
	    $("#mainBackground").css("display","none");
	});																	
    }
    else if (kolekcje == 1) 
    {
	kolekcje = 0;
	salony = 1;

	var szer = $(window).width();
	var poza = (szer-980)/2 + 980;
	var parentHeight  = $(window).height();

	$("#whiteBackground").css("z-index","170").animate({
	    top: parentHeight+"px"
	},1500);

	$("#salonyBackground").css("display","block").css("top","0px").css("opacity","0");
	$("#salonyBackground").animate({
	    opacity : 1
	},2000);

	var kolekcjeOn = 0;
	var weddingOn = 0;
	var casualOn = 0;
	if ($("#kolekcjeWrap").hasClass("kolekcjeOn")) 
	{
	    var kolekcjeOn = 1;
	    $("#kolekcjeWrap").removeClass("kolekcjeOn");
	    $("#kolekcjeImages").fadeOut("600");
	    $("#kolekcjeTopTekst").fadeOut("600");
	    $("#kolekcjeWrap").fadeOut("slow");
	    $("#kolekcjeWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#kolekcjeImages").cycle('stop');
	    $("#kolekcjeNav").css("display","none");
	}
	else if ($("#weddingWrap").hasClass("kolekcjeOn")) 
	{
	    var weddingOn = 1;
	    $("#weddingWrap").removeClass("kolekcjeOn");
	    $("#weddingImages").fadeOut("600");
	    $("#weddingTopTekst").fadeOut("600");
	    $("#weddingWrap").fadeOut("slow");
	    $("#weddingWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#weddingImages").cycle('stop');
	    $("#weddingNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");

	}
	else if ($("#casualWrap").hasClass("kolekcjeOn")) 
	{
	    var casualOn = 1;
	    $("#casualWrap").removeClass("kolekcjeOn");
	    $("#casualImages").fadeOut("600");
	    $("#casualTopTekst").fadeOut("600");
	    $("#casualWrap").fadeOut("slow");
	    $("#casualWrap").animate({
		top: parentHeight+"px"
	    },2000, function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#casualImages").cycle('stop');
	    $("#casualNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");
	}			  

    }
    else if (marka == 1) 
    {
	marka = 0;
	salony = 1;

	$("#marka").animate({
	    opacity : 0
	},1000, function(){
	    $("#marka").css("display","none").css("opacity","1");
	    $("#markaLeftTop").css("opacity","0");
	    $("#markaRightTop").css("opacity","0");
	    $("#markaLeftBottom").css("opacity","0");
	    $("#markaRightBottom").css("opacity","0");
	});

	var parentHeight  = $(window).height();

	$("#markaBackground").css("z-index","150").css("top","0px");														
	$("#salonyBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#salonyBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#markaBackground").css("display","none");
	});
     }
     else if (b2b == 1) 
     {
	b2b = 0;
	salony = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#b2b").animate({
	    opacity: '0'
	},500, function(){
	    $("#b2b").css("display","none").css("opacity","1");
	    $("#b2bLeftTop").css("opacity","0");
	    $("#b2bRightTop").css("opacity","0");
	    $("#b2bLeftBottom").css("opacity","0");
	});
	$("#b2bBackground").css("z-index","150").css("top","0px");
	$("#salonyBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#salonyBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#b2bBackground").css("display","none");
	});  
     }
     else if (strefa == 1) 
     {
	strefa = 0;
	salony = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#strefa").animate({
	    opacity: '0'
	},500, function(){
	    $("#strefa").css("display","none").css("opacity","1");
	    $("#strefaLeftTop").css("opacity","0");
	    $("#strefaRightTop").css("opacity","0");
	    $("#strefaLeftBottom").css("opacity","0");
	});

	$("#strefaBackground").css("z-index","150").css("top","0px");
	$("#salonyBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#salonyBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#strefaBackground").css("display","none");
	});  
     }
     else if (kontakt == 1) 
     {
	kontakt = 0;
	salony = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#kontakt").animate({
	    opacity: '0'
	},1000, function(){
	    $("#kontakt").css("display","none").css("opacity","1");
	    $("#kontaktLeftTop").css("opacity","0");
	    $("#kontaktRightTop").css("opacity","0");
	    $("#kontaktLeftBottom").css("opacity","0");
	    $("#kontaktRightBottom").css("opacity","0");
	}); 
	$("#kontaktBackground").css("z-index","150").css("top","0px");
	$("#salonyBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#salonyBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#kontaktBackground").css("display","none");
	});  
    }
}

function b2bShow() 
{
    $("#b2bLeftTop").css("opacity","0");
    $("#b2bRightTop").css("opacity","0");
    $("#b2bLeftBottom").css("opacity","0");
    $("#b2b").css("display","block").css("opacity","1");

    var width  = 1600;
    var height = 931;
    var parentWidth  = $(window).width();
    var parentHeight = $(window).height();

    if(width/parentWidth < height/parentHeight)
    {
	newWidth  = parentWidth;
	newHeight = newWidth/width*height;
    }
    else
    {
	newHeight = parentHeight;
	newWidth  = newHeight/height*width;
    }

    $("#b2bBackground").css("width",parentWidth).css("height",parentHeight);
    $("#b2bBackground").find("img").css("width",newWidth).css("height",newHeight);


    initSlider = function(){
	$("#b2bTekst").adslider({
		buttons : 0,
		wheelscroll_step : 10,
		slider_size : "box"
	    });  
    }
	
	
    setTimeout(function(){	
	var parentHeight = $(window).height();
	$("#b2b").css("display","block");
	if ($("#b2bLeft").find("#b2bTekst").height() > parentHeight-336) 
	{
	    $("#b2bLeft").find("#b2bTekst").css("height",parentHeight-336+"px");
	}
	//$("#b2bLeft").find("#b2bTekst").css("height",parentHeight-356+"px");
	$("#b2bTekst").adslider({
	    buttons : 0,
	    wheelscroll_step : 10,
	    slider_size : "box"
	}); 
	
	$("#b2bLeftBottom").animate({
	    opacity : '1'
	},1000);
	setTimeout(function(){
	    $("#b2bRightTop").animate({
		opacity : '1'
	     },1000);
	},500);
	setTimeout(function(){
	    $("#b2bLeftTop").animate({
		opacity : '1'
	     },1000,function(){
		var width2 = $("#b2bBackground").find("img").width()*1.05;
		var height2 = $("#b2bBackground").find("img").height()*1.05;
		$("#b2bBackground").find('img').animate({
		    width : width2,
		    height : height2
		},8000);

	    });
	},1000);
    },1000);

    if (glowna == 1) 
    {
	b2b = 1;
	glowna = 0;

	$("#mainBackground").cycle('stop');

	setTimeout(function(){																					 
	    $("#mainMenu").find("#logo").animate({
		top: "-60px"
	    },500, function(){
		$("#mainMenu").animate({
		    top: "0px"
		},1000);
	    });																					 																					 																				 
	},500);

	$("#b2bBackground").css("display","block").css("opacity","0").css("top","0px");
	$("#b2bBackground").animate({
	    opacity : 1
	},2000, function(){
	    $("#mainBackground").css("display","none");
	});			
    }
    else if (kolekcje == 1) 
    {
	kolekcje = 0;
	b2b = 1;

	var szer = $(window).width();
	var poza = (szer-980)/2 + 980;
	var parentHeight  = $(window).height();

	$("#whiteBackground").animate({
	    top: parentHeight+"px"
	},1500);

	$("#b2bBackground").css("display","block").css("top","0px").css("opacity","0");
	$("#b2bBackground").animate({
	    opacity : 1
	},2000);

	var kolekcjeOn = 0;
	var weddingOn = 0;
	var casualOn = 0;
	if ($("#kolekcjeWrap").hasClass("kolekcjeOn")) 
	{
	    var kolekcjeOn = 1;
	    $("#kolekcjeWrap").removeClass("kolekcjeOn");
	    $("#kolekcjeImages").fadeOut("600");
	    $("#kolekcjeTopTekst").fadeOut("600");
	    $("#kolekcjeWrap").fadeOut("slow");
	    $("#kolekcjeWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#kolekcjeImages").cycle('stop');
	    $("#kolekcjeNav").css("display","none");
	}
	else if ($("#weddingWrap").hasClass("kolekcjeOn")) 
	{
	    var weddingOn = 1;
	    $("#weddingWrap").removeClass("kolekcjeOn");
	    $("#weddingImages").fadeOut("600");
	    $("#weddingTopTekst").fadeOut("600");
	    $("#weddingWrap").fadeOut("slow");
	    $("#weddingWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#weddingImages").cycle('stop');
	    $("#weddingNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");

	}
	else if ($("#casualWrap").hasClass("kolekcjeOn")) 
	{
	    var casualOn = 1;
	    $("#casualWrap").removeClass("kolekcjeOn");
	    $("#casualImages").fadeOut("600");
	    $("#casualTopTekst").fadeOut("600");
	    $("#casualWrap").fadeOut("slow");
	    $("#casualWrap").animate({
		top: parentHeight+"px"
	    },2000, function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#casualImages").cycle('stop');
	    $("#casualNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");
	}			  
    }
    else if (marka == 1) 
    {
	marka = 0;
	b2b = 1;

	$("#marka").animate({
	    opacity : 0
	},1000, function(){
	    $("#marka").css("display","none").css("opacity","1");
	    $("#markaLeftTop").css("opacity","0");
	    $("#markaRightTop").css("opacity","0");
	    $("#markaLeftBottom").css("opacity","0");
	    $("#markaRightBottom").css("opacity","0");
	});

	var parentHeight  = $(window).height();

	$("#markaBackground").css("z-index","150").css("top","0px");																
	$("#b2bBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#b2bBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#markaBackground").css("display","none");
	});

     }
     else if (salony == 1) 
     {
	salony = 0;
	b2b = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#b2bBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#salonyBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#salony").animate({
	    opacity : 0
	},1000, function(){
	    $("#salony").css("display","none").css("opacity","1");
	    $("#salonyLeft").css("opacity","0");
	    $("#salonyRight").css("opacity","0");
	    $("#salonyCenter").css("opacity","0");
	});
     }
     else if (strefa == 1) 
     {
	strefa = 0;
	b2b = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#b2bBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#strefaBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#strefa").animate({
	    opacity: '0'
	},500, function(){
	    $("#strefa").css("display","none").css("opacity","1");
	    $("#strefaLeftTop").css("opacity","0");
	    $("#strefaRightTop").css("opacity","0");
	    $("#strefaLeftBottom").css("opacity","0");
	});
     }
     else if (kontakt == 1) 
    {
	kontakt = 0;
	b2b = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#b2bBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#kontaktBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#kontakt").animate({
	    opacity: '0'
	},1000, function(){
	    $("#kontakt").css("display","none").css("opacity","1");
	    $("#kontaktLeftTop").css("opacity","0");
	    $("#kontaktRightTop").css("opacity","0");
	    $("#kontaktLeftBottom").css("opacity","0");
	    $("#kontaktRightBottom").css("opacity","0");
	}); 
    }
}

function strefaShow() 
{
    $("#strefaLeftTop").css("opacity","0");
    $("#strefaRightTop").css("opacity","0");
    $("#strefaLeftBottom").css("opacity","0");
    $("#strefa").css("display","block").css("opacity","1");

    var width  = 1600;
    var height = 931;
    var parentWidth  = $(window).width();
    var parentHeight = $(window).height();

    if(width/parentWidth < height/parentHeight)
    {
	newWidth  = parentWidth;
	newHeight = newWidth/width*height;
    }
    else
    {
	newHeight = parentHeight;
	newWidth  = newHeight/height*width;
    }

    $("#strefaBackground").css("width",parentWidth).css("height",parentHeight);
    $("#strefaBackground").find("img").css("width",newWidth).css("height",newHeight);
    
    $("#strefaCycle").cycle({
			fx: 'fade',
			speed : 1000,
			timeout: 6000
		});

    setTimeout(function(){	
	$("#strefaLeftBottom").animate({
	    opacity : '1'
	},1000);
	setTimeout(function(){
	    $("#strefaRightTop").animate({
		opacity : '1'
	     },1000);
	},500);
	setTimeout(function(){
	    $("#strefaLeftTop").animate({
		opacity : '1'
	     },1000,function(){
		var width2 = $("#strefaBackground").find("img").width()*1.05;
		var height2 = $("#strefaBackground").find("img").height()*1.05;
		$("#strefaBackground").find('img').animate({
		    width : width2,
		    height : height2
		},8000);
		
	     });
	},1000);
    },1000);

    if (glowna == 1) 
    {
	strefa = 1;
	glowna = 0;

	$("#mainBackground").cycle('stop');

	setTimeout(function(){																					 
	    $("#mainMenu").find("#logo").animate({
		top: "-60px"
	    },500, function(){
		$("#mainMenu").animate({
		    top: "0px"
		},1000);
	    });																					 																					 																				 
	},500);

	$("#strefaBackground").css("display","block").css("opacity","0").css("top","0px");
	$("#strefaBackground").animate({
	    opacity : 1
	},2000, function(){
	    $("#mainBackground").css("display","none");
	});																	

    }
    else if (kolekcje == 1) 
    {
	kolekcje = 0;
	strefa = 1;

	var szer = $(window).width();
	var poza = (szer-980)/2 + 980;
	var parentHeight  = $(window).height();

	$("#whiteBackground").animate({
	    top: parentHeight+"px"
	},1500);

	$("#strefaBackground").css("display","block").css("top","0px").css("opacity","0");
	$("#strefaBackground").animate({
	    opacity : 1
	},2000);

	var kolekcjeOn = 0;
	var weddingOn = 0;
	var casualOn = 0;
	if ($("#kolekcjeWrap").hasClass("kolekcjeOn")) 
	{
	    var kolekcjeOn = 1;
	    $("#kolekcjeWrap").removeClass("kolekcjeOn");
	    $("#kolekcjeImages").fadeOut("600");
	    $("#kolekcjeTopTekst").fadeOut("600");
	    $("#kolekcjeWrap").fadeOut("slow");
	    $("#kolekcjeWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#kolekcjeImages").cycle('stop');
	    $("#kolekcjeNav").css("display","none");
	}
	else if ($("#weddingWrap").hasClass("kolekcjeOn")) 
	{
	    var weddingOn = 1;
	    $("#weddingWrap").removeClass("kolekcjeOn");
	    $("#weddingImages").fadeOut("600");
	    $("#weddingTopTekst").fadeOut("600");
	    $("#weddingWrap").fadeOut("slow");
	    $("#weddingWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#weddingImages").cycle('stop');
	    $("#weddingNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");

	}
	else if ($("#casualWrap").hasClass("kolekcjeOn")) 
	{
	    var casualOn = 1;
	    $("#casualWrap").removeClass("kolekcjeOn");
	    $("#casualImages").fadeOut("600");
	    $("#casualTopTekst").fadeOut("600");
	    $("#casualWrap").fadeOut("slow");
	    $("#casualWrap").animate({
		top: parentHeight+"px"
	    },2000, function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#casualImages").cycle('stop');
	    $("#casualNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");
	}			  

    }
    else if (marka == 1) 
    {
	marka = 0;
	strefa = 1;

	$("#marka").animate({
	    opacity : 0
	},1000, function(){
	    $("#marka").css("display","none").css("opacity","1");
	    $("#markaLeftTop").css("opacity","0");
	    $("#markaRightTop").css("opacity","0");
	    $("#markaLeftBottom").css("opacity","0");
	    $("#markaRightBottom").css("opacity","0");
	});

	var parentHeight  = $(window).height();

	$("#markaBackground").css("z-index","150");															
	$("#strefaBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#strefaBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#markaBackground").css("display","none");
	});

     }
     else if (salony == 1) 
     {
	salony = 0;
	strefa = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#strefaBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#salonyBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#salony").animate({
	    opacity : 0
	},1000, function(){
	    $("#salony").css("display","none").css("opacity","1");
	    $("#salonyLeft").css("opacity","0");
	    $("#salonyRight").css("opacity","0");
	    $("#salonyCenter").css("opacity","0");
	});
     }
     else if (b2b == 1) 
     {
	b2b = 0;
	strefa = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#b2b").animate({
	    opacity: '0'
	},500, function(){
	    $("#b2b").css("display","none").css("opacity","1");
	    $("#b2bLeftTop").css("opacity","0");
	    $("#b2bRightTop").css("opacity","0");
	    $("#b2bLeftBottom").css("opacity","0");
	});

	$("#b2bBackground").css("z-index","150");
	$("#strefaBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#strefaBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#b2bBackground").css("display","none");
	});  
     }
     else if (kontakt == 1) 
    {
	kontakt = 0;
	strefa = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#kontakt").animate({
	    opacity: '0'
	},1000, function(){
	    $("#kontakt").css("display","none").css("opacity","1");
	    $("#kontaktLeftTop").css("opacity","0");
	    $("#kontaktRightTop").css("opacity","0");
	    $("#kontaktLeftBottom").css("opacity","0");
	    $("#kontaktRightBottom").css("opacity","0");
	}); 
	$("#kontaktBackground").css("z-index","150");
	$("#strefaBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#strefaBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#kontaktBackground").css("display","none");
	});
    }
}


function kontaktShow() 
{
    $("#kontaktLeftTop").css("opacity","0");
    $("#kontaktRightTop").css("opacity","0");
    $("#kontaktLeftBottom").css("opacity","0");
    $("#kontaktRightBottom").css("opacity","0");
    $("#kontakt").css("display","block").css("opacity","1");

    var width  = 1600;
    var height = 931;
    var parentWidth  = $(window).width();
    var parentHeight = $(window).height();

    if(width/parentWidth < height/parentHeight)
    {
	newWidth  = parentWidth;
	newHeight = newWidth/width*height;
    }
    else
    {
	newHeight = parentHeight;
	newWidth  = newHeight/height*width;
    }

    $("#kontaktBackground").css("width",parentWidth).css("height",parentHeight).css("top","0px").css("display","block");
    $("#kontaktBackground").find("img").css("width",newWidth).css("height",newHeight);

    setTimeout(function(){	
	$("#kontaktLeftBottom").animate({
	    opacity : '1'
	},1000);
	setTimeout(function(){
	    $("#kontaktRightTop").animate({
		opacity : '1'
	     },1000);
	},500);
	setTimeout(function(){
	    $("#kontaktLeftTop").animate({
		opacity : '1'
	     },1000);
	},1000);
	setTimeout(function(){
	    $("#kontaktRightBottom").animate({
		opacity : '1'
	     },1000, function(){
		var width2 = $("#kontaktBackground").find("img").width()*1.05;
		var height2 = $("#kontaktBackground").find("img").height()*1.05;
		$("#kontaktBackground").find('img').animate({
		    width : width2,
		    height : height2
		},8000);
	     });
	},1500);
    },1000);

    if (glowna == 1) 
    {
	kontakt = 1;
	glowna = 0;

	$("#mainBackground").cycle('stop');

	setTimeout(function(){																					 
	    $("#mainMenu").find("#logo").animate({
		top: "-60px"
	    },500, function(){
		$("#mainMenu").animate({
		    top: "0px"
		},1000);
	    });																					 																					 																				 
	},500);

	$("#kontaktBackground").css("display","block").css("opacity","0").css("top","0px");
	$("#kontaktBackground").animate({
	    opacity : 1
	},2000, function(){
	    $("#mainBackground").css("display","none");
	});																	

    }
    else if (kolekcje == 1) 
    {
	kolekcje = 0;
	kontakt = 1;

	var szer = $(window).width();
	var poza = (szer-980)/2 + 980;
	var parentHeight  = $(window).height();

	$("#whiteBackground").animate({
	    top: parentHeight+"px"
	},1500);

	$("#kontaktBackground").css("display","block").css("top","0px").css("opacity","0");
	$("#kontaktBackground").animate({
	    opacity : 1
	},2000);

	var kolekcjeOn = 0;
	var weddingOn = 0;
	var casualOn = 0;
	if ($("#kolekcjeWrap").hasClass("kolekcjeOn")) 
	{
	    var kolekcjeOn = 1;
	    $("#kolekcjeWrap").removeClass("kolekcjeOn");
	    $("#kolekcjeImages").fadeOut("600");
	    $("#kolekcjeTopTekst").fadeOut("600");
	    $("#kolekcjeWrap").fadeOut("slow");
	    $("#kolekcjeWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#kolekcjeImages").cycle('stop');
	    $("#kolekcjeNav").css("display","none");
	}
	else if ($("#weddingWrap").hasClass("kolekcjeOn")) 
	{
	    var weddingOn = 1;
	    $("#weddingWrap").removeClass("kolekcjeOn");
	    $("#weddingImages").fadeOut("600");
	    $("#weddingTopTekst").fadeOut("600");
	    $("#weddingWrap").fadeOut("slow");
	    $("#weddingWrap").animate({
		top: parentHeight+"px"
	    },2000,function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#weddingImages").cycle('stop');
	    $("#weddingNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");

	}
	else if ($("#casualWrap").hasClass("kolekcjeOn")) 
	{
	    var casualOn = 1;
	    $("#casualWrap").removeClass("kolekcjeOn");
	    $("#casualImages").fadeOut("600");
	    $("#casualTopTekst").fadeOut("600");
	    $("#casualWrap").fadeOut("slow");
	    $("#casualWrap").animate({
		top: parentHeight+"px"
	    },2000, function(){
		$('#kolekcjeWrap').css("left","0").css("top",parentHeight+"px");
		$('#casualWrap').css("top","550px").css("left",-poza+"px");
		$('#weddingWrap').css("top","550px").css("left",-poza+"px");
	    });
	    $("#casualImages").cycle('stop');
	    $("#casualNav").css("display","none");
	    $("#kolekcjeNav").css("display","none");
	}			  

    }
    else if (marka == 1) 
    {
	marka = 0;
	kontakt = 1;

	$("#marka").animate({
	    opacity : 0
	},1000, function(){
	    $("#marka").css("display","none").css("opacity","1");
	    $("#markaLeftTop").css("opacity","0");
	    $("#markaRightTop").css("opacity","0");
	    $("#markaLeftBottom").css("opacity","0");
	    $("#markaRightBottom").css("opacity","0");
	});

	var parentHeight  = $(window).height();
	$("#markaBackground").css("z-index","150");																
	$("#kontaktBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#kontaktBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#markaBackground").css("display","none");
	});

     }
     else if (salony == 1) 
     {
	salony = 0;
	kontakt = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#kontaktBackground").css("display","block").css("opacity","1").css("z-index","150").css("top","0px");
	$("#salonyBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#salony").animate({
	    opacity : 0
	},1000, function(){
	    $("#salony").css("display","none").css("opacity","1");
	    $("#salonyLeft").css("opacity","0");
	    $("#salonyRight").css("opacity","0");
	    $("#salonyCenter").css("opacity","0");
	});
     }
     else if (b2b == 1) 
     {
	b2b = 0;
	kontakt = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#b2b").animate({
	    opacity: '0'
	},500, function(){
	    $("#b2b").css("display","none").css("opacity","1");
	    $("#b2bLeftTop").css("opacity","0");
	    $("#b2bRightTop").css("opacity","0");
	    $("#b2bLeftBottom").css("opacity","0");
	});
	$("#b2bBackground").css("z-index","150");
	$("#kontaktBackground").css("display","block").css("top",-parentHeight+"px").css("opacity","1").css("z-index","170");
	$("#kontaktBackground").animate({
	    top : "0px"
	},2000, function(){
	    $("#b2bBackground").css("display","none");
	});  
     }
     else if (strefa == 1) 
     {
	strefa = 0;
	kontakt = 1;

	var parentWidth  = $(window).width();
	var parentHeight = $(window).height();

	$("#kontaktBackground").css("display","block").css("opacity","1").css("z-index","150");
	$("#strefaBackground").css("z-index","170").animate({
	       top: -parentHeight+"px"
	},2000);

	$("#strefa").animate({
	    opacity: '0'
	},500, function(){
	    $("#strefa").css("display","none").css("opacity","1");
	    $("#strefaLeftTop").css("opacity","0");
	    $("#strefaRightTop").css("opacity","0");
	    $("#strefaLeftBottom").css("opacity","0");
	});
     }
}
