function popupIndicacao(){
	window.open(urlBase+'incs/popupIndicacao.asp','popupWap','width=600, height=420')
}
function popupWap(){
	window.open(urlBase+'incs/popupWap.asp','popupWap','width=600, height=420')
}
function popupWidget(){
	window.open(urlBase+'widget/popupWidGet.asp','popupWidget','width=600, height=420')
}
function popupFerramentas(){
	window.open(urlBase+'incs/popupFerramentas.asp','popupFerramentas','width=600, height=420')
}
function popupRss(){
	window.open(urlBase+'incs/popupRss.asp','popupRss','width=600, height=420')
}
function popupNews(){
	novaJanela=window.open(urlBase+'incs/news.asp','popupNews','width=600, height=420')
}
function imprimir(){
	 self.print();
}
function comboMulti(id,campo){
	var combo=document.getElementById(id)
	quais=campo.split(", ")
	for (j=0; j <= quais.length-1; j++){
		for (i=0; i <= combo.length-1; i++){
			if (quais[j] == combo.options[i].value) { combo.options[i].selected=1 }
		}
	}
}
function formataData(o){
	var temp=o.value
	temp = temp.replace("/","")
	temp = temp.replace(/(\d{2})(\d{2})(\d{4})/,"$1/$2/$3")
	o.value=temp
}
function soNumeros(o){
	var temp=o.value
	temp = temp.replace(/\D/,"")
	o.value=temp
}
function fonteMais(){
  indice=CssIndex(".fonteflex");
  if (navigator.appName=="Microsoft Internet Explorer"){
    if((parseInt(document.styleSheets[0].rules[indice].style.fontSize))<19){
      document.styleSheets[0].rules[indice].style.fontSize=(parseInt(document.styleSheets[0].rules[indice].style.fontSize)+2)+"px";
    }
  }else{
    if((parseInt(document.styleSheets[0].cssRules[indice].style.fontSize))<19){
      document.styleSheets[0].cssRules[indice].style.fontSize=(parseInt(document.styleSheets[0].cssRules[indice].style.fontSize)+2)+"px";
    }
  }
}
function fonteMenos(){
  indice=CssIndex(".fonteflex");
  if (navigator.appName=="Microsoft Internet Explorer"){
    if((parseInt(document.styleSheets[0].rules[indice].style.fontSize))>13){
      document.styleSheets[0].rules[indice].style.fontSize=(parseInt(document.styleSheets[0].rules[indice].style.fontSize)-2)+"px";
    }
  }else{
    if((parseInt(document.styleSheets[0].cssRules[indice].style.fontSize))>13){
      document.styleSheets[0].cssRules[indice].style.fontSize=(parseInt(document.styleSheets[0].cssRules[indice].style.fontSize)-2)+"px";
    }
  }
}
function CssIndex(estilo){
  if (navigator.appName=="Microsoft Internet Explorer"){
    for(x=0; x<document.styleSheets[0].rules.length; x++){
      if(estilo.toLowerCase()==document.styleSheets[0].rules[x].selectorText.toLowerCase()) return x;
    }
  }else{
    for(x=0; x<document.styleSheets[0].cssRules.length; x++){
      if(estilo.toLowerCase() ==  document.styleSheets[0].cssRules[x].selectorText.toLowerCase()) return x;
    }
  }
}
function linkarMapa(link){
	if (link == 'RSS'){popupRss();return}
	if (link == 'WAP'){popupWap();return}
	if (link == 'Widget'){popupWidget();return}
	if (link == 'News'){popupNews();return}
	if (link == 'Ferramentas'){popupFerramentas();return}
	if (link != ''){
		if(link.substring(0,4)=='http'){window.open(link)}
			else{window.location=urlBase+link}
	}
}
function buscaindice(id, val){
	var box = document.getElementById(id)
	for (i=0; i < box.length; i++){
		if (box.options[i].value == val) {
			return i
		}
	}
}
function confEmail(email){
	achou=email.indexOf('@')
	achou2=email.indexOf('.')
	if ((achou==-1) || (achou2==-1) || (email.length < 6)) { 
		alert('O e-mail informado é inválido')
		return false
		}
		else{return true}
	}
