
function createActiveFlash(src, width, height){
	
	return AC_FL_RunContent("classid","clsid27CDB6E-AE6D-11cf-96B8-444553540000","codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0","width", width,"height",height,"src",src,"quality","high","pluginspage","http://www.macromedia.com/go/getflashplayer","movie", src);
	
}

/*
 * EFECTOS
 * 
 */
var fx = (function($){
			
	var current_src;	
	
	return {
		
		hover : function(clase){
	
			$('img.'+clase).each(function(){
			
				$(this).hover(function(){
					
					current_src = $(this).attr('src');
					$(this).attr('src', current_src.replace( '.png', '_hover.png'));
	
				}, function(){
					
					$(this).attr('src', current_src);
								
				});
			});
			
		}		
	}	
	
	
})(jQuery);


/*
 * CONTACTO 
 * 
 */

var contacto = (function($){
		
	return {
		
		createMap : function(id){
			
			$(id).goMap({
				 markers: [{  
	          	  	latitude: 39.49849205248122, 
	            	longitude: -0.3371429443359375, 
	            	title: 'OXID Comunicacio',
	            	html:{ 
	              	  	content: '<div style="width: 200px; height: 100px; margin-left: 25px"><img src="http://oxidcomunicacio.com/resources/logo.png" alt="OXID" /></div>',
	                	popup:true 
	            	}
	        	}],
	        	navigationControl: true, 
	      	  	navigationControlOptions: { 
	      	      position: 'LEFT', 
	      	      style: 'ANDROID' 
	      	  	},        	
				zoom: 17
			}); 
			$.goMap.setMap({latitude:'39.499462736558144', longitude:'-0.3369578719139099'});  
		}	
	};
	
})(jQuery);


jQuery(document).ready(function(){
	var menu=(function($){
		
		/*oculta texto sobre menu*/
		$('#menu p:first').addClass('hidden');
		
		/*sólo hace fade 1 vez*/
		var virgin = $.cookie('virgin');	
		
		if(virgin != "0"){
			$('#menu').fadeIn(1000);
			$.cookie('virgin', '0', { expires: 1 });
		}
		else{
			$('#menu').show(0);
		}		
		
		/*
		* PLUGIN ANTI-SPAM
		* 
		* Sustitiuye en la clase email_addr la cadena [###] por @
		*/
		
		var html = $('.email_addr').html();
		var html = html.replace('[###]','@');
		$('.email_addr').html(html);
		
		/*-------------------------------------------------------------*/
		
		
		/*CONTACTO*/
		
		$('#ct_botonera img.clickable').click(function(e){
			
			e.preventDefault();
			
			var _id = $(this).attr('alt');

			$('div.slides').slideUp(500);
			
			$('#'+_id).slideDown(500);			
			
		});
		
		$('#det_call').change(function(){
			$('#det_call_hidden').slideToggle(500);			
		});
		
		$('#f_tel, #f_email').submit(function(e){
			e.preventDefault();
			
			$.ajax({
				  url: "controller.php",
				  type: 'POST',
				  data: $(this).serialize(),
				  success: function(response){
					alert("¡¡ Enviado !!");				
				  }
			});	
			
			return false;			
								
		});
		
		$('#bt_mapa').click(function(){
			
			window.contacto.createMap('#mapa');
			$(this).hide();						
			
		});
		
		
		/*-------------------------------------------------------------*/
		
		/*variables*/
		/*
		var album = $.cookie('album');
		var n_node = 0;
		var buffer = '';
		*/
		
		/*oculta todas las galerias particulares*/
		/*
		$('#menu div.container ul').each(function(i){
			
			if( i >= 2 && album != '1'){ 
	
				$(this).addClass('hidden');

			} 
			
		});*/
		
		
		
		
		
/*
	abracadabra --------------------------------------
	muestra las colecciones ocultas
*/
	/*	$(window).keypress(function(e) {
		  	if ( e.which == 13 ) {
		 	    e.preventDefault();
		 	    buffer = '';
		 	    $.cookie("album","0");
		 	  }
			else{
				buffer += String.fromCharCode(e.which);
				if( buffer.length === 5){
					if (buffer === 'album'){
						
						$('div.container ul.hidden').slideDown(500);
						$.cookie("album", "1");
						
					}
					buffer = '';
					
				}
				
			}
		});*/
/*--------------------------------------------------*/


	
	})(jQuery);
	
	
});


