	function abre500(id)
	{
		imga = document.getElementById('foto').src.split('/') ;
		//imgg = imga[imga.length-2] + "/" + imga[imga.length-1] ;
		wo = window.open ("pt500.php?id="+id+"&img="+document.getElementById('foto').src, "mywindow1","status=1,width=550,height=600");
		wo.focus();
	}
	function troca(foto)
	{
		document.getElementById('foto').src = "img_produtos/250x250/" + foto ;
	}
	function chgcor(idcor)
	{
		obj = document.getElementById('id_cor') ;
		for ( i = 0 ; i <= obj.options.length ; i ++ )
		{
			if ( obj.options[i].value == idcor )
			{
				//alert(i);
				obj.selectedIndex = i ;
				//obj.options[i].selected = true ;
			}
		}
	}
	function alteraqt(id,id_cor,quant,minima,objedit,id_grv)
	{
		//alert(" id = " + id + "  qt = " + quant ) ;
		//i = document.getElementById('ifr');
		if (quant < minima && quant != 0)
		{
			alert('Pedido minimo para este item e de ' + minima + ' pecas ');
			objedit.value = minima ;
		}
		else
		{
			location = '?mod=cpa&id=' + id + '&id_cor=' + id_cor + '&quant=' + quant + '&id_grv=' + id_grv ;
		}
	}
	
	function amigo(id)
	{
		
	}
	
	function ficha(i)
	{										 	
		x = window.open("frmfch.php?p="+i , 'f' , 'width=600,height=600,scrollbars=yes,resizable=yes' ) ;
		try	{	x.focus()	}
		catch(e) {	alert("Navegador com bloqueador de pop-ups") ;	}
	}
	
	function duvida(i)
	{										 	
		x = window.open("duvida.php?id="+i , 'f' , 'width=510,height=300,scrollbars=yes,resizable=yes' ) ;
		try	{	x.focus()	}
		catch(e) {	alert("Navegador com bloqueador de pop-ups") ;	}
	}
	
	function addf()
	{
		document.all ? window.external.AddFavorite("http://www.promotrend.com.br","Promotrend") : sidebar.addPanel("Promotrend","http://www.promotrend.com.br","") ;
	}
	
	function popup(url,width,height)
	{
		j = window.open(url,'x','width='+width+',height='+height);		
		try	{ j.focus() ;	}
		catch(e){ alert('Seu navegador está com o bloqueador de pop-ups ativado') ; }
	}
	
	function MM_preloadImages() { 
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
