var setBullets = function(){
	i = 1;
	$(".fotoBigFaderBullets").children().each(function(){
		$(this).attr("id", "bullet_"+i);
		$(this).attr("title", i);
		if (i==1)
			$(this).addClass("active");
		else
			$(this).addClass("inactive");
		i++;
	});
}
var setMenuEvents = function() {
	$(".menu div").bind("mouseover", function(){
		switch ( $(this).attr("title") ){
			case "Home":
				$(".menuCurrentPage").animate({"margin-left": "26px"}, "fast");
			break;
			case "Colectii":
				$(".menuCurrentPage").animate({"margin-left": "125px"}, "fast");
			break;
			case "Miresele Noastre":
				$(".menuCurrentPage").animate({"margin-left": "260px"}, "fast");
			break;
			case "Contul Meu":
				$(".menuCurrentPage").animate({"margin-left": "420px"}, "fast");
			break;
			case "Blog":
				$(".menuCurrentPage").animate({"margin-left": "530px"}, "fast");
			break;
			case "Contact":
				$(".menuCurrentPage").animate({"margin-left": "620px"}, "fast");
			break;
			case "Carte de Oaspeti":
				$(".menuCurrentPage").animate({"margin-left": "760px"}, "fast");
			break;
		}
	});
	$(".menu div").bind("click", function(){
		switch ( $(this).attr("title") ){
			case "Home":
				document.location = '/';
			break;
			case "Colectii":
				document.location = '/colectii.html';
			break;
			case "Miresele Noastre":
				document.location = '/miresele_noastre.html';
			break;
			case "Contul Meu":
				document.location = '/contul_meu.html';
			break;
			case "Blog":
				document.location = 'http://aristocratboutique.blogspot.com/';
			break;
			case "Contact":
				document.location = '/contact.html';
			break;
			case "Carte de Oaspeti":
				document.location = '/carte_de_oaspeti.html';
			break;
		}
	});
}

var calculateFormHeight = function()
{
	rowHeight = 203;
	cHeight = $(".homeSubcontainer").height();
	cRows = cHeight/rowHeight;
	cRows = Math.ceil(cRows);
	$(".homeSubcontainer").height(cRows*rowHeight);
}

var mountContactShape = function(){
    var windowWidth = $(window).width();
    var windowHeight = $(window).height();
    var leftMargin = (windowWidth - 980)/2;
    $(".contactShape").css("left", Math.round(leftMargin)+980);
    $(".contactShape").css("top", windowHeight-126);
    setTimeout("mountContactShape()", 100);
}

var controlLoginFRM = function(){
	if ( $("#loginFRM").css("display") == "none" )
		$("#loginFRM").show("slow");
	else
		$("#loginFRM").hide("slow");
}

currentBannerHeader = 0;
var mountHeaderBanner = function(){
	if (document.getElementById('banner_header_1'))
	{
		childNodes = $("#banner_header_0").parent().children().length;
		nextBannerHeader = currentBannerHeader+1;

		if (!document.getElementById("banner_header_"+nextBannerHeader))
			nextBannerHeader = 0;

		$("#banner_header_"+currentBannerHeader).fadeOut("slow", function(){
			$("#banner_header_"+nextBannerHeader).fadeIn("slow");
		});

		currentBannerHeader = nextBannerHeader;

		setTimeout("mountHeaderBanner()", 7000);
	}
}

currentBannerLeft = 0;
var mountLeftBanner = function(){
	if (document.getElementById('banner_left_1'))
	{
		childNodes = $("#banner_left_0").parent().children().length;

		nextBannerLeft = currentBannerLeft+1;

		if (!document.getElementById("banner_left_"+nextBannerLeft))
			nextBannerLeft = 0;

		$("#banner_left_"+currentBannerLeft).fadeOut("slow", function(){
			$("#banner_left_"+nextBannerLeft).fadeIn("slow");
		});

		currentBannerLeft = nextBannerLeft;

		setTimeout("mountLeftBanner()", 7000);
	}
}


currentBannerFooter = 0;
var mountFooterBanner = function(){
	if (document.getElementById('banner_footer_1'))
	{
		childNodes = $("#banner_footer_0").parent().children().length;

		nextBannerFooter = currentBannerFooter+1;

		if (!document.getElementById("banner_footer_"+nextBannerFooter))
			nextBannerFooter = 0;

		$("#banner_footer_"+currentBannerFooter).fadeOut("slow", function(){
			$("#banner_footer_"+nextBannerFooter).fadeIn("slow");
		});

		currentBannerFooter = nextBannerFooter;

		setTimeout("mountFooterBanner()", 7000);
	}
}

var toggleFilter = function(ctrl, id){
	if ($("#"+ctrl).css("display")=="none")
	{
		$("#"+ctrl).show(200);
		$("#"+id).removeClass("filterTogglePlus").addClass("filterToggleMinus");
	}
	else
	{
		$("#"+ctrl).hide(200);
		$("#"+id).removeClass("filterToggleMinus").addClass("filterTogglePlus");
	}
}


