//data
var now = new Date();
var mName = now.getMonth() +1;
var hrs = now.getHours();
var min = now.getMinutes();
var sec = now.getSeconds();
if (mName==1){Month = "Janeiro";}
if (mName==2){Month = "Fevereiro";}
if (mName==3){Month = "Mar&ccedil;o";}
if (mName==4){Month = "Abril";}
if (mName==5){Month = "Maio";}
if (mName==6){Month = "Junho";}
if (mName==7){Month = "Julho";}
if (mName==8){Month = "Agosto";}
if (mName==9){Month = "Setembro";}
if (mName==10){Month = "Outubro";}
if (mName==11){Month = "Novembro";}
if (mName==12){Month = "Dezembro";}
var dName = now.getDay() +1;
if (dName==1){Day = "Domingo";}
if (dName==2){Day = "Segunda-feira";}
if (dName==3){Day = "Ter&ccedil;a-feira";}
if (dName==4){Day = "Quarta-feira";}
if (dName==5){Day = "Quinta-feira";}
if (dName==6){Day = "Sexta-feira";}
if (dName==7){Day = "S&aacute;bado";}
var dayNr = now.getDate();
if (dayNr < 10){dayNr = "0"+dayNr;}
var yearNr = now.getYear();
if (yearNr < 2000){Year = 1900 + yearNr;
}else{Year = yearNr;}
var dia = now.getDate();
if (hrs  <= "23"){var daytime = "Boa noite!";}
if (hrs  <= "18"){var daytime = "Boa tarde!";}
if (hrs  <= "12"){var daytime = "Bom dia!";}
if (hrs  <= "6") {var daytime = "Sem sono?!";}
if (min   <= "9"){min = "0"+min;}
if (dia   <= "9"){dia = "0"+dia;}
if (sec   <= "9"){sec = "0"+sec;}
var todaysDate = (" "+ Day +", "+ dayNr + " de " + Month + " de " + Year +". " + daytime);
var dataImp = (" "+ Day +", "+ dayNr + " de " + Month + " de " + Year +". " + hrs + ":" + min + ":" + sec);

//flash botão betoweb

function RunNatal(){
  AC_FL_RunContent( 'type','application/x-shockwave-flash','data','Natal.swf','width','820','height','293','id','Natal','movie','Natal','bgcolor','#000000','allowscriptacess','sameDomain','wmode','transparent','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="Natal.swf" width="820" height="293" id="Natal">\n');
   
   document.write('<param name="movie" value="Natal.swf" />\n');
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n'); 
   
   document.write('<param name="wmode" value="transparent" />\n');  
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');

}

function RunLogo(){
	 AC_FL_RunContent( 'type','application/x-shockwave-flash','data','mini_logo.swf','width','48','height','72','id','mini_logo','movie','mini_logo','bgcolor','#000000','allowscriptacess','sameDomain','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="mini_logo.swf" width="48" height="72" id="mini_logo">\n');
   
   document.write('<param name="movie" value="mini_logo.swf" />\n');
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n');   
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');
}

function RunCAB(){
  AC_FL_RunContent( 'type','application/x-shockwave-flash','data','tubo.swf','width','300','height','170','id','tubo','movie','tubo','bgcolor','#000000','allowscriptacess','sameDomain','wmode','transparent','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="tubo.swf" width="300" height="170" id="tubo">\n');
   
   document.write('<param name="movie" value="tubo.swf" />\n');
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n'); 
   
   document.write('<param name="wmode" value="transparent" />\n');  
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');

}

function RunEND()
{
  AC_FL_RunContent( 'type','application/x-shockwave-flash','data','addr.swf','width','820','height','25','id','addr','movie','addr','allowscriptacess','sameDomain','bgcolor','#000000','wmode','transparent','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="addr.swf" width="800" height="25" id="addr">\n');
   
   document.write('<param name="movie" value="addr.swf" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n'); 
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="wmode" value="transparent" />\n');  
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');

}

function RunVitrine()
{
  AC_FL_RunContent( 'type','application/x-shockwave-flash','data','dst.swf','width','798','height','200','id','dst','movie','dst','allowscriptacess','sameDomain','bgcolor','#000000','wmode','transparent','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="dst.swf" width="798" height="200" id="dst">\n');
   
   document.write('<param name="movie" value="dst.swf" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n'); 
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="wmode" value="transparent" />\n');  
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');

}

