/**
 * @author david
 */
 var ant = 0;
			 var ajax = Boolean();
			 ajax = false;
			 var ajax2 = Boolean();
			 ajax2 = false;
			 var stat_sub = Boolean();
			 var primero = Boolean();
			 var video = Boolean();
			 video = false;
	function cerrar(){
			$('#gallery').fadeOut('slow');
			$('#content_8').fadeOut('fast');
			$('#content_11').fadeIn('slow');
			//$('#footer').css('marginTop','0px');
			$('#overlay3').hide();
	}
			 $(function(){
				var n = $('.menu').length;
				var menus = $('.menu');
				$('.menu').each(function(n){
					$(this).click(function(){
						$('#header').slideUp('slow');
						$('#content_menu').css('background-image','url(http://www.samanthacatering.com/pruebas/pagina/fotos/logo2.jpg)');
						$('.contenedor').each(function(i){
						var cont = $(this);
						if (n == i) {
							cont.show('slow');
							if (n == 9) {
								$('iframe#conocenos').attr('src','http://www.samanthacatering.com/pruebas/pagina/conocenos/conocenos.html');
								/*if (!ajax2) {
									$.ajax({
										type: "GET",
										url: "http://www.samanthacatering.com/pruebas/pagina/conocenos/conocenos.html",
										dataType: "html",
										cache: true,
										success: function(html){
											$("#content_8").html(html);
											
										}
									});
									ajax2 = true;
									$("#content_9").fadeIn('slow');
								}*/
							}
							
							if (n == 8) {
								
									$('#overlay3').show();
									//$('#footer').css('marginTop','200px');
									$('iframe#galeria').attr('src','http://www.samanthacatering.com/pruebas/pagina/galeria/gal-ajax.html');
									} 
							if (n == 11) {
								$('#player').html("<object id='musica' type='application/x-shockwave-flash' width='370' height='17' data='http://www.samanthacatering.com/musica/xspf_player.swf?song_url=http://www.samanthacatering.com/musica/2.mp3&song_title=Melody Gardot - Baby I'm A Fool&autoplay=true'><param name='wmode' value='transparent'><param name='movie' wmode='transparent' value='http://www.samanthacatering.com/musica/xspf_player.swf?song_url=http://www.samanthacatering.com/musica/2.mp3&song_title=Melody Gardot - Baby I'm A Fool&autoplay=false' /></object>");
								video = true;
							}
							else{$('#content_11').html("<object width='694' play='false' height='523'><param name='allowfullscreen' value='true' /><param name='allowscriptaccess' value='always' /><param name='movie' value='http://vimeo.com/moogaloop.swf?clip_id=8690638&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1&amp;autoplay=0' /><embed src='http://vimeo.com/moogaloop.swf?clip_id=8690638&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1&amp;autoplay=0' type='application/x-shockwave-flash' allowfullscreen='true' allowscriptaccess='always' width='694' height='523'></embed></object>");	
								
								if(video)
									$('#player').html("<object id='musica' play='true' type='application/x-shockwave-flash' width='370' height='17' data='http://www.samanthacatering.com/musica/xspf_player.swf?song_url=http://www.samanthacatering.com/musica/2.mp3&song_title=Melody Gardot - Baby I'm A Fool&autoplay=true'><param name='wmode' value='transparent'><param name='movie' wmode='transparent' value='http://www.samanthacatering.com/musica/xspf_player.swf?song_url=http://www.samanthacatering.com/musica/2.mp3&song_title=Melody Gardot - Baby I'm A Fool' /></object>");}
								video = false;	
									/*$.ajax({
										type: 'GET',
										url: "http://www.samanthacatering.com/pruebas/pagina/galeria/gal-ajax.html",
										dataType: "html",
										cache: true,
										success: function(html){
											$("#content_7").append(html);
											
										}
									});*/
							
						}
						else {
							
							cont.hide('slow');
							cont.find('.resumen').css('margin-top', '0px');
						}
							
							
						});
					
					});
				});
				$('#menu2').click(function(){
					if(!stat_sub){
						$('#submenu').show('slow');
						$('ul #sublista').show('');							
							stat_sub = true;
					}
					else{
						$('ul #sublista').hide('fast');
						$('#submenu').hide('slow');
						stat_sub = false;
					}				
			});
			$('.cerrar').each(function(){
				$(this).click(function(){
					$('#overlay2').fadeOut('slow');
					$(this).parents().find('.footer').fadeOut('slow');					
				});
			});
			$('#footer a').each(function(i){
				$(this).click(function(){		
				$('#header').slideUp('slow');			
						$('.footer').fadeOut('fast');
						$('#overlay2').fadeIn('slow');
						switch(i){
							case 0:$('#donde').fadeIn('slow');break;
							case 1:$('#contacto').fadeIn('slow');break;
							case 2:$('#webmaster').fadeIn('slow');break;
							}
						});
			});
			
});	
