function block_showhide(id) {
	if (document.getElementById(id).style.display == "none") {
		document.getElementById(id).style.display = "block";
	} else {
		document.getElementById(id).style.display = "none";
	}
}
function alert_show(msg) {
        alert(msg);
}
function swf_viewer(swf, wt, ht, fvrs){
	LeftPosition = (screen.width) ? (screen.width-wt)/2 : 0; 
	TopPosition = (screen.height) ? (screen.height-ht)/2 : 0;
	window.open("fxs.php?fx=swf_view&swf="+swf+"&fvrs="+fvrs,'IDSC','top=' + TopPosition + ',left=' + LeftPosition + ',width='+wt+',height='+ht+',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');
}
function validate_required(field,alerttxt){
	with (field){
		if (value==null||value==""){
			alert(alerttxt);
			return false;
		}
		else {
			return true
		}
	}
}
function validate_email(field,alerttxt){
	apos = field.value.indexOf("@");
	dotpos = field.value.lastIndexOf(".");
	if (apos<1 || dotpos-apos<2) {
		alert(alerttxt);
		return false;
	}
	else {
		return true;
	}
}
function validate_form(){
	if (validate_required(document.frm_addComment.cmmt_name,"Falto ingresar el nombre!")==false){
		document.frm_addComment.cmmt_name.focus();
		return false;
	}
	if (validate_email(document.frm_addComment.cmmt_email,"No es una dirección de e-mail válida!")==false){
		document.frm_addComment.cmmt_email.focus();
		return false;
	}
	if (validate_required(document.frm_addComment.cmmt_text,"Falto ingresar el comentario!")==false){
		document.frm_addComment.cmmt_text.focus();
		return false;
	}
	if (validate_required(document.frm_addComment.cmmt_captcha,"Escriba el código de confimarción tal y como aparece en la imagen!")==false){
		document.frm_addComment.cmmt_captcha.focus();
		return false;
	}
	return true;
}

//Codigo Nuevo 12/08/2010

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  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=MM_findObj(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+='- El campo email debe contener una direccion de email valida (ejemplo@dominio.com)\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 requerido.\n'; }
  } if (errors) alert('El envio no ha sido procesado debido a los siguientes errores:\n'+errors);
  document.MM_returnValue = (errors == '');
}


function Preguntar()
{
	var eliminar=confirm(""+String.fromCharCode(191)+"Deseas eliminar este registro?");
	if (eliminar) return true;
	else return false;
}

function Mostrar(ruta)
{
	window.open(ruta);

}