/**
 * @Autor David (Marka Informatica)
 * @Fecha 28/04/2011
 * @Descripcion 
 * Script con las funciones para la web.
 */

function AbrirFacebook() {
	var dir = "http://www.facebook.com/profile.php?id=100002424740184"
	window.open(dir,"facebook");
}

function AbrirVideo() {
	var dir = "http://www.youtube.com/watch?v=tUNKth6kH98"
	window.open(dir,"youtube");
}

/**
 * JQuery onload().
 */
$(document).ready(function(){ 
	$("#menu ul li").hover(
		function () {
	    	$(this).addClass("menuOver");
			$(this).fadeTo("fast",0.5);	
	  	}, 
	  	function () {
	    	$(this).removeClass("menuOver");
			$(this).fadeTo("fast",1);	
	  	}
	);	
	
	$(".cajaGaleria, #cajaColor_2").click(function() {
		location.href="galeria.php";
	})				
});

/**
  * jQuery: Funciones.
  */ 

/**
 * @description	Funcion que obtiene el índice (xxx) de un id cuyo sufijo es: "_xxx";
 * @fecha		04/04/2011
 * @param {string} _id
 */		
jQuery.ObtenerIndice = function (_id) {
	var indice = -1;
	var arrayId = _id.split('_');
	if (_id.length > 0) {
		if (arrayId.length > 0) indice = parseInt(arrayId[arrayId.length - 1]);
	}
	
	return indice;
}

