var i=0;
function	MostraEsconde() {

if(i == 0) {
	i=1
	document.getElementById('code').style.display = 'block';
	}else {
	document.getElementById('code').style.display = 'none';
	i=0
	}

}


function Click()
{
if(document.google.q.value == '') { 
		document.google.q.style.background = '#FFF'
		document.google.q.style.border = '1px solid #7F9DB9'
}
}

function Blur()
{
if(document.google.q.value == '') {
		document.google.q.style.background	= 'url(http://www.google.com/coop/intl/pt-br/images/google_custom_search_watermark.gif) no-repeat #FFF'
		document.google.q.style.border = '1px solid #7F9DB9'
}
}

function validaForm(){
           d = document.contato;
           //validar nome
          if (d.nome.value == ""){
                    alert("O campo " + d.nome.name + " deve ser preenchido!");
                 d.nome.focus();
                     return false;
         }
         //validar user
       if (d.email.value == ""){
                  alert("O campo " + d.email.name + " deve ser preenchido!");
                  d.email.focus();
                  return false;
        }
		
		

        if (d.email.value == ""){
                 alert("O campo " + d.email.name + " deve ser preenchido!");
                 d.email.focus();
                 return false;
       }


       parte1 = d.email.value.indexOf("@");
         parte2 = d.email.value.indexOf(".");
        parte3 = d.email.value.length;
       if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
              alert ("Insira um e-mail valido!");
                  d.email.focus();
                 return false;
       }


		 if (d.assunto.value == 0){
                alert("Selecione o assunto!");
                  d.assunto.focus();
                  return false;
        }
		
	
         if (d.comentario.value == ""){
                alert("O campo " + d.comentario.name + " deve ser preenchido!");
                  d.comentario.focus();
                  return false;
        }
		

		

		return true;
}

function EquipPopup(equipid) {
	window.open('/?p=equips&hidebody=1&id='+equipid,'View'+equipid,'width=780,height=620,top=0,left=0,scrollbars=yes');
}
function MobPopup(equipid) {
	window.open('/?p=mobs&modo=1&hidebody=1&id='+equipid,'View'+equipid,'width=780,height=620,top=0,left=0,scrollbars=yes');
}
function ItemPopup(itemid) {
	window.open('/item.php?hidebody=1&id='+itemid,'View'+itemid,'width=780,height=620,top=0,left=0,scrollbars=yes');
}
function CardPopup(cardid) {
	window.open('/?p=cards&modo=1&hidebody=1&id='+cardid,'View'+cardid,'width=780,height=620,top=0,left=0,scrollbars=yes');
}
function Quest(itemid) {
	window.open('/?p=quests&hidebody=1&tipo=item&id='+itemid,'View'+itemid,'width=780,height=620,top=0,left=0,scrollbars=yes');
}
function Skill(skillid) {
	window.open('/?p=skills&hidebody=1&id='+skillid,'View'+skillid,'width=780,height=620,top=0,left=0,scrollbars=yes');
}

function MapPopup(map) {
	window.open('/maps.php?map='+map,'View'+map,'width=780,height=620,top=0,left=0,scrollbars=yes');
}

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function status() {
	LINK_ajax('online.php','status_div');

	setTimeout("server_status()", 120000);
}