//----- DESENVOLVIDO POR TADEU GARIOS EM JAN/2005 ----- //

var xxxxx ="alo"
var Titulo_site ="Dr. Luiz Pimentel - Cirurgia Plástica & Cirurgia da Calvície";
var monta_title = "<TITLE>"+ Titulo_site + "</TITLE>";
var place=1;
var Msg_scrollbar = "   Seja benvindo ao site do " + Titulo_site + "                ";


//alert(parent.document.frames["titulos"].location)

function atualiza_titulo(titulo)
{

parent.window.document.title= Titulo_site;


if (titulo=='')
    {
    parent.document.frames["titulos"].window.document.all.div_traco1.style.visibility ='hidden';
	parent.document.frames["titulos"].window.document.all.div_traco2.style.visibility ='hidden';
	parent.document.frames["titulos"].window.document.all.div_titulo.style.visibility ='hidden';
	parent.document.frames["titulos"].window.document.all.div_titulo.innerText = '';
	}
else
    {
	parent.document.frames["titulos"].window.document.all.div_titulo.innerText = '  ' + titulo + '  ';
	parent.document.frames["titulos"].window.document.all.div_titulo.style.visibility ='visible';
	parent.document.frames["titulos"].window.document.all.div_traco1.style.visibility ='visible';
	parent.document.frames["titulos"].window.document.all.div_traco2.style.visibility ='visible';
	}	

}

function loadFrames(frame1,page1,frame2,page2) {
eval("parent."+frame1+".location='"+page1+"'");
}

function loadFrame(frame1,page1) {
eval("parent."+frame1+".location='"+page1+"'");
}

//function loadFrame2(frame1,page1) {
//eval(frame1+".location='"+page1+"'");
//parent.document.frames["titulos"].location
//eval("parent.document.frames["centro"].location='"+page1+"'");
//alert(page1);
//}

function carrega_frame_centro(page1) {
//eval(frame1+".location='"+page1+"'");
//parent.document.frames["titulos"].location
eval("window.parent.parent.document.frames['centro'].location='"+page1+"'");
//alert(window.parent.parent.document.frames['centro'].location)
//alert('carrega_frame_centro')
}

function carrega_submenu_opc1(opc_submenu) {
var v_href ='';


alert("carrega_submenu_opc1");

if (opc_submenu == 1)
	v_href= 'blank_cinza.html' //'http://www.brasilcap.com\' }
else
	{ 	
 if (opc_submenu == 2)
	v_href= 'blank_cor.html' //'http://www.brasilcap.com\' }
	}

if ( v_href != '') {
	loadFrame('centro', v_href);
	}
}
	

function carrega_submenu_opc2(opc_submenu) {
var v_href ='';

alert("carrega_submenu_opc2");

if (opc_submenu == 1)
	v_href= 'blank_branco.html'
else
	{ 	
 if (opc_submenu == 2)
	v_href= 'blank_cor.html' //'http://www.brasilcap.com\' }
	}

if ( v_href != '') {
	loadFrame('centro', v_href);
	}
}


function abrenoticia(page1) {
eval("parent.frames('Centro').location='"+page1+"'");
}


function NewWindow(titulo, mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
//wint =0;
//winl=0;

//winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=0,status=0,menubar=0'

win = window.open(mypage, myname, winprops);

win.document.title  = titulo;
if (myname = 'name') {
if (parseInt(navigator.appVersion) >= 4) { win.window.focus();}
}
}

function NovaJanela(titulo, mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;


winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,status=0,menubar=0'

//win = window.open(mypage, 'subwindow',winprops);
//win = window.open(mypage,'aaaaaaaaaa', 'width='+w+',height='+h+'');
win = window.open(mypage,'', winprops);
win.document.title  = titulo;
if (myname = 'name') {
if (parseInt(navigator.appVersion) >= 4) { win.window.focus();}
}
}


function NovaJanelaTela(titulo, mypage) {
var winl = 0
var wint = 0
var h = (screen.height)- 30
var w = (screen.width)-10


winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+''

win = window.open(mypage,'subwindow', winprops);
win.document.title  = titulo;
if (myname = 'name') {
if (parseInt(navigator.appVersion) >= 4) { win.window.focus();}
}
}


function pega_img_param(acao)
{

var str =""
var str1=""
var str2=""
var ret=0

	
if (acao == 1 ){
    str1 = location.search.substring(4, 50);
    ret = ProcuraStr(str1,'XX') ;
    str1 = str1.substring(0,ret);
	str=str1;
	}
else
   {
	str1 = location.search.substring(1, 200);
	ret = ProcuraStr(str1,'XX') ;
	str1 = str1.substring(ret+5,200);
	}
	
str=str1;

return str;

function ProcuraStr(texto, str)
{
  var r, re;
  var s = texto;
  re = str;
  r = s.search(re);
  return(r);
}


}

