window.onerror = stopError;
function stopError() { return true; }

var imagesArr = new Array();
var step = 3;
var timerDown;
var timerUp;
var ostat = false;

function scrollstop(objMarquee) { objMarquee.scrollAmount = 0; ostat = true;  }
function scrollplay(objMarquee) { objMarquee.scrollAmount = 5; ostat = false; }
function scrollDivDown(id)			{ clearTimeout(timerDown); document.getElementById(id).scrollTop+=step; timerDown = setTimeout("scrollDivDown('"+id+"')",50); }  
function scrollDivUp(id) 				{ clearTimeout(timerUp); document.getElementById(id).scrollTop-=step; timerUp = setTimeout("scrollDivUp('"+id+"')",50); }  
function stopMe()								{ clearTimeout(timerDown); clearTimeout(timerUp); } 

function showFlash(pArquivo, pLargura, pAltura, pBgcolor, pId, pQualidade, pAlinhamento, pTransparente) { obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+pLargura+'" height="'+pAltura+'" id="'+pId+'" align="'+pAlinhamento+'">'; obj+= '<param name="allowScriptAccess" value="sameDomain" />'; obj+= '<param name="menu" value="true" />'; obj+= '<param name="movie" value="'+pArquivo+'" />'; obj+= '<param name="quality" value="'+pQualidade+'" />'; if(pTransparente) { obj+= '<param name="wmode" value="transparent" />'; } obj+= '<param name="bgcolor" value="'+pBgcolor+'" />'; obj+= '<embed src="'+pArquivo+'" '+((pTransparente)?'wmode="transparent"':'')+'" quality="'+pQualidade+'" bgcolor="'+pBgcolor+'" width="'+pLargura+'" height="'+pAltura+'" name="'+pId+'" align="'+pAlinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'; obj+= '</object>'; document.write(obj); }			
		
function AbreRadio(code) 				{ w = 400; h = 280; LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',resizable=no,titlebar=no,directories=no,status=no,toolbar=no,titlebar=no,location=no,menubar=no,scrollbars=no'; var cdm_radio = window.open('./system/plugins/radio/?code=' + code,'cdm_radio',settings); cdm_radio.focus(); }
function AbreAnuncio(code) 			{ settings = 'resizable=yes,titlebar=yes,status=yes,toolbar=yes,titlebar=yes,location=yes,menubar=yes,scrollbars=yes'; var cdm_pub = window.open('./adv/publicidade.php?key=' + code,'cdm_pub',settings); cdm_pub.focus(); }

function IsImageOk(img) 				{ if (!img.complete) { return false; } if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) { return false; } return true; }
function reloadImage(img,src) 	{ if(!IsImageOk(img)) { img.alt="recarregando ..."; img.src=src; setTimeout("reloadImage("+img+",'"+src+"');",1000); } }

function checkMail(mail)				{ var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/); if(typeof(mail) == "string") { if(er.test(mail)){ return true; } } else if(typeof(mail) == "object") { if(er.test(mail.value)) { return true; } } else { return false; } }

function sendComment() {

		if(document.form_comment.comment_nome.value.length == 0) {
		alert('Informe o seu nome !');
		document.form_comment.comment_nome.focus();
		return;
		}

		if(document.form_comment.comment_email.value.length == 0) {
		alert('Informe o seu endereço de Email !');
		document.form_comment.comment_email.focus();
		return;
		}

		if(!checkMail(document.form_comment.comment_email.value)) {
		alert('O endereço de Email informado é inválido!');
		document.form_comment.comment_email.focus();
		return;		
		}
		
		if(document.form_comment.comment_text.value.length == 0) {
		alert('Você deve digitar o seu comentário antes de enviar !');
		document.form_comment.comment_text.focus();
		return;
		}		
		
		
		document.form_comment.submit();

}

function sendNewsletter() {

		if(document.form_newsletter.nl_nome.value.length == 0) {
		alert('Informe o seu nome !');
		document.form_newsletter.nl_nome.focus();
		return;
		}

		if(document.form_newsletter.nl_email.value.length == 0) {
		alert('Informe o seu endereço de Email !');
		document.form_newsletter.nl_email.focus();
		return;
		}
		
		if(!checkMail(document.form_newsletter.nl_email.value)) {
		alert('O endereço de Email informado é inválido!');
		document.form_newsletter.nl_email.focus();
		return;		
		}
		
		if(document.form_newsletter.nl_telefone.value.length == 0) {
		alert('Informe o seu número de telefone !');
		document.form_newsletter.nl_telefone.focus();
		return;
		}		
		
		
		document.form_newsletter.submit();

}


function sendContact() {

		if(document.form_contact.usr_name.value.length == 0) {
		alert('Informe o seu nome !');
		document.form_contact.usr_name.focus();
		return;
		}

		if(document.form_contact.usr_email.value.length == 0) {
		alert('Informe o seu endereço de Email !');
		document.form_contact.usr_email.focus();
		return;
		}

		if(!checkMail(document.form_contact.usr_email.value)) {
		alert('O endereço de Email informado é inválido!');
		document.form_contact.usr_email.focus();
		return;		
		}
		
		if(document.form_contact.usr_subject.value.length == 0) {
		alert('Você deve digitar um assunto para sua mensagem !');
		document.form_contact.usr_subject.focus();
		return;
		}	
		
		if(document.form_contact.usr_msg.value.length == 0) {
		alert('Digite sua mensagem !');
		document.form_contact.usr_msg.focus();
		return;
		}					
		
		
		document.form_contact.submit();

}
		
function sysBuscar() { if(document.form_buscar.inpBusca.value.length == 0) { document.form_buscar.inpBusca.focus(); return; } if(document.form_buscar.inpBusca.value == "...") { document.form_buscar.inpBusca.focus(); return; } if(document.form_buscar.inpBusca.value.length < 4) { alert('Para realizar uma busca, você deve informar um termo com no mínimo 5 letras.'); document.form_buscar.inpBusca.focus(); return; } document.form_buscar.submit(); }