nn4=(document.layers)?1:0;
nn6=(document.getElementById&&!document.all)?1:0;
op5=(document.all&&!document.styleSheets)?1:0;
ie5=(document.getElementById&&!nn6&&!op5)?1:0;
ie4 = (document.all);
ns4 = (document.layers);


tempX=tempY=0;

var IE = false;
if (navigator.appName == "Microsoft Internet Explorer"){
	IE = true
}
if (!ie4){
	document.captureEvents(Event.MOUSEMOVE)
}
//document.onmousemove = getMouseXY;

function getMouseXY(m){
	if (IE) {
		var tmpX = event.clientX;
		var tmpY = event.clientY;
	} else {
		var tmpX = m.pageX;
		var tmpY = m.pageY;
	} 
	if (!document.body.scrollTop){
		var iL = document.documentElement.scrollLeft; 
		var iV = document.documentElement.scrollTop;
	} else {
		var iL = document.body.scrollLeft; 
		var iV = document.body.scrollTop; 
	}
	tempX= tmpX + iL;
	tempY= tmpY + iV;
}

/* dryes [at] criticalmass.com */
function FlashLibrary(){
    var t = this;
    var activeX = false;
    t.ieAutoInstall = false;
    t.hasVersion = function(ver){
        t.swf = false;
        if(!ver) ver = 0;
        var n = navigator;
        if(n.plugins && n.plugins.length > 0){
            var m,tp,d,v;
            m = n.mimeTypes;
            tp = 'application/x-shockwave-flash';
            if(m && m[tp] && m[tp].enabledPlugin && m[tp].enabledPlugin.description){
                d = m[tp].enabledPlugin.description;
                v = d.charAt(d.indexOf('.')-1);
                t.swf = (v >= ver) ? true : false;
            }
        }else if(n.appVersion.indexOf("Mac") == -1 && window.execScript){
            for(var i=ver; i<=7&&i!=1&&t.swf!=true; i++){
                execScript('on error resume next: flash.swf=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash'+((i==0)?'':'.'+i)+'"))','VBScript');
            }
            if(t.swf) {
                activeX = true;
           }

        }else{
            t.swf = false;
        }
        return t.swf;
    }
    t.getPluginTag = function(swfFile,width,height,bgcolor,ver,altFormat,params,name,pTags){
        var s = '';
        var safari = (navigator.userAgent.toLowerCase().indexOf('safari') != - 1);
        var win = (navigator.appVersion.toLowerCase().indexOf("win")!=-1);
        var ie = (navigator.appName=="Microsoft Internet Explorer");
        if(!ie || (t.hasVersion(ver) && swfFile || (win && ie && swfFile && t.ieAutoInstall))){
            var additionalParams = '';
            if(params && params.length>0){
                var pArray = params.split(",");
                for(var i=0; i<pArray.length; i++){
                    var ta = pArray[i].substr(0,pArray[i].indexOf('='));
                    var v = pArray[i].substr(pArray[i].indexOf('=')+1,pArray[i].length);
                    additionalParams += (activeX)?'\t<param name="' + ta + '" value="' + v + '" />\n': ' '+ ta + '="' + v + '"';
                }
            }
            if(activeX){
                s = '<object id="flashObj'+name+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,21,0" width="'+width+'" height="'+height+'" '+pTags+'>\n';
                s += '\t<param name="movie" value="'+swfFile+'" />\n';
                s += '\t<param name="quality" value="high" />\n';
                s += '\t<param name="menu" value="false" />\n';
                s += '\t<param name="bgcolor" value="'+bgcolor+'" />\n';
                s += additionalParams;
                s += altFormat;
                s += '</object>\n';
                return s;
            }else{
                s = '<embed id="flashObj" src="'+swfFile+'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'"'+additionalParams+(safari?' class="safari"':'')+'></embed>\n';
                return s;
            }
        }else{
            return altFormat;
        }
    }
    t.embedMovie = function(swfFile,width,height,bgcolor,ver,altFormat,params,name,pTags,retu){ 
		if(retu)
			return flash.getPluginTag(swfFile,width,height,bgcolor,ver,altFormat,params,name,pTags);
		else
	        document.write(flash.getPluginTag(swfFile,width,height,bgcolor,ver,altFormat,params,name,pTags)); 
    } 
}
var flash = new FlashLibrary();


