var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

var menuids=new Array("menu-left") //Enter id(s) of UL menus, separated by commas
var submenuoffset=-2 //Offset of submenus from main menu. Default is -2 pixels.

/*
function toggle(zap) {
	if (document.getElementById) {
		var abra = document.getElementById(zap).style;
		if (abra.display == "block") {
			abra.display = "none";
		} else {
			abra.display = "block"
		}
		return false
	} else {
		return true
	}
}
*/

function createcssmenu(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    var spanref=document.createElement("span")
		spanref.className="arrowdiv"
		spanref.innerHTML="&nbsp;&nbsp;"
		ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px"
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu)

function khfh_loadpdf(prfx)
{
	var tst=document.form1.text1.value
	if (tst) {
		window.location="http://web1.eetaa.gr/" + prfx + tst + ".pdf"
	}
}

function loadpdf(prfx)
{
	var tst=document.form1.nomoi.options[document.form1.nomoi.selectedIndex].value
	if (tst) 
		window.location="http://www.eetaa1.gr/" + prfx + tst
}

function _loadpdf(prfx)
{
	var tst=document.form1.nomoi.options[document.form1.nomoi.selectedIndex].value
	if (tst) {
		window.location= "http://www.eetaa.gr/" + prfx + tst
	}
}

function loadpdf1()
{
	var tst=document.form1.nomoi.options[document.form1.nomoi.selectedIndex].value
	if (tst)
		window.location="http://www.eetaa.gr/paidikoi_stathmoi/2010-06-11_prosorina-domon/epil_" + tst
}

function loadpdf2()
{
	var tst=document.form1.nomoi.options[document.form1.nomoi.selectedIndex].value
	if (tst)
		window.location="http://www.eetaa.gr/paidikoi_stathmoi/2010-06-11_prosorina-domon/mi_epil_" + tst
}

function loadpdf1_2()
{
	var tst=document.form1.nomoi.options[document.form1.nomoi.selectedIndex].value
	if (tst)
		window.location="http://www.eetaa.gr/paidikoi_stathmoi/2010-06-18_oristika-domon/epil_" + tst
}

function loadpdf2_2()
{
	var tst=document.form1.nomoi.options[document.form1.nomoi.selectedIndex].value
	if (tst)
		window.location="http://www.eetaa.gr/paidikoi_stathmoi/2010-06-18_oristika-domon/mi_epil_" + tst
}

function loadpdf3()
{
	var tst=document.form1.nomoi.options[document.form1.nomoi.selectedIndex].value
	if (tst)
		window.location="http://www.eetaa.gr/paidikoi_stathmoi/2010-07-22_prosorina-gynaikwn/epil_" + tst
}

function loadpdf3_2()
{
	var tst=document.form1.nomoi.options[document.form1.nomoi.selectedIndex].value
	if (tst)
		window.location="http://www.eetaa.gr/paidikoi_stathmoi/2010-07-22_oristika-gynaikwn/epil_" + tst
}

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 
