// DynClick
d=document
// Basics
function isDef(S){return(eval('typeof('+S+')')!='undefined'&&eval('typeof('+S+')')!='unknown')}
function openPopup(url,n,w,h,other,c){
  if(url.indexOf('/b2c/jsp/CarregaRecuperaDados.jhtml')!=-1){
     url=url.replace('/b2c/jsp/CarregaRecuperaDados.jhtml','/b2c/jsp/CarregaRecuperaDados.jhtml?hasTemplate=true')
  }
  if(url.indexOf('/b2c/jsp/CarregaDadosCadastro.jhtml')!=-1){
     url=url.replace('/b2c/jsp/CarregaDadosCadastro.jhtml','/b2c/jsp/CarregaDadosCadastro.jhtml?vgnextoid='+getIdCanal("MEUS_DADOS",null));   
  }
  if(url.indexOf('/b2c/jsp/default.jhtml?adPagina=122&adArtigo=647')!= -1){
     url=url.replace("/b2c/jsp/default.jhtml?adPagina=122&adArtigo=647","/b2c/vgn/v/index.jsp?vgnextoid=92232194c655b110VgnVCM1000005f05a8c0RCRD");
  }
	l=18;t=18
	if(c){l=(screen.availWidth-w)/2;t=(screen.availHeight-h)/2}
	url=url.replace(/[ ]/g,'%20')
	popup=window.open(url,'pop_'+n,'left='+l+',top='+t+',width='+w+',height='+h+',scrollbars=1'+((other)?','+other:''))
	other=other||''
	if(is.ie&&other.indexOf('fullscreen')!=-1){popup.moveTo(0,0);popup.resizeTo(screen.width,screen.height)}
	popup.focus()
}
function checkBrowser(){
	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.ns4=(T.b=='ns'&&T.v==4)
	T.ns5=(T.b=='ns'&&T.v>=5)
	T.ns6=(T.b=='ns'&&T.v>=5)
	T.ie=(T.b=='ie'&&T.v>=4)
	T.ie4=(u.indexOf('MSIE 4')>0)
	T.ie5=(u.indexOf('MSIE 5.0')>0)
	T.ie55=(u.indexOf('MSIE 5.5')>0)
	T.ie6=(u.indexOf('MSIE 6.0')>0)
	if(T.ie5)T.v=5
	if(T.ie55)T.v=5.5
	if(T.ie6)T.v=6
	T.min=(T.ns||T.ie)
	T.dom=(T.v>=5)
	T.win=(u.indexOf('Win')>0)
	T.mac=(u.indexOf('Mac')>0)
}
is=new checkBrowser()
// Reloads the window if Nav4 resized
function BUG_ns4_reloadOnResize(){
	if(!d.pgW){d.pgW=innerWidth;d.pgH=innerHeight;onresize=BUG_ns4_reloadOnResize}
	else if(innerWidth!=d.pgW||innerHeight!=d.pgH)location.reload()
}
if(d.layers)BUG_ns4_reloadOnResize()
// Objects Constructor
var DOA=new Array()
function DO(parent){this.arguments=DO.caller.arguments;this.newDO=newDO;this.parent=parent;this.itens=new Array()}
function newDO(){return (this.itens)?this.itens[this.itens.length]=new DO(this):DOA[DOA.length]=new DO()}
// DynLayer
// Copyright 1999 Dan Steinman
// http://www.dansteinman.com/dynapi/
function DL(id,n1,n2){
	var T=this
	if(is.ns4){
		if(n1){
			if(n2)T.elm=d.layers[n2].document.layers[n1].document.layers[id]
			else T.elm=d.layers[n1].document.layers[id]
		}
		else T.elm=d.layers[id]
		T.css=T.elm
		T.doc=T.elm.document
		T.l=T.css.left
		T.t=T.css.top
		T.w=T.css.clip.width
		T.h=T.css.clip.height
	}
	else{
		T.elm=T.event=(is.ie4)?d.all[id]:d.getElementById(id)
		T.css=T.elm.style
		T.doc=document
		T.l=T.elm.offsetLeft
		T.t=T.elm.offsetTop
		T.w=T.elm.offsetWidth
		T.h=T.elm.offsetHeight
		if(!T.w)T.w=T.css.pixelWidth
		if(!T.h)T.h=T.css.pixelHeight
	}
	T.obj=((id.lastIndexOf('Div'))?id.substring(0,id.lastIndexOf('Div')):id)+'DL'
	T.sh=DLsh
	T.hd=DLhd
	T.mTo=DLmTo
	T.mBy=DLmBy
	T.rTo=DLrTo
	T.rBy=DLrBy
	T.write=DLwrite
}
function DLsh(){this.css.visibility=(is.ns4)?'show':'visible'}
function DLhd(){this.css.visibility=(is.ns4)?'hide':'hidden'}
function DLmTo(l,t){
	if(l!=null){
		this.l=l
		if(!is.ie)this.css.left=this.l
		else this.css.pixelLeft=this.l
	}
	if(t!=null){
		this.t=t
		if(!is.ie)this.css.top=this.t
		else this.css.pixelTop=this.t
	}
}
function DLmBy(l,t){this.mTo(this.l+l,this.t+t)}
function DLrTo(w,h){
	if(w!=null){
		this.w=w
		if(is.ns4)this.css.clip.width=this.w
		else this.css.width=this.w
	}
	if(h!=null){
		this.h=h
		if(is.ns4)this.css.clip.height=this.h
		else this.css.height=this.h
	}
}
function DLrBy(w,h){this.rTo(this.w+w,this.h+h)}

function DLwrite(S){
	if(is.ns4){this.doc.close();this.doc.open();this.doc.write(S);this.doc.close()}
	else this.elm.innerHTML=S
}
