startList = function() {
	if (document.all&&document.getElementById) {
		listRoot = document.getElementById("gallery").childNodes[0].childNodes[0].childNodes[0];
		for (i=0; i<listRoot.childNodes.length; i++) {
			node = listRoot.childNodes[i];
			if (node.nodeName=="TD") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
openW = function(id,orientation) {
	var x = 0, y = 0;
	if (document.all)
	{
		x = window.screenLeft + 100;
		y = window.screenTop + 100;
	}
	else
	{
		x = window.screenX + 100;
		y = window.screenY + 100;
	}
	
	//var imagePath = "img/gallery/big/"+id+".jpg";
	var imagePath = "src/content/fotocontainer.php?f="+id;
	
	var width = 640;
	var height = 480;
	if(orientation == 'v')
	{
		width = 480;
		height = 640;
	}
	
	var win = window.open(imagePath,'Detail','toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width='+width+',height='+height+', left='+x+', top='+y+', screenX='+x+', screenY='+y);
	
		//get the inner height and width of the popup
		var w,h;
		if (win.innerHeight) // all except Explorer
		{
			w = win.innerWidth;
			h = win.innerHeight;
		}
		else if (win.document.documentElement && win.document.documentElement.clientHeight)
			// Explorer 6 Strict Mode
		{
			w = win.document.documentElement.clientWidth;
			h = win.document.documentElement.clientHeight;
		}
		else if (win.document.body) // other Explorers
		{
			w = win.document.body.clientWidth;
			h = win.document.body.clientHeight;
		}
	
	if(orientation != 'v')
	{	
		win.resizeTo(640,480);
		
		//get the inner height and width of the popup
		var w,h;
		if (win.innerHeight) // all except Explorer
		{
			w = win.innerWidth;
			h = win.innerHeight;
		}
		else if (win.document.documentElement && win.document.documentElement.clientHeight)
			// Explorer 6 Strict Mode
		{
			w = win.document.documentElement.clientWidth;
			h = win.document.documentElement.clientHeight;
		}
		else if (win.document.body) // other Explorers
		{
			w = win.document.body.clientWidth;
			h = win.document.body.clientHeight;
		}

		win.resizeBy(640-w,480-h);
	}
	else
	{
		win.resizeTo(480,640);
		
		//get the inner height and width of the popup
		var w,h;
		if (win.innerHeight) // all except Explorer
		{
			w = win.innerWidth;
			h = win.innerHeight;
		}
		else if (win.document.documentElement && win.document.documentElement.clientHeight)
			// Explorer 6 Strict Mode
		{
			w = win.document.documentElement.clientWidth;
			h = win.document.documentElement.clientHeight;
		}
		else if (win.document.body) // other Explorers
		{
			w = win.document.body.clientWidth;
			h = win.document.body.clientHeight;
		}		
		
		win.resizeBy(480-w,640-h);
	}

}

window.onload=startList;