var popUpWin=0;
var top;
var left;

function popUp(URLStr, width, height, id){

	top = (screen.height/2)-(height/2);
	left = (screen.width/2)-(width/2);

  if(popUpWin) {
  	if(!popUpWin.closed) popUpWin.close();
  }
	popUpWin = open(URLStr, id, 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
	 var ieversion=new Number(RegExp.$1)
	 if (ieversion==7)
	  window.location="http://www.adv7.org.br/new/index.asp#anchor1";
	 else if (ieversion==6)
	  window.location="http://www.adv7.org.br/new/index.asp#anchor1";
}

	

	function get_fotos() {
			$('#carrega').show();
			$('#fotos').hide();
			$('#fotos').html("");
			
		
				
			
				conteudo = "";
				$.getJSON("fotos_json.asp", function(j){
				  for (var i = 0; i < j.length; i++) {
					conteudo += '<div id="photos" class="foto_'+i+'">';
					conteudo += '<img src="'+ j[i].foto_p + '" width="80" height="64" style="border:2px solid #CCCCCC;" /><br/>';
					conteudo += j[i].descricao;
					conteudo += '</div>';
					$('#fotos').append(conteudo);
					conteudo = "";
				  }
				  $('#fotos').show();
				  $('#carrega').hide();
				});
			
		}

$(document).ready(function(){
	if ( $.browser.msie ) {
		$('#quinze').hide();
	//
	}else {
	
	get_fotos();
	setTimeout(function() {get_fotos();}, 15000);

}
		
			setTimeout(function(){ $("#v_vid").html('<embed  src="http://www.nettv.org.br/player.swf" width="450" height="376" allowscriptaccess="always" allowfullscreen="true" flashvars="width=500&height=418&file=http://www.ucb.org.br/reencontro/h264-reencontro.flv&autostart=true" />'); clearTimeout(this)}, 3000);
			
			$('a.menu-link').click(function() {
				if ($(this).html() == 'Clipe') {
					$('#v_vid').html('<embed  src="http://www.nettv.org.br/player.swf" width="450" height="376" allowscriptaccess="always" allowfullscreen="true" flashvars="width=500&height=418&file=http://www.ucb.org.br/reencontro/h264-reencontro.flv&autostart=true" />');
				} else {
					$('#v_vid').html('');		
				}
			});
			
			$.preloadCssImages(); 
			$(".vid").jqvideobox();
			
			$.superbox();
			$.superbox.settings = {
				boxId: "superbox",
				boxClasses: "",
				overlayOpacity: .8,
				boxWidth: "400",
				boxHeight: "200",
				loadTxt: "Carregando...",
				closeTxt: "Fechar",
				prevTxt: "Anterior",
				nextTxt: "Próximo"
			};
			
			
			//upload foto
			//$('#loader_form').hide();
			
			


			
});









function logar() {
					if(Spry.Widget.Form.validate(document.getElementById("vip"))) {
						var c_name = $("#nome").val();
						var c_user = $("#email").val();
						var c_pass = $("#senha").val();
						var c_tipo = $("#tipo").val();
						//$(this).hide();
						
						$.post("login.asp", {email: c_user, senha: c_pass, nome:c_name, tipo: c_tipo},
							function(data){
								
								
								
								if(data == "ok") {
									alert(data);
								 } else {
									alert(data);
								}
								//$(this).show();
							}
					);
					}
			}
