﻿// <summary>
// Abre Pop-up sem as barras de endereço e menus
// </summary>
(function($)
{
	$.Abrir = function(intW, intH, strLocation) {
	    window.open(strLocation, "JANELA", "height = " + intH + ", width =" + intW, "location = no", "toolbar = no");
    };

})(jQuery);


// <summary>
// Otimiza as mensagens do site
// </summary>
function MsgBox(blnVisible, blnStatus, strMsg, objDiv){
	
	  if(blnVisible)
	  {
		$.scrollTo(0, { duration: 1000, onAfter: function(){ $(objDiv).slideUp("normal", function(){
			strImagePath = (blnStatus ? "img/Icones/IcoOk.png" : "img/Icones/IcoErrorPage.png");
			objDiv.innerHTML = "<img src='" + strImagePath + "' /><span style='margin-left: 10px; vertical-align: top;'>" + strMsg + "</span>";
			$(objDiv).slideDown("normal"); });}});
	  }else
	  {
		$(objDiv).slideUp("normal");
	  }	  
}


(function($)
{
	$.managementTextValue = function(element, oldValue, newValue, nameFunction)
	{
		if(nameFunction == 'onfocus' && element.value == oldValue)
			{
				element.value = newValue;
			}
		else if(nameFunction == 'onblur' && element.value == '')
			{			
				element.value = newValue;
			}
	};
})(jQuery);