<!--
function popupOpen( url) {
	w=screen.width*(0.7);
	h=screen.height*(0.7);
	t=screen.height*(0.1);
	l=screen.width*(0.1);
	popup = this.open( url, 'popup', "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width="+w+",height="+h+",alwaysRaised=Yes,left="+l+",top="+t+",titlebar=No" ); //
	popup.focus();
}
function popUp( url, w, h) {
	popup = this.open( url, 'popup', "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width="+w+",height="+h+",alwaysRaised=no,left=50%,top=50%,titlebar=No" ); //
	popup.focus();
}
	function news_pop( id ) {
	news_popup = this.open( '?popup&news_ID='+id, 'popup', "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=460,height=480,alwaysRaised=Yes,left=10%,top=10%,titlebar=No" ); //
		news_popup.focus();
}
	function cal_pop( year, month, day ) {
				popupOpen( 'index.php?event_popup&cal_d='+day+'&cal_m='+month+'&cal_y='+year);
	}

function popOpen( url) {
	popup = this.open( url+'&noMenu', 'popup', "statusbar=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,width=740,height=470,alwaysRaised=Yes,left=10,top=10,titlebar=No" ); //
		popup.focus();
}
function toggle(theDiv) {
	var elem = document.getElementById(theDiv);
	elem.style.display = (elem.style.display == "none")?"":"none";
	for( var i=1; i < arguments.length; i++ ) {
		arg=document.getElementById( arguments[i]);
		arg.style.display = (arg.style.display == "none")?"":"none";
	}
}
function call_first_visible( form) {
	if( document.forms[form]) {
		for( var i = 0; i < document.forms[form].length; i++) {
			if( document.forms[form].elements[i].type != 'hidden' && document.forms[form].elements[i].type != 'select-one'
			&& document.forms[form].elements[i].style.display != 'none') {
				document.forms[form].elements[i].focus();
				break;
			}
		}
	}
}
function selectAll(chkbox,form){
	for (var i=0; i<form.elements.length; i++){
		var elemento = form.elements[i];
		if (elemento.type == "checkbox"){
			elemento.checked = chkbox.checked
		}
	}
}
function validateDate(fecha){
	if (fecha != undefined && fecha != "" ){
   		if (!/^\d{2}\/\d{2}\/\d{4}$/.test(fecha)){
			return false;
		}
		var dia  =  parseInt(fecha.substring(0,2),10);
   		var mes  =  parseInt(fecha.substring(3,5),10);
   		var anio =  parseInt(fecha.substring(6),10);
   		switch(mes){
  			case 1:
  			case 3:
  			case 5:
  			case 7:
  			case 8:
  			case 10:
  			case 12:
  				numDias=31;
  				break;
  			case 4: case 6: case 9: case 11:
  				numDias=30;
  				break;
  			case 2:
  				if (validateBisiesto(anio)){ numDias=29 }else{ numDias=28};
 				break;
  			default:
  				return false;
  		}
		if (dia>numDias || dia==0){
  			return false;
  		}
  		return true;
	}
}
function validateBisiesto(anio){
	if ( ( anio % 100 != 0) && ((anio % 4 == 0) || (anio % 400 == 0))) {
  		return true;
	}else {
   		return false;
	}
}
function validateEmail(str) {
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1)  return false;
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)   return false;
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)  return false;
	if (str.indexOf(at,(lat+1))!=-1)   return false;
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)   return false;
	if (str.indexOf(dot,(lat+2))==-1)    return false;
	if (str.indexOf(" ")!=-1)    return false;
	return true;
 }
//-->
