<!--
	function OpenModalWindow(){
		if(document.alls){
			var strProperties = 'dialogWidth: 650px; dialogHeight:620px; status: no; help: no; center: yes; edge: raised; resizable: no; scroll: yes'; 
			window.showModalDialog(arguments[0], null, strProperties);
		}else{
			var strProperties = 'top=' + parseInt((screen.height - 653) / 2) + ',left=' + parseInt((screen.width - 640) / 2) +
								',width=653px,height=600px,toolbar=no,status=no,resizable=no,menubar=no,scrollbars=yes,location=no'; 
			window.open(arguments[0], 'WindowModal', strProperties);			
		}
	}
	
	function OpenWindowImage(){
		var w;
		var h = arguments[2] + 125;
		
		if(arguments[1] < 200){w = 340 + (200 - arguments[1]);}else{w = arguments[1] + 140;}
		
		var strProperties = 'top=' + parseInt((screen.height - h) / 2) + ',left=' + parseInt((screen.width - w) / 2) +
							',width='+w+'px,height='+h+'px,toolbar=no,status=no,resizable=no,menubar=no,scrollbars=yes,location=no'; 		
		window.open(arguments[0] + "&W="+w+"&H="+h, 'WindowImage', strProperties);
	}

	function isEmpty(fld, mnsg){
		if(fld.value == ""){
			fld.focus();
			if(mnsg != ""){
				alert(mnsg);
			}
			return(true);
		}
		return(false);
	}
	
	function CheckBlankTwo(fld1, fld2, mnsg){
		
		if(fld1.value == ""){
			if(fld2 != null && fld2.value != "") return(false);
			fld1.focus();
			if(mnsg != "") alert(mnsg);
			return(true);
		}
		return(false);
	}
	
	function CheckEmailField(emailStr, mnsg){
		if (emailStr.value.length == 0){
			if(mnsg != ""){
				alert('Indique una dirección de correo electrónico');
			}
		   	return true;
	    }
		
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailStr.value)){
			return (false)
		}else{
			if(mnsg != ""){
				alert('Indique una dirección de correo electrónico válida');
			}
		   	return true;
		}
	}
	
	function CheckSelect(slct, mnsg){
		if((slct.length == 0) || (slct.options[slct.selectedIndex].value == "")){
			slct.focus();
			if(mnsg != ""){
				alert(mnsg);
			}
			return(true);
		}
		
		return(false);
	}
	
	function isNumeric(dgt, mnsg, empty){
		dgt.value = dgt.value.replace(',','.');
		if(isNaN(dgt.value) || (!empty && dgt.value == "")){
			dgt.focus();
			alert(mnsg);
			return(false);
		}
		
		return(true);
	}
	
	function CheckPassword(pswd1, pswd2, empty){
		if(!empty){
			if(pswd1.value != ""){
				if(pswd2.value == ""){
					pswd2.focus();
					alert('Introduzca confirmación de contraseña');
					return(false);
				}
				
				if((pswd1.value != "") && (pswd2.value != "")){
					if(pswd1.value != pswd2.value){
						pswd1.focus();
						alert('Los campos contraseña y confirmación contraseña no coinciden');
						return(false);
					}
				}
			}
		}else{
			if(pswd1.value == ""){
 				pswd1.focus();
 				alert('Introduzca contraseña');
 				return(false);
			}
			
			if(pswd2.value == ""){
				pswd2.focus();
				alert('Introduzca confirmación de contraseña');
				return(false);
			}
				
			if((pswd1.value != "") && (pswd2.value != "")){
				if(pswd1.value != pswd2.value){
					pswd1.focus();
					alert('Los campos contraseña y confirmación contraseña no coinciden');
					return(false);
				}
			}
		}
		
		return(true);
	}
	
	function openPriceList(){
		window.open('pricelist.html', 'priceList', 'top=' + ((screen.height - 300) / 2) + ',left=' + ((screen.width - 250) / 2) + ',width=300,height=250,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
	}


	function openMyHistory(sid){
		window.open('history.php?sid=' + sid, 'myHistory', 'top=' + ((screen.height - 400) / 2) + ',left=' + ((screen.width - 700) / 2) + ',width=700,height=400,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');
	}
//-->
