// JavaScript Document
// configurações:
// ===============================

// posiçao inicial do popop antes de carregar imagens
PositionX = 0;
PositionY = 0;

defaultWidth  = 300;
defaultHeight = 300;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbar=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbar=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Carregando...</title><style>body{margin:0px;}</style>');
writeln('<script>');
writeln('var isNN,isIE;');
writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('window.resizeTo(100,100);');
writeln('width=10 + (document.images[0].width);');
writeln('height=36 + (document.images[0].height);');
writeln('window.resizeTo(width,height);}');
writeln('if (isNN){');       
writeln('window.innerWidth=document.images["imagem"].width;');
writeln('window.innerHeight=document.images["imagem"].height;}}');

writeln('function doTitle(){document.title="'+imageTitle+'";}');

//writeln('function centra_janela(){ var winleft = (screen.width - window.width) / 2;	var wintop = (screen.height - window.height) / 2;	window.left ='+winleft+';	window.top ='+wintop+';}');
writeln('</script>');
if (!AutoClose) writeln('</head><body bgcolor=#FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="imagem" src='+imageURL+' style="display:block"></body></html>');
close();		
}}



//funcao para abrir video .SWF em uma janela com o tamanho do video

function popVideo(VURL,VTitle,Vwidth,Vheight){
	
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Carregando...</title><style>body{margin:0px;}</style>');
writeln('<script>');
writeln('var isNN,isIE;');
writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');
writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');

writeln('function reSizeToImage(){');
writeln('if (isIE){');    
writeln('width=10 + '+Vwidth+';');
writeln('height=36 + '+Vheight+';');     
writeln('window.resizeTo(width,height);}');
writeln('if (isNN){');  
writeln('window.innerWidth='+Vwidth+';');
writeln('window.innerHeight='+Vheight+';}');
writeln('}');
writeln('function doTitle(){document.title="'+VTitle+'";}');
writeln('</script>');
writeln('<style type="text/css">');
writeln('body {margin-left: 0%; margin-top: 0%; margin-right: 0%; margin-bottom: 0%;}');
writeln('</style>');
writeln('</head>');
writeln('<body bgcolor=#000000 scroll="no"  onload="reSizeToImage();doTitle();self.focus()">');
writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+Vwidth+'" height="'+Vheight+'" ID="Captivate1">');
writeln('<param name="movie" value="'+VURL+'">');
writeln('<param name="quality" value="high">');
writeln('<param name="menu" value="false">');
writeln('<param name="loop" value="0">');
writeln('<embed src="'+VURL+'" width="'+Vwidth+'" height="'+Vheight+'" loop="0" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false">');
writeln('</embed></object></body></html>');

close();		
}}


function messageWindow(title, msg)
{
  var width="300", height="150";
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  var msgWindow = window.open("","msgWindow", styleStr);
  var head = '<html><head><title>'+title+'</title><style> body{background-color: #FFFFE1} .style1 {font-family: Verdana; font-size: 11px}</style></head>';
  var body = '<center><span class="style1">'+msg+'</span><br><p><form><input type="button" value="   OK   " onClick="self.close()"></form><center><html>';
  msgWindow.document.write(head + body);
}



function desabilitar(){ 
//    alert ("Gostou do CAD/TQS??? \n \n Entre em contato para maiores informações.") 
    return false 
} 
document.oncontextmenu=desabilitar 

//
function swapImage(obj,imgFile) 
{
  	obj.src=imgFile;
}
//