
d=document

// Limpa Forms
function ClearForm(which){
if (which.value!="")
which.value=''
}

// Abre pop
function pop(link, name, w, h, s)
{
v=window.open(link, name, "directories=no,height=" + h + ",width=" + w + ",hotkeys=no,location=no,menubar=no,resizable=no,scrollbars=" + s + ",status=no,toolbar=no,copyhistory=no,screenX=5,screenY=5,top=10,left=10");
v.focus();
}

// Pop galeria
function galeria(img, tot, url)
{
url = "pop_"+ url +".htm?imagem="+ img +"&total="+ tot;
window.open(url,'popgaleria','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=340,height=390');
}

function abrir(img, tot)
{
url = "pop_fotos.htm?imagem="+ img +"&total="+ tot;
window.open(url,'popfoto','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=340,height=390');
}

function abrir_codigo(img, tot)
{
url = "pop_fotos_codigo.htm?imagem="+ img +"&total="+ tot;
window.open(url,'popfoto','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=340,height=390');
}

function abrir_curso(img, tot)
{
url = "/intranet/pop_fotos_curso.htm?imagem="+ img +"&total="+ tot;
window.open(url,'popfoto','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=340,height=390');
}

function abrir_eleicao(img, tot)
{
url = "pop_fotos_eleicao.htm?imagem="+ img +"&total="+ tot;
window.open(url,'popfoto','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=340,height=390');
}

function abrir_cafe(img, tot)
{
url = "pop_fotos_cafe.htm?imagem="+ img +"&total="+ tot;
window.open(url,'popfoto','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=340,height=390');
}

// Checa Browser
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()

// Dimensão de página

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))}

// Redimensiona o pop
function resPop(){
	var w = (docW() > 296) ?  322 : 322;
	w += (is.ie)?0:4;
	if(docH()<530) resizeTo(w,docH()+29);
	else resizeTo(w,529);
}

// Abre e Fecha Menu
function cMn(obj) {
	var objId = obj.id;
	var objChldId = objId + '_int';
	var objChld = document.getElementById(objChldId);

	if(objChld.style.display == ''){
		objChld.style.display = 'none';
	}else{
		objChld.style.display = '';
	}
}

//Nome na Barra
window.defaultStatus="Abracom"
