﻿sortChange = function() {
	    var sortBox = document.getElementById('sortOrder');
	    document.form1.order.value = sortBox.value;
	    document.form1.pageNum.value = 0;
	    document.form1.submit();
	}
	//used at the dropdown
	letterChange = function() {
	    var letterBox = document.getElementById('letter');
	    document.form1.lettersCtrl.value = letterBox.value;
	    document.form1.pageNum.value = 0;
	    document.form1.SearchName.value = '';
	    document.form1.vSearchName.value = '';
	    document.form1.submit();
	}
	//used at the dropdown
	dateChange = function() {
	    var dateBox = document.getElementById('date');
	    document.form1.datesCtrl.value = dateBox.value;
	    document.form1.pageNum.value = 0;
	    document.form1.SearchName.value = '';
	    document.form1.vSearchName.value = '';
	    document.form1.submit();
	}
	pageChange = function(page) {
	    document.form1.pageNum.value = page;
	    document.form1.submit();
	}
	//used at the full display bars
	function getDate(date) {
	    document.form1.datesCtrl.value = date;
	    document.form1.pageNum.value = 0;
	    document.form1.SearchName.value = '';
	    document.form1.vSearchName.value = '';
	    //alert(date);
	    document.form1.submit();
	}
	
	function getletter(letter) {
	    document.form1.lettersCtrl.value = letter;
	    document.form1.pageNum.value = 0;
	    document.form1.SearchName.value = '';
	    document.form1.vSearchName.value = '';
	    document.form1.submit();
	}
	
	function getName(SearchName) {
	    document.form1.SearchName.value = SearchName;
	    document.form1.datesCtrl.value = '';
	    document.form1.lettersCtrl.value = '';
	    document.form1.pageNum.value = 0;
	    //document.searchForm.SearchWhat.value='Λέξη κλειδί';
	    document.form1.submit();
	}
	
    startList = function() {
	if (document.getElementById) {
	    var navElements = new Array("DateNav", "grNav", "pager"); //, "enNav"
	    for (j=0; j<3; j++) { 
			var navRoot = document.getElementById(navElements[j]);
		    if (!navRoot) { 
				continue; 
			}else{
				for(i=0;i<navRoot.childNodes.length;i++){			 
					node = navRoot.childNodes[i];
					if (node.nodeValue == "Σελίδα:") { continue; }
					if ( (node.nodeName=="LI" && node.className.search(/Disabled/) ==-1) || (node.nodeName=="SPAN" && node.className.search(/pageLink/) >= 0 ) ) {
						node.onmouseover=function() {
							this.className+=" over";
						}
						node.onmouseout=function() {
							this.className=this.className.replace(" over", "");
							this.className=this.className.replace("over", ""); //Firefox: if className starts with whitespace it's auto trimmed
						}
					}
				}
			}
	    }
	}
	
	document.styleSheets[0].disabled=true;
	//set previously selected font size
	checkCookie();
	}
	
	window.onload=startList;
