var NodeListOn = 0;
function pageInit()
{
    if(document.getElementById && (navigator.userAgent.indexOf('IE 5.0')==-1))
	{ 
		if(document.getElementById('region-content'))
		{
			if(NodeListOn>0)
				NodeListOn-=1;
			if(NodeListOn==0)
				HideNodes();
    	}
	}	
	else
	{  
	   if(document.all['region-content'])
		{
			if(NodeListOn>0)
				NodeListOn-=1;
			if(NodeListOn==0)
				HideNodes();
    	}
	}
		
}
function SetTourName(id,Name)
{
	if(document.getElementById && (navigator.userAgent.indexOf('IE 5.0')==-1))
	{
		document.getElementById('tourname').innerHTML ="<a href=\"javascript:var obj_window=window.open('viewtour.php?tid="+id+"&short=1','','toolbar=no,directories=no,status = no,resizable=yes,menubar=no,scrollbars=yes,width=500,height=600'); obj_window.focus()\";>"+Name+"</a>";
		document.forms.ftour.TourID.value = id;
		HideNodes();
		return;
	}
	else
	{
	    document.all['tourname'].innerHTML ="<a href=\"javascript:var obj_window=window.open('viewtour.php?tid="+id+"&short=1','','toolbar=no,directories=no,status = no,resizable=yes,menubar=no,scrollbars=yes,width=500,height=600'); obj_window.focus()\";>"+Name+"</a>";
		document.forms.ftour.TourID.value = id;
		HideNodes();
		return;
	}
}

function ShowNodes()
{

    if( NodeListOn > 0 )
	   return HideNodes();
	if(document.getElementById && (navigator.userAgent.indexOf('IE 5.0')==-1))
	{
	    doLoad();
		NodeListOn = 2;
		document.getElementById('node-block').style.visibility = 'visible';
		document.getElementById('node-table').style.visibility = 'visible';
		document.getElementById('node-table').style.borderCollapse = 'collapse';
		document.getElementById('sportselect').src = 'images/sportselectup.gif';
	}
	else
	{
	    doLoad();
		NodeListOn = 2;
		document.all['node-block'].style.visibility = 'visible';
		document.all['node-table'].style.visibility = 'visible';
		document.all['node-table'].style.borderCollapse = 'collapse';
		document.all['sportselect'].src = 'images/sportselectup.gif';
	}
}
function HideNodes()
{
	if(document.getElementById && (navigator.userAgent.indexOf('IE 5.0')==-1))
	{
	    NodeListOn = 0;
		document.getElementById('node-block').style.visibility = 'hidden';
		document.getElementById('node-table').style.visibility = 'hidden';
		try { document.getElementById('region-select').style.visibility = 'visible';
  		}
 		catch(e){   
      	}
		document.getElementById('sportselect').src = 'images/sportselect.gif';
		return;
	}
	else
	{
	    NodeListOn = 0;
		document.all['node-block'].style.visibility = 'hidden';
		document.all['node-table'].style.visibility = 'hidden';
		try { document.all['region-select'].style.visibility = 'visible';
  		}
 		catch(e){   
      	}
		document.all['sportselect'].src = 'images/sportselect.gif';
		return;
	}
}
 function doLoad() {
        var query = '';
        var req = new Subsys_JsHttpRequest_Js();
		var rand_val = Math.round(Math.random()*10000);
        req.onreadystatechange = function() {
            if (req.readyState == 4) {
                if (req.responseJS) {
                    document.getElementById('region-content').innerHTML = 
					    req.responseJS.res;
                }
            }
        }
        req.caching = true;
        req.open('POST', 'load.php', true);
        req.send({ q: query, rand: rand_val, na: 1 });
    }