function mClick(end){
	document.location.href=end;
}
function mOver(src){
	  src.style.cursor = 'pointer';
}

function ampliar(arquivo){
	l=document.getElementById("foto_voando");
	l.style.left=tempX-260;
	l.style.visibility="visible";
	f=document.getElementById("foto_ampliada");
	html="<a href=\"javascript:fechar();\"><img src=\""+arquivo+"\" /></a>";
	f.innerHTML=html;
}

function fechar(){
	l=document.getElementById("foto_voando");
	l.style.visibility="hidden";
}

function limpaDados(obj,text){
	if(obj.value==text)
		obj.value="";
	else if(obj.value=="")
		obj.value=text;	
}
function limpaFunc(text){
	text=text.substr(text.indexOf("{")+1);
	return 	text.substr(0,text.lastIndexOf("}")-1);
}
function onload(){
	objs=document.forms;
	for(a=0;a<objs.length;a++){
		frm=objs[a];
		for(b=0;b<frm.length;b++){
			obj=frm[b];
			if(obj.maxLength!=undefined && obj.maxLength<=300){
				obj.setAttribute("onkeyupb",((obj.onkeyup!=undefined)? limpaFunc(obj.onkeyup.toString()) : ""));
				obj.onkeyup=function(){ eval(this.onkeyupb); nextObj(this); };
			}
		}
	}
}
function nextObj(obj){
	if(obj.value.length==obj.maxLength){
		n=getNextObjForm(obj);
		n.focus();
	}
}

function isObject(obj){
	return typeof(obj) == "object";
}

function getObject(obj){
	el=(!isObject(obj)) ? document.getElementById(obj) : obj;
	return (el!=undefined)? el : obj;
}

function getNextObjForm(obj,btnSub){
	obj=getObject(obj);
	frm=obj.form.elements;
	for(a=0;a<frm.length;a++){
		if(frm[a].name==obj.name){
			if(frm[a+1]!=undefined){
				if(btnSub==undefined && frm[a+1].type=="submit")
					return false;
				else
					return frm[a+1];
			} else
				return false;
			break;
		}
	}
}	

function getXObj(obj){
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	} else if (obj.x)
		curleft += obj.x;
		
	return curleft;
}
function getYObj(obj){
	var curtop = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	} else if (obj.y)
		curtop += obj.y;
		
	return curtop;
}


/*					LOCALIZACAO							*/



var map;
var i=0;
var icons=Array();

