// JavaScript Document
	//Modeless window script- By DynamicDrive.com
	//for full source code and terms of use
	//visit http://www.dynamicdrive.com
	function modelesswin(url,mwidth,mheight){
		if (document.all&&window.print) //if ie5
			eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
		else
			eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=1,scrollbars=1")')
		}
		//configure URL and window dimensions (width/height)
		//modelesswin(url,600,600)
		//To load via link, use something like below:
		//<a href="javascript:modelesswin('http://yahoo.com',600,400)">Click here</a>


	function getLink() {
		// si todos los campos están ok...
		if(checkForm()) {
			var prec=0;
			prec=document.formulario.precio.value;
			var s="";
					
			s+="index_better.php?precio="+prec+"&email="+document.formulario.email.value;
			if ( (!isNumberFloat(prec)) || (prec == 0) ) {	alert("El precio no puede ser 0, o no numérico");  }
			else { 
				modelesswin(s,600,450);
				//location = s; 
			}
		}
	}
	function isNumberFloat(inputString) {  return (!isNaN(parseInt(inputString))) ? true : false;}
	
	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+='- '+'Este campo '+nm+' debe ser una dirección e-mail válida.\n';
				} // end email check 
				else if (test!='R') {
					num = parseFloat(val);
					if (isNaN(val)) errors+='- '+nm+' debe contener un número.\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 entre '+min+' y '+max+'.\n';
					} // end numeric check 
				} //end R
			}
			else if (test.charAt(0) == 'R') errors += '- '+nm+' es necesario.\n'; }
  } 
	
	if (errors) alert('Los siguiente errores se han producido:\n'+errors);
  
	document.MM_returnValue = (errors == '');
}
