<!--
/*
function clickIE() {
	if (document.all) {
		return false;
	}
}
function clickNS(e) {
	if (document.layers || (document.getElementById&&!document.all)) {
		if (e.which==2||e.which==3) {
			return false;
		}
	}
}
if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown = clickNS;
}else{
	document.onmouseup = clickNS;
	document.oncontextmenu = clickIE;
}
document.oncontextmenu=new Function("return false")


/******************************/

function openWindow(URL,WinNome,add) {
  window.open(URL,WinNome,add);
};

function openWIN(url,nome,W,H,OPT) {
	HORZ = Math.ceil((screen.width - W) / 2);
	VERT = Math.ceil((screen.height - H) / 2);
	NOPT = (OPT==1) ? "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,"
	: "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,";
	window.open(url,nome,NOPT+"width="+W+",height="+H+",top="+VERT+",left="+HORZ);
};

function upEnq(HITS,ID,W,H) {
	HORZ = Math.ceil((screen.width - W) / 2);
	VERT = Math.ceil((screen.height - H) / 2);
	OPCOES = "'toolbar=no,location=no,status=no,menubar=no,directories=no,scrollbars=yes,resizable=no,width=400,height=320,top="+VERT+",left="+HORZ+"'";
	var DOC = document.form_enquete.respostas;
	if (HITS > 1){
		for(i=0; i<HITS; i++){
			if (DOC[i].checked) {
				window.open("enquete_show.php?opt="+DOC[i].value+"&id="+ID,"enquete",OPCOES);
				return false;
			}
		}
	} else {
		if (DOC.checked){
			window.open("enquete_show.php?opt="+DOC.value+"&id="+ID,"janela",OPCOES);
			return false;
		}
	}
	alert('Selecione uma resposta!');
}

function ch_color(TOT, NUM) {
	for(i=0; i<TOT; i++) {
		document.getElementById("prd_"+i).className = (i == NUM) ? "td_PRD_ON" : "td_PRD_OFF";
	}
}

function ch_Foto(FOTO) {
	document.getElementById("FT_PROD").src = FOTO;
}

function ch_list(obj, tipo) {
	var sIndex = obj.options[obj.selectedIndex].value;
	document.getElementById("odSource").src = "source.php?id="+sIndex;
};



/* Função simples para limpar campo on focus, e onblur inserir um texto se o campo estiver vazio */
function MaskCampo(OBJ, VALUE) {
	if (OBJ.value == "") {
		OBJ.value = VALUE;
	} else if (OBJ.value == VALUE){
		OBJ.value = "";
	}
};

function TestNome(field) {
	this.nome = field.value;
	var expReg = /\W+/g;
	this.nome = nome.search(expReg);
	if (this.nome == 0) {
		alert('Preencha o campo ' + field.name + ' com caractéres válidos');
		field.focus();
	}
}

function upLogon() {
	var doc = document.fm_logon;
	var len = doc.elements.length-1;
	var nome;
	for (i=0; i < len; i++) {
		nome	= doc.elements[i].name;
		id		= doc.elements[i].id;
		valor	= doc.elements[i].value;
		if ((nome=='login' || nome=='passw') && (valor=='' || valor==' ' || valor=='login' || valor=='senha')) {
			alert('Preencha o campo '+id);
			doc.elements[i].focus();
			return false;
		}
	}
	doc.action = 'ass_login.php';
	doc.submit();
};

function upFMotos() {
	var doc = document.fmoto;

	var sMar = doc.marca.options[doc.marca.selectedIndex].value;
	var sMod = doc.mod.options[doc.mod.selectedIndex].value;
	if (sMar=='' || sMod=='') {
		alert('Você precisa selecionar uma marca e um modelo');
		return false;
	}
	doc.submit();
}

/******************************************************************************************************************************************************************************************************************/
function MM_preloadImages() { //v3.0
	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];}}
};

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
};

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
};

//-->