function RunTv(){
	 AC_FL_RunContent( 'type','application/x-shockwave-flash','data','video.swf','width','480','height','160','id','video','movie','video','bgcolor','#000000','allowscriptacess','sameDomain','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="video.swf" width="480" height="160" id="video">\n');
   
   document.write('<param name="movie" value="video.swf" />\n');
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n');   
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');
}

function RunBordado()
{
  AC_FL_RunContent( 'type','application/x-shockwave-flash','data','bordado.swf','width','200','height','112','id','bordado','movie','bordado','allowscriptacess','sameDomain','bgcolor','#000000','wmode','transparent','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="bordado.swf" width="200" height="112" id="bordado">\n');
   
   document.write('<param name="movie" value="bordado.swf" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n'); 
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="wmode" value="transparent" />\n');  
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');

}

function RunCadastro()
{
  AC_FL_RunContent( 'type','application/x-shockwave-flash','data','cadastro.swf','width','192','height','112','id','cad','movie','cadastro','allowscriptacess','sameDomain','bgcolor','#000000','wmode','transparent','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="bordado.swf" width="192" height="112" id="cad">\n');
   
   document.write('<param name="movie" value="cadastro.swf" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n'); 
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="wmode" value="transparent" />\n');  
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');

}

function RunOrcamento()
{
  AC_FL_RunContent( 'type','application/x-shockwave-flash','data','orcamento.swf','width','192','height','112','id','orc','movie','orcamento','allowscriptacess','sameDomain','bgcolor','#000000','wmode','transparent','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="orcamento.swf" width="192" height="112" id="orc">\n');
   
   document.write('<param name="movie" value="orcamento.swf" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n'); 
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="wmode" value="transparent" />\n');  
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');

}

function RunPedido()
{
  AC_FL_RunContent( 'type','application/x-shockwave-flash','data','pedido.swf','width','192','height','112','id','ped','movie','pedido','allowscriptacess','sameDomain','bgcolor','#000000','wmode','transparent','quality','best','scale','noScale','menu','false','salign','TL','flashvars','playerMode=embedded' );

   document.write('<noscript>\n');
	
   document.write('<object type="application/x-shockwave-flash" data="pedido.swf" width="192" height="112" id="ped">\n');
   
   document.write('<param name="movie" value="pedido.swf" />\n');
   
   document.write('<param name="allowScriptAccess" value="sameDomain" />\n'); 
   
   document.write('<param name="bgcolor" value="#000000" />\n');
   
   document.write('<param name="wmode" value="transparent" />\n');  
   
   document.write('<param name="quality" value="best" />\n');
   
   document.write('<param name="scale" value="noScale" />\n');
      
   document.write('<param name="menu" value="false" />\n');
   
   document.write('<param name="salign" value="TL" />\n');

   document.write('<param name="FlashVars" value="playerMode=embedded" />\n');
   
   document.write('</object>\n');
   
   document.write('</noscript>\n');

}

var url="http://www.cabbordados.com.br/help/livehelp.php?department=2";
var altura=10;
var largura=5;
var y=5;
var x=5;
if(document.layers && !document.getElementById) down=70; else down=3;
if(document.all) right=5; else right=20;

function abrir(){
	janela=window.open("","","menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no");
	//interceptacao de erro na abertura da janela
	text = "Se a janela nao abriu\ntalvez seja porque voce tenha um\nprograma bloqueador de pop-up!\nObservacao » O windows XP service pack 2\nbloqueia pop-ups!";
	if(janela == null) { alert(text); return; }
	//fim
	janela.resizeTo(670,580);
	janela.moveTo(300,290);
	janela.location=url;
	
}



