function openTOM(){
  newWin = window.open("http://www.acessa.com/topofmind/tom2002/", "Tom2000","resizable=no,width=650,height=480,status=no,location=no,toolbar=yes,top=30,left=60");
}

function sometexto(f){
   if (f.email.value == "seu e-mail") {
     f.email.value = ""
   }
}

function voltatexto(f){
   if (f.email.value == "") {
     f.email.value = "seu e-mail"
   }
}

function selectGetURL(f){
if (f.options[f.selectedIndex].value == "tom")
        {
	openTOM();
	f.selectedIndex = 0;
	newWin.focus();
	return;
        }
if (f.name == "links")
        {
        var URL = f.options[f.selectedIndex].value;
	newWin = window.open(URL);
	f.selectedIndex = 0;
	newWin.focus();
	return;
        }
if (f.name == "optmenu_webm")
        {
        var URL = "http://www.acessa.com" + f.options[f.selectedIndex].value;
	window.open(URL);
	f.selectedIndex = 0;
	return;
        }
if (f.options[f.selectedIndex].value == "nada")
        {
        f.selectedIndex = 0;
        return;
        }
else
	{
	var URL = f.options[f.selectedIndex].value;
	f.selectedIndex = 0;
	top.location.href = URL;
	return;
	}
}

function openwin(URL, N, L, A) {
newWin = window.open(URL, N,"resizable=no,width=" + L + ",height=" + A + ",status=no,location=no,scrollbars=1,toolbar=no,top=30,left=60");
newWin.focus();
}

function openWin(URL, N, L, A) {
newWin = window.open(URL, N,"resizable=no,width=" + L + ",height=" + A + ",status=no,location=no,scrollbars=1,toolbar=no,top=30,left=60");
newWin.focus();
}

function openWin2(URL, N, L, A) {
newWin = window.open(URL, N,"resizable=no,width=" + L + ",height=" + A + ",status=no,location=no,scrollbars=0,toolbar=no,top=30,left=60");
newWin.focus();
}

function openwin2(URL, N, L, A) {
newWin = window.open(URL, N,"resizable=no,width=" + L + ",height=" + A + ",status=no,location=no,scrollbars=0,toolbar=no,top=30,left=60");
newWin.focus();
}

function openWinCenter(URL, N, W, H, S) {
  L = (screen.width - W) / 2;
  T = (screen.height - H) / 2;
  newWin = window.open(URL, N,"scrollbars="+S+",width=" + W + ",height=" + H +",top=" + T+ ",left=" + L);
  newWin.focus();
}


function setCookie(nome,valor,dir,exp) {
  if ((nome == undefined) || (valor == undefined)) {
    return false;
  } else if (exp != undefined) {
    var d = new Date();
    var minutos = d.getTime() + (exp * 60 * 1000);
    d.setTime(minutos);
    document.cookie = nome+"="+valor+(dir!=undefined?";path="+dir:"")+";expires="+d.toGMTString();
  } else { 
    document.cookie = nome+"="+valor+(dir!=undefined?";path="+dir:"");
  }
}

function getCookie(n) {
  if (document.cookie.indexOf(n) == -1) {
    return false;
  } else {
    v = document.cookie.substring(document.cookie.indexOf(n),document.cookie.length);
  }
  if (v.indexOf(';') == -1) {
    v = v.substring(n.length+1);
  } else {
    v = v.substring(n.length+1,v.indexOf(';'));
  }
  return v;
}

function getBrowser() {
  if (navigator.userAgent.toUpperCase().indexOf("OPERA") != -1) {
    return "op";
  } else if (navigator.userAgent.toUpperCase().indexOf("MSIE") != -1) {
    return "ie";
  } else {
    return "mz";
  }
}

function resizeSWF(id, h) {
  if (getBrowser() == "ie") {
    document.getElementById(id+"_obj").style.height=h;
  } else {
    document.getElementById(id+"_emb").style.height=h;
  }
}

function resizeGIF(id, v) {
  document.getElementById(id).style.overflow=v;
}

/*
function showExpSWF(src, height, url, trg) {
  document.write('<span id="flash_exp" onMouseOver=resizeSWF("flash",'+height+') onMouseOut=resizeSWF("flash",60)>');
  document.write('<OBJECT id="flash_obj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="468" HEIGHT="60">');
  document.write('<PARAM NAME=movie VALUE='+src+'><PARAM NAME=flashvars VALUE="url='+url+'&target='+((trg)?(trg):("_self"))+'"><PARAM NAME=menu VALUE=false><PARAM NAME=scale VALUE=noborder><PARAM NAME=salign VALUE=T><PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent>');
  document.write('<EMBED id="flash_emb" src='+src+' flashvars="url='+url+'&target='+((trg)?(trg):("_self"))+'" menu=false quality=high scale=noborder salign=T wmode=transparent WIDTH="468" HEIGHT="60" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></span>');
}
*/

