board = new Image(150,109);
board.src = "/img/tavliera.gif";
board2 =new Image(150,109)
board2.src = "/img/tavliera2.gif"

function hiLite(imgDocID,imgObjName) {
	document.images[imgDocID].src = eval(imgObjName + ".src")
}
//----------
function checkLogin() {
	var nick = document.login.nick.value ;
	var pass = document.login.pass.value ;
	nick = nick.replace(/\s/g,"");
	pass =pass.replace(/\s/g,"");
	if(nick.length < 3 || pass.length < 3){
		alert("Συμπληρώστε σωστά τα στοιχεία σας");
		return ;
	}
	document.login.submit();
	//document.login.reset();
}
//--------------
function resetS(){
        document.search.action= document.URL ;
        document.search.target = "_self" ;
        }

//-----------------
function checkSearch() {
	var test = document.search.who.value ;
	var test1 = document.search.who.value ;
	test = test.replace(/\s/g,"");
	
	if(test.length <3 ){
		alert("Η αναζήτηση απαιτεί τουλάχιστον 3 γράμματα");
		resetS() ;
		return ;
	}
	
	var wordsArray = test1.split(/ /);
	
	for (var i = 0 ;i<wordsArray.length ; i++){
		test = wordsArray[i] ;
		if(test == 'OR' || test == 'or' || test == 'AND' || test == 'and'){
			alert("Η αναζήτηση δεν χειρίζεται boolean operators");
			resetS() ;
		return ;
		}
	}
	
	document.search.action = "http://www.exares.gr/search.asp";
	document.search.submit();
	document.search.reset();
}
//-----------		
function doCleanup(){
	for(var i =0 ;i< document.forms.length ; i++){
		document.forms[i].reset() ;
	}
}

//-----------
function game(i) {
        var url = "game.asp?w="+i;
	 wname = '_B' + Math.round(Math.random() * 100) ;
         window.open( url , wname, 'resizable=yes,width=630,height=550, scrollbars=yes' );
  }
//--------
function msg(i,n){
	var url = "/msg.asp?rid=" + i +"&nick="+ n ;
	window.open( url , '_MSG', 'resizable=yes,width=440,height=380,scrollbars=yes' );
}
//-------
function checkDel(){
	for (var i = 0 ; i < document.del.elements.length; i++){
		if(document.del.elements[i].checked){
			document.del.submit();
			return ;
		}
	}
		alert("Δεν διαλέξατε τίποτα για διαγραφή");
}
