/*-----------------------------------------------------------------------------+
| Funções Gerais JavaScript                                                    |
+-----------------------------------------------------------------------------*/

function popup(url,w,h){
	window.open(url,"","toobar=no,location=no,directories=no,maximize=no,menubar=no,scrollbars=yes,status=no,resizable=no,WIDTH="+w+",HEIGHT="+h+",top=0,left=50");
}

function roundNumber(preco) {
	var numberField = preco;
	var rlength = 2; // The number of decimal places to round to
	var newnumber = Math.round(numberField*Math.pow(10,rlength))/Math.pow(10,rlength);
	return newnumber;
}


function IsNumeric(sText)
{
   var ValidChars = "123456789 ";
   var IsNumber=true;
   var Char;


   for (i = 0; i < sText.length && IsNumber == true; i++)
      {
      Char = sText.charAt(i);
      if (ValidChars.indexOf(Char) == -1)
         {
         IsNumber = false;
         }
      }
   return IsNumber;
}

$(document).ready(function(){ 
	//Pngfix
	$(document).pngFix();
	//FaceBox
	$('a[rel*=facebox]').facebox();
	//Jcaroussel
	$('#mycarousel').jcarousel({
		vertical: true,
		scroll: 1
	});
	//Troca Foto Galerias
	$('ul#mycarousel a.carrousel_thumb').click(function() {
		$('div.galeriaContainer div.maskBigGaleria').css("background", "url('/fotos/galerias/" + $(this).attr("id") + "') no-repeat center center" );
		return false;
	});
});
