                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

d=document

function getElm(id){return (is.ie4)?d.all[id]:d.getElementById(id)}

function checkBrowserLight(){
	T=this
	b=navigator.appName
	v=navigator.appVersion
	u=navigator.userAgent
	if(b=='Netscape')T.b='ns'
	else if(b=='Microsoft Internet Explorer')T.b='ie'
	else T.b=b
	T.v=parseInt(v)
	T.ns=(T.b=='ns'&&T.v>=4)
	T.ie=(T.b=='ie'&&T.v>=4)
	T.sa=(u.indexOf('Safari')>0)
	T.win=(u.indexOf('Win')>0)
	T.mac=(u.indexOf('Mac')>0)
	T.osx=(u.indexOf('Mac OS X')>0||u.indexOf('MSIE 5.2')>0)
	T.os=(T.mac||T.osx)?'mac':'win'
}
is=new checkBrowserLight()

var flash=false
var flashVersion=null
if(is.ie&&is.win){
	document.write(
		'<script language="VBScript"\>\n'+
		'function isDef(id)\n'+
			'on error resume next\n'+
			'isDef = false\n'+
			'isDef = IsObject(CreateObject(id))\n'+
		'end function\n'+
		'flash = isDef("ShockwaveFlash.ShockwaveFlash")\n'+
		'if flash = true then\n'+
			'flashVersion = 2\n'+
			'flashObject = true\n'+
			'do while flashObject = true\n'+
				'flashVersion = flashVersion+1\n'+
				'flashObject = isDef("ShockwaveFlash.ShockwaveFlash." & flashVersion)\n'+
			'loop\n'+
			'flashVersion = flashVersion-1\n'+
		'end if\n'+
		'</script\>\n'
	)
}
else{
	flash=navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin
	if(flash){flashVersion=parseInt(flash.description.substring(flash.description.indexOf('.')-1,flash.description.indexOf('.')));flash=true}
}

function docW(){return(is.ie?(d.body.scrollWidth):(d.width))}
function docH(){return(is.ie?(d.body.scrollHeight):(d.height))}
function winW(){return(is.ie?(d.body.clientWidth):(window.innerWidth))}
function winH(){return(is.ie?(d.body.clientHeight):(window.innerHeight))}


// InterDHTML

var interDHTML_elms=new Array()

function interDHTML_flash(source,name,left,top,width,height,time,center,load_trasparent,style){
	if(!is.win&&!is.osx)return false // Exit para OS diferente de Windows e OS X
	if((is.mac||is.ns)&&flashVersion<6)return false // Exit para Mac ou Netscape com Flash inferior ˆ vers‹o 6
	if(is.ns&&is.v<5)return false // Exit para Netscape inferior ˆ vers‹o 5
	interDHTML_elms[interDHTML_elms.length]=name
	source+='?name='+name+'&os='+is.os
	width=width||'100%'
	height=height||'100%'
	time=time||'60'
	time=time*1000
	var id='interDHTML_layer_'+name
	var S=''
	var S2=''
	S='<div id="'+id+'" style="position:absolute;left:'+left+';top:'+top+';width:'+width+';height:'+height+';z-index:10;'+((load_trasparent)?((is.mac)?'visibility:hidden;':'clip:rect(0 1 1 0);'):'')+style+'" time="'+time+'">'
	if(is.win&&is.ie){
		S+=''+
		'<object'+
			' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+
			' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"'+
			' id="'+name+'"'+
			' width='+width+
			'	height='+height+
			'>'+
			'<param name="movie" value="'+source+'">'+
			'<param name="quality" value="high">'+
			'<param name="bgcolor" value="#FFFFFF">'+
			'<param name="wmode" value="transparent">'+
			'<param name="play" value="false">'+
		'</object>\n'+
		'<script language="vbscript"\>\n'+
		'on error resume next\n'+
		'sub '+name+'_FSCommand(ByVal command,ByVal args)\n'+
		'call interDHTML_flash_DoFSCommand(command,args)\n'+
		'end sub\n'+
		'</script\>\n'
	}else{
		S+=''+
		'<embed'+
			' type="application/x-shockwave-flash"'+
			' pluginspage="http://www.macromedia.com/go/getflashplayer"'+
			' id="'+name+'"'+
			' name="'+name+'"'+
			' width='+width+
			' height='+height+
			' src="'+source+'"'+
			' quality="high"'+
			' bgcolor="#FFFFFF"'+
			' wmode="transparent"'+
			' SWLiveConnect="true"'+
			' allowScriptAccess="always"'+
			((is.win)?' play="false"':'')+
		'>'+
		'</embed>\n'+
		'<script\>\n'+
		'function '+name+'_DoFSCommand(command,args){\n'+
		'	interDHTML_flash_DoFSCommand(command,args)\n'+
		'}\n'+
		'</script\>\n'
	}
	S+='</div>'
	document.write(S)
	if(center)interDHTML_center(name)
	onload=function(){
		if(is.win)getElm(name).Play()
	}
}

function interDHTML_center(name){
	var elm=getElm('interDHTML_layer_'+name)
	var pagW=(winW()>docW())?winW():docW()
	var left=(pagW-elm.offsetWidth)/2
	elm.style.left=(left>0)?left:0
}

function interDHTML_flash_open(name){
	var elm=getElm('interDHTML_layer_'+name)
	elm.style.clip='rect(0 '+elm.style.width+' '+elm.style.height+' 0)'
	elm.style.visibility='visible'
	var time=elm.getAttribute('time')
	setTimeout('interDHTML_flash_close("'+name+'")',time||30000);
}

function interDHTML_flash_close(name){
	var elm=getElm('interDHTML_layer_'+name)
	elm.style.clip='rect(0 0 0 0)'
	if(is.ie||is.mac)elm.style.display='none'
}

function interDHTML_flash_DoFSCommand(command,args){
	eval(command+'("'+args+'")')
}

onresize=function(){
	for(var i=0;i<interDHTML_elms.length;i++){
		interDHTML_center(interDHTML_elms[i])
	}
}