function createMarker(point, icon, htmlText) {
	var infoTabs = [
	  new GInfoWindowTab("tab"+(i+1), htmlText)
	];
  var marker = new GMarker(point,icon.icon);
  GEvent.addListener(marker, "click", function() {
	marker.openInfoWindowTabsHtml(infoTabs);
  });
  map.addOverlay(marker);
  marker.openInfoWindowTabsHtml(infoTabs);
}
function mapIcon(obj){
	var new_icon = new GIcon();
		new_icon.image = obj.src;  
		new_icon.size = new GSize(obj.w,obj.h);
		new_icon.iconAnchor = new GPoint(obj.x,obj.y);
		new_icon.infoWindowAnchor = new GPoint(obj.xi,obj.yi);

	var opt = {};
		opt.icon = new_icon;
		opt.draggable = false;
		opt.clickable = true;
		opt.dragCrossMove = false;
		opt.title=obj.title;
	
	return opt;
}
function load_maps(l) {
  if (GBrowserIsCompatible()) {
	m=document.getElementById(l==undefined? "map" : l);
	if(m!=undefined){
		icons.push(mapIcon({src: "imagens/map/michele2.png",			 	title: "Michele Canez",					w: 60, h: 60, x: 16, y : 40, xi: 30, yi: 2}));
		icons.push(mapIcon({src: "imagens/map/pontoRef.png", 			title: "Ponto de refer&ecirc;ncia"	, 	w: 32, h: 40, x: 16, y : 40, xi: 18, yi: 2}));
		
		
		map = new GMap2(m);

		map.enableDoubleClickZoom();
		map.enableContinuousZoom();
		map.enableScrollWheelZoom();

		var mapTypeControl = new GMapTypeControl();
		map.addControl(mapTypeControl);

		var mapLargeControl = new GLargeMapControl();
		map.addControl(mapLargeControl);

		pointCenter=new GLatLng(-27.12971557016348, -48.60545217990875);
		map.setCenter(pointCenter, 15);

		map.setMapType(G_HYBRID_MAP);

		createMarker(new GLatLng(-27.12756715701816, -48.601890206336975),icons[1],"<div class='texto'><b>Cal&ccedil;ad&atilde;o Praia Shopping</b></div>");
		createMarker(new GLatLng(-27.128636594498637, -48.60106408596039),icons[1],"<div class='texto'><b>Shopping Russi & Russi</b></div>");
		createMarker(new GLatLng(-27.129276342388177, -48.60431492328644),icons[1],"<div class='texto'><b>Caixa Econ&ocirc;mica Federal</div>");
		createMarker(new GLatLng(-27.129963828577683, -48.600372076034546),icons[1],"<div class='texto'><b>Banco Bradesco</b></div>");
		createMarker(new GLatLng(-27.128402655923675, -48.60182583332062),icons[1],"<div class='texto'><b>Restaurante Alberto&prime;s</b></div>");
		createMarker(new GLatLng(-27.127906131612338, -48.60902488231659),icons[1],"<div class='texto'><b>Supermercado Koch</b></div>");
		createMarker(new GLatLng(-27.132441608315954, -48.60896587371826),icons[1],"<div class='texto'><b>Posto de Combust&iacute;vel Petrobras</b></div>");
		createMarker(new GLatLng(-27.13067995553055, -48.60631585121155),icons[1],"<div class='texto'><b>Golden Gol</b></div>");
		createMarker(new GLatLng(-27.130011570517222, -48.60535025596619),icons[1],"<div class='texto'><b>Auto Pe&ccedil;as Zec&atilde;o</b></div>");
		createMarker(new GLatLng(-27.13122898308846, -48.60683083534241),icons[1],"<div class='texto'><b>Academia New Corpore</b></div>");
		createMarker(new GLatLng(-27.12971557016348, -48.60545217990875),icons[0],"<div class='texto'><b>Michele Canez<br>Fotografia Profissional</b><br><br>Rua 246, n&deg; 406 - Sala 1<br>Meia Praia - Itapema - SC</div>");

	}
  }
}


/*				SELECT						*/

function getOuter(ele) { 
	var parent = ele.parentNode; 
	var el = document.createElement(parent.tagName); 
	el.appendChild(ele); 
	var shtml = el.innerHTML; 
	parent.appendChild(ele); 
	return shtml; 
}

function selectChange(value,lnk){
	window.location='?lnk='+lnk+'&cod='+value;	
}

function selectValue(op,obj,value){
	obji=getObject(obj+'input');
	obji.value=value;

	index=getObject(obj+'index');
	index.innerHTML=getOuter(op);
	
	if(obji.alt!="")
		selectChange(value,obji.alt);
	
	selectBtn(obj);
}

function selectBtn(obj){
	list=getObject(obj+'options');
	pos=getObject(obj+'index');
	list.style.visibility=(list.style.visibility=="hidden" || list.style.visibility=="")? "visible" : "hidden";
	list.style.top=getYObj(pos)+22;
	list.style.left=getXObj(pos);
}


function trim (valor) { 
	return valor.replace(/^\s+|\s+$/, ''); 
}


// MENSAGENS FORM.JS

msg					=Array();
msg["nome"]			="Preencha o campo Nome corretamente.";
msg["email"]		="Preencha o campo E-mail corretamente com e-mail válido.";
msg["cidade"]		="Preencha o campo Cidade corretamente.";
msg["uf"]			="Preencha o campo UF corretamente.";
msg["telefone"]		="Preencha o campo Telefone corretamente.";
msg["mensagem"]		="Preencha o campo Mensagem corretamente.";

