//Requerimientos, jQuery.js y Utilities.js
//
//ejemplo, de estructura valida para mostrar multiples errores.
// var MyTripsPanelPart= 
	// ids:[
		// {
			// 'idCtrl':'reserva',
			// 'divError':'divError',
			// 'colorValid':'#aaccdd',
			// 'colorInvalid':'#ddffee',
			// 'titleID':'htitle',
			// 'titleText':'Error Titulo',
			// 'messageID':'liError',
			// 'messageText':'Descripcin error',
			// 'IsEmpty':1,
			// 'RegularExp':'^[a-zA-Z]{2,}$'
		// },
		// {
			// 'idCtrl':'name',
			// 'divError':'divError',
			// 'colorValid':'#aaccdd',
			// 'colorInvalid':'#ddffee',
			// 'titleID':'htitle',
			// 'titleText':'Error Titulo',
			// 'messageID':'liError',
			// 'messageText':'Descripcion error 2',
			// 'IsEmpty':1,
			// 'RegularExp':'^(([0-9]{12,13})|([0-9a-zA-Z]{6})|([a-zA-Z]{2}[0-9]{6}))$'
		// }	
	// ]		
// ;


// var MyTripsPanelPart =
// {
	// message:'Numero de reservacion, boleto electronico',
	// ids:
		// [
			// {
				// 'idCtrl':'ctl00_SPWebPartManager1_g_ef2692ee_9139_444b_8289_34fdc0f208e8_txtReservation',
				// 'divError':'error',
				// 'messageID':'ulerror',
				// 'IsEmpty':1,
				// 'RegularExp':'^(([0-9]{12,13})|([0-9a-zA-Z]{6})|([a-zA-Z]{2}[0-9]{6}))$'
				// },
				// {
					// 'idCtrl':'ctl00_SPWebPartManager1_g_ef2692ee_9139_444b_8289_34fdc0f208e8_txtLastName',
					// 'divError':'error',
					// 'messageID':'ulerror',
					// 'IsEmpty':1,
					// 'RegularExp':'^[a-zA-Z]{2,}$'
				// }
			// ]
// };

function MyTripsPanelPart(){}

MyTripsPanelPart.prototype = new Utilities();

MyTripsPanelPart.prototype.CheckGeneralFormatForSingleMessage= function(params)
{
    var colorError = '#CC0000';
	var result = this.IsValidGeneralFormat(params, colorError);
	
	if(result==false)
	{
		result = this.RenderError(params.ids[0].divError,params.ids[0].messageID,params.message);
	}	 
	return !result;
}

var myTrips = new MyTripsPanelPart();

function IsValidMyTripPanelInputs(sender, args){
	if(myTrips.CheckGeneralFormatForSingleMessage(MyTripsPanelPart)){
		args.IsValid = true;
	}
	else{
		args.IsValid = false;
	}
}