/*
window.onerror = function() { return true };
// 	ONLOAD GERAL DAS PAGINAS

onload = function() {
//	window.focus();
var menu01 = new mocMenu('dhtml','dhtmllnk',500,1,22);
}
*/
// selecao de css
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;
}
// abre popup
function imgZoom(imgNum) {
	var s=imgGrande[imgNum].src;
	var w=imgGrande[imgNum].width;
	var h=imgGrande[imgNum].height;
	//alert(w+' - '+h);
	sHTML='';
	sHTML=sHTML+'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
	sHTML=sHTML+'<html><head><title>Defense Systems - Embraer</title></head>';
	sHTML=sHTML+'<body style="margin:0;padding:0" bgcolor="#294468" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">';
	sHTML=sHTML+'<img name="img" src="'+s+'" width="'+w+'" height="'+h+'"><br>';
	sHTML=sHTML+'<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	sHTML=sHTML+'<tr>';
	sHTML=sHTML+'<td width="100%" height="16" bgcolor="#294468" align="right"><a href="javascript:window.top.close();"><img src="../../img/btn_pop_close.gif" width="45" height="15" alt="Close" title="Close" border="0"></a><br></td>';
	sHTML=sHTML+'</tr>';
	sHTML=sHTML+'</table>';
	sHTML=sHTML+'</body></html>';
	wOpen('','_blank',w,h+19,0,sHTML,'');
}////
/// BIBLIOTECA de SCRIPTS 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);

// Função Popup: <a href="arquivo.ext" onclick="popup(this.href,'360','535','1'); return false;"></a>
function popup(url,w,h,s) {
	var oW=window.open(url,'popup','width='+w+',height='+h+',directories=0,location=0,menubar=0,resizable=0,scrollbars='+s+',status=0,toolbar=0,marginleft=0,margintop=0,left='+(((screen.availWidth-w)/2)+-10)+',top='+(((screen.height-h)/2)+-10));
}

function popups(pg,nome,fs,w,h,rolagem) {
	if(fs) { // fullscreen
		var w=screen.availWidth,h=screen.availHeight;
		var winObj = window.open(pg,nome,'width='+w+',height='+h+',directories=0,location=0,menubar=0,resizable=0,scrollbars='+rolagem+',status=0,toolbar=0,marginleft=0,margintop=0,left=0,top=0');
		with(winObj) { moveTo(0,0); resizeTo(w,h); focus(); }
	} else { // popup normal
		var winObj=window.open(pg,nome,'width='+w+',height='+h+',directories=0,location=0,menubar=0,resizable=0,scrollbars='+rolagem+',status=0,toolbar=0,marginleft=0,margintop=0,left='+(((screen.width-w)/2)+-10)+',top='+(((screen.height-h)/2)+-30));
		winObj.focus();
	}
}