var PromoArtDesCaves = Class.create({
	Show: function() {
		var Div = new Element('div', { 'id':'DivPromo', 'onclick':'Promo.Hide();' });
		Div.setStyle({
			'position': 'absolute',
			'top': '0px',
			'left': '0px',
			'background-color': '#000000',
			'width': this.getPageSize()['xScroll'] + 'px',
			'height': this.getPageSize()['yScroll'] + 'px',
			'opacity': 0.7
		});
		Div.update('<div onclick="Promo.Hide();" style="width:'+this.getPageSize()['xScroll']+'px;height:'+this.getPageSize()['yScroll']+'px;background-color:#000000;">&nbsp;</div>')
		$(document.body).insert(Div).show();
		
		var Div = new Element('div', { 'id':'DivPecaPromo' });
		Div.setStyle({
			'position': 'absolute',
			'top': '50px',
			'left': '200px',
			'width': '600px',
			'height': '422px'
		});
		
		var swf = '../floaterPromo/floater_sophistique_colors.swf?atualizadoEm=03/09/2009-17h40';
		var swfWidth = '750';
		var swfHeight = '400';
		
		var strHTML = '<object id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' + 
			'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ' + 
			'width="' + swfWidth + '" height="' + swfHeight + '">' + 
			'<param name="movie" value="' + swf + '" />' + 
			'<param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />' + 
			'<param name="quality" value="high" />' + 
			'<param name="wmode" value="transparent" />' +
			'<embed id="globalnav-embed" src="' + swf + '" type="application/x-shockwave-flash" ' +
			'pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" ' + 
			'flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#ffffff" menu="false" ' + 
			'quality="high" salign="tl" scale="noscale" width="' + swfWidth + '" height="' + swfHeight + '"></embed>'
			'</object>'
		
		Div.update(strHTML);
		$(document.body).insert(Div).show();
	},
	
	Hide: function() {
		//alert('Hide()');
		$('DivPecaPromo').remove();
		$('DivPromo').remove();
	},
	
	getPageSize: function() {
		var xScroll, yScroll;
		if (window.innerHeight && window.scrollMaxY) {
			xScroll = document.body.scrollWidth;
			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
			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;
		}
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else {
			pageHeight = yScroll;
		}
		
		return( { 
			'xScroll': xScroll, 
			'yScroll': yScroll, 
			'windowWidth': windowWidth, 
			'windowHeight': windowHeight, 
			'pageHeight': pageHeight 
		} );
	}
})

var Promo = new PromoArtDesCaves();

if(!FlashLinks) {
	var FlashLinks = function(Secao) {
		if(Secao.toLowerCase()=='fechar'){
			Promo.Hide();
		}
	}
}