var siteroot = "http://www.underwaterscapes.com/";
var xmlHttp;
var xmlHttp2;


function gotoLink(linkname){
    location.href = siteroot+linkname;
}


function openNewWindow(url){
    popupWin = window.open(url,'open_window',
        'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=800, height=600, left=0, top=0');
    
}

function hidePicture(){
    document.getElementById("gallery_picture").style.zIndex=0;
}

 function parentStateChanged() { 
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
        var resp = xmlHttp.responseText;
        //InitializeTimer("out");
        parent.document.getElementById("gallery_picture").innerHTML= resp;
        parent.document.getElementById("gallery_picture").style.zIndex=2;
        InitializeTimer("in");
    }
 }

 function parentStateChanged2() { 
    if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete") {
        parent.document.getElementById("PictureInfoArea").innerHTML=xmlHttp2.responseText;
    }
 }
 
function onThumbnailClick(imgname) {
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null) {
        return;
     }
    
    /* this is called from an iframe, to cause a change in the parent */ 
    xmlHttp.onreadystatechange=parentStateChanged;     
    var url= siteroot+"phpfiles/CtrlMainNav.php?req=showPicture&picture="+imgname;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}


