var root = '../../'
var root_test = 'http://www.judisdaid.com/'
var image_root = '../../images/'

function setHeight()	{
if (!document.getElementsByTagName) return;
 h=parseInt(document.getElementById('content').offsetHeight);

document.getElementById("menu").style.height= h + "px";
}



var W3CDOM = (document.createElement && document.getElementsByTagName);

var mouseOvers = new Array();
var mouseOuts = new Array();



init();


function init()
{
	if (!W3CDOM) return;
	 nav = document.getElementById('menu');

//	var lists=nav.getElementsByTagName('ul');
	var items=nav.getElementsByTagName('a');
	var where = location.href;

where=where.split("/");
 id_search = where[3].substring(0, where[3].indexOf(".php"));


	for (var i=0;i<items.length;i++)
	{
		items[i].onmouseover = mouseGoesOver;
		//lists[i].onmouseout = mouseGoesOut;
		items[i].onclick = mouseClick;
	if(items[i].parentNode.getAttribute("id")==id_search)	{ 
	items[i].parentNode.setAttribute('class','red');
		items[i].parentNode.setAttribute('className','red');
	items[i].parentNode.parentNode.style.display='block';
		//alert(items[i].parentNode.getAttribute("class"));
	}
		//var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
		//var isRed = imgs[i].src.substring(imgs[i].src.lastIndexOf('_'));
		
		//mouseOuts[i] = new Image();
		//mouseOuts[i].src = imgs[i].src;
		//mouseOvers[i] = new Image();
		//mouseOvers[i].src = //imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "_sel" + suffix;
		//imgs[i].number = i;
	}
		nav.style.display='block';
}

function mouseGoesOver()
{
//var next=document.getElementsByTagName('ul');
//alert(next);


//this.parentNode.parentNode.nextSibling.nextSibling='block';

//var isCurrent = //mouseOvers[this.number].src.substring(mouseOvers[this.number].src.indexOf('_'));

	//if (isCurrent != '_sel_sel.jpg')	{
//	this.src = mouseOvers[this.number].src;
//} 

	
}

function mouseGoesOut()
{
	this.src = mouseOuts[this.number].src;
}


function mouseClick()	{
var exp= this.childNodes[0].nodeValue;

if(document.getElementById(exp).style.display=='none')	{
document.getElementById(exp).style.display='block';
document.getElementById(exp.substring(0,4).toLowerCase() + "_indicator").innerHTML='&nbsp;&lt;';
}	else	{
document.getElementById(exp).style.display='none';
document.getElementById(exp.substring(0,4).toLowerCase()  + "_indicator").innerHTML='&nbsp;&gt;';
}
//alert("click");
//this.src = mouseOuts[this.number].src;
//self.location.href= root +  menUrls[this.number];
}



function loadTaxi(page,wide,high)	{
num=0;

if(page=='taxiGal.php')	{
//windowWidth=1104;
//windowHeight=849;

windowWidth=720;
windowHeight=561;

}

if(page=='videoTest.php')	{
windowWidth=1028;
windowHeight=772;
}

if (page=='NoPlaceGal.php')	{
windowWidth=591;
windowHeight=444;

}

if (page=='aberGal.php')	{
windowWidth=640;
windowHeight=412;

}

if (page=='piano_doc.pdf')	{
windowWidth=640;
windowHeight=412;

}

if (page=='errorGal.php')	{
windowWidth=640;
windowHeight=481;

}

if (page=='anteGal.php' || page=='anteGal2.php'  )	{
windowWidth=928;
windowHeight=631;

}

if (page=='error1926Gal.php')	{
windowWidth=650;
windowHeight=433;
}
if (page=="http://www.errorengine.org" || page == "BookOfError1202.html")	{
windowWidth=screen.width;
windowHeight=screen.height;
}

windowCount=1;

/*while(screen.width > windowWidth*4)	{
windowWidth-=5;
windowHeight-=5;
return windowWidth;
return windowHeight;
}*/
//alert(windowWidth);
leftPos=(screen.width-(windowWidth*windowCount))/2;
topPos=(screen.height-windowHeight)/2;
//alert(screen.width);

//for(windows=0; windows<4; windows++)	{
if(page != '#' && page != 'http://www.errorengine.org')	{
window.open(page, 'window' + num, 'width =' + windowWidth +',' + 'height =' + windowHeight + ',' + 'resizable=no' +',' + 'top=' + topPos + ',' + 'left=' + leftPos);
num++;
leftPos+=windowWidth;
}


if(page=='http://www.errorengine.org')	{
window.open(page, 'window' + num, 'width =' + windowWidth +',' + 'height =' + windowHeight + ',' + 'resizable=yes' +',' + 'top=' + topPos + ',' + 'left=' + leftPos);
num++;
leftPos+=windowWidth;
}



//}


}

function taxiReload()	{


}


function loadNoPlace()	{
num=0;
windowWidth=591;
windowHeight=444;
windowCount=1;

/*while(screen.width > windowWidth*4)	{
windowWidth-=5;
windowHeight-=5;
return windowWidth;
return windowHeight;
}*/
//alert(windowWidth);
leftPos=(screen.width-(windowWidth*windowCount))/2;
topPos=(screen.height-windowHeight)/2;
//alert(screen.width);

//for(windows=0; windows<4; windows++)	{

window.open('NoPlaceGal.php', 'window' + num, 'width =' + windowWidth +',' + 'height =' + windowHeight + ',' + 'resizable=no' +',' + 'top=' + topPos + ',' + 'left=' + leftPos);
num++;
leftPos+=windowWidth;
//}

}







