/* -------------------------------------------------- */
/* INICIO SOURCE CODE                                 */
/* -------------------------------------------------- */
/* CREDITOS                                           */
/* -------------------------------------------------- */
/* DESENVOLVEDOR: DANIEL J. CONTEL                    */
/* TELEFONE.....: (18) 9791-3160                      */
/* E-MAIL.......: CONTATO@DJCONTEL.COM                */
/* -------------------------------------------------- */
function OpenWin(file, name, width, height, scrollbars) {
	// Certifica-se de que uma dimensão de tela existe
	screen_width = 800;
	screen_height = 600;

	if (scrollbars) if (scrollbars !== '') scrollbars = ',' + scrollbars;

	// Dimensões da tela do usuário
	if (screen) if (screen.width) screen_width = screen.width;
	if (screen) if (screen.height) screen_height = screen.height;

	// Calcula a posição da janela no centro
	window_left = (screen_width / 2) - (width / 2);
	window_top = (screen_height / 2) - (height / 2);

	// Abre janela
	if (window) {
	   if (window.open) {
	      w = window.open(file,name,'width='+width+',height='+height+',left='+window_left+',top='+ window_top+',screenX='+window_left+',screenY='+ window_top+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrollbars+',resizable=no,menubar=no');
	      if (w.moveTo)
	         w.moveTo(window_left, window_top);
	         if (w.focus)
	            w.focus();
				return w;
	   }
	}
}

function abrir_foto(file, name, width, height, scrollbars, comentario) {
	// Certifica-se de que uma dimensão de tela existe
	screen_width = 800;
	screen_height = 600;

	if (scrollbars) if (scrollbars !== '') scrollbars = ',' + scrollbars;

	// Dimensões da tela do usuário
	if (screen) if (screen.width) screen_width = screen.width;
	if (screen) if (screen.height) screen_height = screen.height;

	// Calcula a posição da janela no centro
	window_left = (screen_width / 2) - (width / 2);
	window_top = (screen_height / 2) - (height / 2);

	// Abre janela
	if (window) {
	   if (window.open) {
	      w = window.open(file,name,'width='+width+',height='+height+',left='+window_left+',top='+ window_top+',screenX='+window_left+',screenY='+ window_top+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrollbars+',resizable=no,menubar=no,copyhistory=no');
	      if (w.moveTo)
	         w.moveTo(window_left, window_top);
	         if (w.focus)
	            w.focus();
				w.document.write("<html>");
				w.document.write("<head>");
				w.document.write("<title>Tsunami Lan House</title>");
				w.document.write("</head>");
				w.document.write("<link href='_lib/css/jogos.css' rel='stylesheet' type='text/css'>");
				w.document.write("<body topmargin='0' leftmargin='0'>");
				w.document.write("<table width='100%' height='"+height+"' border='0' cellpadding='0' cellspacing='0'>");
				w.document.write("  <tr>");
				w.document.write("    <td width='"+width+"' class='foto'>");
				w.document.write("<p><img src='"+file+"' alt='' /></p>");
				w.document.write("	  </td>");
				w.document.write("  </tr>");
				w.document.write("  <tr>");
				w.document.write("    <td width='"+width+"' class='comentario'>");
				w.document.write("<p>"+comentario+"</p>");
				w.document.write("	  </td>");
				w.document.write("  </tr>");
				w.document.write("</table>");
				w.document.write("</body>");
				w.document.write("</html>");
				w.document.close();
	   }
	}
}

function vrf_enquete() {
	var form = document.enquete
	var encontrou = false;
	for (var i = 0; i < form.elements.length; i++) {
	   if (form.elements[i].type == "radio") {
	      if (form.elements[i].checked == true) {
			  encontrou = true;
		  }
	   }
	}
	if (encontrou == false) {
	   alert("Escolha uma opção para votar!");
	   return false;
	}
	return true;
}
function votar() {
	w = OpenWin('','Enquete','300','340','no');
	document.enquete.submit();
	w.focus();
}
function resultado_parcial(id) {
	w = OpenWin('enquetes.php?action=resultado_parcial&id='+id,'Enquete','300','340','no');
	w.focus();
}

function MM_formtMask(e,src,mask) {
if(window.event) { _TXT = e.keyCode; }
else if(e.which) { _TXT = e.which; }
if(_TXT > 47 && _TXT < 58) {
 var i = src.value.length; var saida = mask.substring(0,1); var texto = mask.substring(i)
 if (texto.substring(0,1) != saida) { src.value += texto.substring(0,1); }
    return true; } else { if (_TXT != 8) { return false; }
 else { return true; }
}
}

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_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_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];}
}








function cellMouseOver(obj, cor)
{
	obj.style.backgroundColor = cor;
}

function cellMouseOut(obj, cor)
{
	obj.style.backgroundColor = cor;
}
/* -------------------------------------------------- */
/* FIM SOURCE CODE                                    */
/* -------------------------------------------------- */