msg["npessoas"]		="Preencha o campo Nº Pessoas corretamente.";
msg["horario"]		="Preencha o campo Horário corretamente.";
msg["dia"]			="Preencha o campo Dia corretamente.";
msg["mes"]			="Preencha o campo Mês corretamente.";
msg["ano"]			="Preencha o campo Ano corretamente.";


msg["senha"]		="Preencha o campo Senha corretamente. Mínimo 6 carac.";

msg["nome_amigo"]	="Preencha o campo Nome do amigo corretamente.";
msg["email_amigo"]	="Preencha o campo E-mail do amigo corretamente com e-mail válido.";

function trim (valor) { 
	return valor.replace(/^\s+|\s+$/, ''); 
}

function validaForm(name){
	form=eval("document."+name+"Form");
	tderror=document.getElementById("error");
	eval("valida_"+name+"();");	
}
function validaForm_erro(mensagem,field){
	if(tderror==undefined)
		alert(mensagem);
	else 
		tderror.innerHTML=mensagem;
	field.focus();
}
function validaForm_send(){
	form.submit();	
}

//////////////////// CONTATO //////////////////////////
function valida_contato(){
	campos=Array("nome","email","cidade","telefone","uf");
	for(cp=0;cp<campos.length;cp++){
		eval("var "+campos[cp]+"=form."+campos[cp]);
	}
	if(trim(nome.value).length<3){
		validaForm_erro(msg["nome"],nome);
	} else if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value)==false){
		validaForm_erro(msg["email"],email);
	} else if(trim(telefone.value).length<1){
		validaForm_erro(msg["telefone"],telefone);
	} else if(trim(cidade.value).length<3){
		validaForm_erro(msg["cidade"],cidade);
	} else if(trim(uf.value).length<2){
		validaForm_erro(msg["uf"],uf);
	} else {
		validaForm_send();
	}
}
//////////////////// PROPOSTA //////////////////////////
function valida_depoimento(){
	campos=Array("nome","email","cidade","uf");
	for(cp=0;cp<campos.length;cp++){
		eval("var "+campos[cp]+"=form."+campos[cp]);
	}
	if(trim(nome.value).length<3){
		validaForm_erro(msg["nome"],nome);
	} else if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value)==false){
		validaForm_erro(msg["email"],email);
	} else if(trim(cidade.value).length<3){
		validaForm_erro(msg["cidade"],cidade);
	} else if(trim(uf.value).length<2){
		validaForm_erro(msg["uf"],uf);
	} else {
		validaForm_send();
	}
}


//////////////////// RESTRITO //////////////////////////
function valida_restrito(){
	campos=Array("email","senha");
	for(cp=0;cp<campos.length;cp++){
		eval("var "+campos[cp]+"=form."+campos[cp]);
	}
	if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value)==false){
		validaForm_erro(msg["email"],email);
	} else if(senha.value.length<6){
		validaForm_erro(msg["senha"],senha);
	} else {
		validaForm_send();
	}
}


//////////////////// INDICAR //////////////////////////
function valida_indicar(){
	campos=Array("nome","email","nome_amigo","email_amigo");
	for(cp=0;cp<campos.length;cp++){
		eval("var "+campos[cp]+"=form."+campos[cp]);
	}
	if(trim(nome.value).length<3){
		validaForm_erro(msg["nome"],nome);
	} else if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value)==false){
		validaForm_erro(msg["email"],email);
	} else if(trim(nome_amigo.value).length<3){
		validaForm_erro(msg["nome_amigo"],nome_amigo);
	} else if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email_amigo.value)==false){
		validaForm_erro(msg["email_amigo"],email_amigo);
	} else {
		validaForm_send();
	}
}
currentTime = new Date();
anoAtual=parseInt(currentTime.getYear());

