/*
     TITLE: Dimitre Lima Java Script Funcions
   VERSION: 1.0.7 
      TYPE: Object Definition
    AUTHOR: Dimitre Lima
 COPYRIGHT: 1999-2001 Sereia Corporation, Inc. All Rights Reserved
 
functions criadas por Dimitre Lima (dmtr@terra.com.br) em 22 e 23/01/01
*/

function noticia(id) {
	//location.href='noticia.php?id='+id;
	location.href='/noticia.jsp?noticia='+id;
}

function artista(id) {
	location.href='artista.jsp?id='+id;
}

var a = 0;

function display(id, on_off) { 
	var el = document.all ? document.all[id] : document.getElementById(id);  if(el) el.style.display = on_off ? '' : 'none'; 
}


function update() {
	imagem = "file://"+document.posta.filename.value;
	document.images['pic'].src = imagem;
	window.status = (imagem);
}


function audio(numero)
{
	var endereco;
	var parametros = 'fullscreen=0,location=0,directories=0,menubar=0, scrollbars=0,status=0,toolbar=0,resizable=0,width=468,height=180';
	if (checkOS() == 'Macintosh' || checkOS() == 'Linux') {
		//endereco = '/gvirtual/player/player_qt2.jsp?id_musica=';
		endereco = '/gvirtual/player/player_qt.jsp?id_musica=';
		parametros = 'fullscreen=0,location=0,directories=0,menubar=0, scrollbars=0,status=0,toolbar=0,resizable=0,width=468,height=165';		
	}
	else {
		//endereco = '/gvirtual/player/player_wm2.jsp?id_musica=';
		endereco = '/gvirtual/player/player_wm.jsp?id_musica=';
	}
	player = window.open (endereco+numero.toString(), 'player', parametros);
	if (navigator.plataform == 'MacPPC')
	{
		player.resizeTo (468, 165);
	}
	player.focus();
}
function play(param) {
	if (checkOS() == 'Macintosh' || checkOS() == 'Linux') {
		parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars=0,status=1,toolbar=0,resizable=0,width=468,height=219'
	+ ',left=70,top=20';
		janelaplay = window.open ('mp3Player.jsp?id_musica='+param, 'player', parametros);
	}
	else {
		parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars=0,status=1,toolbar=0,resizable=0,width=468,height=219'
	+ ',left=70,top=20';
		janelaplay = window.open ('mp3PlayerW.jsp?id_musica='+param, 'player', parametros);
	}
	
	janelaplay.focus();
}

function video(id, vel) {
	parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars=0,status=1,toolbar=0,resizable=0,width=340,height=440,left=70,top=20';
	janelaplay = window.open ('videoPlayer.jsp?id='+id+'&vel='+vel, 'VideoPlayer', parametros);	
	janelaplay.focus();
}

function txt(param) {
	parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars=1,status=1,toolbar=0,resizable=0,'+
	'width=400,height=400,left=70,top=20';
	janelatxt = window.open ('txt.php?id='+param, 'janela_txt', parametros);
	janelatxt.focus();
	//if (navigator.platform == 'MacPPC') txt.resizeTo (X, Y);
}

function img(param, width, height) {

	if (width > screen.width)
		alert ('aaahhh');
		
	parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars=0,status=1,toolbar=0,resizable=0,'+
	'width='+width+',height='+height+',left=70,top=20';
	janelaimg = window.open ('img.php?id='+param, 'txt', parametros);
	janelaimg.focus();
}

function comenta(id) {
	parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars=1,status=1,toolbar=0,resizable=0,width=400,height=400'
	+ ',left=70,top=180';
	janelacomenta = window.open ('comenta.php?id='+id, 'comenta', parametros)
	//if (navigator.platform == 'MacPPC') janelacomenta.resizeTo (X, Y);
	janelacomenta.focus();
}

function sobre(id) {
	parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars=1,status=1,toolbar=0,resizable=0,width=550,height=350'
	+ ',left=120,top=20';
	janelasobre = window.open ('release.php?id='+id, 'sobre', parametros)
	//if (navigator.platform == 'MacPPC') janelacomenta.resizeTo (X, Y);
	janelasobre.focus();
}

function mudapagina(n) {
	document.pagina.pagina.value = n;
	document.pagina.submit();
}

function foto(endereco) {
	sobraX = 12;
	sobraY = (screen.height - screen.availHeight);
	if (navigator.appName != "Microsoft Internet Explorer" || (navigator.platform == 'MacPPC' && navigator.appName != "Netscape"))
	{sobraX = 0;	sobraY = 0;	}
	nova = window.open('', 'foto', 'fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,status=0,resizable=1,scrollbars=0, width=100, height=50, top=50, left=100')
	//nova.document.open("text/html", "replace");
	nova.document.write('<HTML><HEAD><TITLE>'+endereco+'</TITLE></HEAD>');
	nova.document.write('<BODY bgcolor=black background=f6.jpg leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="margin:0;overflow:hidden" onload="self.resizeTo(document.pic.width + ' + sobraX.toString() + ', document.pic.height + ' + sobraY.toString() + ');">\r\n');
	nova.document.write('<a href="#"><IMG SRC="' + endereco + '" BORDER=0 name="pic" alt="clique para fechar" onclick="parent.self.close();"></a></BODY></HTML>');
	nova.document.close();
	nova.focus();
}

