/***********
 COLORBOX
 */
$(document).ready(function(){
	$("a[rel='img']").colorbox();
});
/***********
 CYCLE
 */
function iniciarFade(_div, _speed, _timeout) {
    $(_div).cycle({
    	fx: 'fade',
    	speed: _speed,
		timeout:  _timeout
	});
}; 





function visibilidad_detalle_calculo() {
	if(document.getElementById('calculo_oculto').style.display=='none') {
		document.getElementById('calculo_oculto').style.display='';
		document.getElementById('cmdVerDetalle').value='Ocultar detalle';
	}
	else {
		document.getElementById('calculo_oculto').style.display='none';
		document.getElementById('cmdVerDetalle').value='Ver detalle';
	}			
			
}
function opcionales(material) {
	if(material == 'PVC' || material == 'DM' || material == 'ALUMINIO') {
		document.getElementById('opcionales').style.display='';
		document.getElementById('op_pintura').style.display='';
	}
	else {
		document.getElementById('opcionales').style.display='none';
		document.getElementById('op_pintura').style.display='none';
	}
	if(material == 'ALUMINIO' || material == 'INOX.') {
		document.getElementById('opcionales').style.display='';
		document.getElementById('op_pernos').style.display='';
	}
	else {
		document.getElementById('opcionales').style.display='none';
		document.getElementById('op_pernos').style.display='none';
	}	
			
}
function validar_registro() {
	if (document.forms.frm_registro.txtEmpresa.value == '' ||
		document.forms.frm_registro.txtId_sector.value < 1 ||
		document.forms.frm_registro.txtNombre.value == '' ||
		document.forms.frm_registro.txtDireccion.value == '' ||
		document.forms.frm_registro.txtCiudad.value == '' ||
		document.forms.frm_registro.txtCif.value == '' ||
		document.forms.frm_registro.txtUsuario.value == '' ||
		document.forms.frm_registro.txtEmail.value == '' ||
		document.forms.frm_registro.txtTelefono.value == '' ||
		document.forms.frm_registro.txtCaptcha.value == '') {
		alert('Todos los datos son obligatorios');
		return false;
	}
	if (document.forms.frm_registro.txtPass1.value != document.forms.frm_registro.txtPass2.value) {
		alert('Las contrase\u00F1as no coinciden');
		return false;
	}
}
