winWidth = 400; // sets a default width for browsers who do not understand screen.width below
winheight = 400; // ditto for height

if (screen){ // weeds out older browsers who do not understand screen.width/screen.height
   winWidth = screen.width;
   winHeight = screen.height;
}

function swf($arquivo,$largura,$altura,$bg,$wmode,$title)
{
	document.writeln('<object type="application/x-shockwave-flash" data="' + $arquivo + '" width="' + $largura + '" height="' + $altura + '" title="' + $title + '" align="center">');
	document.writeln('<param name="movie" value="' + $arquivo + '">');
	document.writeln('<param name="bgcolor" value="#' + $bg + '">');
	document.writeln('<param name="wmode" value="' + $wmode + '">');
	document.writeln('<param name="menu" value="false">');
	document.writeln('<param name="quality" value="high">');
	document.writeln('</object>');
}

function popupWindow(){
	
	if(screen.width == 800){
		win = 'index800x600.php';
	}
	else{
		win = 'index1024x768.php';
	}	
	
	newWindow = window.open(win,'newWin','toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight+',left=0,top=0');
	newWindow.focus();
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function maximizar(){ 
	window.moveTo(0,0);
	window.resizeTo(screen.width,screen.height);
}

function abrir(pagina,largura,altura) {

	w = screen.width;
	h = screen.height;
	
	meio_w = w/2;
	meio_h = h/2;

	altura2 = altura/2;
	largura2 = largura/2;
	meio1 = meio_h-altura2;
	meio2 = meio_w-largura2;
	
	window.open(pagina,'','height=' + altura + ', width=' + largura + ', scrollbars=no, status=yes, top='+meio1+', left='+meio2+''); 
}