﻿// CSS Browser Selector   v0.2.5
// Documentation:         http://rafael.adm.br/css_browser_selector
// License:               http://creativecommons.org/licenses/by/2.5/
// Author:                Rafael Lima (http://rafael.adm.br)
// Contributors:          http://rafael.adm.br/css_browser_selector#contributors
/*
    * .[os].[browser] .mylink { font-weight: bold; } -> without space between .[os] and .[browser]

Available OS Codes [os]:

    * win - Microsoft Windows
    * linux - Linux (x11 and linux)
    * mac - Mac OS

Available Browser Codes [browser]:

    * ie - Internet Explorer (All versions)
    * ie6 - Internet Explorer 6.x
    * ie5 - Internet Explorer 5.x
    * gecko - Mozilla, Firefox, Camino
    * opera - Opera (All versions)
    * opera8 - Opera 8.x
    * opera9 - Opera 9.x
    * konqueror - Konqueror
    * webkit or safari - Safari, NetNewsWire, OmniWeb, Shiira

*/


var css_browser_selector = function() {
	var 
		ua=navigator.userAgent.toLowerCase(),
		is=function(t){ return ua.indexOf(t) != -1; },
		h=document.getElementsByTagName('html')[0],
		b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('gecko/')? 'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',
		os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';
	var c=b+os+' js';
	h.className += h.className?' '+c:c;
}();



$(document).ready(function(){
	var textoReset = 80;
	var clicks = 0;
	var tope=2;
	var minTope = -1;
	var incremento = 10;
	var tamanyo = 80;
	var tamanyoLabel = 83;
	$('#contenido').addClass('clearfix'); // hacemos que todos los contenidos tengan el alto correcto cuando sus elementos interiores flotan
	$('#buscador').addClass('clearfix'); // hacemos que todos los contenidos tengan el alto correcto cuando sus elementos interiores flotan
	$('.articulo').addClass('clearfix'); // hacemos que todos los contenidos tengan el alto correcto cuando sus elementos interiores flotan
	$('.experiencia').addClass('clearfix'); // hacemos que todos los contenidos tengan el alto correcto cuando sus elementos interiores flotan
	$('div.bloqueMain h3:nth-child(1)').addClass('h3titular');
	
	$("#ampliarText").click(function (){							  
		if(clicks<tope || clicks==0){
			tamanyo=tamanyo+incremento;
			tamanyoLabel=tamanyoLabel+incremento;
			$("p").css("font-size",tamanyo+"%");
			$("dl").css("font-size",tamanyo+"%");
			$("label").css("font-size",tamanyoLabel+"%");	
			clicks++;
		}
	});
	$("#reducirText").click(function (){
		$("#tope").html(clicks);
		if(clicks>=minTope || clicks==0){
			tamanyo=tamanyo-incremento;
			tamanyoLabel=tamanyoLabel-incremento;
			$("p").css("font-size",tamanyo+"%");
			$("dl").css("font-size",tamanyo+"%");
			$("label").css("font-size",tamanyoLabel+"%");	
			clicks--;
		}
	});
	

	

});

jQuery().ready(function(){
		
	// second simple Accordion with special markup
/*	jQuery('#navigation').Accordion({
		active: false,
		header: '.head',
		navigation: true,
		event: 'click',
		autoheight: false,
		animated: 'easeslide'
	});
	
	var wizard = $("#wizard").Accordion({
		header: '.title',
		event: false
	});
	
	$("div.title", wizard).each(function(index) {
		$(this)
		.next()
		.children(":button")
		.filter(".next, .previous")
		.click(function() {
			wizard.activate(index + ($(this).is(".next") ? 1 : -1))
		});
	});
	
	// bind to change event of select to control first and seconds accordion
	// similar to tab's plugin triggerTab(), without an extra method
	jQuery('#switch select').change(function() {
		jQuery('#navigation').activate( this.selectedIndex-1 );
	});
	jQuery('#close').click(function() {
		jQuery('#navigation').activate(-1);
	});
	jQuery('#switch2').change(function() {
		jQuery('#navigation').activate(this.value);
	});*/
	
	
	
});

function calcular_edad(fecha){ 

    hoy=new Date() 

    var array_fecha = fecha.split("/") 
    if (array_fecha.length!=3) 
       return false 

    var ano 
    ano = parseInt(array_fecha[2]); 
    if (isNaN(ano)) return false 

    var mes 
    mes = parseInt(array_fecha[1]); 
    if (isNaN(mes)) return false 

    var dia 
    dia = parseInt(array_fecha[0]); 
    if (isNaN(dia)) return false 


    if (ano<=99) ano +=1900 

    edad=hoy.getFullYear()- ano - 1;

    if (hoy.getMonth() + 1 - mes < 0) return edad 
    if (hoy.getMonth() + 1 - mes > 0) return edad+1 

    if (hoy.getUTCDate() - dia >= 0) return edad + 1 

    return edad 
} 