function getId(id){
	return document.getElementById(id)
}
function validaBusca(nomeForm){
	f=getId(nomeForm)
	if ((f.palavra.value=='')||(f.palavra.value=='Buscar no Exclusivo')) {alert('Você ainda não digitou a palavra a ser buscada')}
		else {f.submit()}
}
function openAjax() { 
	var Ajax; 
	try {Ajax = new XMLHttpRequest(); // XMLHttpRequest para browsers mais populares, como: Firefox, Safari, dentre outros. 
		}catch(ee) { try {Ajax = new ActiveXObject("Msxml2.XMLHTTP"); // Para o IE da MS 
					}catch(e) { 	try {Ajax = new ActiveXObject("Microsoft.XMLHTTP"); // Para o IE da MS 
						}catch(e) {Ajax = false; 
			} 	} 	} 
	return Ajax; 
}
function clickRecurso(recurso) {
		var Ajax = openAjax()
		Ajax.open("GET", "incs/ajaxRecursos.asp?recurso="+recurso, true)
		Ajax.send(null)
}
function insereFavoritos(){
    clickRecurso('Favoritos')
    var url      = "http://www.exclusivo.com.br";
    var title    = "Exclusivo On Line - O portal do calçado e da moda";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title)}
}
function insereHome(){
    clickRecurso('Inicial')
	}
function abreBanner(codBanner, tipo){
	peds=tipo.split(',')
	if (peds[0] == 'E') {window.open(urlBase+'incs/banClick.asp?codBanner='+codBanner)}
		else if (peds[0] == 'I') {window.location=urlBase+'incs/banClick.asp?codBanner='+codBanner}
			else if (peds[0] == 'P') {window.open(urlBase+'incs/banClick.asp?codBanner='+codBanner, 'NovaJanela','height='+peds[2]+', width='+peds[1])}
}

// procura na combo indicada por obj o valor informado em val e faz a seleção na combo
function buscaIndCombo(obj, val){
	for (i=0; i < obj.length; i++){
		if (obj.options[i].value == val) {
			obj.selectedIndex=i
			break
		}
	}
}

function topo(){
		window.location='#topo'
	}
	
function bordaFotoCapa(estado,obj, ind){
		if(estado == 1){obj.style.borderColor='#f79d00';obj.style.borderWidth='5'; obj.style.zIndex=10}
			else{obj.style.borderColor='999999';obj.style.borderWidth='1'; obj.style.zIndex=ind}
	}
	
function criaLinks(txt, id){
	xml = xmlMicoxLoader('incs/xmls/listaPalavras.xml'); //carrega o xml
	var palavras = xml.getElementsByTagName("LISTA")[0].childNodes[0].nodeValue;
	var palavrasV = palavras.split(',')
	var texto=txt
	for (i=0; i<palavrasV.length-1; i++){
		texto=texto.replace(' '+palavrasV[i]+' ',' <a href="javascript:buscaTags(\'Links\',\''+palavrasV[i]+'\')"><font color=#D90000><b>'+palavrasV[i]+'</b></font></a> ')
		texto=texto.replace(' '+palavrasV[i]+'.',' <a href="javascript:buscaTags(\'Links\',\''+palavrasV[i]+'\')"><font color=#D90000><b>'+palavrasV[i]+'</b></font></a>.')
		texto=texto.replace(' '+palavrasV[i]+',',' <a href="javascript:buscaTags(\'Links\',\''+palavrasV[i]+'\')"><font color=#D90000><b>'+palavrasV[i]+'</b></font></a>,')
	}
	document.getElementById(id).innerHTML=texto
}

function xmlMicoxLoader(url){
	if (window.XMLHttpRequest) {
		var Loader = new XMLHttpRequest(); 
		Loader.open("GET",  url ,false);
		Loader.send(null);        
		return Loader.responseXML;    
		}
	else if(window.ActiveXObject){        
		var Loader = new ActiveXObject("Msxml2.DOMDocument.3.0");        
		Loader.async = false;        
		Loader.load(url);        
		return Loader;    
		}
}
function popularCombo(obj, ini, lista){
	listaV=lista.split('##')
	obj.length=listaV.length/2+ini
	for (i=0; i < obj.length - ini; i++){
		obj.options[i+ini].value=listaV[i*2]
		obj.options[i+ini].text=listaV[i*2+1]
	}
}
function redimensionaIframe(id) {
		if (document.all)	{		
			frame = document.all[id];		
			frame.heigth = 0;		
			frame.height = document.frames[id].document.body.scrollHeight+5;
		}	
		else	{		
			frame = document.getElementById(id);		
			frame.height = 0;		
			frame.height = frame.contentDocument.body.offsetHeight+20;	
		}
}