// JavaScript Document

<!--
// define redirect function
function redirect(url){
	parent.location.href=url;
}

// set timeout to call a function
		// setTimeout("redirect()",10000)

// nova janela
var newwin = null;
if(top.location != window.location)
  top.location.replace(window.location.href);

// simple popup
function popup(url, wid, hi, scroll) {
  new_spec = wid + "_" + hi + scroll;
  scrolling = scroll? "yes": "no";
  if (scroll && document.all && (navigator.userAgent.indexOf("Mac") > -1)) wid = wid+17;
  newwin=window.open(url,new_spec,"WIDTH=" + wid + ",HEIGHT=" + hi + ",scrollBars=" + scrolling + ",resizable=no,screenX=100,screenY=100,left=100,top=100");
  newwin.focus();
}

// advanced window open
function launchwin(winurl,winname,winfeatures) {
  newwin = window.open(winurl,winname,winfeatures);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

// fullscreen window open
function launchFullWin(winurl,winname) {
  var winl = 0;//screen.width / 2;
  var wint = 0;//screen.height / 2;
  newwin = window.open(winurl,winname,'scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,top=' + wint + ',left=' + winl + ',width=' + screen.availWidth + ',height=' + screen.availHeight);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

// centered window  open
function launchCenteredWin(url, name, width, height, otherfeatures) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;
    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  newwin = window.open(url, name, str + ',' + otherfeatures);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

// reload page if resized (bugs)
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);


// a example of predefined window opener
function launchNewsWin(winurl,winname) {
  newwin = window.open(winurl,winname,'scrollbars=yes,resizable=yes,width=800,height=600');
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}


var win= null; 
function OpenCaseStudy(mypage,w,h,myname){ 
     var winl = (screen.width-w)/2; 
     var wint = (screen.height-h)/2; 
     settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no,location=yes,status=no,menubar=no,resizable=no,dependent=no' 
     win=window.open(mypage,myname,settings) 
if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
}


// bookmark page function
function bookmarkIt() { 
  var bookmarktitle = document.title;
  var bookmarkurl = document.location;
  var netscape
  var macintosh
  netscape="Attention Netscape Users. To Bookmark this page please click the page you would like to bookmark and press CTRL+D. If you would like to add this page to your Netscape Sidebar, please click OK on the next window which appears.";
  macintosh="Attention Macintosh User. To Bookmark this page please click the page you would like to bookmark and press CTRL+D.";

  if (window.sidebar&&window.sidebar.addPanel) { 
    alert(netscape);
    window.sidebar.addPanel(bookmarktitle, bookmarkurl,""); 
  } else if (is_mac) {
    alert(macintosh);
  } else if (document.all) {
    window.external.AddFavorite(bookmarkurl, bookmarktitle);
  } else if (window.opera && window.print) {
    return true;
  }
}



function printIt() { 
  var macprint;
  macprint = "Attention Macintosh User. Unfortunately this functionality is not available on the Macintosh OS. Please click the page you would like to print a select print from your browser menu.";

  if (is_mac) { 
    alert(macprint);
  } else {
  self.print()
  }
}



function loginForm(){
	document.loginform2.screenname.value=document.loginform1.screenname.value;
	if((document.loginform2.screenname.value=='') || (document.loginform2.password.value=='')){
		alert('Preencha os dois campos:\n\n  - Usuário\n  - Senha');
	}else{
		document.loginform2.submit();
	}
}


//-->