// JavaScript Document

function abreHoriz(pg){//popUp Unico Central
		var x; 	
		var y;
		var w = 600;
		var h = 440;
		x = (screen.width-w)/2;
		y = (screen.height-h)/2;
	    window.open(pg,'foto','scrollbars=auto,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width='+w+',height='+h+',left='+x+',top='+y+'');
}

function abreVert(pg){//popUp Unico Central
		var x; 	
		var y;
		var w = 440;
		var h = 600;
		x = (screen.width-w)/2;
		y = (screen.height-h)/2;
	    window.open(pg,'foto','scrollbars=auto,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width='+w+',height='+h+',left='+x+',top='+y+'');
}

function abrePopup(pg,nome,w,h){//popUp Unico Central
		var x; 	
		var y;
		x = (screen.width-w)/2;
		y = (screen.height-h)/2-20;
	    window.open(pg,nome,'scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width='+w+',height='+h+',left='+x+',top='+y+'');
}

function abrePopupStatus(pg,nome,w,h){//popUp Unico Central
		var x; 	
		var y;
		x = (screen.width-w)/2;
		y = (screen.height-h)/2-20;
	    window.open(pg,nome,'scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,width='+w+',height='+h+',left='+x+',top='+y+'');
}

function abrePopupScroll(pg,nome,w,h){//popUp Unico Central
		var x; 	
		var y;
		x = (screen.width-w)/2;
		y = (screen.height-h)/2-20;
	    window.open(pg,nome,'scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,width='+w+',height='+h+',left='+x+',top='+y+'');
}

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_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_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_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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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];}}
}

	// Set up the variables we need for the random URL selection.

	var uc = 2;	   	 			// Number of URLs
	var u = new Array(uc);			// Array to hold URLs

	// These are all local URLs; they could just as well be URLs
	// pointing to other machines, or a mixture of both. You
	// could even put mailto: or telnet: URLs in here.
	
	u[0] = "index_ele.html";
	u[1] = "index_ela.html";

	// pickRandom - Return a random number in a given range. This
	// function is 'browser-proofed' to run correctly on older
	// browsers that don't implement 'Math.random'.
	
	function pickRandom(range) {
		if (Math.random)
			return Math.round(Math.random() * (range-1));
		else {
			var	now = new Date();
			return (now.getTime() / 1000) % range;
		}
	}

	// Function: pickRandomURL
	//
	// A very simple function that selects one of the URLs in the
	// 'u' array at random, and returns it as a string.

	function pickRandomURL() {
		var choice = pickRandom(uc);
		return u[choice];
	}
	

// Amazing Frameless Popup Window - Version I
// (C) 2000 www.CodeLifter.com
// Free for all users, but leave in this  header

// set the popup window width and height

var windowW=screen.availWidth // wide
var windowH=screen.availHeight // high

 

// set the screen position where the popup should appear

var windowX = 0 // from left
var windowY = 0 // from top

// set the url of the page to show in the popup

var urlPop = pickRandomURL()

// set the title of the page

var title =  "Grupo Trampulim"

// set this to true if the popup should close
// upon leaving the launching page; else, false

var autoclose = true

// ============================
// do not edit below this line
// ============================

s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false

function openFrameless(){
  if (beIE){
    NFW = window.open("","popFrameless","fullscreen,"+s)     
    NFW.blur()
    window.focus()       
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling='no'>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    urlPop = pickRandomURL()
    NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
    NFW.blur()
    window.focus() 
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
  }   
  NFW.focus()   
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}
