var thepos;
var theimg;
var xml;
var is_ns;

function mresize(e)
{
    if (obj=document.getElementById("outer"))
    {
        x=Math.floor((document.body.clientWidth-parseInt(obj.style.width)-24)/2);
        if (x<4)
            x=4;
        obj.style.left=x+"px";
    }
}

function hideWaterFall(pos)
{
        document.getElementById(pos).style.visibility='hidden';
        thepos=false;
        theimg=false;
}

function showpicture()
{
        if (xml.readyState==4 && thepos)
        {
                document.getElementById(thepos).style.visibility='visible';
                return true;
        }
}

function showWaterFall(pos,img,thex,width)
{
        if (img == theimg)
              return true;
        thepos=pos;
        x=parseInt(document.getElementById(thepos).style.left);
        if (thex)
        {
               if (x>width/3 && x<thex)
                   document.getElementById(thepos).style.left=(thex+4)+"px";
        }
/*
        try
        {
              theX=window.event.pageX;
              theY=window.event.pageY;
              is_ns=true;
              alert(theX);
        }
        catch(e)
        {
              theX=event.x;
              theY=event.y;
              is_ns=false;
        }
        if (x<theX && x+300>theX)
*/
        theimg=img;
        try
        {
               xml = new XMLHttpRequest();
        }
        catch(e)
        {
                try
                {
                        xml = new ActiveXObject("Msxml2.XMLHTTP");
                }
                catch (e)
                {
                        try
                        {
                                xml = new ActiveXObject("Microsoft.XMLHTTP");
                        }
                        catch (e)
                        {
                                document[thepos].src="http://www.gowaterfalling.com/waterfalls/images/thumbs/"+theimg;
                                document.getElementById(thepos).style.visibility='visible';
                                return true;
                        }
                }
        }
    try
    {
        xml.open("GET","http://www.gowaterfalling.com/waterfalls/images/thumbs/"+img,true);
        xml.onreadystatechange=showpicture;
        xml.send(true);
        document[thepos].src="http://www.gowaterfalling.com/waterfalls/images/thumbs/"+theimg;
    }
    catch (e)
    {
          document[thepos].src="http://www.gowaterfalling.com/waterfalls/images/thumbs/"+theimg;
          document.getElementById(thepos).style.visibility='visible';
     }
}


function hideInfo(pos)
{
	document.getElementById(pos).style.visibility='hidden';
}

function showInfo(pos,info,y)
{
	o=document.getElementById(pos);
	s=document.getElementById(info).getAttribute("info");
	o.innerHTML=s;
	o.style.height=s.length>350 ? 250 : 200;
	o.style.top=y+"px";
	o.style.visibility='visible';

/*
		"<a href='#' onClick='document.getElementById("
			+'"'+pos+'"'+
			").style.visibility="+'"hidden";'+"'>Close</a><br>" + 
*/
}

window.onresize=mresize;
window.onload=mresize;




