function doProm(y,o,n) {
	
	var frm = document.forms[1]
	var sw = document.getElementById("rProm_" + o).checked
		
	//alert(y+' '+o+' '+n)		
	//alert(sw)
		
	var sel,fre,f,v1,v2,v3,v4,txt,v5
	for (i=0; i<y; i++) {
		
		cnt = 0
				
		v1 = document.getElementById("tHot_" + o + "_" + i)
		v2 = document.getElementById("tTot_" + o + "_" + i)
		v3 = document.getElementById("tBak_" + o + "_" + i)
		v4 = document.getElementById("tToh_" + o + "_" + i)
				
		//alert(v1.value)
		//alert(v2.value)
		//alert(v3.value)
		//alert(v4.value)
				
		for (j=0; j<n; j++) {
				
			sel = document.getElementById('tPR_' + i + '_' + o + '_' + j)
									
			if (sel != null) {				
				
				fre = document.getElementById('tFN_' + i + '_' + o + '_' + j)
				//alert(fre.value)
										
				f = document.getElementById('fPr_' + i + '_' + o + '_' + j)					
				fr = document.getElementById('fFr_' + i + '_' + o + '_' + j)		
					
				iBr = document.getElementById('iBr_' + i + '_' + o + '_' + j)		
					
				//alert(iBr)			

				if (sw) {
					iBr.style.visibility = 'visible'
				}else{
					iBr.style.visibility = 'hidden'
				}
					
				if (cnt == fre.value-1) {					
					if (sw) {
						f.className = 'notc'
						fr.className = 'nofr'
					}else{					
						f.className = 'tach'
						fr.className = 'free'
					}	
					cnt = 0
				}else{
					cnt++
				}
			}
		}				
		if (sw) {
			v1.value = v2.value
			v4.value = v2.value	
		}else{							
			v1.value = v3.value
			v4.value = v3.value
		}				
	}		
}
	
function ancBookSubm(act,it,ic,rm,ss) {

    //alert(ss)    
    
    if (ss != null && Number(ss) < 9) {
		alert("Sorry, but we are currently in the process of re-vamping our on-line reservations system. New payment services, credit card processing and SSL security services are being added. Please, keep up with us and return soon to make reservations!...")
		
		return false
    }   

	var frm = document.forms[1]
	
	//alert(frm.name)
		
	if (act == 'del') {	
		if (!confirm("Esta seguro de querer eliminar este servicio?")) {	
			return false
		}
	}		
	if (act == 'add') {

		frm['txtRoom_' + it].value = rm
			
		if (frm.txtResName.value == '') {			
			frm.txtResName.value = 'Nueva reserva...'
		}
	}
	//frm.txtAct.value = act
	//frm.txtSel.value = it
		
	if (act == 'new' || act == 'edit') {
		
		frm.action = 'main.asp?t=edit&c=' + ic			
	}else{
		if (ic != null) {
			frm.action = frm.action + '#' + ic
		}
	}	
	
	bSearch = act == 'go' || (act == 'se' && frm.txtSearch.value != '') || act == 'add'
	
	if (frm.payType && frm.payType.value == -1 && bSearch) {

		alert('Seleccione el tipo de pago...')
		
		frm.payType.focus()
		return false
		
	}else{	
	
		if (bSearch && frm.agency && 
			(frm.txtNameHid.value == '' && 	(frm.agency.value == 'OLET' || frm.agency.value == 'OVIS')) && 
			!confirm('Esta seguro de querer empezar una reserva sin seleccionar un Agente ?...')) {
		
			frm.agency.focus()
			return false
		
		}else{		
				
			if (act == 'se' && frm.txtSearch.value == '') {
		
				frm.txtSearch.focus()
				return false

			}else{
		
				frm.txtNameHid.value = 'OLET'
		
				if (act == 'se') act = 'go'
			
				frm.txtAct.value = act
				frm.txtSel.value = it
		
				return true
			}				
		}	
	}	
}

