function oculta(selector)
{
	//alert(selector);
	//$(selector).fadeOut(500);
	$(selector).hide(500);
}

//pselecciona
function muestra(selector)
{
	//$(selector).fadeIn(500);
	//alert(selector);
	$(selector).show(500);
}

function quita(selector)
{
	//$(selector).fadeOut(500);
	$( selector + " textarea[class*=editor]" ).each(
		// For each hottie, run this code. The "indIndex" is the
		// loop iteration index on the current element.
		function( intIndex ){
			//alert($(this).attr('id'));
			tinyMCE.execCommand('mceFocus', false, $(this).attr('id'));
			tinyMCE.execCommand('mceRemoveControl', false, $(this).attr('id'));
		}
	);

	$(selector).hide(500,$(selector).remove());
}

function reemplaza(selector,html)
{
	//alert(html);
	//alert(selector);
	//html=utf8_decode(html);

	$(selector).hide(500);
	$(selector).replaceWith(html);
	$(selector).show(500);
}


function CargaSeleccion(url)
{
	$.ajax({
			url: url,
			cache: false,
			success: function(html){
			html=utf8_decode(html);
		    checkResponse(html);
		    //alert(html);
		  }
		});
	return false;
}

function inicializaPestanas(width)
{
	//$('.pestanaX .pestana').click(function () {
	$('.pestanaIzq .pestana').mouseenter(function () {
		changewidth($(this).parent(),width);
		changepadding($(this).parent(),'10px');
		//$(this).parent().css("width","92%");
	});

	$('.pestanaIzq').mouseleave(function () {
		if( $(this).css("width") == width ){
			changewidth($(this),"0%")
			changepadding($(this),"0%")
		}
		//$('formordenNotas
		//$(this).css("width","0%");
	});
}

function changewidth(elem,newsize)
{
	elem.animate({"width": newsize}, 350);

}
function changepadding(elem,newsize)
{
	elem.animate({"padding": newsize}, 350);

}
function despliega(variable,ancho,alto,barr){ window.open(variable,"Online","scrollbars=yes,resizable=yes,width="+ancho+",height="+alto); }
