// JavaScript Document

// Evita borda do flash no Explorer
function GerarSWF(arquivo,altura,largura,id,alig){
    document.writeln('    <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="' + largura + '" height="' + altura + '" align="' + alig + '" id="' + id + '">');
    document.writeln('        <param name="movie" value="' + arquivo + '" />');
    document.writeln('        <param name="FlashVars" value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />');
    //document.writeln('        <param name="bgcolor" value="#ffffff" />');
    //document.writeln('        <param name="menu" value="false" />');
    document.writeln('        <param name="quality" value="high" />');
    document.writeln('        <param name="salign" value="tl" />');
    //document.writeln('        <param name="scale" value="noscale" />');
    document.writeln('        <param name="wmode" value="transparent" />');
    document.writeln('        <embed id="globalnav-embed" src="' + arquivo + '" 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" name="' + id + '" width="' + largura + '" height="' + altura + '" align="' + alig + '"></embed>');
    document.writeln('    </object>');
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
  return true;
}
function OpenSaibaMais(){
window.open('byvisa.php','principal','height=435,width=270,top=0,left=0,resizable=no,status=1');
}


function tamtela() {
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;
}
windowWidth=0, windowHeight=0;
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;
}
}

function ajustaDiv() {
	tamtela();
	altDiv=pageHeight+"px";
	document.getElementById('conteiner').style.height=altDiv;  // altura da div conteiner
	altCont=(pageHeight-212)+"px";
	document.getElementById('colmenu').style.height=altCont;   // altura da div colmenu
 	if (windowWidth <= 800) {
		 aDiv=document.getElementById("animatopo");
		 aDiv.style.float="none";
		 aDiv.style.position="absolute";
		 aDiv.style.left="240px";
		 aDiv.style.top="13px";
		 aDiv.style.width="490px";
	}
	return true;
}
function confaction(msg) {
	msg="Tem certeza que deseja\n"+msg;
	var resp = confirm(msg);
	return resp;
}