function showExpSWF(src, width, height, height_exp, url, trg) {
  document.write('<span id="flash_exp" onMouseOver=resizeSWF("flash",'+height_exp+') onMouseOut=resizeSWF("flash",'+height+')>');
  document.write('<OBJECT id="flash_obj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+width+'" HEIGHT="'+height+'">');
  document.write('<PARAM NAME=movie VALUE='+src+'><PARAM NAME=flashvars VALUE="url='+url+'&target='+((trg)?(trg):("_self"))+'"><PARAM NAME=menu VALUE=false><PARAM NAME=scale VALUE=noborder><PARAM NAME=salign VALUE=T><PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent>');
  document.write('<EMBED id="flash_emb" src='+src+' flashvars="url='+url+'&target='+((trg)?(trg):("_self"))+'" menu=false quality=high scale=noborder salign=T wmode=transparent WIDTH="'+width+'" HEIGHT="'+height+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT></span>');
}

/*
function showExpGIF(src, url, trg) {
  document.write('<span id="gif_exp" onMouseOver=resizeGIF(this.id,"visible") onMouseOut=resizeGIF(this.id,"hidden")><a href='+url+((trg)?(" target="+trg):(""))+'><img src='+src+' border=0></a></span>');
}
*/

function showExpGIF(src, url, width, height, trg) {
  document.write('<span id="gif_exp" style="width:'+width+'px;height:'+height+'px" onMouseOver=resizeGIF(this.id,"visible") onMouseOut=resizeGIF(this.id,"hidden")><a href='+url+((trg)?(" target="+trg):(""))+'><img src='+src+' border=0></a></span>');
}


function showBannerSWF(src, width, height, url, bg, trg, win) {
  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + width + '" HEIGHT="' + height + '">');
  document.write('<PARAM NAME=movie VALUE="' + src + '"><PARAM NAME=flashvars VALUE="url=' + url + '&target=' + ((trg)?(trg):("_self")) + '"><PARAM NAME=wmode VALUE="' + win + '"><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#' + bg + '>');
  document.write('<EMBED src="' + src + '" menu=false flashvars="url=' + url + '&target=' + ((trg)?(trg):("_self")) + '" wmode="' + win + '" quality=high bgcolor=#' + bg + '  WIDTH="' + width + '" HEIGHT="' + height + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
}

function showBannerGIF(src, width, height, url, trg) {
  document.write('<a href='+url+((trg)?(" target="+trg):(""))+'><img src='+src+' width='+width+' height='+height+' border=0></a>');
}

/*
function showSplash(width, height, top, left, time, dir) {
  if ((getBrowser() != "op") && (getCookie("splash_"+dir.substr(1)) != "sim")) {
    setCookie("splash_"+dir.substr(1),"sim",dir);
    document.write('<iframe id="splash" src="splash.php" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'" allowtransparency="true" style="position:absolute;left:'+left+'px;top:'+top+'px"></iframe>');
    document.getElementById("splash").onload = function(){startTimer(time);}
    return true;
  } else {
    return false;
  }
}


function showSplash(width, height, top, left, time, dir) {
  if (getCookie("splash_"+dir.substr(1)) == "sim2") {return false}
  if (getCookie("splash_"+dir.substr(1)) == "sim") {
    setCookie("splash_"+dir.substr(1),"sim2",dir);
    document.write('<iframe id="splash" src="splash.php" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'" allowtransparency="true" style="position:absolute;left:'+left+'px;top:'+top+'px"></iframe>');
    document.getElementById("splash").onload = function(){startTimer(time);}
    return true;
  }
  if ((getBrowser() == "op") || (getCookie("splash_"+dir.substr(1)) == "sim")) {
    return false;
  } else {
    setCookie("splash_"+dir.substr(1),"sim",dir);
    document.write('<iframe id="splash" src="splash.php" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'" allowtransparency="true" style="position:absolute;left:'+left+'px;top:'+top+'px"></iframe>');
    document.getElementById("splash").onload = function(){startTimer(time);}
    return true;
  }
}
*/


function showSplash(width, height, top, left, time, dir, exp) {
  if ((getBrowser() == "op") || (getCookie("splash_"+dir.substr(1)) == "sim")) {
    return false;
  } else {
    if (exp != undefined) {
      setCookie("splash_"+dir.substr(1),"sim",dir,exp);
    } else {
      setCookie("splash_"+dir.substr(1),"sim",dir);
    }
    if (dir != "/") dir += "/";
    document.write('<iframe id="splash" src="http://www.acessa.com'+dir+'splash.php" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'" allowtransparency="true" style="position:absolute;left:'+left+'px;top:'+top+'px"></iframe>');
    document.getElementById("splash").onload = function(){startTimer(time);}
    return true;
  }
}


function startTimer(t) {
  timer = setTimeout("hideSplash()",t*1000);
}

function hideSplash() {
  document.getElementById("splash").style.visibility="hidden";
  clearTimeout(timer);
}

function parOuImpar() {
  return Math.floor(Math.random()*10)%2;
}

function showPop(width, height, top, left, dir, exp) {
  if (getCookie("pop_"+dir.substr(1)) != "sim") {
    if (exp != undefined) {
      setCookie("pop_"+dir.substr(1),"sim",dir,exp);
    } else {
      setCookie("pop_"+dir.substr(1),"sim",dir);
    }
    window.open("anuncio.apl","pop","width="+width+",height="+height+",top="+top+",left="+left);
    return true;
  } else {
    return false;
  }
}

function flash(src, width, height, bg, win, vars, scl) {
  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + width + '" HEIGHT="' + height + '">');
  document.write('<PARAM NAME=movie VALUE="' + src + '"><PARAM NAME=flashvars VALUE="' + vars + '"><PARAM NAME=wmode VALUE="' + win + '"><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=high><PARAM NAME=scale VALUE="' + scl + '"><PARAM NAME=bgcolor VALUE=#' + bg + '>');
  document.write('<EMBED src="' + src + '" menu=false flashvars="' + vars + '" wmode="' + win + '" quality=high scale="' + scl + '" bgcolor=#' + bg + '  WIDTH="' + width + '" HEIGHT="' + height + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
}

