var URL = document.location+"";
var URLSITE = URL;
var estabResize;
var eventResize;
if( URL.lastIndexOf('.br') != -1 )
	URLSITE = URL.substring( 0, URL.lastIndexOf('.br') + 3 );

//URLSITE = 'http://localhost:8080'

function setLogo() {
	url = document.location;
	if( url.toString().indexOf('lbr')>0 )
		document.getElementById('logo').style.background="transparent url(/templates/site/default/logos/logorede.png) no-repeat scroll 0 0";
}

function setFocus(el) {
	setTimeout("document.getElementById('"+el+"').focus();",500);
}

//---------------------------------------------------------------------
//Upload
function uploadFile( recipient, type, name, path, width, height ) {
	var recipient = recipient+"";
	var inputfile = document.getElementById( recipient );
	var fupload = document.getElementById('fupload');
	
	if( document.getElementById('imageBtn') )
		var buttons = 1;

	if( inputfile.value != "" ) {
		fupload.insertBefore( inputfile, null );
		if( buttons == 1 ) 
			document.getElementById("imageBtn").style.display="none";
//		else
//			inputfile.style.display = "none";
		
		var URL = document.location+"";		
		URL = URL.substring(0,URL.lastIndexOf('index.php'));
		
		var url = URL+'index.php?m=upload&filename='+name+'&recipient='+recipient+'&type='+type+'&path='+path+'&width='+width+'&height='+height;
		micoxUpload("fupload",url,recipient+'_load','&nbsp;<img src="image/indicatormini.gif">&nbsp;Carregando...','Erro ao carregar');
	}
}
//---------------------------------------------------------------------

function fecharRich() {
	richM = findDOM('Rich_Media');
	if( richM )
		richM.parentNode.removeChild(richM);
}

function fecharIntro() {
	richM = findDOM('introDiv');
	sites = findDOM('siteAgito');
	if( richM )
		richM.parentNode.removeChild(richM);
	if( sites )
		sites.style.display = "inline";
	if( richM ) {
		loadCorpo();
		setLoading();
	}
}

function disableselect(e){
      return false;
}

function reEnable(){
      return true;
}

function removeSidebar() {
	document.onselectstart=new Function ("return false");
	if (window.sidebar){
      	document.onmousedown=disableselect;
    	document.onclick=reEnable;
	}
}

function textCounter(field, maxlimit) {
if (field.value.length > maxlimit) 
	field.value = field.value.substring(0, maxlimit);
}

function scrollToBottom() {
	if (document.all)
		topScroll = document.documentElement.clientHeight; 
	else
		topScroll = window.innerHeight; 
	window.scrollTo(0, topScroll);
}

function confirmDelete( question, action ) {
	answer = confirm(question);
	if( answer )
		eval( action );
		
	return answer;
}

/////////////////////////////////////////////
//    Funcoes para o Loading do Ajax       //
/////////////////////////////////////////////

var wait=0;
var countResponse=0;

function showLoading() {

	var page = findDOM("disablePage");
	var loading = findDOM("loadingMessage");
	var isHome = findDOM("chamadasCadernoHome");
	var isLive = findDOM("janelaPerfilPrincipal");
	
	if( wait==0 )
		countResponse=0;

	if( isHome ) {
		page.style.display='none';
		loading.style.display='none';
	}
	else {
		if( document.all ) {
			page.style.height=document.body.offsetHeight;
			topScroll = document.documentElement.scrollTop;
			page.style.width=document.body.offsetWidth;
			leftScroll = document.documentElement.scrollLeft;
			widthTotal = document.body.clientWidth;
		} else {
			page.setAttribute('style','height:'+document.body.offsetHeight+'px;');
			topScroll = window.pageYOffset; 
			page.setAttribute('style','width:'+document.body.offsetWidth+'px;');
			leftScroll = window.pageXOffset; 
			widthTotal = window.innerWidth;
		}
		if( isLive )
			if( topScroll > 300 ) {
				window.scrollTo(0, 0);
				topScroll = 0;
			}
		loading.style.top = ( topScroll + 200 )+"px";
		loading.style.left = ( leftScroll + parseInt((widthTotal/2)-75) )+"px";
		page.style.display='block';	
		loading.style.display='block';
		page.disabled = true;
	}
}

function hideLoading() {

	countResponse++;

	if( wait==0 ) {
		var page = findDOM("disablePage");
		var loading = findDOM("loadingMessage");
		
		page.style.display='none';
		loading.style.display='none';
    	
    	// fotos
    	var fotoCob=findDOM('fotoCobertura');
    	if( fotoCob )
			fotoCob.style.visibility = 'visible';
	}
	
}

