$(function () {
          $(".menu li").hide();
          $(".menu > li").each(function(i){jQuery(this).delay(i*300).fadeIn(300);});
		  $(".menu li").each(function(i){jQuery(this).fadeIn(0);});

          $(".mono span").click(function (){
                    if ($(this).parent().has(".popup").length){
                                        $popup = $(this).parent().find(".popup").attr('id');
                                        $.prettyPhoto.open("#"+$popup);
                                        }

                    if ($(this).parent().has(".gallery").length){
                                        $photo = $(this).parent().find(".gallery");
                                        $imagex = $photo.find("span:first").text().split("\n");
                                        $imagex.pop()
                                        $titlex = Array();
                                        $descrix = Array();
                                        $i = 0;
                                        while ($i < $imagex.length) {
                                                  $titlex.push($(this).text());
                                                  $descrix.push($photo.find("span:last").text())
                                                  $i++;
                                        }
                                        //$("#title").text($titlex.length);
                                        //$imagex = Array("img/images/01.jpg","img/images/02.jpg");
                                        $.prettyPhoto.open($imagex,$titlex,$descrix);
                                        }
										$.vegas( 'pause' );

                    });
          $(".multi > span").click(function (){
                    if ($(this).hasClass("arrow_down")) {
                              $(this).parent().parent().find(".arrow_up").toggleClass("arrow_down arrow_up").parent().children(".submenu").slideUp();
							  $(this).parent().children(".submenu").slideDown();
					}
                    if ($(this).hasClass("arrow_up")) {
                              $(this).parent().find(".submenu").slideUp();
                              }
                    $(this).toggleClass("arrow_down arrow_up");
                    });
});
