// JavaScript Document
//Todo esto de aca hasta la otra linea funciona
//----------------------------------------------------------------------------------------------
function pulsar(e,a) {	
 tecla = (document.all) ? e.keyCode : e.which;
 if ((tecla==32) && (document.getElementById(a).value.length < 2)){
	if ((document.getElementById(a).value == "") || (document.getElementById(a).value==" ") || (document.getElementById(a).value=="  ")){
	alert ('Enter a value different from the space bar.');
	document.getElementById(a).value='';
	}
}}
//-----------------------------------------------------------------------------------------------
function max_chart(text,quantity,message){
	var v=text.value;
	if (v.length>quantity){
		alert(message);
		 text.value=v.substring(0,quantity);
		}
	}

//-----------------------------------------------------------------------------------
function invisible(){
	if(document.getElementById('sino')){
	document.getElementById('sino').style.visibility = 'hidden'
	}}
function visible(){
	if(document.getElementById('sino')){
	document.getElementById('sino').style.visibility = 'visible'
	}}
//-----------------------------------------------------------------------------------------------
function val_reason(id){
	var errors='';
	if(document.getElementById(id).value == ''){
		errors += ' - Fail , Not written the reason for deleted. \n';
		}
			if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
	}
//-------------------------------------------------------------------------------------------------
function val_contac(){
	var errors='';
	if (document.contacto.Phone.value==''){
	errors += ' - Enter phone number. \n';
	}
	else{
	var number = parseFloat(document.contacto.Phone.value);
	if (isNaN(number)){
	errors += ' - Enter the value number for Phone. \n';
	}
	}
	if(number>999999999999 || number==0){
	errors += ' - Enter the value number maximum 12 digits. \n';
	}	
	if (document.contacto.country.value==''){
	errors += ' - Enter the country. \n';
	}
	if (document.contacto.Topic.value==''){
	errors += ' - Enter the subject (Topic). \n';
	}
	if (document.contacto.message.value==''){
	errors += ' - Message field can not be empty. \n';
	}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//------------------------------------------------------------------------------------
function val_hotel1(){
	var errors='';
	if (document.layover.IDACD.value==''){
	errors += ' - Fail , Enter hotel to search. \n';	
	}
	if (document.layover.city.value==''){
	errors += ' - Fail , Enter city or airport code. \n';
	}
	if (document.layover.acode.value==''){
	errors += ' - The city not were on the list. \n';
	}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//------------------------------------------------------------------------------------
function validar(){
	var errors='';
	if (document.form1.destination_city.value==''){
	errors += ' - Fail, Enter data for Destination City. \n';
	}
	if (document.form1.Airport_Code.value==''){
	errors += ' - Fail, Enter data for Airport Code. \n';
	}
	if (document.form1.request_date.value==''){
	errors += ' - Fail, Enter date of Request. \n';
	}
	if (document.form1.current_hotel.value==''){
	errors += ' - Fail, Enter data for current hotel. \n';
	}
	if (document.form1.Rooms1.value==''){
	errors += ' - Fail, Enter minimum rooms required. \n';
	}
	if (document.form1.Rooms2.value==''){
	errors += ' - Fail, Enter maximum rooms required. \n';
	}
	if (document.form1.Priority_Code.value==''){
	errors += ' - Fail, Enter the priority survey. \n';
	}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
	}
//------------------------------------------------------------------------------------
function reload(){
//window.parent.reload();
setTimeout('document.location.reload()',10000);}
//-------------------------------------------------------------------------------------
function val_s_complaint(){
	var errors='';
	var valor = parseInt(document.search1.Id_complaint.value);
	if (document.search1.Id_complaint.value.length >0){	 
	if ((isNaN(valor)) || (valor =='') || (valor ==' ')){
	document.search1.Id_complaint.value ='';
	errors += ' - NEED ISSUE NUMBER TO SEARCH. \n';
	}
	}
		if (errors) alert('Please check that you are searching using only numbers.\n\n'+errors);
 document.MM_returnValue = (errors == '');
	}
	///-------------------------------------------------------------------------------------------
		function val_s_complaint1(){
	var errors='';
	if ((isNaN(document.search1.Id_complaint.value)) || (document.search1.Id_complaint.value =='') || (document.search1.Id_complaint.value ==' ')){
	document.search1.Id_complaint.value ='';
	errors += ' - NEED ISSUE NUMBER TO SEARCH. \n';
	}
		if (errors) alert('Please check that you are searching using only numbers .\n\n'+errors);
 document.MM_returnValue = (errors == '');
	}
//-------------------------------------------------------------------------------------
function addOption(text, value){
var strValues = (text);
var strOptions= (value);
strValues = document.complaint.opciones.value  + strValues + "," ;
//strOptions= strOptions + "," + document.complaint.valores.value;
document.complaint.valores.value=strOptions;
document.complaint.opciones.value=strValues;
}
function delAllOptions(){
document.complaint.valores.value="";
document.complaint.opciones.value="";
document.complaint.temp.value="";
document.complaint.temp1.value="";
document.complaint.category.value="";
document.complaint.Button.disabled = false;
}
//--------------------------------------------------------------------------------/
function addOption1(text,dep){
var strValues = (text);
var val = (dep);
if (val!= 0){
	document.complaint.category.value = val;
	}
strValues = document.complaint.opciones.value  + strValues + "-->" ;
document.complaint.opciones.value=strValues;
	document.complaint.del_all.disabled = false;	
	document.complaint.Button.disabled = true;
}
//---------------------------------------------------------------------------------/
function addtemp(){
	if(document.complaint.opciones.value!=''){
	document.complaint.temp.value=document.complaint.opciones.value;
	document.complaint.temp1.value=document.complaint.valores.value;
	document.complaint.del_all.disabled = true;
	}
}
//--------------------------------------------------------------------------------/

//--------------------------------------------------------------------------------/
function adduser(value){
var strOptions= (value);
strOptions= strOptions + "," + document.note.usuarios.value;
document.note.usuarios.value=strOptions;
}
//------------------------------------------------------------------------------/
function val_prov(){
	var errors='';
if (document.form1.name.value==''){
	errors += ' - Fail , Enter Neme Provider. \n';
}
if (document.form1.phone.value==''){
	errors += ' - Fail , Enter Number Phone. \n';
}
if (document.form1.contact.value==''){
	errors += ' - Fail , Enter Name Contact. \n';
}
if (document.form1.type_provider.value==''){
	errors += ' - Fail , Enter Type Provider. \n';
}
if (document.form1.contact_email.value!=''){
	if(document.form1.contact_email.value.indexOf('@')==-1){
			errors += ' - The Email, does not correspond to a mail address validated. \n';
		}
	}	
if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//------------------------------------------------------------------------------/
function validarcargar(){ //v4.0
var errors='';
if ((document.Form1.subject.value=='')||(document.Form1.subject.value==' ')){
	errors += ' - Fail , Enter Subject of evidence. \n';
}
if (document.Form1.File1.value==''){
	errors += ' - Fail , Enter File of evidence. \n';
}
if ((document.Form1.description.value=='')||(document.Form1.description.value==' ')){
	errors += ' - Fail , Enter Description of evidence. \n';
}
if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//-----------------------------------------------------------------------------------
function val_mail()
{ //v4.0
var errors='';
if (document.form1.email.value==''){
	errors += ' - Fail , Enter the Email.  \n';
	}	
	else{
		if(document.form1.email.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}	
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//------------------------------------------------------------------------------------/
function vali_user()
{ //v4.0
var errors='';
	if (document.user.name.value==''){
	errors += ' - Fail , Enter the name. \n';
	}
	if (document.user.lastname.value==''){
	errors += ' - Fail , Enter the lastname. \n';
	}
	if (document.user.job.value==''){
	errors += ' - Fail , Enter the title Job. \n';
	}	
	if (document.user.email.value==''){
	errors += ' - Fail , Enter the Email.  \n';
	}	
	else{
		if(document.user.email.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}	
	if (document.user.email2.value==''){
	errors += ' - Fail , Enter the Email Confirm.  \n';
	}	
	else{
		if(document.user.email2.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}
	if(document.user.email.value!=document.user.email2.value){
	errors +=  ' - Fail ,The confirm the Email is Incorrect \n';
	}	
	if(document.user.employee_number.value==""){
	errors += ' - Fail , Enter the Employee Number.  \n';
	}
		else{
			if(document.user.employee_number.value.length>6){
			errors += ' - Fail , There needs your number of complete employee NOT a number with more digits.  \n';
				}
				if(document.user.employee_number.value.length<6){
			errors += ' - Fail , There needs your number of complete employee NOT a number with fewer digits.  \n';
				}
			}
		if(document.user.pas.value==""){
	errors += ' - Fail , Enter the Password.  \n';
	}	
	if(document.user.pas2.value==""){
	errors += ' - Fail , Enter the Password of confirm.  \n';
	}	

	if(document.user.pas.value!=document.user.pas2.value){
	errors += ' - Fail ,The confirm the Password is Incorrect \n' ;
	}	
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//------------------------------------------------------------------------------------/
function vali_user1()
{ //v4.0
var errors='';
	if ((document.user.name.value=='')||(document.user.name.value==' ')){
	errors += ' - Fail , Enter the name. \n';
	}
	if ((document.user.lastname.value=='')||(document.user.lastname.value==' ')){
	errors += ' - Fail , Enter the lastname. \n';
	}
	if ((document.user.email.value=='')||(document.user.email.value==' ')){
	errors += ' - Fail , Enter the Email.  \n';
	}	
	else{
		if(document.user.email.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}	
	if ((document.user.email2.value=='')||(document.user.email2.value==' ')){
	errors += ' - Fail , Enter the Email Confirm.  \n';
	}	
	else{
		if(document.user.email2.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}
	if(document.user.email.value!=document.user.email2.value){
	errors +=  ' - Fail ,The confirm the Email is Incorrect \n';
	}	
	if((document.user.pas.value=="")||(document.user.pas.value==" ")){
	errors += ' - Fail , Enter the Password.  \n';
	}	
	if((document.user.pas2.value=="")||(document.user.pas2.value==" ")){
	errors += ' - Fail , Enter the Password of confirm.  \n';
	}	

	if(document.user.pas.value!=document.user.pas2.value){
	errors += ' - Fail ,The confirm the Password is Incorrect \n' ;
	}	
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//--------------------------------------------------------------------------------/
function vali_upuser()
{ //v4.0
var errors='';
	if ((document.user1.name.value=='')||(document.user1.name.value==' ')){
	errors += ' - Fail , Enter the name. \n';
	}
	if ((document.user1.lastname.value=='')||(document.user1.lastname.value==' ')){
	errors += ' - Fail , Enter the lastname. \n';
	}
	
	
	if ((document.user1.email.value!='')||(document.user1.email.value!=' ')){
		if(document.user1.email.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
			}
			if ((document.user1.email2.value=='')||(document.user1.email2.value=='')){
				errors += ' - Fail , Enter the Email Confirm.\n';
				}	
				else{
					if(document.user1.email2.value.indexOf('@')==-1){
						errors += ' - The confirm email, does not correspond to a mail address validated. \n';
							}
					}
		}
		
	if(document.user1.email.value!=document.user1.email2.value){
	errors +=  ' - Fail ,The confirm the Email is Incorrect \n';
	}	
	if((document.user1.employee_number.value=="")||(document.user1.employee_number.value==" ")){
	errors += ' - Fail , Enter the Employee Number.  \n';
	}
	if((document.user1.pas.value!="")&&(document.user1.pas.value!=" "))
	{
	if((document.user1.pas2.value=="")||(document.user1.pas2.value==" ")){
	errors += ' - Fail , Enter the Password of confirm.  \n';
		}
	}	
	if(document.user1.pas.value!=document.user1.pas2.value){
	errors += ' - Fail ,If it is going to change the password it is necessary to fill the corresponding fields with the same information. \n' ;
	}	
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//---------------------------------------------------------------------------------/
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-------------------------------------------------------------------/

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//----------------------------------------------------------------------------/
function GP_popupConfirmMsg(msg) { //v1.0
  document.MM_returnValue = confirm(msg);
}
//-----------------------------------------------------------------------------------/
function val_ans(){
	var errors='';
	if ((document.answer.message.value=='') || (document.answer.message.value==' ')){
	errors += ' - Fail , To send the message it is necessary to fill the field Message.. \n';
	}
	if ((document.answer.subject2.value=='') || (document.answer.subject2.value==' ')){
	errors += ' - Fail , To send the message it is necessary to fill the field Subject. \n';
	}
//	if (document.answer.to.value==''){
//	errors += ' - Fail , Enter the Email.  \n';
//	}	
//	else{
//		if(document.answer.to.value.indexOf('@')==-1){
//			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
//		}
//	}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//-------------------------------------------------------------------------------------/
function val_rep(){
	var errors='';
	if (document.report.until.value!=''){
		if(document.report.from.value>document.report.until.value)
	errors += ' - Fail , The date from must be a minor that the date until. \n';
	}
		if(document.report.n_employee.value!=""){
			if(document.report.n_employee.value.length>6){
			errors += ' - Fail , There needs your number of complete employee NOT a number with more digits.  \n';
				}
				if(document.report.n_employee.value.length<6){
			errors += ' - Fail , There needs your number of complete employee NOT a number with fewer digits.  \n';
				}
			}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//--------------------------------------------------------------------------------------/
function cargar1_onsubmit()
{ //v4.0
var errors='';
	if (document.nnew.NAME.value==''){
	errors += ' - Fail , Enter the name. \n';
	}
	if (document.nnew.LASTNAME.value==''){
	errors += ' - Fail , Enter the lastname. \n';
	}
	if (document.nnew.JOB.value==''){
	errors += ' - Fail , Enter the title Job. \n';
	}	
	if (document.nnew.PHONE.value==''){
	errors += ' - Fail , Enter the phone. \n';}
	else{
	var number = parseFloat(document.nnew.PHONE.value);
	if (isNaN(number)){
	errors += ' - Fail , Enter the value number. \n';
		}
	}
	if (document.nnew.EMAIL.value==''){
	errors += ' - Fail , Enter the Email.  \n';
	}	
	else{
		if(document.nnew.EMAIL.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}	
	if (document.nnew.EMAIL2.value==''){
	errors += ' - Fail , Enter the Email Confirm.  \n';
	}	
	else{
		if(document.nnew.EMAIL2.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}
	if(document.nnew.EMAIL.value!=document.nnew.EMAIL2.value){
	errors +=  ' - Fail ,The confirm the Email is Incorrect \n';
	}	
	if(document.nnew.PASS.value!=document.nnew.PASS2.value){
	errors += ' - Fail ,The confirm the Password is Incorrect \n' ;
	}	
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//-------------------------------------------------------------------------------------------
/*function size(){
File f = new File("c:\\temp\\archivo.txt");  
long = f.length();
} Tamaño del archivo */ 
//-------------------------------------------------------------------------------------/
function val_pass(){
	var errors='';
	if (document.loging.password.value == ''){		
	errors += ' - Fail , The information of the password NOT have until. \n';
	}
	if(document.loging.login.value == ''){			
			errors += ' - Fail , The Information of the Login NOT have until.  \n';
				}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//--------------------------------------------------------------------------------------//
function val_hotel(){
	var errors='';
	if (document.dates.contac.value == ''){		
	errors += ' - Fail , The Information of the Contact NOT have until. \n';
	}
	if(document.dates.mailcontac.value == ''){			
			errors += ' - Fail , The Information of the Email of Contact NOT have until.  \n';
				}
					else{
		if(document.dates.mailcontac.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}	
	if(document.dates.fech1.value == ''){			
			errors += ' - Fail , The Information of the Start Contract NOT have until.  \n';
				}
					if(document.dates.fech2.value == ''){			
			errors += ' - Fail , The Information of the End Contract NOT have until.  \n';
				}
					if(document.dates.fech2.value < document.dates.fech1.value){			
			errors += ' - Fail , The date of End contract cannot be a minor that that of Start Contract. \n';
				}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//--------------------------------------------------------------------------------------//
function val_compl(){
	var errors='';	
	if (document.complaint.hotels.value==''){
	errors += ' - It appears you did not select a Hotel Name/Provider Name. \n';
	}
	if (document.complaint.opciones.value==''){
	errors += ' - You did not select the type of issue. \n';
	}
//	if (document.complaint.room.value==''){
//	errors += ' - Fail , The number of your room. \n';
//	}
//	if (document.complaint.layover_flight.value==''){
//	errors += ' - Fail , The number of layover flight. \n';
//	}
//	if (document.complaint.departure_flight.value==''){
//	errors += ' - Fail , The number of departure flight. \n';
//	}
//	if (document.complaint.layover_city.value==''){
//	errors += ' - Fail , The Arrival city. \n';
//	}
	if (document.complaint.priority.value==''){
	errors += ' - The priority empty. \n';
	}
	if (document.complaint.titulo.value=='' || document.complaint.titulo.value==" "){
	errors += ' - You did not enter a subject for your issue. \n';
	}
	if (document.complaint.text.value==''  || document.complaint.text.value==" "){
	errors += ' - You did not describe your issue . \n';
	}
//	if (document.complaint.fech1.value==''){
//	errors += ' - There is no arrival date. \n';
//	}
	if (document.complaint.issue_date.value==''){
	errors += ' - There is no date of occurrence . \n';
	}
	//*******************************************************************************************************
String1 = document.complaint.issue_date.value;
String2 = document.complaint.now.value;
// Si los dias y los meses llegan con un valor menor que 10 
// Se concatena un 0 a cada valor dentro del string 
if (String1.substring(1,2)=="/") {
String1="0"+String1
}
if (String1.substring(4,5)=="/"){
String1=String1.substring(0,3)+"0"+String1.substring(3,9)
}

if (String2.substring(1,2)=="/") {
String2="0"+String2
}
if (String2.substring(4,5)=="/"){
String2=String2.substring(0,3)+"0"+String2.substring(3,9)
}

mes1=String1.substring(0,2);
dia1=String1.substring(3,5);
anyo1=String1.substring(6,10);
mes2=String2.substring(0,2);
dia2=String2.substring(3,5);
anyo2=String2.substring(6,10);


if (dia1 == "08") // parseInt("08") == 10 base octogonal
dia1 = "8";
if (dia1 == '09') // parseInt("09") == 11 base octogonal
dia1 = "9";
if (mes1 == "08") // parseInt("08") == 10 base octogonal
mes1 = "8";
if (mes1 == "09") // parseInt("09") == 11 base octogonal
mes1 = "9";
if (dia2 == "08") // parseInt("08") == 10 base octogonal
dia2 = "8";
if (dia2 == '09') // parseInt("09") == 11 base octogonal
dia2 = "9";
if (mes2 == "08") // parseInt("08") == 10 base octogonal
mes2 = "8";
if (mes2 == "09") // parseInt("09") == 11 base octogonal
mes2 = "9";

dia1=parseInt(dia1);
dia2=parseInt(dia2);
mes1=parseInt(mes1);
mes2=parseInt(mes2);
anyo1=parseInt(anyo1);
anyo2=parseInt(anyo2);
if (anyo1>anyo2)
{
errors += ' - The date ocurrence cannot be later than todays date. \n';
}

if ((anyo1==anyo2) && (mes1>mes2))
{
errors += ' - The date ocurrence cannot be later than todays date. \n';
}
if ((anyo1==anyo2) && (mes1==mes2) && (dia1>dia2))
{
errors += ' - The date ocurrence cannot be later than todays date. \n';
} 
//*********************************************************************************************************//
	if (document.complaint.fech1.value!=''){
String1 = document.complaint.fech1.value;
String2 = document.complaint.now.value;
// Si los dias y los meses llegan con un valor menor que 10 
// Se concatena un 0 a cada valor dentro del string 
if (String1.substring(1,2)=="/") {
String1="0"+String1
}
if (String1.substring(4,5)=="/"){
String1=String1.substring(0,3)+"0"+String1.substring(3,9)
}

if (String2.substring(1,2)=="/") {
String2="0"+String2
}
if (String2.substring(4,5)=="/"){
String2=String2.substring(0,3)+"0"+String2.substring(3,9)
}

mes1=String1.substring(0,2);
dia1=String1.substring(3,5);
anyo1=String1.substring(6,10);
mes2=String2.substring(0,2);
dia2=String2.substring(3,5);
anyo2=String2.substring(6,10);


if (dia1 == "08") // parseInt("08") == 10 base octogonal
dia1 = "8";
if (dia1 == '09') // parseInt("09") == 11 base octogonal
dia1 = "9";
if (mes1 == "08") // parseInt("08") == 10 base octogonal
mes1 = "8";
if (mes1 == "09") // parseInt("09") == 11 base octogonal
mes1 = "9";
if (dia2 == "08") // parseInt("08") == 10 base octogonal
dia2 = "8";
if (dia2 == '09') // parseInt("09") == 11 base octogonal
dia2 = "9";
if (mes2 == "08") // parseInt("08") == 10 base octogonal
mes2 = "8";
if (mes2 == "09") // parseInt("09") == 11 base octogonal
mes2 = "9";

dia1=parseInt(dia1);
dia2=parseInt(dia2);
mes1=parseInt(mes1);
mes2=parseInt(mes2);
anyo1=parseInt(anyo1);
anyo2=parseInt(anyo2);
if (anyo1>anyo2)
{
errors += ' - The date of arrival cannot be later than todays date. \n';
}

if ((anyo1==anyo2) && (mes1>mes2))
{
errors += ' - The date of arrival cannot be later than todays date. \n';
}
if ((anyo1==anyo2) && (mes1==mes2) && (dia1>dia2))
{
errors += ' - The date of arrival cannot be later than todays date. \n';
} 

		}
		//************************************************************************************************
String1 = document.complaint.fech1.value;
String2 = document.complaint.fech2.value;
// Si los dias y los meses llegan con un valor menor que 10 
// Se concatena un 0 a cada valor dentro del string 
if (String1.substring(1,2)=="/") {
String1="0"+String1
}
if (String1.substring(4,5)=="/"){
String1=String1.substring(0,3)+"0"+String1.substring(3,9)
}

if (String2.substring(1,2)=="/") {
String2="0"+String2
}
if (String2.substring(4,5)=="/"){
String2=String2.substring(0,3)+"0"+String2.substring(3,9)
}

mes1=String1.substring(0,2);
dia1=String1.substring(3,5);
anyo1=String1.substring(6,10);
mes2=String2.substring(0,2);
dia2=String2.substring(3,5);
anyo2=String2.substring(6,10);


if (dia1 == "08") // parseInt("08") == 10 base octogonal
dia1 = "8";
if (dia1 == '09') // parseInt("09") == 11 base octogonal
dia1 = "9";
if (mes1 == "08") // parseInt("08") == 10 base octogonal
mes1 = "8";
if (mes1 == "09") // parseInt("09") == 11 base octogonal
mes1 = "9";
if (dia2 == "08") // parseInt("08") == 10 base octogonal
dia2 = "8";
if (dia2 == '09') // parseInt("09") == 11 base octogonal
dia2 = "9";
if (mes2 == "08") // parseInt("08") == 10 base octogonal
mes2 = "8";
if (mes2 == "09") // parseInt("09") == 11 base octogonal
mes2 = "9";

dia1=parseInt(dia1);
dia2=parseInt(dia2);
mes1=parseInt(mes1);
mes2=parseInt(mes2);
anyo1=parseInt(anyo1);
anyo2=parseInt(anyo2);
if (anyo1>anyo2)
{
errors += ' - Arrival date cannot be later than departure date. \n';
}

if ((anyo1==anyo2) && (mes1>mes2))
{
errors += ' - Arrival date cannot be later than departure date. \n';
}
if ((anyo1==anyo2) && (mes1==mes2) && (dia1>dia2))
{
errors += ' - Arrival date cannot be later than departure date. \n';
} 

//************************************************************************************************

	if (document.complaint.fech1.value!=''){
String1 = document.complaint.fech1.value;
String2 = document.complaint.issue_date.value;
// Si los dias y los meses llegan con un valor menor que 10 
// Se concatena un 0 a cada valor dentro del string 
if (String1.substring(1,2)=="/") {
String1="0"+String1
}
if (String1.substring(4,5)=="/"){
String1=String1.substring(0,3)+"0"+String1.substring(3,9)
}

if (String2.substring(1,2)=="/") {
String2="0"+String2
}
if (String2.substring(4,5)=="/"){
String2=String2.substring(0,3)+"0"+String2.substring(3,9)
}

mes1=String1.substring(0,2);
dia1=String1.substring(3,5);
anyo1=String1.substring(6,10);
mes2=String2.substring(0,2);
dia2=String2.substring(3,5);
anyo2=String2.substring(6,10);


if (dia1 == "08") // parseInt("08") == 10 base octogonal
dia1 = "8";
if (dia1 == '09') // parseInt("09") == 11 base octogonal
dia1 = "9";
if (mes1 == "08") // parseInt("08") == 10 base octogonal
mes1 = "8";
if (mes1 == "09") // parseInt("09") == 11 base octogonal
mes1 = "9";
if (dia2 == "08") // parseInt("08") == 10 base octogonal
dia2 = "8";
if (dia2 == '09') // parseInt("09") == 11 base octogonal
dia2 = "9";
if (mes2 == "08") // parseInt("08") == 10 base octogonal
mes2 = "8";
if (mes2 == "09") // parseInt("09") == 11 base octogonal
mes2 = "9";

dia1=parseInt(dia1);
dia2=parseInt(dia2);
mes1=parseInt(mes1);
mes2=parseInt(mes2);
anyo1=parseInt(anyo1);
anyo2=parseInt(anyo2);
if (anyo1>anyo2)
{
errors += ' - Date of occurrence cannot be earlier than arrival date. \n';
}

if ((anyo1==anyo2) && (mes1>mes2))
{
errors += ' - Date of occurrence cannot be earlier than arrival date. \n';
}
if ((anyo1==anyo2) && (mes1==mes2) && (dia1>dia2))
{
errors += ' - Date of occurrence cannot be earlier than arrival date. \n';
} 

		}
//************************************************************************************************************************
	if (document.complaint.fech2.value!=''){
String1 = document.complaint.issue_date.value;
String2 = document.complaint.fech2.value;
// Si los dias y los meses llegan con un valor menor que 10 
// Se concatena un 0 a cada valor dentro del string 
if (String1.substring(1,2)=="/") {
String1="0"+String1
}
if (String1.substring(4,5)=="/"){
String1=String1.substring(0,3)+"0"+String1.substring(3,9)
}

if (String2.substring(1,2)=="/") {
String2="0"+String2
}
if (String2.substring(4,5)=="/"){
String2=String2.substring(0,3)+"0"+String2.substring(3,9)
}

mes1=String1.substring(0,2);
dia1=String1.substring(3,5);
anyo1=String1.substring(6,10);
mes2=String2.substring(0,2);
dia2=String2.substring(3,5);
anyo2=String2.substring(6,10);


if (dia1 == "08") // parseInt("08") == 10 base octogonal
dia1 = "8";
if (dia1 == '09') // parseInt("09") == 11 base octogonal
dia1 = "9";
if (mes1 == "08") // parseInt("08") == 10 base octogonal
mes1 = "8";
if (mes1 == "09") // parseInt("09") == 11 base octogonal
mes1 = "9";
if (dia2 == "08") // parseInt("08") == 10 base octogonal
dia2 = "8";
if (dia2 == '09') // parseInt("09") == 11 base octogonal
dia2 = "9";
if (mes2 == "08") // parseInt("08") == 10 base octogonal
mes2 = "8";
if (mes2 == "09") // parseInt("09") == 11 base octogonal
mes2 = "9";

dia1=parseInt(dia1);
dia2=parseInt(dia2);
mes1=parseInt(mes1);
mes2=parseInt(mes2);
anyo1=parseInt(anyo1);
anyo2=parseInt(anyo2);
if (anyo1>anyo2)
{
errors += ' - Date of occurrence cannot be later than departure date. \n';
}

if ((anyo1==anyo2) && (mes1>mes2))
{
errors += ' - Date of occurrence cannot be later than departure date. \n';
}
if ((anyo1==anyo2) && (mes1==mes2) && (dia1>dia2))
{
errors += ' - Date of occurrence cannot be later than departure date. \n';
} }
//*******************************************************************************************************
//	if (document.complaint.subject1.value!=''){
//		if (document.complaint.file1.value==''){
//	errors += ' - You have not uploaded a file for evidence please remove the description or upload your file.\n';
//		}
//	}
	if(document.complaint.contacted1){
		if (document.complaint.contacted1.value==1){
		if (document.complaint.contacto.value==''){
	errors += ' - If it has informed to someone about his issue please to deposit whom..\n';
		}
	}}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//-------------------------------------------------------------------------------------/
function val_new(){
var errors='';
	if (document.newhotel.name.value==''){
	errors += ' - Fail , Select the Name Hotel. \n';
	}
		if (document.newhotel.phone.value==''){
	errors += ' - Fail , Select the Phone Hotel. \n';
	}
		if (document.newhotel.address.value==''){
	errors += ' - Fail , Select the Address Hotel. \n';
	}
		if (document.newhotel.country.value==''){
	errors += ' - Fail , Select the Country Hotel. \n';
	}
		if (document.newhotel.state.value==''){
	errors += ' - Fail , Select the State Or Providence Hotel. \n';
	}
		if (document.newhotel.metro.value==''){
	errors += ' - Fail , Select the Metro Area Hotel. \n';
	}
		if (document.newhotel.city.value==''){
	errors += ' - Fail , Select the City Hotel. \n';
	}
		if (document.newhotel.postalcode.value==''){
	errors += ' - Fail , Select the Postal Code Hotel. \n';
	}	
		if (document.newhotel.fax.value==''){
	errors += ' - Fail , Select the Main Fax Hotel. \n';
	}	
		if (document.newhotel.email.value==''){
	errors += ' - Fail , Select the Email Hotel. \n';
	}
	else{
		if(document.newhotel.email.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a mail address validated. \n';
		}
	}	
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//-------------------------------------------------------------------------------------/

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_dragLayer(objName,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v4.01
  //Copyright 1998 Macromedia, Inc. All rights reserved.
  var i,j,aLayer,retVal,curDrag=null,curLeft,curTop,IE=document.all,NS4=document.layers;
  var NS6=(!IE&&document.getElementById), NS=(NS4||NS6); if (!IE && !NS) return false;
  retVal = true; if(IE && event) event.returnValue = true;
  if (MM_dragLayer.arguments.length > 1) {
    curDrag = MM_findObj(objName); if (!curDrag) return false;
    if (!document.allLayers) { document.allLayers = new Array();
      with (document) if (NS4) { for (i=0; i<layers.length; i++) allLayers[i]=layers[i];
        for (i=0; i<allLayers.length; i++) if (allLayers[i].document && allLayers[i].document.layers)
          with (allLayers[i].document) for (j=0; j<layers.length; j++) allLayers[allLayers.length]=layers[j];
      } else {
        if (NS6) { var spns = getElementsByTagName("span"); var all = getElementsByTagName("div"); 
          for (i=0;i<spns.length;i++) if (spns[i].style&&spns[i].style.position) allLayers[allLayers.length]=spns[i];}
        for (i=0;i<all.length;i++) if (all[i].style&&all[i].style.position) allLayers[allLayers.length]=all[i]; 
    } }
    curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
    curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
    curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
    curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
    curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
    curDrag.MM_oldZ = (NS4)?curDrag.zIndex:curDrag.style.zIndex;
    curLeft= (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft; 
    if (String(curLeft)=="NaN") curLeft=0; curDrag.MM_startL = curLeft;
    curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop; 
    if (String(curTop)=="NaN") curTop=0; curDrag.MM_startT = curTop;
    curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop-cU;
    curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop+cD;
    curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
    document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
    if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  } else {
    var theEvent = ((NS)?objName.type:event.type);
    if (theEvent == 'mousedown') {
      var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
      var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
      var maxDragZ=null; document.MM_maxZ = 0;
      for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
        var aLayerZ = (NS4)?aLayer.zIndex:parseInt(aLayer.style.zIndex);
        if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
        var isVisible = (((NS4)?aLayer.visibility:aLayer.style.visibility).indexOf('hid') == -1);
        if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
          var parentL=0; var parentT=0;
          if (NS6) { parentLayer = aLayer.parentNode;
            while (parentLayer != null && parentLayer.style.position) {             
              parentL += parseInt(parentLayer.offsetLeft); parentT += parseInt(parentLayer.offsetTop);
              parentLayer = parentLayer.parentNode;
          } } else if (IE) { parentLayer = aLayer.parentElement;       
            while (parentLayer != null && parentLayer.style.position) {
              parentL += parentLayer.offsetLeft; parentT += parentLayer.offsetTop;
              parentLayer = parentLayer.parentElement; } }
          var tmpX=mouseX-(((NS4)?pageX:((NS6)?parseInt(style.left):style.pixelLeft)+parentL)+MM_hLeft);
          var tmpY=mouseY-(((NS4)?pageY:((NS6)?parseInt(style.top):style.pixelTop) +parentT)+MM_hTop);
          if (String(tmpX)=="NaN") tmpX=0; if (String(tmpY)=="NaN") tmpY=0;
          var tmpW = MM_hWidth;  if (tmpW <= 0) tmpW += ((NS4)?clip.width :offsetWidth);
          var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += ((NS4)?clip.height:offsetHeight);
          if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
              || maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
      if (curDrag) {
        document.onmousemove = MM_dragLayer; if (NS4) document.captureEvents(Event.MOUSEMOVE);
        curLeft = (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft;
        curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop;
        if (String(curLeft)=="NaN") curLeft=0; if (String(curTop)=="NaN") curTop=0;
        MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
        document.MM_curDrag = curDrag;  curDrag.MM_SNAPPED=false;
        if(curDrag.MM_toFront) {
          eval('curDrag.'+((NS4)?'':'style.')+'zIndex=document.MM_maxZ+1');
          if (!curDrag.MM_dropBack) document.MM_maxZ++; }
        retVal = false; if(!NS4&&!NS6) event.returnValue = false;
    } } else if (theEvent == 'mousemove') {
      if (document.MM_curDrag) with (document.MM_curDrag) {
        var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
        var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
        newLeft = mouseX-MM_oldX; newTop  = mouseY-MM_oldY;
        if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
        if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
        if (MM_bT!=null) newTop  = Math.max(newTop ,MM_bT);
        if (MM_bB!=null) newTop  = Math.min(newTop ,MM_bB);
        MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
        if (NS4) {left = newLeft; top = newTop;}
        else if (NS6){style.left = newLeft; style.top = newTop;}
        else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
        if (MM_dragJS) eval(MM_dragJS);
        retVal = false; if(!NS) event.returnValue = false;
    } } else if (theEvent == 'mouseup') {
      document.onmousemove = null;
      if (NS) document.releaseEvents(Event.MOUSEMOVE);
      if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
      if (document.MM_curDrag) with (document.MM_curDrag) {
        if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
            (Math.pow(MM_targL-((NS4)?left:(NS6)?parseInt(style.left):style.pixelLeft),2)+
             Math.pow(MM_targT-((NS4)?top:(NS6)?parseInt(style.top):style.pixelTop),2))<=MM_tol) {
          if (NS4) {left = MM_targL; top = MM_targT;}
          else if (NS6) {style.left = MM_targL; style.top = MM_targT;}
          else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
          MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
        if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
        if(MM_dropBack) {if (NS4) zIndex = MM_oldZ; else style.zIndex = MM_oldZ;}
        retVal = false; if(!NS) event.returnValue = false; }
      document.MM_curDrag = null;
    }
    if (NS) document.routeEvent(objName);
  } return retVal;
}
//-->
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

//-----------------------------------------------------------------------------------------------/
function redirect(URLStr) 
		{ 
		location = URLStr; 
		}
//-----------------------------------------------------------------------------------------------/
function val_note(){
var errors='';
	if ((document.note.titulo.value=='')||(document.note.titulo.value==' ')){
	errors += ' - Fail , Please the field fills Subject. \n';
	}
	if ((document.note.text.value=='')||(document.note.text.value==' ')){
	errors += ' - Fail , Please the field fills Note. \n';
	}	
if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//-------------de aca para abajo esta lo de view e inbox  ---------------------------------------
function messageWindow(title, msg)
{
  var width="300", height="125";
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  var msgWindow = window.open("","msgWindow", styleStr);
  var head = '<head><title>'+title+'</title></head>';
  var body = '<center><b>'+msg+'</b><br><p><form  method=\'post\' ><input  type="submit" value="Yes" >&nbsp;<input type="button" value="No" onClick="self.close()"></form>';
  msgWindow.document.write(head + body);
}

function addnote(id,usr)
	{
	var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no,height=300,width=720",
	fullurl = "addnotice.asp?id="+id+"&usr="+usr+"&tipo=1";
	wcontainer2  = open ( fullurl, "detalle1", params);      
	}
	function abrirevidence(id)
	{
	var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=yes,titlebar=yes,toolbar=no,height=250,width=370",
	fullurl = "evidencia.cfm?id="+id;
	wcontainer2  = open ( fullurl, "evidence1", params);      

	}

	function abrirnota(id)
	{
	var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no,height=300,width=500",
	fullurl = "viewnote.cfm?id="+id;
	wcontainer2  = open ( fullurl, "detalle1", params);      
	}
	function abrirchange(id)
	{
	var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no,height=200,width=500",
	fullurl = "changeticket.asp?id="+id;
	wcontainer2  = open ( fullurl, "detalle1", params);      

	}

    function asignLeader(id,usr)
	{
	var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no,height=500,width=800",
	fullurl = "frame_committeeRadio.asp?id_complaint="+id+"&id_user="+usr;
	wcontainer2  = open ( fullurl, "leader", params);  
	}
	
	function forward_issue(id) 
	 {
	    var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no,height=300,width=600",
	fullurl = "forward.asp?id_complaint="+id;
	wcontainer2  = open ( fullurl, "forward_issue", params); 
	 }
	 
	function agregar_usuario(id,usr)
	{
	var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=yes,titlebar=yes,toolbar=no,height=500,width=800",
	fullurl = "frame_committee.asp?id_complaint="+id+"&id_user="+usr;
	wcontainer2  = open ( fullurl, "list_usri", params);      
    wcontainer2.focus();
	}
function borrar_queja(queja,user)
	{
	var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no,height=150,width=350",
	fullurl = "desvincular.asp?id_user="+user+"&id_complaint="+queja+"&objeto=Complaint";
	wcontainer2  = open ( fullurl, "detalleX", params);  
	}
	
function descripcion(id)
	{
	var params = "dependent=yes,directories=no,hotkeys=no,location=no,menubar=no,personalbar=no,scrollbars=yes,status=no,titlebar=yes,toolbar=no,height=400,width=600",
	fullurl = "description.asp?id="+id;
	wcontainer2  = open ( fullurl, "detalle4", params);      

	}
	
function reloadPagina(){
}
function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
function recargar(){
	location.reload();
}
//-------------------------------------------------------------------------------------------------/
function val_newcontac(){
var errors='';
	if ((document.new_contact.name.value=='')||(document.new_contact.name.value==' ')){
	errors += ' - Enter name. \n';
	}	if ((document.new_contact.lastname.value=='')||(document.new_contact.lastname.value==' ')){
	errors += ' - Enter Lastname. \n';
	}	if ((document.new_contact.email.value=='')||(document.new_contact.email.value==' ')){
	errors += ' - Enter Email. \n';
	}	
		else{
		if(document.new_contact.email.value.indexOf('@')==-1){
			errors += ' - The confirm email, does not correspond to a Email address validated. \n';
		}
	}	
	if ((document.new_contact.phone.value=='')||(document.new_contact.phone.value==' ')){
	errors += ' - Enter Phone. \n';
	}
	if ((document.new_contact.address.value=='')||(document.new_contact.address.value==' ')){
	errors += ' - Enter Address. \n';
	}
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');
}
//-------------------------------------------------------------------------------------------------/
function val_check(){
	var a=0;
	for (var i = 1; i < 13; i++){
if (document.getElementById(i).checked){
		a+=1
		}
}
	if (a==0){
	alert('It appears you have left a required field checked, please try again.\n\n');
 }
 document.MM_returnValue = (a > 0);
	}
//-----------------------------------------------------------------------------------------------------/
function val_news(){
var errors='';	
	if ((document.form1.title.value=='') || (document.form1.title.value==' ')){
	errors += ' - Fail, title field can not be empty. \n';
	}
	if ((document.form1.description.value=='') || (document.form1.description.value==' ')){
	errors += ' - Fail, description field can not be empty. \n';
	}
	
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');

}
//-------------------------------------------------------------------------------------------------/
function val_com(){
var errors='';	
	if ((document.comment1.comment.value=='')||(document.comment1.comment.value==' ')){
	errors += ' - Fail , The field Comment can´t empty . \n';
	}
	
	if (errors) alert('It appears you have left a required field blank, please try again.\n\n'+errors);
 document.MM_returnValue = (errors == '');

}
//-------------------------------------------------------------------------------------------------
function aviso(valor){
var a=valor;
if (a==1){
alert ('The issue you are entering is affecting your Safety/Security.')
}
if (a==2){
alert ('The issue you are entering is affecting your comfort/convinience.')
}
if (a==3){
alert ('The issue you are entering is for Informational purpose only.')
}
}
//-----------------------------------------------------------------------------------------------------------
function user(){
if (document.getElementById('id_user').value == '')
alert ('- Please enter Crew Member');
}

//-----------------------------------------------------------------------------------------------------------
function validarEntero(valor,campo){ 
      //intento convertir a entero. 
     //si era un entero no le afecta, si no lo era lo intenta convertir 
     valor = parseInt(valor) 

      //Compruebo si es un valor numérico 
      if (isNaN(valor)) { 
            //entonces (no es numero) devuelvo el valor cadena vacia 
            document.getElementById(campo).value='';
      }else{ 
            //En caso contrario (Si era un número) devuelvo el valor
			if (valor<24){
            document.getElementById(campo).value=valor; }else{
			alert ('Hour maximum 23');
			document.getElementById(campo).value=23;
			}
      } 
} 
function validarEntero1(valor,campo){ 
      //intento convertir a entero. 
     //si era un entero no le afecta, si no lo era lo intenta convertir 
     valor = parseInt(valor) 

      //Compruebo si es un valor numérico 
      if (isNaN(valor)) { 
            //entonces (no es numero) devuelvo el valor cadena vacia 
            document.getElementById(campo).value='';
      }else{ 
            //En caso contrario (Si era un número) devuelvo el valor
			if (valor<60){
            document.getElementById(campo).value=valor; }else{
			alert ('Minutes maximum 59');
			document.getElementById(campo).value=59;
			}
      } 
} 