////////////////////////////////////////////////
///////////////////GDC//////////////////////////
////////////////////////////////////////////////
function excluirAdicional(id_adicional,id_produto)
{	
confirma = confirm('Tem certeza que deseja excluir este adicional?');
	if(confirma)
	{
	location.href='adicionais_visualizar.php?remover=adicional&id_adicional='+id_adicional+'&id_produto='+id_produto;
	}else{
	return false;
	}
}

function excluirVideo(id_video,id_produto)
{	
confirma = confirm('Tem certeza que deseja excluir este vídeo?');
	if(confirma)
	{
	location.href='videos_visualizar.php?remover=video&id_video='+id_video+'&id_produto='+id_produto;
	}else{
	return false;
	}
}

function excluirAnexo(id_anexo,id_produto)
{	
confirma = confirm('Tem certeza que deseja excluir este anexo?');
	if(confirma)
	{
	location.href='anexos_visualizar.php?remover=anexo&id_anexo='+id_anexo+'&id_produto='+id_produto;
	}else{
	return false;
	}
}

function excluirEmail(codigo,nome,codCategoria){
	
confirma = confirm('Tem certeza que deseja excluir o email de '+nome+' ?');
	if(confirma){
	location.href='news_cadastros_visualizar.php?codEmail='+codigo+'&acao=remover&codCategoria='+codCategoria;

		}else{
			return false;
}
}

////////////////////////////////////////////////
///////////////////GDC//////////////////////////
////////////////////////////////////////////////
function abrePopup(url,width,height){
	window.open(''+url+'','','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height+'');
}
function validaImagem(id){
	var obj = document.getElementById(id);
	
	if (document.form1.image[0].checked == true){
		obj.style.display = "";
		return;
	} 
		
	if (document.form1.image[1].checked == true){
	 	obj.style.display = "none";
		return;
	}
}


//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
/////////////////funcao p/ jump menu//////////////////////
//////////////////////////////////////////////////////////
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//////////////////////////////////////////////////////////
//funcao p/ abrir popup no centro do navegador
//////////////////////////////////////////////////////////
function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll;
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4){
		win.window.focus();
	}
}

function bloqueia_alfa(e){
navegador = /msie/i.test(navigator.userAgent);
if (navegador)
	var tecla = event.keyCode;
else
	var tecla = e.which;
	if(tecla > 47 && tecla < 58) // numeros de 0 a 9
		return true;
	else{
	if (tecla != 8) // tab
		return false;
	else
		return true;    
	}
}
function formataCampos(e,src, mask) {
	

	evt = /msie/i.test(navigator.userAgent);
	bloqueia_alfa(evt);
		
		var i = src.value.length;
		var saida = mask.substring(0,1);
		var texto = mask.substring(i)
		
		if (texto.substring(0,1) != saida)
		{
		src.value += texto.substring(0,1);
		}
		{
		if (evt < 45 || evt > 57) evt.returnValue = false;
		}
		
}

//////////////////////////////////////////////////////////
////////////////função para as divs///////////////////////
//////////////////////////////////////////////////////////
function MM_reloadPage(init){
	if (init==true) with (navigator) {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)){
			document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
		}
	} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH){
		location.reload();
	}
}
MM_reloadPage(true);


/////////////////////////////////////////////////////////
////////// função para exibir/esconder divs /////////////
/////////////////////////////////////////////////////////
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->


/////////////////////////////////////////////////////////
////////// função para abrir popup preto ////////////////
/////////////////////////////////////////////////////////
/*$(document).ready(function() {
	//mostra o lightbox das fotos
	$('#fotos a').lightBox();
});*/ 