function setLoading() {
	xajax.callback.global.onRequest = showLoading;
	xajax.callback.global.onComplete = hideLoading;
	xajax.callback.global.onFailure = hideLoading;
	
/*	xajax.callback.global.onFailure = function(args) {
		alert("In global.onFailure...HTTP status code: " + args.request.status);
	} 
*/	
//	xajax.loadingFunction = showLoading;
//	xajax.doneLoadingFunction = hideLoading;
	try {
  		document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {}	
}

function setLoadingPos( el, waux, haux ) {	
	var loadingWidth = 150;
	var loadingHeight = 30;	
	var w = el.offsetWidth;
	var h = el.offsetHeight;		
	
	pos = findPos(el);
			
	if( !waux )
		waux = 0;
	if( !haux )
		haux = 0;
		
	loading = findDOM("loadingMessage");	
	if( document.all ) {
		loading.style.top = pos[1] + haux + (h/2) - loadingHeight/2;
		loading.style.left = pos[0] + waux + (w/2) - loadingWidth/2;
	}
	else {
		top = pos[1] + haux + (h/2) - loadingHeight/2;
		left = pos[0] + waux + (w/2) - loadingWidth/2;
		loading.setAttribute('style','top:'+top+'px;'+'left:'+left+'px;');
	}
}

function setWait() {
	wait=1;
	foto = findDOM("fotoCobertura");	
	if( foto.offsetHeight > 375 )	
		setLoadingPos( foto, 0, -62 );
	else
		setLoadingPos( foto );
}

function stopWait() {
	wait=0;
	
	if( countResponse > 0 )
		setTimeout("hideLoading();", 500);
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

////////////////////////////////////////////
//    Funcoes de formatacao de foto       //
////////////////////////////////////////////

function findDOM(objectId) {
	if (document.getElementById) {
		return (document.getElementById(objectId));}
		if (document.all) {
			return (document.all[objectId]);}
}

function recarregaPerfil( urlPerfil ) {
	perfilD = findDOM('amigoPerfil_id');
	var perfilExist = false;
	if( perfilD != null ) {
		perfil = perfilD.value;
		if( perfil > 0 ) {
			perfilComp = "&perfil_id="+perfil;
			perfilExist = true;
		}
	}
	if( perfilExist )
		url = urlPerfil+perfilComp;
	else
		url = urlPerfil;
	setTimeout("top.location.href = '"+url+"';",500);
}

function redirecionarUrl( url ) {
	setTimeout("top.location.href = '"+url+"';",500);
}

function limpaThumbsAlbum(sortPic,numeroPagina,proximaFoto,anteriorFoto,largura,altura){
	var e=document.getElementsByTagName("a");
	for(var i=0;i<e.length;i++){
		if(e[i].className=='thumbAlbumMarcado'||e[i].className=='thumbAlbum') 
			e[i].className = 'thumbAlbum';
	}
	var at=findDOM('thumb'+sortPic);
	var prox = findDOM('proxima');
	var ant = findDOM('anterior');
	if (at!=null) {
		at.className = 'thumbAlbumMarcado';	
		if(proximaFoto!=0) {
			var pr=findDOM('thumb'+proximaFoto);
			if (pr!=null) {
				prox.style.display = 'block';
				prox.onclick = function() {
					hideFoto(0);
					xajax_getFoto(proximaFoto,numeroPagina, xajax.getFormValues( 'formFoto' ) );
				}
			}				
			else {
				prox.style.display = 'block';
				prox.onclick = function() {
					hideFoto(0);
					xajax_getPagina((numeroPagina+1),1,xajax.getFormValues( 'formFoto' ));
				}	
			}
		} 
		else {
			prox.style.display = 'none';
			prox.onclick = function() {
				void(null);
			}
		}

		if(anteriorFoto!=0) {
			var an=findDOM('thumb'+anteriorFoto);
			if (an!=null) {
				ant.style.display = 'block';
				ant.onclick = function() {
					hideFoto(0);
					xajax_getFoto(anteriorFoto,numeroPagina,xajax.getFormValues( 'formFoto' ));}				
			} 
			else {
				ant.style.display = 'block';
				ant.onclick = function() {
					hideFoto(0);
					xajax_getPagina((numeroPagina-1),0,xajax.getFormValues( 'formFoto' ));}			
			}
		} 
		else {
			ant.style.display = 'none';
			ant.onclick = function() {
				void(null);
			}	
		}
	}
	var fotoCob=findDOM('fotoCobertura');
	fotoCob.style.width = largura+'px';
	fotoCob.style.height = altura+'px';
	hideLoading();
}

function hideFoto(foto_id) {
	var fotoMarcada = 1;
	var atFoto=findDOM('thumb'+foto_id);
	if( atFoto )
		if( atFoto.className != 'thumbMarcado' || atFoto.className != 'thumbAlbumMarcado' ) 
			fotoMarcada = 0;
	
	fotoCob = findDOM('fotoCobertura');	
	fotoCob.src = "../default/img/transparente.gif";
	if( foto_id==0 && fotoMarcada == 0) {
		fotoCob.style.visibility = 'hidden';
		setWait();
	} else {
		fotoCob.style.visibility = 'visible';
	}	
}

function showDenuncia ( hash ) {
	xajax_getJanelaDenuncia( hash );
}

function hideJanela ( id ) {
	dDOM = findDOM(id);
	if(dDOM) {
		dDOM.style.display = 'none';
		dDOM.innerHTML = "";
	}
}

function ini( conteudo_id, entidade_id, dominio_id ) {
	cont_id=conteudo_id;
	ent_id=entidade_id;
	dom_id=dominio_id;

	getMidias();
	checkLoginBox();
	//xajax_checkMenu();
}

function iniAlbum ( numeroPagina, conteudo_id, entidade_id ) {
	cont_id=conteudo_id;
	ent_id=entidade_id;
	dom_id=0;
	getMidias();
	xajax_getJanelaPesquisa( xajax.getFormValues( 'formFoto' ), numeroPagina );	
}

function iniPerfil ( usuario_id, acao, album_id, entidade_id ) {
	cont_id=usuario_id;
	ent_id=entidade_id;
	dom_id=0;
	getMidias();
	xajax_getPaginaPerfil( usuario_id, acao, album_id );
}

function iniComunidade ( comunidade_id, acao, album_id, entidade_id ) {
	cont_id=comunidade_id;
	ent_id=entidade_id;
	dom_id=0;
	getMidias();	
	xajax_getPaginaComunidade( comunidade_id, acao, album_id );
}

function mostraVideo( video ) {
	vd = findDOM('biografiaVideo');	
	vd.innerHTML = video;
}

function selecaoPesquisa () {
	document.getElementById("filterWord").select();
}

function selecaoCampo ( nomeCampo ) {
	document.getElementById( nomeCampo ).select();
}

function disableEnterKey( e, c )
{
     var key;
     if(window.event)
          key = window.event.keyCode;     	//IE
     else
          key = e.which;     				//firefox

     if(key == 13) {
     	if( c == "pesquisa" )
			resultPesquisa();
		else if ( c == "amigoPesquisa" ) {
			usr = findDOM('amigoUsuario_id');
			xajax_getPaginaAmigos( 1, usr.value, xajax.getFormValues('formPesqAmigo'));	
		}
		else if ( c == "pessoaPesquisa" ) {
			usr = findDOM('amigoUsuario_id');
			xajax_getPesquisaPessoasPagina( 1, usr.value, xajax.getFormValues('formPesqAmigo'), xajax.getFormValues('formPesqPessoa'));
		}		
		else if ( c == "favoritoPesquisa" ) {
			usr = findDOM('favoritoUsuario_id');
			xajax_getPaginaFavoritos( 1, usr.value, xajax.getFormValues('formPesqFavorito'));	
		}
		else if ( c == "metaAlbumTexto" )
			xajax_putNovoMetaFoto( xajax.getFormValues('formTagAlbum'),xajax.getFormValues('formFoto'));
		
		else if ( c == "metaAlbumPesquisa" )
			xajax_putMetaTextoPesquisa( xajax.getFormValues('formPesqAlbum'),xajax.getFormValues('formFoto'));
			
		else if ( c == "loginDen" )
			logarUsuario('Den');
		
		else if ( c == "loginMsg" )
			logarUsuario('Msg');
		
		else if ( c == "loginHome" )
			logarUsuario('Home');
     	
		else if ( c == "loginFav" )
			logarUsuario('Fav');

		else if ( c == "loginFavE" )
			logarUsuario('FavE');
     	
		else if ( c == "loginFavU" )
			logarUsuario('FavU');     	

		else if ( c == "loginFot" )
			logarUsuario('Fot'); 

		else if ( c == "loginAlb" )
			logarUsuario('Alb'); 
     	
		else if ( c == "perguntaPromocao" )
			xajax_putRespostaPromocao( xajax.getFormValues( 'formCheckPromo' ) );	
			
		else if ( c == "checkRGPromocao" ) 
			xajax_checkRG( xajax.getFormValues( 'formCheckPromo' ) );	

		else if ( c == "checkCPFPromocao" )
			xajax_checkCPF( xajax.getFormValues( 'formCheckPromo' ) );	
			
     	return false;
     }
     else 
     	return true;     
}

function logarUsuario() {

	loginDOM = findDOM('loginInput');
	senhaDOM = findDOM('senhaInput');

	hashDOM = findDOM('hashConteudo');
	if(hashDOM)
		hash = hashDOM.value;
	
	xajax_getAuthUser( loginDOM.value, senhaDOM.value, hash );
}

function checkLoginBox(){
	loginB = findDOM("loginBox");
	loginBT = findDOM("loginBoxTexto");
	if(checkCookieLogin()) {
		loginB.style.display = "none";
		loginBT.style.display = "block";
		xajax_atualizaLogin();
	} else {
		loginB.style.display = "block";
		loginBT.style.display = "none";
	}
}
function checkCookieLogin(){
	al = getCookieLogin("agitologinInfo");
	if (al!=null&&al!=""){
		//msg('checkCookieTRUE');
		return true;
	}else{
		//msg('checkCookieFALSE');  	
		return false;
	}
}	
function getCookieLogin(c_name){
	if (document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name+"=");
		//msg("c"+document.cookie);
		if (c_start!=-1){ 
			c_start=c_start+c_name.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if(c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}	

function pesquisaAmigos( valorPesqAmigos, perfil_id ) {
	campoPesqAmigos = findDOM( 'abrangenciaAmigos' );
	campoPesqAmigos.value = valorPesqAmigos;
			
	todosAmigosAmDOM = findDOM( 'todosAmigosPesquisaAm' );	
	amigosAmDOM = findDOM( 'amigosPesquisaAm' );	
	
	todosAmigosAmDOM.className = "pesquisaAmItem";	
	amigosAmDOM.className = "pesquisaAmItem";	
	
	linkPesqAmDOM = findDOM( valorPesqAmigos+'PesquisaAm' );
	linkPesqAmDOM.className = "pesquisaAmSelecionado";
	
	if( valorPesqAmigos == 'todosAmigos' )
		xajax_getPesquisaPessoasPagina( 1, perfil_id, xajax.getFormValues('formPesqAmigos') );
	else
		xajax_getPaginaAmigos( 1, perfil_id, xajax.getFormValues('formPesqAmigos') );
}


function limpaAbas( el, tag, base ) {
	var e=document.getElementsByTagName(tag);
	for(var i=0;i<e.length;i++){
		if(e[i].className==base+'Marcado'||e[i].className==base+'Fim'||e[i].className==base) {
			if(	e[i].id==base+"7" || e[i].id==base+"14" || e[i].id==base+"21" || e[i].id==base+"28" ||
				e[i].id==base+"6" || e[i].id==base+"13" || e[i].id==base+"20" || e[i].id==base+"27")
				e[i].className = base+'Fim';
			else
				e[i].className = base;
		}
	}
	sp = findDOM(base+el);
	sp.className=base+'Marcado';	
}

function atualizaFormAgenda ( campo, valor ) {
	cp = findDOM(campo);
	cp.value = valor;
}

function marcarSelecionado( base, id, total ) {
	for( var i=0; i<=total; i++ ) {
		elem = findDOM( base+i );
		if( elem )
			elem.className = base;
	}
	el = findDOM( base + id );
	if( el )
		el.className = base + 'Marcado';
}

function cancelarResponderMensagem( usuario_id ) {	
	respMsgSuccess  = findDOM( 'responderMsgSucesso' );
	respMsg 		= findDOM( 'responderMsgUsuario' );
	loginTxt 		= findDOM( 'loginTextoMsgUsuario' );
	msgConteudo_id 	= findDOM( 'mensagemConteudo_id' );
	msgTexto 		= findDOM( 'textoMensagem' );
	msgTitulo 		= findDOM( 'tituloMensagem' );
	msgResponder	= findDOM( 'mensagemResponder' );
	
	respMsgSuccess.style.visibility = "hidden";
	respMsg.style.visibility 	= "hidden";
	loginTxt.style.visibility 	= "visible";
	msgConteudo_id.value 		= usuario_id;
	msgTexto.style.backgroundColor = "#FFFFFF";
	msgTitulo.style.backgroundColor = "#FFFFFF";
	msgResponder.value = 0;
}

function hoverIcones( mensagem ) {
	spanIcon = findDOM( 'mensagemIcones' );
	if( spanIcon ) 
		spanIcon.style.visibility = "visible";
	
	spanIconTxt = findDOM( 'mensagemIconesTexto' );
	if(spanIconTxt)
	spanIconTxt.innerHTML = mensagem;
	
}

function hoverIconesLimpar() {
	spanIcon = findDOM( 'mensagemIcones' );
	spanIcon.style.visibility = "hidden";
	spanIconTxt = findDOM( 'mensagemIconesTexto' );
	spanIconTxt.innerHTML = "";
}

function showPesquisaAv(){
	av = findDOM("buscaAv");
	
	if( av.style.display == "none")
		av.style.display = "block";
	else
		av.style.display = "none";
}

function showInserirMsg(){
	v = findDOM("inserirMsg");
	
	if( v.style.display == "none")
		v.style.display = "block";
	else
		v.style.display = "none";
}

function resultPesquisa() {
	
	noHover=0;
	
	var entidadesStr = "";	
	filterWordDOM = findDOM('filterWord');
	filterDomainDOM = findDOM('filterDomain');
	perPageDOM = findDOM('perPage');
	orderByDOM = findDOM('orderBy');
	usuariosDOM = findDOM('usuarios');

	coberturasDOM = findDOM('coberturasE');
	enquetesDOM = findDOM('enquetesE');
	estabelecimentosDOM = findDOM('estabelecimentosE');
	eventosDOM = findDOM('eventosE');
	materiasDOM = findDOM('materiasE');
	promocoesDOM = findDOM('promocoesE');

	if ( !coberturasDOM.checked )
		entidadesStr = entidadesStr + coberturasDOM.value + ",";
	
	if ( !enquetesDOM.checked )
		entidadesStr = entidadesStr + enquetesDOM.value + ",";
	
	if ( !estabelecimentosDOM.checked )
		entidadesStr = entidadesStr + estabelecimentosDOM.value + ",";
	
	if ( !eventosDOM.checked )
		entidadesStr = entidadesStr + eventosDOM.value + ",";

	if ( !materiasDOM.checked )
		entidadesStr = entidadesStr + materiasDOM.value + ",";

	if ( !promocoesDOM.checked )
		entidadesStr = entidadesStr + promocoesDOM.value + ",";
		
	if ( !usuariosDOM.checked )
		allUsers = 0;
	else
		allUsers = 1;

	if ( !filterDomainDOM.checked )
		filterDomain = 0;
	else
		filterDomain = 1;		
		
	xajax_getSearchResultPage( 1, filterWordDOM.value, orderByDOM.value, entidadesStr, 
									allUsers, perPageDOM.value, filterDomain );
}


// ----------------------------------------------------------------------
// Editor HTML

var validateEditor=0;
var editor_id="";

function initEditor( editor_id, type, height, width ) {
	if( !height ) {
		height = "300";
		width = "98%"
	}
	oFCKeditor = new FCKeditor( editor_id, width, height, type,'' );
	var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('index.php'));
	sBasePath = sBasePath + "lib/fckeditor/"
	oFCKeditor.BasePath	= sBasePath;
	oFCKeditor.ReplaceTextarea();
}

function updateFCK( id ) {
	var fck = FCKeditorAPI.GetInstance( id );
	eval("document.forms[0]."+id+".value = fck.GetXHTML();");
}

function debug( el ) {
	var element = document.getElementById( el );
	alert(element.innerHTML);
}

/*--------  Customized FOR getOption -----------------------------------*/
function addOption(selectId, txt, val) {
    var objOption = new Option( decodeHtml(val), txt);
    document.getElementById(selectId).options.add(objOption);
}

function clearOptions(selectId) {	
	var select = document.getElementById( selectId );	
	while( select.length > 0 ) {
		select.options.remove(0);
	}
}

function decodeHtml(html) {
	html = 	html.replace("&nbsp;"," ");
	html =	html.replace("&iexcl;","?");
	html =	html.replace("&cent;","?");
	html =	html.replace("&pound;","?");
	html =	html.replace("&curren;","?");
	html =	html.replace("&yen;","?");
	html =	html.replace("&brvbar;","?");
	html =	html.replace("&sect;","?");
	html =	html.replace("&uml;","?");
	html =	html.replace("&copy;","?");
	html =	html.replace("&ordf;","?");
	html =	html.replace("&laquo;","?");
	html =	html.replace("&not;","?");
	html =	html.replace("&shy;","?");
	html =	html.replace("&reg;","?");
	html =	html.replace("&macr;","?");
	html =	html.replace("&deg;","?");
	html =	html.replace("&plusmn;","?");
	html =	html.replace("&sup2;","?");
	html =	html.replace("&sup3;","?");
	html =	html.replace("&acute;","?");
	html =	html.replace("&micro;","?");
	html =	html.replace("&para;","?");
	html =	html.replace("&middot;","?");
	html =	html.replace("&cedil;","?");
	html =	html.replace("&sup1;","?");
	html =	html.replace("&ordm;","?");
	html =	html.replace("&raquo;","?");
	html =	html.replace("&frac14;","?");
	html =	html.replace("&frac12;","?");
	html =	html.replace("&frac34;","?");
	html =	html.replace("&iquest;","?");
	html =	html.replace("&Agrave;","?");
	html =	html.replace("&Aacute;","?");
	html =	html.replace("&Acirc;","?");
	html =	html.replace("&Atilde;","?");
	html =	html.replace("&Auml;","?");
	html =	html.replace("&Aring;","?");
	html =	html.replace("&AElig;","?");
	html =	html.replace("&Ccedil;","?");
	html =	html.replace("&Egrave;","?");
	html =	html.replace("&Eacute;","?");
	html =	html.replace("&Ecirc;","?");
	html =	html.replace("&Euml;","?");
	html =	html.replace("&Igrave;","?");
	html =	html.replace("&Iacute;","?");
	html =	html.replace("&Icirc;","?");
	html =	html.replace("&Iuml;","?");
	html =	html.replace("&ETH;","?");
	html =	html.replace("&Ntilde;","?");
	html =	html.replace("&Ograve;","?");
	html =	html.replace("&Oacute;","?");
	html =	html.replace("&Ocirc;","?");
	html =	html.replace("&Otilde;","?");
	html =	html.replace("&Ouml;","?");
	html =	html.replace("&times;","?");
	html =	html.replace("&Oslash;","?");
	html =	html.replace("&Ugrave;","?");
	html =	html.replace("&Uacute;","?");
	html =	html.replace("&Ucirc;","?");
	html =	html.replace("&Uuml;","?");
	html =	html.replace("&Yacute;","?");
	html =	html.replace("&THORN;","?");
	html =	html.replace("&szlig;","?");
	html =	html.replace("&agrave;","?");
	html =	html.replace("&aacute;","?");
	html =	html.replace("&acirc;","?");
	html =	html.replace("&atilde;","?");
	html =	html.replace("&atilde;","?");
	html =	html.replace("&atilde;","?");		
	html =	html.replace("&auml;","?");
	html =	html.replace("&aring;","?");
	html =	html.replace("&aelig;","?");
	html =	html.replace("&ccedil;","?");
	html =	html.replace("&egrave;","?");
	html =	html.replace("&eacute;","?");
	html =	html.replace("&ecirc;","?");
	html =	html.replace("&euml;","?");
	html =	html.replace("&igrave;","?");
	html =	html.replace("&iacute;","?");
	html =	html.replace("&icirc;","?");
	html =	html.replace("&iuml;","?");
	html =	html.replace("&eth;","?");
	html =	html.replace("&ntilde;","?");
	html =	html.replace("&ograve;","?");
	html =	html.replace("&oacute;","?");
	html =	html.replace("&ocirc;","?");
	html =	html.replace("&otilde;","?");
	html =	html.replace("&ouml;","?");
	html =	html.replace("&divide;","?");
	html =	html.replace("&oslash;","?");
	html =	html.replace("&ugrave;","?");
	html =	html.replace("&uacute;","?");
	html =	html.replace("&ucirc;","?");
	html =	html.replace("&uuml;","?");
	html =	html.replace("&yacute;","?");
	html =	html.replace("&thorn;","?");
	html =	html.replace("&yuml;","?");
	//html =	html.replace("&quot;",""");
	html =	html.replace("&lt;","<");
	html =	html.replace("&gt;",">");
	html =	html.replace("&amp;","&");
	
	return html;
}			   
/*--------  Customized FOR getOption -----------------------------------*/

