function TiltViewerJ()
{
	this.Width;
	this.Height;
	this.CaminhoXML;
	this.Linhas;
	this.Colunas;
	this.ShowFlipButton;
	this.ShowLinkButton;
	this.CorBordaImagem;
	this.CorAtrazImagem;
	this.CorInternaFundo;
	this.CorExternaFundo;
	this.TamanhoMaxImgs;

	this.show = function()
	{
		///UserCodeRegionStart:[show] (do not remove this comment.)
		document.write('<div id="flashcontent">TiltViewer requires JavaScript and the latest Flash player. <a href="http://www.macromedia.com/go/getflashplayer/">Get Flash here.</a></div>');
		var fo = new SWFObject("../static/TiltViewerJ/TiltViewer.swf", "viewer", this.Width, this.Height, "9.0.28", "#000000");
				
		fo.addVariable("useFlickr", "false");
		fo.addVariable("xmlURL", this.CaminhoXML);
		fo.addVariable("maxJPGSize",this.TamanhoMaxImgs);		
	
		fo.addVariable("useReloadButton", "False");
		fo.addVariable("columns",this.Colunas);
		fo.addVariable("rows", this.Linhas);
		
		fo.addVariable("showFlipButton", this.ShowFlipButton);
		fo.addVariable("showLinkButton", this.ShowLinkButton);
		
		fo.addVariable("frameColor", rgbToHexa(this.CorBordaImagem.R, this.CorBordaImagem.G, this.CorBordaImagem.B));
		fo.addVariable("backColor", rgbToHexa(this.CorAtrazImagem.R, this.CorAtrazImagem.G, this.CorAtrazImagem.B));
		
		fo.addVariable("bkgndInnerColor", rgbToHexa(this.CorInternaFundo.R, this.CorInternaFundo.G, this.CorInternaFundo.B));
		fo.addVariable("bkgndOuterColor", rgbToHexa(this.CorExternaFundo.R, this.CorExternaFundo.G, this.CorExternaFundo.B)); 
						
		fo.addParam("allowFullScreen","true");
	    fo.write("flashcontent");	
		
		
		
		
		
		
		///UserCodeRegionEnd: (do not remove this comment.)
	}
	///UserCodeRegionStart:[User Functions] (do not remove this comment.)
function rgbToHexa(CorRrgb,CorGrgb,CorBrgb)
{
	var CorRrgb;
	var CorGrgb;
	var CorBrgb;
	var CorRhex;
	var CorGhex;
	var CorBhex;
	var Hexadecimal;
	var CorExplodida = new Array() 
	var CorAntiga;
	var CorNova;
	
	
	CorRhex = dec2hex(CorRrgb);
	CorGhex = dec2hex(CorGrgb);
	CorBhex = dec2hex(CorBrgb);
	
	Hexadecimal = "#" + CorRhex + CorGhex + CorBhex;
	CorAntiga = Hexadecimal;
	CorExplodida = CorAntiga.split("#");
	CorNova = "0x"+CorExplodida[1];
	return CorNova;
}

function dec2hex(theDec) 
{
	
	var leftNum;
	var rightNum;
	var leftNumS;
	var rightNumS;
	var retNum;
	
	leftNum = Math.floor(theDec / 16);
	leftNumS = fixHex(leftNum);
	rightNum = theDec%16;
	rightNumS = fixHex(rightNum);
	retNum = leftNumS + rightNumS;
	
	return retNum;
}

function fixHex(theDec) 
{ 
	var hNum = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");
	var retHex = hNum[theDec];
	return retHex;
}
	
	
	
	
	
	///UserCodeRegionEnd: (do not remove this comment.):
}

