jQuery.noConflict();

function closePopupIfNoErrors(idForm, idPopup) {
	if (jQuery('#'+ idForm +' .error').length <= 0){
		Richfaces.hideModalPanel(idPopup);
	}
}

function callMethod(theMethod, theParameter) {
	if (theMethod == undefined || theMethod == null || theMethod == '')
		return;
		
	switch(theMethod) {
		// Show del icono de carga para el buscador del list.xhtml
		case 'LoadingBuscador.show':
			if (typeof LoadingBuscador != 'object')
				break;
				
			if (typeof LoadingBuscador.show != 'function')
				break;
			
			LoadingBuscador.show();
		break;
		
		// Hide del icono de carga para el buscador del list.xhtml
		case 'LoadingBuscador.hide':
			if (typeof LoadingBuscador != 'object')
				break;
			
			if (typeof LoadingBuscador.hide != 'function')
				break;	
			
			LoadingBuscador.hide();
		break;
		
		// Bindeo del TimeSelector
		case 'jQuery.timeSelector':
			if (typeof jQuery != 'function')
				break;
				
			if (typeof jQuery.timeSelector != 'function')
				break;
			
			
			jQuery('input.inputTime').timeSelector();
		break;
		
		// Resizeo de textarea
		case 'jQuery.resizeTextarea':
			if (typeof jQuery != 'function')
				break;
				
			if (typeof jQuery.resizeTextarea != 'function')
				break;
			
			
			jQuery('textarea').resizeTextarea();
		break;
		
		// Counter de textarea
		case 'jQuery.counterTextarea':
			if (typeof jQuery != 'function')
				break;
				
			if (typeof jQuery.counterTextarea != 'function')
				break;
			
			
			jQuery('textarea').counterTextarea();
		break;
		
		// Show del icono estándar del plugin loading de jQuery
		case 'jQuery.showLoadingHtml':
			if (typeof jQuery != 'function')
				break;
				
			if (typeof jQuery.showLoadingHtml != 'function')
				break;
			
			if (theParameter == undefined || theParameter == null || theParameter == '') {
				jQuery.showLoadingHtml();
			}
			else {
				jQuery.showLoadingHtml(theParameter);
			}
		break;
		
		// Hide del icono estándar del plugin loading de jQuery
		case 'jQuery.hideLoadingHtml':
			if (typeof jQuery != 'function')
				break;
				
			if (typeof jQuery.hideLoadingHtml != 'function')
				break;
			
			if (theParameter == undefined || theParameter == null || theParameter == '') {
				jQuery.hideLoadingHtml();
			}
			else {
				jQuery.hideLoadingHtml(theParameter);
			}
		break;
		
		// Bindeo de eventos para los efectos de :hover en las filas de las tablas
		case 'TABLES.hover':
			if (typeof TABLES != 'object')
				break;
				
			if (typeof TABLES.hover != 'function')
				break;
				
			TABLES.hover();
		break;
		
		// Show para el loading del paginador Ajax
		case 'TABLES.pagerAjaxInit':
			if (typeof TABLES != 'object')
				break;
				
			if (typeof TABLES.pagerAjaxInit != 'function')
				break;
				
			TABLES.pagerAjaxInit();
		break;
		
		// Hide para el loading del paginador Ajax
		case 'TABLES.pagerAjaxFinish':
			if (typeof TABLES != 'object')
				break;
				
			if (typeof TABLES.pagerAjaxFinish != 'function')
				break;
				
			TABLES.pagerAjaxFinish();
		break;
		
		// Re-bindeo de calendarios fd-datepicker
		case 'datepicker':
			if (typeof datePickerController.create != 'function')
				break;
				
			datePickerController.create();
		break;
		
		case 'appTimeout':
			if (typeof appTimeout != 'function')
				break;
			
			if (theParameter == undefined || theParameter == null || theParameter == '') {
				appTimeout('/');
			}
			else {
				appTimeout(theParameter);
			}
		break;
	}
}