// JavaScript Document
function goHome(){
	window.location.href = "http://www.alcaldiamunicipiosucre.gov.ve/contenido/index.php"
}
function followLink(linkToFollow){
	window.location.href = linkToFollow;
}

sfHover = function() {
	if (!document.getElementsByTagName) return false;
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			//this.class+=" sfhover";
			this.className+=" sfhover";
		}

		sfEls[i].onmouseout=function() {
			//this.class=this.class.replace(new RegExp(" sfhover\\b"), "");
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

 
 
jQuery(document).ready(function(){					
	mainmenu();
	jQuery("a[href='#']").click(function(){ return false; }); 
	jQuery("area[href='#']").click(function(){ return false; }); 
	/*Tabla zebra*/
	$(".stripeMe tr").mouseover(function() {$(this).addClass("zebra3"); }).mouseout(function() {$(this).removeClass("zebra3");});
	$(".stripeMe tr:even").addClass("zebra1");
	$(".stripeMe tr:odd").addClass("zebra2");
	jQuery("#rentas_licencia").click(function(){
		window.open("http://www.segecom.com/declaracionSucre/aplicacion/busca_cuentarenta.php", "rentas_declaracion", "location=no,status=yes,scrollbars=yes,innerWidth=800,height=500,resizable=yes");
	});
	jQuery("#rentas_sinlicencia").click(function(){
		window.open("http://www.segecom.com/sinLicencia/aplicacion/actualizar_datos.php", "rentas_declaracion", "location=no,status=yes,scrollbars=yes,innerWidth=800,height=500,resizable=yes");
	});
	var newsletterflag = $('h3.storytitle').html();
	newsletterflag = newsletterflag.toLowerCase();
	if ((newsletterflag.indexOf("olet")>0) && (newsletterflag.indexOf("n electr")>0)){
		$('#sideBar').remove();
		$('div.content').width(930)
	}
});
function showCalEvs(){
	document.getElementById("calendario2").style.display = "block";
	document.getElementById("calendario1").style.display = "none";
	document.getElementById("buttActAct").setAttribute("class", "linke_cal_tab_off");
	document.getElementById("buttActEvs").setAttribute("class", "linke_cal_tab_on");
}
function showCalActs(){
	document.getElementById("calendario1").style.display = "block";
	document.getElementById("calendario2").style.display = "none";
	document.getElementById("buttActAct").setAttribute("class", "linke_cal_tab_on");
	document.getElementById("buttActEvs").setAttribute("class", "linke_cal_tab_off");
}
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe contener un email.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' debe contener un numero.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' debe contener un numero entre '+min+' y '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es obligatorio.\n'; }
    } if (errors) alert('No se puede enviar la forma:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
function clearMail(){
	document.getElementById("newsletterEmail").value="";;
}