// JavaScript Document
function showBanner(imagem, url)
{
	objImg = new Image()
	objImg.src = 'imagens/'+imagem 
	var img_b = 'imagens/'+imagem
	var url
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;


	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}
	pageWidth = parseInt(pageWidth)-270
	
	
	if (document.all)
	{
		//var wtop = parseInt(document.documentElement.scrollTop) + 20
		var wtop = ( (parseInt(screen.height) - 450) / 2 ) - 50
		
	}
	else
	{
		//var wtop = parseInt(window.scrollY) + 20
		var wtop = ( (parseInt(screen.height) - 450) / 2 ) - 50
	}
	
	
	//var wleft = ( (parseInt(pageWidth) - 1000) / 2 )
	wleft = ( (1000-parseInt(427)) / 2)
	wleft = parseInt(wleft)
	
	$("#caixaCores").remove()
	$("#fundoOpacoBannner").remove()	
	str = "<div id='caixaCores'>"	
	str += "<a href='"+url+"'><img src='"+img_b+"' id='imgBanner' alt='' border='0'></a>"
	str += "<div id='div_fecharCor'><img src='imagens/aniver09/fechar.jpg' id='btn_fechar' title='Fechar' alt='Fechar'></div>"
	str +="</div>"

	
	$(str).css("left",wleft).css("top",wtop).appendTo("body")
	
	$("#btn_fechar").click(function(){
		$("#caixaCores").remove()		
		$("#fundoOpacoBannner").remove()
		foto_atual = 0;
		id_foto_atual = "#img_0"
	})

	
	
	$("<div id='fundoOpacoBannner'>&nbsp;</div>").appendTo("body")		
	
	objF = document.getElementById('fundoOpacoBannner')
	objF.style.width = pageWidth + "px"
	
	objF.style.height = (pageHeight) + "px"
	$("#fundoOpacoBannner").click(function(){
		$("#div_fecharCor").remove()		
		$("#caixaCores").remove()		
		$("#fundoOpacoBannner").remove()		
		foto_atual = 0;
		id_foto_atual = "#img_0"
		
		
	})
	
}
