// JavaScript Document

function destinoAjax(opcion,idProducto,cant)
{
		if(opcion=="add"){
			quitarArea = document.getElementById('div_totales');
			document.getElementById('div_contadores').removeChild(quitarArea);
			if(cant > 0){
				setProducto(idProducto, 1);
			}else{
				cantidad = $('#cant'+idProducto).val();
				setProducto(idProducto, cantidad);
			}
		}else if(opcion=="del"){
			removeProducto(idProducto);
			}else if(opcion=="mod"){
			modificarProducto(idProducto,cant);
		}
}

function registrarse(opcion){
	if(opcion=="edit"){
		setParametro();
	}else{

		setParametro();
	}
}

function cerrarSesion()
{
		setCerarSesion();
}

function validarLogin()
{
    if(document.getElementById('usuario').value!="" && document.getElementById('clave').value!="")
		document.getElementById('login').submit();
	else
		alert('Debes escribir tu Usuario y Contrasena');
}

function validarRegistro()
{	
	document.getElementById('registroCliente').submit();
}

function enviar(nombreForma){
	document.getElementById(nombreForma).submit();
}

function activarBusquedaAvanzada(){
	document.getElementById("div_busquedaAvanzada").style.display="block";
	document.getElementById("div_busquedaBasica").style.display="none";
	}
	
function activarCampoBusquedaAvanzada(){
	if((document.getElementById("campo").value/1)!=3){
	document.getElementById("valorTexto").style.display="block";
	document.getElementById("valorNumero").style.display="none";
	}else{
	document.getElementById("valorNumero").style.display="block";
	document.getElementById("valorTexto").style.display="none";
	}
}	
	

function mostarPanoramica(id)
{
	var w;
	w = window.open("visita_virtual_vista.php?id="+id, "", "width=492,height=310,titlebar=0,location=0,resizable=yes,scrollbars=0,hotkeys=0,status=0,top=" + (screen.																																																																															height-570)/2 + ",left=" + (screen.width-790)/2);

w.isDebugFramework = false;

}

function finalizarCompra(mensaje)
{
  if(mensaje)
  	if(document.getElementById('mensaje').value!="")
	  setMensajeNovios(document.getElementById('mensaje').value);
}

function cargarMensaje(){
		  setMensajeNovios(document.getElementById('mensaje').value);
}