function formulario(feedback){
if (feedback.nome.value == ""){ 
alert("Por favor, não deixe o seu nome ou o nome de sua Empresa em branco!");
feedback.nome.focus();
return (false); 
}
if (feedback.email.value == "") {
	alert("Informe o e-mail.");
	feedback.email.focus();
	return (false);
	} else {
		prim = feedback.email.value.indexOf("@")
		if(prim < 2) {
			alert("E-mail inválido");
			feedback.email.focus();
			return (false);
		}
		if(feedback.email.value.indexOf("@",prim + 1) != -1) {
			alert("E-mail inválido");
			feedback.email.focus();
			return (false);
		}
		if(feedback.email.value.indexOf(".") < 1) {
			alert("E-mail inválido");
			feedback.email.focus();
			return (false);
		}
		if(feedback.email.value.indexOf(" ") != -1) {
			alert("E-mail inválido");
			feedback.email.focus();
			return (false);
		}
	}

if (feedback.tel.value == ""){ 
alert("Preencha o telefone com o DDD sem o zero e sem traços!");
feedback.tel.focus();
return (false); 
}
if (feedback.tel.value.length < 14){ 
alert("Telefone inválido!");
feedback.tel.focus();
return (false); 
}
if (feedback.mensagem.value == ""){
alert("Digite sua mensagem!");
feedback.mensagem.focus();
return (false);
}
}



function checa_formulario(contato){
if (contato.nome.value == ""){ 
alert("Por favor, não deixe o seu nome ou o nome de sua Empresa em branco!");
contato.nome.focus();
return (false); 
}
if (contato.email.value == "") {
	alert("Informe o e-mail.");
	contato.email.focus();
	return (false);
	} else {
		prim = contato.email.value.indexOf("@")
		if(prim < 2) {
			alert("E-mail inválido");
			contato.email.focus();
			return (false);
		}
		if(contato.email.value.indexOf("@",prim + 1) != -1) {
			alert("E-mail inválido");
			contato.email.focus();
			return (false);
		}
		if(contato.email.value.indexOf(".") < 1) {
			alert("E-mail inválido");
			contato.email.focus();
			return (false);
		}
		if(contato.email.value.indexOf(" ") != -1) {
			alert("E-mail inválido");
			contato.email.focus();
			return (false);
		}
	}
if (contato.addr.value == ""){
alert("Preencha o Endereço!");
contato.addr.focus();
return (false);
}
if (contato.bar.value == ""){
alert("Preencha o Bairro!");
contato.bar.focus();
return (false);
}

if (contato.cidade.value == ""){
alert("Preencha a Cidade!");
contato.cidade.focus();
return (false);
}
if (contato.icep.value == ""){ 
alert("Preencha o CEP!");
contato.icep.focus();
return (false); 
}

if (contato.icep.value < 10){ 
alert("Preencha o CEP!");
contato.icep.focus();
return (false); 
}

if (contato.tel.value == ""){ 
alert("Preencha o telefone com o DDD sem o zero e sem traços!");
contato.tel.focus();
return (false); 
}
if (contato.tel.value.length < 14){ 
alert("Telefone inválido!");
contato.tel.focus();
return (false); 
}
if (contato.mensagem.value == ""){
alert("Digite sua solicitação!");
contato.mensagem.focus();
return (false);
}
}
function mascara(o,f){
	v_obj=o
	v_fun=f
	setTimeout("execmascara()",1)
	}
	function execmascara(){
    v_obj.value=v_fun(v_obj.value)
	}
	function telefone(v){
    v=v.replace(/\D/g,"")                 
    v=v.replace(/^(\d\d)(\d)/g,"($1) $2")
	v=v.replace(/(\d{4})(\d)/,"$1-$2")    
	return v
	}
	function soNumeros(v){
    return v.replace(/\D/g,"")
	}
	function cep(v){
    v=v.replace(/\D/g,"")
	v=v.replace(/^(\d{2})(\d)/,"$1.$2") 
   	v=v.replace(/(\d{3})(\d{1,3})$/,"$1-$2")
    return v
	}
	function data(v){
	v=v.replace(/D/g,"")
	v=v.replace(/^(\d{2})(\d)/,"$1/$2") 
	v=v.replace(/(\d{2})(\d{4})/,"$1/$2") 	
	return v
	}

function showTo(contact){
	
    var msn = new ActiveXObject("Messenger.UIAutomation.1");

    if(msn.MyStatus == 1) msn.Signin()

    msn.InstantMessage(contact)
}

	
var message="";
function clickIE() {
	if (document.all) {
		(message);
		return false;
		}
	}
function clickNS(e) {
	if (document.layers || (document.getElementById&&!document.all)) {
	if (e.which==2||e.which==3) {
		(message);
		return false;
		}
	}
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS;
	}else{
	document.onmouseup=clickNS;document.oncontextmenu=clickIE;
	}
	

function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }


