function changeImage(imageSRC) {
  document.getElementById('changingImage').src=imageSRC;
}

function abreVentana(){
	window.open("", "popup", "width = 310, height = 286");
}

function VbidA(oba,cba,mba) {
	var Foba = parseFloat(oba);
	var Fcba = parseFloat(cba);
	var Fmba = parseFloat(mba);
	if (isNaN(Foba) || isNaN(Fcba)) {
	  alert('Bid amount and confirm bid amount must be numerics.');
	  return false;
	}
	if (Foba != Fcba) {
	  alert('Bid amount and confirm bid amount must be the same.');
	  return false;
	}
	if (Foba == 0 || Foba == '' || !Foba) {
	  alert('Bid amount must be a numeric value greater than 0.');
	  return false;
	}
	if (Foba < Fmba) {
	  alert('Your bid amount should be at least the minimun bid amount suggested.');
	  return false;
	}
	return true;
}

function vRegForm() {
	var Error = "You must fill the following fields:\n";
	var nError = 0;
	var flag = 0;
	var x = document.getElementById("register");
	for (var i = 0; i < x.length; i++) {
		if(x.elements[i].value == "" && x.elements[i].title && !x.elements[i].disabled) {
			if(flag == 0) {
				x.elements[i].focus();
				flag = 1;
			}
			Error += x.elements[i].title + ".\n";
			nError += 1;
		}
	}
	if (nError > 0) {
		alert(Error);
		return false;
	}
	if (x.passw.value != x.cpass.value) {
		x.passw.focus();
		alert('Password and confirmation password must be the same.');
		return false;
	}

	return true;
}

function ValidaFormulario() {
  var Error = "You must fill the following fields:\n";
  var nError = 0;
  var flag = 0;
  var x = document.getElementById("formulario");
	  for (var i = 0; i < x.length; i++) {
		  if(x.elements[i].value == "" && x.elements[i].title) {
			  if(flag == 0)
			  {
				x.elements[i].focus();
				flag = 1;
			  }
			  Error += x.elements[i].title + ".\n";
			  nError += 1;
		  }
		}
	if (nError > 0)
	{
	  alert(Error);
	  return false;
	}
	else
	{
	  return true;
	}
}

