$(document).ready(function(){
	
	$("a[rel='galeria']").colorbox();
	/**
	 * Adicionar Beabyte a Parceiros (caso nao esteja)
	 */
	$('#addBeabyteParceiro').one('click', function(){		
		var values = $(this).attr('alt').split('|');		
		$.ajax({
			type: 'post',
			url: "ajax/addBeabyteParceiro.php",
			data: "parceiro=" + values[0] + '&aluno=' + values[1],
			cache: false,
			beforeSend: function(){

			},
			success: function(txt){
				if(txt == 'ok') {
					$('#addBeabyteParceiro').text('Cadastrado com sucesso!').css('color', 'green');
				} else {
					$('#addBeabyteParceiro').text('Falha no Cadastrado!').css('color', 'red');
				}				
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				
			}
		});		
	});
	
	$("#patrocinadores-fechar").click(function(){
		$("#patrocinadores-flutuante").hide();
		//$("#rodape").css("margin-bottom","0");
	});	
	
	$(".entrar-bt").toggle(function(){$("#entrar").css('display','block');$(".entrar-bt").addClass('entrar-bt-click');$(':text').eq(0).focus();},function(){$("#entrar").css('display','none');$(".entrar-bt").removeClass('entrar-bt-click');});
	$("#indice-bt").toggle(function(){$("#indice").slideDown();},function(){$("#indice").slideUp();});
	$("#indice-fechar").click(function(){$("#indice").slideUp();});	
	
	$('#botao-assistir a').click(function(){
		document.location = $(this).attr('href');
		$(this).attr('href', 'javascript://');
	});

	var estado = new Array('', 'AC', 'AL', 'AM', 'AP', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS', 'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ', 'RN', 'RS', 'RO', 'RR', 'SC', 'SE', 'SP', 'TO', 'NA');
	
	$('#qtd_aulas_permitidas_hoje').ready(function(){
		if($('#qtd_aulas_permitidas_hoje').html()){
			$.ajax({
				type: 'post',
				url: "ajax/verifica_qtd_aulas_disponiveis.php",
				data: "ok=1",
				cache: false,
				beforeSend: function(){

				},
				success: function(txt){
					$('#qtd_aulas_permitidas_hoje').html(txt)
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					
				}
			});
		}
	});
	
	$('#qtd_bytes_disponiveis_hoje').ready(function(){
		if($('#qtd_bytes_disponiveis_hoje').html()){
			$.ajax({
				type: 'post',
				url: "ajax/verifica_qtd_bytes_disponiveis.php",
				data: "ok=1",
				cache: false,
				beforeSend: function(){
					
				},
				success: function(txt){
					$('#qtd_bytes_disponiveis_hoje').html(txt)
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					
				}
			});
		}
	});
	
	var fonte = 12;
	$('#aumenta_fonte').click(function(){
		if (fonte<14){
			fonte=fonte+1;
			$('body').css({'font-size':fonte+'px'});
		}
	});

	$('#reduz_fonte').click(function(){
		if (fonte>11){
			fonte=fonte-1;
			$('body').css({'font-size':fonte+'px'});
		}
	});

	$(".entrar-bt").toggle(
		function(){
			$("#entrar").css('display','block');
			$(".entrar-bt").addClass('entrar-bt-click');
			$(':text').eq(0).focus();
			$('.msg1').css('display', 'none');
		},
		function(){
			$("#entrar").css('display','none');
			$(".entrar-bt").removeClass('entrar-bt-click');
			$('.msg1').css('display', 'none');
		}
	);

	$(".numerico").mask("?99999999");
	$("#dataNascimento").mask("99/99/9999");
	$("#cpf").mask("999.999.999-99");
	$("#cep").mask("99999-999");
	$(".dinheiro").maskMoney({symbol:"R$", decimal:",", thousands:"."});
	
	$("#dataNascimento").blur(function(){

		var val = $(this).val();
		var msg = '';

		if(val){

			var arr = val.split('/');

			if(arr[0] && arr[1] && arr[2]){

				var dia = arr[0];
				var mes = arr[1];
				var ano = arr[2];
				
				if(dia < 1 || dia > 31){
					msg = 'Não existe data com ' + dia + ' dias.';
				}else{
					if(mes < 1 || mes > 12){
						msg = 'Não existe data com ' + mes + ' meses.';
					}else if(dia == 31 && (mes == 4 || mes == 6 || mes == 9 || mes == 11)){
						msg = 'O mês ' + mes + ' não tem ' + dia + ' dias.';
					}else if(mes == 2){
						if(dia > 29){
							msg = 'Fevereiro não possui ' + dia + ' dias.';
						}else if(dia == 29){
							if((ano%4) != 0){
								msg = ano + ' não é ano bisexto.';
							}
						}
					}
				}

			}else{
				msg = 'Verifique e digite-a corretamente.';
			}

			if(msg){
				$('.msg1').html(msg).animate({height:'show', opacity:'show'}, 300);
				var loc = document.location.href;
				loc = loc.replace("#", "");
				document.location = loc + '#';
				$('input[type=submit]').attr('disabled', 'disabled');
				$(this).focus();
			}else{
				$('#texto').animate({height:'hide', opacity:'hide'}, 'slow');
				$('input[type=submit]').attr('disabled', '');
			}

		}else{
			$('#texto').animate({height:'hide', opacity:'hide'}, 'slow');
			$('input[type=submit]').attr('disabled', '');
		}

	});
	
	$('form').find('input').keydown(function(){
		$('.msg1').animate({height:'hide', opacity:'hide'}, 300);
	});

$('form').submit(function() {
		
		if($(this).attr('id') == 'btmpago' || $(this).attr('id') == 'formQuantidadeProdutos' || $(this).attr('id') == 'form-consulta_mercadopago'){
			return true;
		}
		
		var self = $(this);
		var method = self.attr('method');
		var action = self.attr('action');
		var param = self.serialize();		
		
		if (action == "") {
			if(validateForm()){
				return true;
			}else{
				return false;
			}
		} else {
			$.ajax({
				type: method,
				url: "ajax/" + action + ".php",
				data: param,
				cache: false,
				beforeSend: function(){
					$('#msg1').html("<img alt=\"\" src=\"/img/ajax-loader.gif\" />").animate({height:'show', opacity:'show'}, 300);
					self.find('*').attr('disabled', true);
				},
				success: function(txt){
					if(action == 'cadastrar'){																							
						var loc = document.location.href;
						loc = loc.replace("#", "");
						document.location = loc + '#';
						self.find('*').attr('disabled', false);
						//
						if(txt.substring(0,13) == "<p><h2 class="){
							$("#divTransparencia").css("display", "block");
							$("#boxTransparencia").css("display", "block");
							$('#boxTransparencia').html(txt).animate({height:'show', opacity:'show'}, 300);
							setTimeout(function(){
								document.location = 'index.php'
							}, 22000);
						}else{
							if (self.attr('id') != "form-cadastro") {
								$('#msg1').html(txt).animate({height:'show', opacity:'show'}, 300);
							} else {
								$('#msg1').html("").animate({height:'hide', opacity:'hide'}, 0);
								//$('#alertasErroCadastro').html(txt).animate({height:'show', opacity:'show'}, 300);
								$('#msg-apelido').css('display', 'none');
								$('#msg2').html(txt).animate({height:'show', opacity:'show'}, 300);
							}
						}
						
					} else if((action == 'salva_forum') || (action == 'postar_comentario')) {
						self.find('*').attr('disabled', false);
						$('#msg').html(txt).animate({height:'show', opacity:'show'}, 300);
						setTimeout(function(){ $('#msg').html("").animate({height:'hide', opacity:'hide'}, 300); }, 5000);
					}else{
						if (action == 'atualizar') { $('#msg2').css('display', 'none'); }
						self.find('*').attr('disabled', false);
						$('#msg1').html(txt).animate({height:'show', opacity:'show'}, 300);
						var loc = document.location.href;
						loc = loc.replace("#", "");
						document.location = loc + '#';	
					}
					
					if(txt == "Atualizado com sucesso. Recarregando..."){
						$('#msgOk').html(txt).animate({height:'show', opacity:'show'}, 300);
						setTimeout(function(){
							document.location = '?go=area_do_aluno';
						}, 1700);
					} else {
						if (action == 'atualizar') {
							$('#msg2').html(txt).animate({height:'show', opacity:'show'}, 300);
						}
					}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					// Linha abaixo é para debugar
					//alert("ATENÇÃO\nHouve uma falha na consulta:\n" + XMLHttpRequest.responseText);
					alert("ATENÇÃO\nHouve uma falha na consulta:\n");
					self.find('*').attr('disabled', false);
				}
			});
			return false;
		}
	});
	
	$('#perguntar_apelido').click(function(){

		var self = $(this);
		var valr = $('#apelido').val();
		if(valr){

			$.ajax({
				type: "post",
				url: "ajax/perguntar_apelido.php",
				data: "apelido=" + valr,
				cache: false,
				beforeSend: function(){
					$('#form-cadastro').find('input').attr('disabled', true);
				},
				success: function(txt){
					if(txt == 1){
						$('#msg-apelido').css('display', 'none');
						$('#msg2').html('<span style="color:#F00">Você NÃO pode usar esse apelido! Por favor, escolha outro!</span>').animate({height:'show', opacity:'show'}, 300);
						
						$('#apelido').attr('disabled', false).focus();
						self.attr('disabled', false);
						setTimeout(function(){
							$('#apelido').select();
						}, 200);
					}else{
						$('#msg2').css('display', 'none');
						$('#msg-apelido').html('Sim, você pode usar este apelido! Agora pode prosseguir com o seu cadastro!').animate({height:'show', opacity:'show'}, 300);
						$('#form-cadastro').find('input').attr('disabled', false);
						$('#senha').focus();
					}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					// Linha abaixo é para debugar
					//alert("ATENÇÃO\nHouve uma falha na consulta:\n" + XMLHttpRequest.responseText);
					alert("ATENÇÃO\nHouve uma falha na consulta:\n");
				}
			});

		}

	});
	
	$('#cep').blur(function(){
		var cep = $(this).val();
		if(cep){

			$.ajax({

				type: "GET",
				url: "ajax/cep.php",
				data: "id=" + cep,
				dataType: "xml",
				cache: false,
				beforeSend: function(){
				
					$('#endereco').val('Aguarde...').attr('disabled', true);
					$('#numero').val('Aguarde...').attr('disabled', true);
					$('#bairro').val('Aguarde...').attr('disabled', true);
					$('#cidade').val('Aguarde...').attr('disabled', true);
					$('#estado').val('Aguarde...').attr('disabled', true);
					$('input[type=submit]').attr('disabled', true);
					
				},
				success: function(xml){
					var msgErro =  $(xml).find('erro').text();
					if(msgErro == "Não encontrado"){
						
						$("#cep").attr('bt-xtitle', "Ops! Cep não encontrado eu inexistente, verifique se ele foi digitado corretamente!");
						$("#cep").focus();
						setTimeout(
								function(){
									$("#cep").val("");
									$("#cep").attr('bt-xtitle', "Basta digitar aqui o CEP que o sistema preencherá seu endereço. Digite o CEP correto!");
									$("#cep").focus();
								}, 2000);
						
					}else{
						var tipo = $(xml).find('tipo').text();
						var logradouro = $(xml).find('logradouro').text();
						var bairro = $(xml).find('bairro').text();
						var cidade = $(xml).find('cidade').text();
						var uf = $(xml).find('uf').text();
						
						for(x = 0; x < estado.length; x++){
							
							if(estado[x] == uf){
								
								y = x;
								
							}
							
						}
					}
					$('#cep').attr('disabled', false);
					$('#endereco').val(tipo + ' ' + logradouro).attr('disabled', false);
					if(logradouro){
						$('#numero').val('').attr('disabled', false).focus();
					}else{
						$('#numero').val('').attr('disabled', false);
						$('#endereco').val('').attr('disabled', false).focus();
					}
					$('#bairro').val(bairro).attr('disabled', false);
					$('#cidade').val(cidade).attr('disabled', false);
					$('#estado').val(y).attr('disabled', false);
					$('input[type=submit]').attr('disabled', false);
					
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					$('input[type=submit]').attr('disabled', false);
					alert(Erro);
					// Linha abaixo é para debugar
					//alert("ATENÇÃO\nHouve uma falha na consulta:\n" + XMLHttpRequest.responseText);
					alert("ATENÇÃO\nHouve uma falha na consulta:\n");
				}
			});
		}
	});
	
	//Hint box - Informação sobre o campo
	// Hintbox nos campos Input Type=text class=hintbox
	$('input[type=text].hintBox, input[type=password].hintBox, select.hintBox').bt({
		contentSelector: "$(this).attr('title')",
		trigger: ['focus', 'blur'],
		positions: 'right', 
		width: 350, 
		spikeLength: 10, 
		spikeGirth: 10,
		strokeStyle: '#0060AD',
		fill: '#FFF',
		strokeWidth: 1,
		closeWhenOthersOpen:true
	});

	// Hintbox nos campos Label class=hintbox
	$('label.hintBox').bt({
		contentSelector: "$(this).attr('title')",
		positions: 'bottom', 
		width: 150, 
		spikeLength: 10, 
		spikeGirth: 10,
		strokeStyle: '#0060AD',
		fill: '#FFF',
		strokeWidth: 1,
		closeWhenOthersOpen:true
	});	

	// Hintbox nos campos Input Type=submit e Type=button class=hintbox
	$('input[type=submit].hintBox, input[type=button].hintBox').bt({
		contentSelector: "$(this).attr('title')",
		positions: 'right', 
		width: 150, 
		spikeLength: 10, 
		spikeGirth: 10,
		strokeStyle: '#0060AD',
		fill: '#FFF',
		strokeWidth: 1,
		closeWhenOthersOpen:true
	});	
	
	
	$('#busca_cep').click(function(){
		window.open('http://www.buscacep.correios.com.br/servicos/dnec/menuAction.do?Metodo=menuLogradouro');
	});

	$('#outro_pais').click(function(){

		if($(this).attr('checked')){

			$('.outro_pais').animate({opacity:'hide'}, 300);
			setTimeout(
				function(){
					$('.pais_outro').animate({opacity:'show'}, 300);
					$('#zip').focus();
					$('#idpais').val('');
					$('#estado').val(28);
					$('#validacep').val(1);
				},
				301
			);

		}else{

			$('.pais_outro').animate({opacity:'hide'}, 300);
			
			setTimeout(
					function(){
						$('.outro_pais').animate({opacity:'show'}, 300);
						$('#cep').focus();
						$('#idpais').val('');
						$('#estado').val('');
						$('#validacep').val(0);
					},
					301
			);

		}

	});

	$("#btnEntrar").val("Entrar");
	$("#btnEntrar").attr("disabled", false);
	
});

function replaceExternalLinks() {	
	var httpElements = $('a[href^=http://]');
	var wwwElements = $('a[href^=www.]');
	var jsOpenElementsHttp = $('a[onclick*=http://]');
	var jsOpenElementsWww = $('a[onclick*=www.]');
	var mailtoElements = $('a[href^=mailto:]');
	
	/* REMOVE HTTP HREF */
	if(httpElements.length > 0) {
		$(httpElements).each(function(i) {
			if($(this).attr("id") != "player"){
				$(this).attr("href", "#");
			}
		});
	}		
	/* REMOVE WWW HREF */
	if(wwwElements.length > 0) {
		$(wwwElements).each(function(i) {
			$(this).attr("href", "#");		
		});
	}
	/* REMOVE Http WINDOW.OPEN */
	if(jsOpenElementsHttp.length > 0) {
		$(jsOpenElementsHttp).each(function(i) {
			$(this).attr("href", "#");
			$(this).removeAttr("onclick");
		});
	}	
	/* REMOVE WWW WINDOW.OPEN */
	if(jsOpenElementsWww.length > 0) {
		$(jsOpenElementsWww).each(function(i) {
			$(this).attr("href", "#");
			$(this).removeAttr("onclick");
		});
	}
	/* REMOVE MAILTO HREF */
	if(mailtoElements.length > 0) {
		$(mailtoElements).each(function(i) {
			$(this).attr("href", "#");			
		});
	}
}	

function newPlayerCaptioned(elId, URLdirectory, captionLink){
	flowplayer(elId, {src: URLdirectory + 'swf/flowplayer.commercial-3.1.5.swf', wmode: 'opaque'},{
		key: '#@cc5ca334d8729772871',
		plugins: { 
		
			rtmp: {
				url: URLdirectory + 'swf/flowplayer.rtmp-3.1.3.swf',
			   	netConnectionUrl: 'rtmp://187.61.55.142/vod/mp4:beabyte',
			   	durationFunc: 'getStreamLength'
			},			
		
			// the captions plugin
			captions: {
				url: 'swf/flowplayer.captions-3.2.1.swf',
				
				// pointer to a content plugin (see below)
				captionTarget: 'content',
				
				button: {
					width: 20,
					height: 25,
					right: 5,
					bottom: 30,
					label: 'LG'
				}
			
			},

			/*
			configure a content plugin so that it 
			looks good for showing subtitles
			*/
			content: {
				url:'swf/flowplayer.content-3.2.0.swf',
				bottom: 5,
				height:80,
				backgroundColor: 'transparent',
				backgroundGradient: 'none',
				border: 0,
	            textDecoration: 'outline',
				style: { 
					body: { 
						fontSize: 18, 
						fontFamily: 'Arial',
						textAlign: 'center',
						color: '#ffffff',
						fontWeight: 'bold'
					} 
				} 
			},	
			
			
			beabyte: {  
			url: URLdirectory + 'swf/buttons_beabyte.swf',  
			type: 'classLibrary'  
			},
		// Utilizando a skin do be-a-byte 
			controls: { 
				url: URLdirectory + 'swf/flowplayer.controls-skinless-3.1.5.swf',
				skin: 'beabyte', 
				
				// Botões do controle
				stop: true,
				all: false, 
				stop:false,
				play:true,
				fullscreen:true,
				scrubber:true, 
				mute:true,
				time:true,
				volume:true,

				// Desativando a playlist
				playlist: false,

				//Background
				background: 'url(' + URLdirectory + 'img/flowplayer_beabyte_bg.gif) left top no-repeat', 
				backgroundGradient: 'none', 

				// Posicionamento do menu de controle do vídeo
				left: '0px',
				top:'312px',

				// Altura, largura e borda do controle
				height: '37px',
				width:'480px',	
				border:'none',

				// Propriedades dos botões
				buttonColor: '#ffffff',

				// Linha de tempo 
				scrubberHeightRatio: 0.6,
				scrubberBarHeightRatio: 0.1,

				// barra de volume 
				volumeBarHeightRatio:0.2,
				volumeSliderHeightRatio: 0.6,

				// Tempo de execução e duração do vídeo
				timeBgHeightRatio:0.3,
				timeBgColor: 'transparent',
				timeColor: '#000',
				durationColor: '#383838',

				// Hints
				tooltipColor: '#2DABFF',
				tooltipTextColor: '#2B4453',

				// Configuração dos textos dos Hints
				tooltips: {
					buttons: true,
					fullscreen: 'Tela Cheia',
					fullscreenExit: 'Sair da Tela Cheia',
					stop: 'Parar',
					play: 'Seguir',
					pause: 'Pausar',
					next: 'Próximo',
					previous: 'Anterior',
					mute: 'Mudo',
					unmute: 'Ligar Som'
				} 
			}
		},
		logo: { 
			url: '../img/logo.png', 
			fullscreenOnly: false, 
			displayTime: 3    	
		},
		// Botão Play Again (apresentado no final do vídeo)
		play: { 
			url: URLdirectory + 'swf/playagain.swf',
			replayLabel: null,
			width:70,
			height:70,
			opacity: 0.8
		},
		
		clip:{
			provider: 'rtmp',
			bufferLength: 3,
			autoBuffering: true,
	        captionUrl: 'http://temp.beabyte.com.br/srt/' + captionLink
		}
		

	});
	
}

function newPlayer(elId, URLdirectory){
	flowplayer(elId, {src: URLdirectory + 'swf/flowplayer.commercial-3.1.5.swf', wmode: 'opaque'},{
		key: '#@cc5ca334d8729772871',
		plugins: { 
		
			rtmp: {
				url: URLdirectory + 'swf/flowplayer.rtmp-3.1.3.swf',
			   	netConnectionUrl: 'rtmp://187.61.55.142:443/vod/beabyte',
			   	durationFunc: 'getStreamLength'
			},		
		
			beabyte: {  
				url: URLdirectory + 'swf/buttons_beabyte.swf',  
				type: 'classLibrary'  
			},
			
		// Utilizando a skin do be-a-byte 
			controls: { 
				url: URLdirectory + 'swf/flowplayer.controls-skinless-3.1.5.swf',
				skin: 'beabyte', 
				
				// Botões do controle
				stop: true,
				all: false, 
				stop:false,
				play:true,
				fullscreen:true,
				scrubber:true, 
				mute:true,
				time:true,
				volume:true,

				// Desativando a playlist
				playlist: false,

				//Background
				background: 'url(' + URLdirectory + 'img/flowplayer_beabyte_bg.gif) left top no-repeat', 
				backgroundGradient: 'none', 

				// Posicionamento do menu de controle do vídeo
				left: '0px',
				top:'312px',

				// Altura, largura e borda do controle
				height: '37px',
				width:'480px',	
				border:'none',

				// Propriedades dos botões
				buttonColor: '#ffffff',

				// Linha de tempo 
				scrubberHeightRatio: 0.6,
				scrubberBarHeightRatio: 0.1,

				// barra de volume 
				volumeBarHeightRatio:0.2,
				volumeSliderHeightRatio: 0.6,

				// Tempo de execução e duração do vídeo
				timeBgHeightRatio:0.3,
				timeBgColor: 'transparent',
				timeColor: '#000',
				durationColor: '#383838',

				// Hints
				tooltipColor: '#2DABFF',
				tooltipTextColor: '#2B4453',

				// Configuração dos textos dos Hints
				tooltips: {
					buttons: true,
					fullscreen: 'Tela Cheia',
					fullscreenExit: 'Sair da Tela Cheia',
					stop: 'Parar',
					play: 'Seguir',
					pause: 'Pausar',
					next: 'Próximo',
					previous: 'Anterior',
					mute: 'Mudo',
					unmute: 'Ligar Som'
				} 
			}
		},
		logo: { 
			url: '../img/logo.png', 
			fullscreenOnly: false, 
			displayTime: 3    	
		},
		// Botão Play Again (apresentado no final do vídeo)
		play: { 
			url: URLdirectory + 'swf/playagain.swf',
			replayLabel: null,
			width:70,
			height:70,
			opacity: 0.8
		},
		clip:{
			provider: 'rtmp',
			bufferLength: 3,
			autoBuffering: true
		}
	});
	
}


function abrir(){
	window.open("http://www.beabyte.com.br/material/beabyte-projeto.pdf", "Projeto Be-a-Byte", "");
}

var validateForm = function(){return true;}

function validarSenha(input){
	var entrada = input.value;
	var strSize = entrada.length;
	var achou = false;
	var caracterinvalido = '';
	var strSanatize = '';
	for(i=0; i < strSize; i++) {
		if(entrada[i] == ' ' || !(entrada[i].match("[a-zA-Z0-9\.#*;+-]"))) {						
			achou = true;
			input.value = entrada.replace(entrada[i], '');
			caracterinvalido = entrada[i];
			validarSenha(input);
		}
	}	
	if (achou) {
		$(input).after('<span class="msgErroSenhaInv" style="color: #F00	;"><br />Caracter Inválido Removido ['+caracterinvalido+']!</span>');
		setTimeout(function(){ $('.msgErroSenhaInv').hide()}, 1500)
	}		
}
function mascara(o,f, e, a){
    v_obj=o
    v_fun=f
    estoque = e
    isAula = a;
    setTimeout("execmascara()",1)
}

function execmascara(){
	var numero = v_fun(v_obj.value);
	if(isAula == 0){
		if(numero > estoque){
			v_obj.value=estoque;
		}		
	}else{
		v_obj.value=numero;
	}
}
function soNumeros(v){
    return v.replace(/\D/g,"")
}

function leech(v){
    v=v.replace(/o/gi,"0")
    v=v.replace(/i/gi,"1")
    v=v.replace(/z/gi,"2")
    v=v.replace(/e/gi,"3")
    v=v.replace(/a/gi,"4")
    v=v.replace(/s/gi,"5")
    v=v.replace(/t/gi,"7")
    return v
}

function player_Pseudo(URLarquivo){
	flowplayer('player', {src: './swf/flowplayer.commercial-3.2.7.swf', wmode: 'opaque'},{
		key: '#@d74a462f0e9f9449540',
		plugins: { 
            lighttpd: { url: './swf/flowplayer.pseudostreaming-3.2.5.swf' },
			beabyte: {  
				url: './swf/buttons_beabyte.swf',  
				type: 'classLibrary'  
			},
		
		// Utilizando a skin do be-a-byte 
			controls: { 
				url: './swf/flowplayer.controls-3.2.5.swf',
				skin: 'beabyte', 
				// Botões do controle
				stop: true,
				all: false, 
				stop:false,
				play:true,
				fullscreen:true,
				scrubber:true, 
				mute:true,
				time:true,
				volume:true,

				// Desativando a playlist
				playlist: false,

				//Background
//				background: 'url(http://www.beabyte.com.br/img/flowplayer_beabyte_bg.gif) left top no-repeat', 
//				backgroundGradient: 'none', 
				// Posicionamento do menu de controle do vídeo
				left: '0px',
				top:'312px',
				// Altura, largura e borda do controle
				height: '37px',
				width:'480px',	
				border:'none',
				// Propriedades dos botões
				buttonColor: '#ffffff',
				// Linha de tempo 
				scrubberHeightRatio: 0.6,
				scrubberBarHeightRatio: 0.1,
				// barra de volume 
				volumeBarHeightRatio:0.2,
				volumeSliderHeightRatio: 0.6,
				// Tempo de execução e duração do vídeo
				timeBgHeightRatio:0.3,
				timeBgColor: 'transparent',
				timeColor: '#000',
				durationColor: '#383838',
				// Hints
				tooltipColor: '#2DABFF',
				tooltipTextColor: '#2B4453',
				// Configuração dos textos dos Hints
				tooltips: {
					buttons: true,
					fullscreen: 'Tela Cheia',
					fullscreenExit: 'Sair da Tela Cheia',
					stop: 'Parar',
					play: 'Seguir',
					pause: 'Pausar',
					next: 'Próximo',
					previous: 'Anterior',
					mute: 'Mudo',
					unmute: 'Ligar Som'
				} 
			}
		},
		logo: { 
			url: '../img/logo.png', 
			fullscreenOnly: false, 
			displayTime: 3    	
		},
		// Botão Play Again (apresentado no final do vídeo)
		play: { 
			url: './swf/playagain.swf',
			replayLabel: null,
			width:70,
			height:70,
			opacity: 0.8
		},
		clip:{
              url: URLarquivo ,
              provider: 'lighttpd'
	        }			
	});
	
}