//////////////////// AGENDAR //////////////////////////
function valida_agendar(){
	campos=Array("nome","email","cidade","ddd","telefone","uf","npessoas","horario1","horario2","data1","data2","data3");
	for(cp=0;cp<campos.length;cp++){
		eval("var "+campos[cp]+"=form."+campos[cp]);
	}
	if(trim(nome.value).length<3){
		validaForm_erro(msg["nome"],nome);
	} else if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value)==false){
		validaForm_erro(msg["email"],email);
	} else if(trim(ddd.value).length<2){
		validaForm_erro(msg["telefone"],ddd);
	} else if(trim(telefone.value).length<8){
		validaForm_erro(msg["telefone"],telefone);
	} else if(trim(cidade.value).length<3){
		validaForm_erro(msg["cidade"],cidade);
	} else if(trim(uf.value).length<2){
		validaForm_erro(msg["uf"],uf);
	} else if(trim(npessoas.value).length<1){
		validaForm_erro(msg["npessoas"],npessoas);
	} else if(trim(horario1.value).length<2 || trim(horario1.value)>12){
		validaForm_erro(msg["horario"],horario1);
	} else if(trim(horario2.value).length<2 || trim(horario2.value)>59){
		validaForm_erro(msg["horario"],horario2);
	} else if(trim(data1.value).length<1 || trim(data1.value)>31){
		validaForm_erro(msg["dia"],data1);
	} else if(trim(data2.value).length<1 || trim(data2.value)>12){
		validaForm_erro(msg["mes"],data2);
	} else if(trim(data3.value).length<4 || trim(data3.value)<anoAtual || trim(data3.value)>anoAtual+2){
		validaForm_erro(msg["ano"],data3);
	} else {
		validaForm_send();
	}
}



function profissionais(act){
	obj=document.getElementById("boxEventosProfissionais");
	obj2=document.getElementById("boxEventosFundo");
	if(obj!=undefined)
		obj.style.visibility=obj2.style.visibility=(act)? "visible" : "hidden";	
}
function comentariosAcao(act){
	obj=document.getElementById("boxEventosComentarios");
	obj2=document.getElementById("boxEventosFundo");
	if(obj!=undefined)
		obj.style.visibility=obj2.style.visibility=(act)? "visible" : "hidden";	
}



function nextPos(box,pos){
	for(o=0;o<box.childNodes.length;o++){
		ob=box.childNodes[o];
		pos2=Number(ob.id.substr(4));
		if(pos2>pos){
			return ob;
			break;
		}		
	}
}

function formatCurrency(num,s,c) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";

	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	
	if(cents<10)
		cents = "0" + cents;
	
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+'.'+num.substring(num.length-(4*i+3));
		
	
	return (((sign)?'':'-') + ((s==undefined)? 'R$ ' : '') + num +  ((c==undefined)? ',' +cents : ''));
}


function calcula(){
	frm=document.forms[0];
	total_calc=0;
	total_foto=0;
	total=document.getElementById("vl2TotalDiv");
	nfoto=document.getElementById("qt2TotalDiv");
	for(a=0;a<frm.elements.length;a++){
		obj=frm[a];
		if(obj.id.substr(0,2)=="pb"){
			col=document.getElementById("qt"+obj.id.substr(2));
			pqt=document.getElementById("prqt"+obj.id.substr(2));
			pqtTotal=0;
			if(pqt!=undefined)
				pqtTotal=pqt.value;
				
			calc=Number(col.value)+Number(obj.value)-Number(pqtTotal);
			calc=(calc<0)? 0 : calc;
			
			total_calc=total_calc+(Number(obj.alt)*calc);
			total_foto=total_foto+Number(obj.value)+Number(col.value);
		}
	}

	qtTotalObj=document.getElementById("qtTotalDiv");
	qtTotalObj.innerHTML=formatCurrency(qtTotal+total_foto,false,false);

	vlTotalObj=document.getElementById("vlTotalDiv");
	vlTotalObj.innerHTML=formatCurrency(vlTotal+total_calc);
	
	total.innerHTML=formatCurrency(total_calc);
	nfoto.innerHTML=formatCurrency(total_foto,false,false);
}

function contar(curTarget){
	carrinho=document.getElementById("boxAreaClientesContentCarrinho");
	carrinhoDesc=document.getElementById("boxAreaClientesContentCarrinhoDesc");
	carrinhoTotal=document.getElementById("boxAreaClientesContentCarrinhoTotal");

	if(carrinho!=undefined){
		tot=0;
		for(j=0;j<carrinho.childNodes.length;j++)
			if(carrinho.childNodes[j].id!=undefined && carrinho.childNodes[j].id!="boxAreaClientesContentCarrinhoDesc")
				tot++;
		carrinhoDesc.className=(tot>0)? "boxAreaClientesContentCarrinhoDescEsconde" : "none";
		carrinhoTotal.innerHTML=tot+" Foto(s)";
	}
}

function addCart(target,t2,pos,codImg,codTipo,Tipo){
	carrinho=document.getElementById("boxAreaClientesContentCarrinho");
	fotos=document.getElementById("boxAreaClientesContentFotos");
	obj=document.getElementById(target);
	obj4=document.getElementById("btn"+target);
	if(obj4.lang=="1"){
		activeCont=carrinho;
		obj4.innerHTML="Remover";
		obj4.lang="0";
		ajaxRead("arquivos/compras.php?action=add&cod_img="+codImg+"&codTipo="+codTipo+"&Tipo="+Tipo+"&pos="+pos,false);
	} else {
		activeCont=fotos;
		obj4.innerHTML="Comprar";
		obj4.lang="1";
		ajaxRead("arquivos/compras.php?action=del&cod_img="+codImg+"&codTipo="+codTipo+"&Tipo="+Tipo,false);
	}
	beforeN=nextPos(activeCont,pos);
	if(beforeN!=undefined)
		activeCont.insertBefore(obj, beforeN);
	else
		activeCont.appendChild(obj);
	contar(obj);
}



///////////////////// AJAX
try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

function ajaxRead(url,funcao,retorna){
    xmlhttp.open("GET", url, true);
	xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4){
			var texto=xmlhttp.responseText;
			texto=unescape(texto.replace(/\+/g," "));
			//alert(texto);
			eval(funcao);
			if(retorna!=undefined)
				return texto==retorna;
        }
    }
    xmlhttp.send(null);
}


function mask(type,evt){
	evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
	switch(type){
		case 'num':
		if (charCode > 31 && (charCode < 48 || charCode > 57))
			return false;
		break;
	}
    return true;
}

function comprasAcao(op,img,n,codimg,type){
	if(op){
		i=document.getElementById("imagem");
		cn=document.getElementById("codNum");
		cn.innerHTML=n;
		imgG=img.replace("_M","_O");
		i.innerHTML="<a href=\""+imgG+"\" onClick=\"myLightbox.start(this); return false;\" rel=lightbox[compra]><img class=img1 src=\""+img+"\" /></a>";
		hrefNew="img.php?f="+imgG;
		
		var anchors = document.getElementsByTagName('a');
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			var relAttribute = String(anchor.getAttribute('rel'));
			if (anchor.getAttribute('href') && relAttribute=='lightbox[pb]'){
				anchor.href=hrefNew;
				anchor.onclick = function () {myLightbox.start(this); return false;}
			}
		}
		
		qtTotalObj=document.getElementById("qtTotalDiv");
		qtTotalObj.innerHTML=formatCurrency(qtTotal,false,false);

		vlTotalObj=document.getElementById("vlTotalDiv");
		vlTotalObj.innerHTML=formatCurrency(vlTotal);
		
		total=document.getElementById("vl2TotalDiv");
		nfoto=document.getElementById("qt2TotalDiv");
		nfoto.innerHTML=formatCurrency(0,false,false);
		total.innerHTML=formatCurrency(0);
		
		codimgObj=document.getElementById("cod_imagem");
		codimgObj.value=codimg;
		typeObj=document.getElementById("tipo");
		typeObj.value=type;
	}
	
	fundo=document.getElementById("boxComprasFundo");
	box=document.getElementById("boxCompras");
	fundo.style.visibility=box.style.visibility=(op)? "visible" : "hidden";
}
