window.onerror = function() { return true };
// === onload geral
function aoCarregar() {
	// home
	if(window.location.href.indexOf('content/home',0)!=-1) {

	// internas
	} else {
		imgCarregar();
	}
	wSt();
}
onload=aoCarregar;
//
function imgCarregar() {
	p="../../images/menu/";
	MM_preloadImages(p+'btn_companyoverview_ovr.gif');
}
// window.status
function wSt(t) {
	t=(t==null)?'Embraer Image Gallery':'Embraer Image Gallery: '+t;
	window.status=t;
}
// ===
function swfZoom(imgNum,w,h) {
	w=swfGrande[imgNum].width;
	h=swfGrande[imgNum].height+19;
	strBody='';
	strBody=strBody+'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
	strBody=strBody+'<html>';
	strBody=strBody+'<head>';
	strBody=strBody+'<title>Legacy by Embraer</title>';
	strBody=strBody+'</head>';
	strBody=strBody+'<body bgcolor="#ffffff" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">';
	strBody=strBody+'<OBJECT id="flash_object" name="flash.swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,30,0" width="'+swfGrande[imgNum].width+'" height="'+swfGrande[imgNum].height+'">';
	strBody=strBody+'<PARAM name="movie" value="'+swfGrande[imgNum].src+'" />';
	strBody=strBody+'<PARAM name="scale" value="scale" />';
	strBody=strBody+'<PARAM name="salign" value="TL" />';
	strBody=strBody+'<PARAM name="loop" value="false" />';
	strBody=strBody+'<PARAM name="quality" value="high" />';
	strBody=strBody+'<PARAM name="menu" value="false" />';
	strBody=strBody+'<PARAM name="wmode" value="opaque" />';
	strBody=strBody+'<EMBED id="flash_embed" name="flash.swf" src="'+swfGrande[imgNum].src+'" wmode="opaque" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" flashvars="" scale="scale" salign="TL" loop="false" quality="high" menu="false" width="'+swfGrande[imgNum].width+'" height="'+swfGrande[imgNum].height+'"></EMBED></OBJECT><br>';
	strBody=strBody+'<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	strBody=strBody+'<tr>';
	strBody=strBody+'<td bgcolor="#D5D5D5"><img src="../../images/pix.gif" width="10" height="19" alt=""></td>';
	strBody=strBody+'<td width="100%" bgcolor="#D5D5D5" background="../../images/bgr_pop_barra.gif"><img src="../../images/pixel.gif" width="1" height="1"></td>';
	strBody=strBody+'<td><a href="javascript:window.top.close();"><img src="../../images/btn_pop_close.gif" width="58" height="19" alt="Close" title="Close" border="0"></a></td>';
	strBody=strBody+'</tr>';
	strBody=strBody+'</table>';
	strBody=strBody+'</body>';
	strBody=strBody+'</html>';
	wOpen('','_blank',w,h,'no',strBody,'');
}

function imgZoom(imgNum) {
	w=imgGrande[imgNum].width;
	h=imgGrande[imgNum].height;
	//alert(w+' - '+h);
	strBody='';
	strBody=strBody+'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
	strBody=strBody+'<html>';
	strBody=strBody+'<head>';
	strBody=strBody+'<title>Legacy by Embraer</title>';
	strBody=strBody+'</head>';
	strBody=strBody+'<body bgcolor="#ffffff" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">';
	strBody=strBody+'<img name="img" src="'+imgGrande[imgNum].src+'" width="'+w+'" height="'+h+'"><br>';
	strBody=strBody+'<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	strBody=strBody+'<tr>';
	if(window.location.href.indexOf('mediacenter/images',0)!=-1)
		strBody=strBody+'<td bgcolor="#D5D5D5"><img src="../../images/pix.gif" width="10" height="19" alt=""></td>';
	else
		strBody=strBody+'<td><a href="javascript:var objWin=window.opener.location.href=\'../mediacenter/images.asp\'; window.top.close();"><img src="../../images/btn_pop_moreimg.gif" width="74" height="19" alt="More images" title="More images" border="0"></a></td>';
	strBody=strBody+'<td width="100%" bgcolor="#D5D5D5" background="../../images/bgr_pop_barra.gif"><img src="../../images/pixel.gif" width="1" height="1"></td>';
	strBody=strBody+'<td><a href="javascript:window.top.close();"><img src="../../images/btn_pop_close.gif" width="58" height="19" alt="Close" title="Close" border="0"></a></td>';
	strBody=strBody+'</tr>';
	strBody=strBody+'</table>';
	strBody=strBody+'</body>';
	strBody=strBody+'</html>';
	wOpen('','_blank',w,h+19,'no',strBody,'');
}

function selecionarCSS(){
	estiloCerto=(document.getElementById)?'ie.css':((document.all)?'ie.css':'ns.css');
	correcaoPath=((document.location+'-').indexOf('/content')!=-1)?'../../':'';
	document.write('<link rel="stylesheet" href="'+correcaoPath+'css/'+estiloCerto+'" type="text/css">');
}
selecionarCSS();

var objWin;
function wOpen(pURL, pName, w, h, scroll, text, specialSettings){
	//alert(objWin);
	if(objWin) { objWin.close(); objWin=null }
	xLeft=(screen.width)?(screen.width-w)/2:0;
	xTop=(screen.height)?(screen.height-h)/2:0;
	xSettings = 'height='+h+',width='+w+',top='+xTop+',left='+xLeft+',scrollbars='+scroll+specialSettings;
	objWin = window.open(pURL,pName,xSettings);
	if(objWin.window.focus){objWin.window.focus();}
	if(text != "") objWin.document.write(text);
	//ns4
	if(!document.all) objWin.document.close();
	//
	return objWin;
}

// === comuns

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

/* acesso rápido */
function nnuLstAcessTop(idsub,acaome){
	if (acaome == '1'){
		document.getElementById(idsub).className = 'hover';
	}else{
		document.getElementById(idsub).className = '';
	}
}
function nnuLstAcess(idsub,acaome){
	var uls = document.getElementsByTagName("ul");	
	for(var no=0;no<uls.length;no++){
		if((uls[no].className=="lstAcesRapSub") || (uls[no].className=="lstAcesRapSub hover")){
			uls[no].className = "lstAcesRapSub";
		}	
	}
	document.getElementById(idsub).className = "lstAcesRapSub hover";
}