function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}


function popimage(imagesrc,winwidth,winheight,titulo){
var look='width='+winwidth+',height='+winheight+','
popwin=window.open("","",look)
popwin.document.open()
//popwin.document.write('<title>Preview</title><body marginleft=0 marginright=0><img src="'+imagesrc+'"></body>')
var text = "<title>:: " + titulo + " ::</title><body background ='"+imagesrc+"'";
text+= " onLoad=\"setTimeout('window.close()',5000);\">";
//text+= "<div>'" + titulo + "'</div>')";
text+= "</body>";
//alert(text);
popwin.document.write(text);
popwin.document.close()
}



function NovaJanela(mypage,myname,w,h,scroll){

var win = null;
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
//settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=0,toolbar=0,menubar=0'
win = window.open(mypage,myname,settings)
}

function NovaJanelaExterna(mypage,myname,w,h){

var win = null;
myname = "new";
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
//TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
TopPosition = 10;
//settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=1,resizable=1,toolbar=1,menubar=1'
win = window.open(mypage,myname,settings)
}


dissolve_objObjects = new Object();
dissolve_objTimers = new Object();

function dissolve_obj(object, destOp, rate, delta){


if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("dissolve_obj("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(dissolve_objTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        dissolve_objObjects[object.sourceIndex]=object;
        dissolve_objTimers[object.sourceIndex]=setTimeout("dissolve_obj(dissolve_objObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}


function fade_obj(cur,which){
//strength=(which==0)? 1 : 0.2
strength=(which==0)? 1 : 0.6

if (cur.style.MozOpacity)
cur.style.MozOpacity=strength
else if (cur.filters)
cur.filters.alpha.opacity=strength*100
}



function escreve_topico(titulo_topico,caminho_img)
{

var img1 = caminho_img + "marcador1.jpg" //"blt_marcador.gif" //"marcador1.jpg"
var img2 = caminho_img + "marcador2.jpg"

//alert(caminho_img)

var monta_topico = '<TABLE  Class ="Table_Marcador" cellSpacing=0 cellPadding=0 width="98%" height="17" border="0" align="LEFT"  >'
monta_topico = monta_topico + '<TR><TD align="left" bgcolor=rgb(87,123,181) background = ' + img1 + ' style="width:17PX;height:17PX;BACKGROUND-REPEAT:no-repeat">'
monta_topico = monta_topico + '</TD><TD align="LEFT" bgcolor=rgb(87,123,181) width="350" height="17">' + titulo_topico + '</TD>'
monta_topico = monta_topico + '<TD align="left" width="12" height="17" bgcolor=rgb(87,123,181) background = ' + img2 + ' style="BACKGROUND-REPEAT: no-repeat"></TD>'
monta_topico = monta_topico + '<TD align="left" width="100%" height="17" ><table style="table-layout:fixed;margin-left:-2" border="0" '
monta_topico = monta_topico + 'width="100%"  cellSpacing=0 cellPadding=0><tr><td width="100%" height="11" align="left" bgcolor=#ffffff></td></tr>'
monta_topico = monta_topico + '<tr><td width="100%" height="6" align="left" bgcolor=rgb(87,123,181)></td></tr></table>'
monta_topico = monta_topico + '</TD><TD></TD></TR></TABLE><br><br>'

//alert(monta_topico)

return monta_topico

}


function escreve_topico_curto(titulo_topico,caminho_img)
{

var img1 = caminho_img + "marcador1.jpg" //"blt_marcador.gif" //"marcador1.jpg"
var img2 = caminho_img + "marcador2.jpg"

var monta_topico = '<TABLE  Class ="Table_Marcador" cellSpacing=0 cellPadding=0 width="75%" height="17" border="0" align="LEFT"  >'
monta_topico = monta_topico + '<TR><TD align="left" bgcolor=rgb(87,123,181) background = ' + img1 + ' style="width:17PX;height:17PX;BACKGROUND-REPEAT:no-repeat">'
monta_topico = monta_topico + '</TD><TD align="LEFT" bgcolor=rgb(87,123,181) width="230" height="17">' + titulo_topico + '</TD>'
monta_topico = monta_topico + '<TD align="left" width="12" height="17" bgcolor=rgb(87,123,181) background = ' + img2 + ' style="BACKGROUND-REPEAT: no-repeat"></TD>'
monta_topico = monta_topico + '<TD align="left" width="100%" height="17" ><table style="table-layout:fixed;margin-left:-2" border="0" '
monta_topico = monta_topico + 'width="100%"  cellSpacing=0 cellPadding=0><tr><td width="100%" height="11" align="left" bgcolor=#ffffff></td></tr>'
monta_topico = monta_topico + '<tr><td width="100%" height="6" align="left" bgcolor=rgb(87,123,181)></td></tr></table>'
monta_topico = monta_topico + '</TD><TD></TD></TR></TABLE><br><br>'

return monta_topico

}

function escreve_title()
{

return  monta_title 

}


function getthedate(){
var dayarray=new Array("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado")
var montharray=new Array("Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro")
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn= "hs" //"AM"
if (hours>=12)
dn= "hs" //"PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
//var cdate="<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+""+dn
//var cdate="<font color='000000' face='Arial' size='1'><b>"+dayarray[day]+",  "+daym+"  "+montharray[month]+" "+year+" "+hours+":"+minutes+":"+seconds+""+dn
//+"</b></font>"
var cdate=dayarray[day]+",  "+daym+" de " + montharray[month]+" de "+year+" "+hours+":"+minutes+":"+seconds+""+dn
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function exibe_data_hora(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}


function listaDivsPorClass(pstrNmClassProcura) {
       for (i = 0; i < document.all.length; i++) {
                if (document.all(i).tagName.toString().toString().toLowerCase() == "div") {
                        if (document.all(i).className == pstrNmClassProcura) {
                                alert(document.all(i).name + " = " + document.all(i).className);
                        }
                }
        }

}



function config_obj_cursor(pstrNmTag, pstrNmClassProcura, pstrNmCursor) {
		//alert(pstrNmTag.toString().toLowerCase());
		
       for (i = 0; i < document.all.length; i++) {
		  
          if (document.all(i).tagName.toString().toString().toLowerCase() == pstrNmTag.toString().toLowerCase()) {
						//alert(document.all(i).tagName.toString().toString().toLowerCase())
						//alert(pstrNmClassProcura.toString().toLowerCase());
						//alert(document.all(i).className);
                        if (document.all(i).className.toString().toString().toLowerCase() == pstrNmClassProcura.toString().toLowerCase()) {
                                //alert(document.all(i).name + " = " + document.all(i).className);
                                //alert(document.all(i).id);
                                //document.all(i).style.cursor = url("lupa.ico");
                                //document.all(i).style.cursor = url(pstrNmCursor);
                                //document.all(i).style.className = "IMG_FOTO_EXEMPLO";
                                //alert(document.all(i).style.cursor)
                        }
                }
        }

}


function escreve_estilo()
{
	//alert("alo");
	//document.write("<style type='text/css'>.IMG_FOTO_EXEMPLO {cursor:crosshair}</style>")
	
	//var var_escreve = "<style type='text/css'>.IMG_FOTO_EXEMPLO {cursor:url(lupa.ico)}</style>"

	//alert(document.frames["titulos"].window.document.all.div_titulo.innerText)
	//alert(document.parentWindow.name)
	
	//alert(xxxxx)
	
	//return var_escreve
	

}



function pagina_principal(pag_principal)
{
//javascript:loadFrame('centro','../../principal.htm')
//javascript:loadFrame('centro',pag_principal)
//carrega_frame_centro(pag_principal);
alert(pag_principal)
}



function escreve_div_navegador()
{

var monta_navegador = '<P>&nbsp;</P><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 style="table-layout:fixed;" width="50" height="40" >'
monta_navegador = monta_navegador + '<TR><TD  width="3%"></TD><TD BGCOLOR="RED"><a ID="Lnk_Navega"  href="javascript:showmenuie5();" >NAVEGA</TD><TD  width="3%"></TD></TR>'
monta_navegador = monta_navegador + '</TABLE>'

alert(monta_navegador)

return monta_navegador

}


function aplica_sombra(obj)
{

obj.style.filter = "progid:DXImageTransform.Microsoft.Shadow(color=GRAY,direction=-130)" ;

}


function scrollIn() {
window.status=Msg_scrollbar.substring(0, place);
if (place >= Msg_scrollbar.length) {
place=1;
window.setTimeout("scrollOut()",20);
} else {
place++;
window.setTimeout("scrollIn()",80);
}
}
function scrollOut() {
window.status= Msg_scrollbar.substring(place, Msg_scrollbar.length);
if (place >= Msg_scrollbar.length) {
place=1;
window.setTimeout("scrollIn()", 20);
} else {
place++;
window.setTimeout("scrollOut()", 80);
}
}

