$(document).ready(function(){
    $("dd:not(:first)").hide();
	$("dt a:first").prev().attr("src","../../img/ListMarcFechar.gif");
    $("dt a").click(function(){
        $("dd:visible").slideUp("slow");
        $(this).parent().next().slideDown("slow");
		//alert($("dt a span").html());
		$("dt a").prev().attr("src","../../img/ListMarcAbrir.gif"); 
		$(this).prev().attr("src","../../img/ListMarcFechar.gif");
        return false;
	});
});


function pngAlpha(objImagem,strW,strH){
	if(document.all){
		document.write("<div style=\"position:absolute; bottom:80px; right:0px; width:"+strW+"; height:"+strH+"; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+objImagem+"');\">&nbsp;</div>");
	}
	else {document.write("<div style=\"position:absolute; bottom:80px; right:0px; \"><img src='"+objImagem+"'></div>");
	}
}

function flutuante(html) {
	var x = 400;
	var y = 400;
	var altura = $(window).height();
	var largura = $(window).width();
	$('#fundo').css({'width':largura, 'height':altura});						   
	$('#fundo').slideDown('slow');
	if(typeof(window.innerWidth) == 'number' ){
	largura = window.innerWidth;
	altura = window.innerHeight;
	} 
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	largura = document.documentElement.clientWidth;
	altura = document.documentElement.clientHeight;
	}
	largura = (largura-x)/2;
	altura = (altura-y)/2;
	$('#flutuante').css({'top':altura, 'left':largura, 'width':x, 'height':y});
	$('#flutuante').slideDown('medium');
	$('#contFlutuante').html(html);
};

function flutuantep(x,y, html) {
	var altura = $(window).height();
	var largura = $(window).width();
	$('#fundo').css({'width':largura, 'height':altura});						   
	$('#fundo').slideDown('slow');
	if (y == 0 || y == null || y == ''){
		y = 400;
	}	
	if (x == 0 || x == null || x == ''){
		x = 400;
	}
	if(typeof(window.innerWidth) == 'number' ){
	largura = window.innerWidth;
	altura = window.innerHeight;
	} 
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	largura = document.documentElement.clientWidth;
	altura = document.documentElement.clientHeight;
	}
	largura = (largura-x)/2;
	altura = (altura-y)/2;
	if (altura < 0) {
		altura = 0;
	}
	
	if (largura < 0) {
		largura = 0;
	}
	$('#flutuante').css({'top':altura, 'left':largura, 'width':x, 'height':y});
	$('#flutuante').slideDown('medium');
	$('#contFlutuante').html(html);	
};

function flutuanter(html) {
	var x = 550;
	var y = 600;
	var altura = $(window).height();
	var largura = $(window).width();
	$('#fundo').css({'width':largura, 'height':altura});						   
	$('#fundo').slideDown('slow');
	if(typeof(window.innerWidth) == 'number' ){
	largura = window.innerWidth;
	altura = window.innerHeight;
	} 
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	largura = document.documentElement.clientWidth;
	altura = document.documentElement.clientHeight;
	}
	largura = (largura-x)/2;
	altura = (altura-y)/2;
	$('#flutuante').css({'top':altura, 'left':largura, 'width':x, 'height':y});
	$('#contFlutuante').css('display','table');
	$('#flutuante').slideDown('medium');
	$('#contFlutuante').html(html);
};

$(document).ready(function(){
	$('.btnX').click(function(){
		$('#flutuante, #fundo').slideUp('medium');
		return false;
	});						   
});