function pop(endereco, X, Y, rolagem) {
	var windowX = Math.ceil((window.screen.width  - X) / 2);
	var windowY = Math.ceil((window.screen.height - Y) / 2);
	parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars='+rolagem+',status=1,toolbar=0,resizable=0,width=' + X.toString()+ ',height=' +Y.toString()
	+ ',left=' + Math.ceil(windowX).toString() + ',top=' + Math.ceil(windowY).toString()
	nova = window.open (endereco, '', parametros)
	if (navigator.platform == 'MacPPC') nova.resizeTo (X, Y);
}

function pop6(endereco, X, Y, XX, YY, rolagem) {
	parametros='fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,status=0,resizable=0,scrollbars='
	+rolagem+', width='+X.toString()+', height='+Y.toString() + ',left=' + XX + ',top=' + YY;
	nova = window.open(endereco, '', parametros);
	if (navigator.platform == 'MacPPC') nova.resizeTo (X, Y);
}
function pop2(endereco, X, Y, rolagem, XX, YY) {
	parametros='fullscreen=0,location=0,directories=0,menubar=0,toolbar=0,status=0,resizable=0,scrollbars='
	+rolagem+', width='+X.toString()+', height='+Y.toString() + ',left=' + XX + ',top=' + YY;
	nova = window.open(endereco, '', parametros);
	if (navigator.platform == 'MacPPC') nova.resizeTo (X, Y);
}

function reage()
{
	var windowX = Math.ceil( (window.screen.width  - 780) / 2 );
	var windowY = Math.ceil( (window.screen.height - 290) / 2 );

	splashWin = window.open( 'about:<body bgcolor=31486f style="overflow:hidden; border:2px solid #ff55aa;"><font face=Tahoma color=white size=1>....</font></body>', "aeee",
	"fullscreen=1,location=0,directories=0,menubar=0,toolbar=no,status=no,resizable=0,scrollbars=no,height=290,width=780")
	splashWin.moveTo(Math.ceil(windowX), Math.ceil(windowY))
	splashWin.resizeTo(780, 290)
	splashWin.focus();

/* - peguei do chromeless - nao sei se rola
*/
	splashWin.document.open("text/html", "replace");
	splashWin.document.write("<body onload=\"top.document.location.replace('http://planeta.terra.com.br/arte/dmtr/reativo/reativo.html?')\" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll='no'>");
	splashWin.document.write("</body></html>");
	splashWin.document.close();	
}



function getPlayer(macAudioFilePath, winAudioFilePath) {
	if (checkOS() == 'Macintosh') {
		return '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" id="MediaPlayer" valign="middle" height="16" width="320">'+
	           '<param name="src" value="'+macAudioFilePath+'"'+
			   '<embed src="'+macAudioFilePath+'" name="MediaPlayer" valign="middle" enablejavascript="true" height="16" width="320">'+
			   '</object>';
	} else {
		return '<embed src="'+winAudioFilePath+'" autostart="true" loop="false" width="300" controller="true"></embed>';
	}
}




//function alerta() {
	//alert (l.join('\n'));
//}

//function alerta(){
//if (document.body)
//	document.body.background = "/_img/bolha.jpg";
//}
function alerta() {
	alert('dimitre lima\n\nd (at) dmtr.org \n+55 11 3815.4661')
}


	var ns = document.layers ? 1 : 0;
	var ie = document.all ? 1 : 0;
	var moz = (navigator.userAgent.indexOf('Gecko') != -1);
	function show(div){
		if(ie)
		 {
			var rolou = document.body.scrollTop ;
			document.all[div].style.visibility="visible";
			//document.all[div].style.top=event.clientY+10 ;
		document.all[div].style.top=event.clientY+10+rolou;
		//alert(rolou);
			document.all[div].style.left=event.clientX;
			}
		if(ns) document.layers[div].visibility="show";
		if(moz) document.getElementById(div).style.visibility="visible";
	}
	
	function hide(div){
		if(ie) (document.all[div].style.visibility="hidden");
		if(ns) (document.layers[div].visibility="hide");
		if(moz) (document.getElementById(div).style.visibility="hidden");
	}	
	







var ycsdone;
function visita(acao) {
	var z;
	if (ycsdone)
	return;
	z="&r="+escape(document.referrer);
	z=z+"&b="+escape(navigator.appName+" "+navigator.appVersion);
	w=parseFloat(navigator.appVersion);
	if (w > 2.0) {
		z=z+"&s="+screen.width+"x"+screen.height;
		z=z+"&o="+navigator.platform;
    	v="1.2";
    if (navigator.appName != "Netscape") {
		z=z+"&c="+screen.colorDepth;
    } else {
		z=z+"&c="+screen.pixelDepth
    }
	z=z+"&j="+navigator.javaEnabled();
} else {
	v=1.0;
}
z=z+"&v="+v;

if (acao!=undefined) {
	z=z+"&acao="+acao;
	document.writeln("<img src=\"_visita.php?"+z+"\" width=1 height=1>");
	ycsdone=1;
	}
}

function videoPromo() {
  parametros='fullscreen=0,location=0,directories=0,menubar=0,scrollbars=0,status=1,toolbar=0,resizable=0,width=330,height=400,left=100,top=100';
  janelaPromo = window.open ('videoPromo.htm', 'VideoPlayer', parametros);
  janelaPromo.focus();
}
