function updateParent(newURL)

{

  opener.document.location = newURL

  window.close()

}



///////////////////////////////////////////////////////////////////////////////



function openVSWindow(winName) {

  popupWin = window.open(winName, '', 'scrollbars=yes,toolbar=no,resizable=no,width=450,height=450,left=0,top=0')

}



///////////////////////////////////////////////////////////////////////////////



function openWindow(winName) {

  popupWin = window.open(winName, '', 'scrollbars=yes,toolbar=no,resizable=no,width=450,height=520')

}



///////////////////////////////////////////////////////////////////////////////



function openLoginWindow(pagename,scriptname,action) {

  popupWin = window.open(pagename+'?action='+action+'&scriptname='+scriptname, 'loginwin', 'menubar=no,location=no,scrollbars=auto,toolbar=no,resizable=yes,width=500,height=250,left=100,top=100')

        popupWin.focus();

}



///////////////////////////////////////////////////////////////////////////////

function openPicWindow(pic, wTitle, wHeight, wWidth) {

  var winParams = "'scrollbars=no,toolbar=no,resizable=no,width="+wWidth+",height="+wHeight+",left=0,top=0'";

  var picCode = "<html><head><title>" + wTitle + "</title><link rel=\"stylesheet\" type=\"text/css\" ></head><body bgcolor=\"#333333\"><img src=\"" + pic + "\"><p align=\"center\"><a href=\"javascript:window.close();\">Close</a></p></body></html>";

  popupWin = window.open('', '', winParams);

  popupWin.document.write(picCode);

  popupWin.document.close();

}

///////////////////////////////////////////////////////////////////////////////

function openPicWindowScroll(pic, wTitle, wHeight, wWidth) {

  var winParams = 'scrollbars=1,toolbar=0,resizable=0,width='+wWidth+',height='+wHeight+',left=0,top=0';
  var picCode = "<html><head><title>"+wTitle+"</title></head><body bgcolor=\"#333333\"><div align=\"center\"><img src=\""+pic+"\"><p><a href=\"javascript:window.close();\" style=\"color:#FFCC33;\">Close</a></p></div></body></html>";

  popupWin = window.open('', '', winParams);
  popupWin.document.write(picCode);
  popupWin.document.close();

}

///////////////////////////////////////////////////////////////////////////////

function OpenViewerWindow(url, winName, wHeight, wWidth) {
  popupWin = window.open(url, winName, 'scrollbars=yes,toolbar=no,resizable=yes,width='+wWidth+',height='+wHeight+',left=0,top=0');
}


///////////////////////////////////////////////////////////////////////////////

function openHTMLWindow(htmlName, wHeight, wWidth) {
  var winParams = 'scrollbars=yes,toolbar=no,resizable=yes,width='+wWidth+',height='+wHeight+',left=0,top=0';
  popupWin = window.open(htmlName, '', winParams);
}

///////////////////////////////////////////////////////////////////////////////

function openClipWindow(clip) {

  var wHeight = 280;
  var wWidth = 340;
  var wTitle = "BearFilms.com Video Clip";
  var winParams = "'scrollbars=no,toolbar=no,resizable=no,width="+wWidth+",height="+wHeight+",left=100,top=100'";
  var picCode = "<html><head><title>" + wTitle + "</title><link rel=\"stylesheet\" type=\"text/css\" ></head><body bgcolor=\"#333333\"><p align=\"center\"><EMBED SRC=\"" + clip + "\" WIDTH=320 HEIGHT=256 AUTOPLAY=true CONTROLLER=true LOOP=false PLUGINSPAGE=\"http://www.apple.com/quicktime/\"></p></body></html>";
  popupWin = window.open(clip, '', winParams);
  popupWin.document.write(picCode);
  popupWin.document.close();
}

function openPHPWindow(htmlName,  wWidth, wHeight) {

//    alert(htmlName);
  var winParams, popupWin;

  winParams = '"resizable=yes,scrollbars=yes,width='+wWidth+', height='+wHeight+', left=0, top=0"';
  popupWin = window.open(htmlName, 'BearFilms', winParams);
  popupWin.focus();
}

function openPhotoViewerWindow(galleryType,photosetId,imageNum,wWidth,wHeight)
{
    var viewerType = document.getElementsByName("viewer_type");
    var viewerURL = '';
    var winParams, popupWin;

    if (viewerType[0].checked == true)
    {
        viewerURL = 'flv_photo_viewer.php?type='+galleryType+'&photoset='+photosetId+'&image='+imageNum;
    }
    else if (viewerType[1].checked == true)
    {
        if ('event' == galleryType)
        {
            viewerURL = 'event_photo_viewer.php?type='+galleryType+'&photoset='+photosetId+'&image='+imageNum;
        }
        else
        {
            viewerURL = 'photo_viewer.php?type='+galleryType+'&photoset='+photosetId+'&image='+imageNum;
        }
    }

    winParams = '"resizable=yes,scrollbars=yes,width='+wWidth+', height='+wHeight+', left=0, top=0"';
    popupWin = window.open(viewerURL, 'BearFilms', winParams);
    popupWin.focus();

}

function enumerate()
{
//    var lists = document.getElementsByTagName("INPUT");
    var lists = document.getElementsByName("viewer_type");
    for (var i = 0; i < lists.length; i++) {
      alert(lists[i].name + '  ' + lists[i].checked);
    }
    alert(document.getElementsByName("viewer_type")[0].checked);
}
