if(document.all && !document.getElementById) 
{
    document.getElementById = function(id) 
	{
         return document.all[id];
    }
}

function mitem_visibility(itm, make_visible) {
	if (make_visible != null) {
		if (make_visible) itm.style.visibility = 'visible';
		else itm.style.visibility = 'hidden';
}}
function mhide (itm) {
	var curr_item, visib;
	for (var i = 0; i < (document.getElementById('flycontainer').children.length); i++) {
		curr_item = document.getElementById('flycontainer').children[i];
		if ( (curr_item.id.length%2)==0 )
		{
			visib = ( (itm.id == curr_item.id.slice(0,(itm.id.length-1)) || itm.id == curr_item.id.slice(0,(itm.id.length))) && (itm.id != curr_item.id));
		}
		else
		{
			visib = (( itm.id == curr_item.id.slice(0,(itm.id.length))  ) && (itm.id != curr_item.id));
		}
		if (visib) mitem_visibility(curr_item, false); 
}}
function mshow (itm) {
	var curr_item, visib;
	for (var i = 0; i < (document.getElementById('flycontainer').children.length); i++) {
		curr_item = document.getElementById('flycontainer').children[i];
		visib = ((itm.id == curr_item.id.slice(0,itm.id.length)) && (itm.id != curr_item.id) && (itm.id.length == (curr_item.id.length - 2) || itm.id.length == (curr_item.id.length - 3) ));
		if (visib) mitem_visibility(curr_item, true); 
}}
function mout (itm) {
	if (itm.id.length == 3) itm.className = "m0out";
	else itm.className = "m1out"; 
	if (1==1) {
		if (itm.id.length == 3) { 
			itm.hide_timer = setTimeout('mhide(document.getElementById("'+ itm.id + '"));', 250);
		} else 
		{
			if ( (itm.id.length%2)==0 ) 
			{
				for (var j = (itm.id.length-1); j >= 3; j = j-2 ) { 
					var par = eval('document.getElementById("' + itm.id.slice(0,j) + '")');
					par.hide_timer = setTimeout('mhide(document.getElementById("'+ par.id + '"));', ((itm.id.length-j)*100)+200); }
			}
			else
			{
				for (var j = itm.id.length; j >= 3; j = j-2 ) { 
					var par = eval('document.getElementById("' + itm.id.slice(0,j) + '")');
					par.hide_timer = setTimeout('mhide(document.getElementById("'+ par.id + '"));', ((itm.id.length-j)*100)+200);
			}
}}}}
function mover (itm) {
	if (itm.id.length == 3) itm.className = "m0over";
	else itm.className = "m1over"; 
	if (1==1) {
		var curr_item, visib;
		itm.show_timer = setTimeout('mshow(document.getElementById("' + itm.id + '"));', 250);
		var id_length = itm.id.length;
		if ( (id_length%2)==0 )
		{
			for (var j = (itm.id.length-1); j >= 3; j = j-2 ) { eval('clearTimeout(document.getElementById("' + itm.id.slice(0,j) + '").hide_timer);'); }
			for (var j = (itm.id.length); j >= 3; j = j-2 ) { eval('clearTimeout(document.getElementById("' + itm.id.slice(0,j) + '").hide_timer);'); }
		}
		else
		{
			for (var j = itm.id.length; j >= 3; j = j-2 ) { eval('clearTimeout(document.getElementById("' + itm.id.slice(0,j) + '").hide_timer);'); }
		}
	}
}


function extrastuff () {
		for (var i = 0; i < (document.getElementById('flycontainer').children.length); i++) {
			curr_item = document.getElementById('flycontainer').children[i];
			visib = ((itm.id == curr_item.id.slice(0,itm.id.length)));
			if (visib && (itm.id.length == (curr_item.id.length - 2))) mitem_visibility(curr_item, true);
		}

}

function iwin(image,tytle,width,height) {
		var cond1,cond2
        if (width==0) cond1=" "
                else cond1="width="+(width+40)+"";
        if (height==0) {cond2=" "}
                else {cond2="height="+(height+85)+""};

       var s1 ="<TITLE>"+tytle+"</TITLE>" 
       var s15=""
       var s2 ="<CENTER><IMG SRC='"+image+"' BORDER=0>"
       var s3 ="<p><FORM><INPUT TYPE='BUTTON' VALUE='Close'"+
                " onClick='self.close()'>"
       var s4 ="</FORM></CENTER></BODY>"

        ImageWindow=window.open("", "newwin",
        "toolbar=no,resizable=yes,scrollbars=auto,menubar=no,left = 440,top = 412,"+cond1+","+cond2);
        ImageWindow.document.write(s1+s15+s2+s3+s4)
        ImageWindow.document.close()
}

function makeNewWindow(url,width,height, scrollbars) 
{
	var var1
	if (scrollbars==true)
	{
		var1="yes"
	}
	else
	{
		var1="no"
	}
	var windowOpened
	var newWindow
	var w = screen.width; // Get the width of the screen
    var h = screen.height; // Get the height of the screen
    var left = (w - width)/2;
    var top = (h - height)/2;
	if (left<10) left = 10;
	if (top<10) top = 10;
	var high = height + 0 // customizable
	var wide = width + 0  // customizable
	if (windowOpened) 
	{
		newWindow.close();
	}
	newWindow=window.open(url, "newwin",
        "toolbar=no,resizable=yes,scrollbars="+var1+",menubar=no,left = "+left+",top = "+top+",width="+wide+",height="+high);
	windowOpened=true;
}