<!--
// ------------------------------------
// UTEIS - AnimaStudio Comunicação 
// ------------------------------------
// linhas html a colocar no head, para carregar este script:
// <   script type='text/javascript' src='../scrip/uteis.js'>
	// © AnimaStudio 
// <     /script>
//
//funções:
//------------------------------------
//função novajanela(estilo, nome, scrola) - abre janela usando o default de medidas e posição
//função novajanela_size(xx, yy, estilo, nome, scrola) - abre janela com tamanho predefinido e posiciona para ñ ocupar barras do SO 
//função novajanela_max(estilo, nome, scrola) - abre, posiciona e maximiza a janela sem ocupar barras do SO
//------------------------------------
//função adicionafavoritos() 
//-------------------------------------

//-----------------------script a carregar:

window.status="> Bem vindo à AnimaStudio! a sua melhor comunicação... AnimaStudio © 2005 todos os direitos reservados";

function novajanela(estilo, nome, scrola)
	{
	parametros="resizable,status";
	if (scrola) {parametros="scrollbars,"+parametros;}
	newWindow=window.open(estilo, nome, parametros); 
	newWindow.focus();
}

function novajanela_size(xx, yy, estilo, nome, scrola)
{
	// testa se há barras dos lados e acima ou abaixo, para nao ocupar esse espaço caso seja possivel
	zerox=screen.width-screen.availWidth;
	zeroy=screen.height-screen.availHeight;
	if ((screen.width-(2*zerox))<xx) {zerox=0;}
	if ((screen.height-(2*zeroy))<yy) {zeroy=0;}
	
	xx=xx-12;
	yy=yy-61;
	parametros="resizable,status,HEIGHT="+yy+",WIDTH="+xx+",TOP="+zeroy+",LEFT="+zerox+",SCREENX="+zerox+",SCREENY="+zeroy;
	if (scrola) { parametros="scrollbars,"+parametros;}
	newWindow=window.open(estilo, nome, parametros);
	newWindow.focus();
}

function novajanela_max(estilo, nome, scrola)
{
	// testa se há barras dos lados e acima ou abaixo, para nao ocupar esse espaço caso seja possivel
	zerox=screen.width-screen.availWidth;
	zeroy=screen.height-screen.availHeight;
	if ((screen.width-(2*zerox))<770) {zerox=0;}
	if ((screen.height-(2*zeroy))<570) {zeroy=0;}
	
	xx=screen.availWidth-zerox-12;
	yy=screen.availHeight-zeroy-61;
	parametros="resizable,status,HEIGHT="+yy+",WIDTH="+xx+",TOP="+zeroy+",LEFT="+zerox+",SCREENX="+zerox+",SCREENY="+zeroy;
	if (scrola) { parametros="scrollbars,"+parametros;}
	newWindow=window.open(estilo, nome, parametros);
	newWindow.focus();
}

function adicionafavoritos() {
	var favoritosurl="http://www.animastudio.com.br"
	var favoritostitulo="AnimaStudio! Comunicação!"
	if (document.all) {  // está usando IE 4+
		window.external.AddFavorite(favoritosurl,favoritostitulo);
		}
	else {
		if (window.sidebar&&window.sidebar.addPanel) { // está usando NS6
			window.sidebar.addPanel(favoritosurl,favoritostitulo,"");
			}
		else { // não é IE4+ nem NS6
			alert("Esta função só funciona em Internet Explorer versão 4 ou mais e em Netscape 6");
		}
	}
}

//-----------------------------------------------------------------

//This script detects the following:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer


var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ns || !win) {
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

//SAMPLE USAGE- detect "Flash"
//if (pluginlist.indexOf("Flash")!=-1)
//document.write("You have flash installed")

// abre janela caso tenha flash instalado
function novajanelaflash(estilo, nome, scrola)
	{
	if (pluginlist.indexOf("Flash")!=-1){
		parametros="resizable,status";
		if (scrola) {parametros="scrollbars,"+parametros;}
		newWindow=window.open(estilo, nome, parametros); 
		newWindow.focus();}
	else {
		//alert("Não foi detectado o plugin do flash instalado neste computador. Deseja continuar mesmo assim?", "Continuar", "Desistir");
		if (confirm("A operação solicitada exige o plugin do Flash, que não foi detectado neste computador. Deseja tentar mesmo assim?")) {
			parametros="resizable,status";
			if (scrola) {parametros="scrollbars,"+parametros;}
			newWindow=window.open(estilo, nome, parametros); 
			newWindow.focus();
		}
	}	
}


//-------------------------------------fim do script
-->
