/*****************************************
UTF - ěščřžýáíé
haremscarem.net New Window Defined
******************************************/
function newWindow(URL, name, specs)
{ var anon_win = window.open(URL, name, specs); }


/* New Window IMG */
function fW(file,width,height){
var x=width;
var y=height
s='toolbar=0,location=0,directories=0,menubar=0,status=0,dependent=0,resizable=0'
s+=',width='+x+',height='+y+''

win2=window.open("imgWin.php?image="+file+"&width="+x+"&height="+y,"",s);
win2.focus();

return false;
}

function OpenFromMenu(itemValue){
	re = document.domain;

	if(itemValue.search(re)!== -1){
		top.location.href=itemValue;
	}else{
		window.open(itemValue);
	}

}

/* Hidden */
function view(x) {
  var targetId, targetElement;
  targetId = x;

  if (document.getElementById){
	     targetElement = document.getElementById(targetId);
  }else if(document.all){
  	 targetElement = document.all[targetId];
  }else if(document.layers){
  	targetElement = document[targetId];
  }
   if (targetElement.style.display == "none") {
        targetElement.style.display = "block";
		} else {
        targetElement.style.display = "none";
     }
}

/************** CHAT ***************************/
setFocus = 0;

function removetext(field)
{
  if (setFocus == 0)
    {
        setFocus = 1;
        field.value="";
    }
}

function nickvalid()
{
    var nick = document.getElementById("nickname").value;
    if(nick.match(/^[A-Za-z0-9\[\]\{\}^\\\|\_\-`]{2,32}$/) && setFocus==1) { return true; }
    else
    {
        alert('Please enter a valid nickname');
        document.getElementById("nickname").value = nick.replace(/[^A-Za-z0-9\[\]\{\}^\\\|\_\-`]/g, '');
        return false;
    }
}
