 function NewWindows(url)
{
    var jumpToHere;
    var winOptions;
    var popUpWindow;
    var swidth;
    var sheight

    swidth = screen.availWidth;
    sheight = screen.availHeight;
    jumpToHere = url ;
    winOptions = 'outerHeight=' + sheight + ', outerWidth=' + swidth +',scrollbars=yes,resizable=yes';
    popUpWindow = open(jumpToHere, "NewWindow", winOptions);
 }


function setinnerHeight()
{
if (window.innerHeight) 
    {
    theHeight=window.innerHeight;
    }
else if (document.documentElement && document.documentElement.clientHeight) 
    {
    theHeight=document.documentElement.clientHeight;
    }
else if (document.body) 
    {
    theHeight=document.body.clientHeight;
    }
    
if(parseInt(theHeight) < parseInt(document.body.scrollHeight))
    {
    theHeight=document.body.scrollHeight + 5;
    }    

document.getElementById("LeftBar").style.height=(theHeight-400) +'px';
}

function showphoto(divObj)
{
var CurDiv = document.getElementById(divObj)
if(CurDiv.style.display == "block")
    {
    CurDiv.style.display = "none"
    }
else
    {
    var divs = document.getElementsByTagName('div') 
    for (var i=0;i<divs.length;i++)
    { 
    if (divs[i].style.display =='block')
        {
        divs[i].style.display ='none'
        }
    }
    
    hza = document.getElementById(divObj);
    hza.style.display = "block" ;
    }
//CurDiv.style.display = "block"
}
function hidephoto()
{
var CurDiv = document.getElementById('LargePhoto')

CurDiv.style.display = "none"
}

function showfile(file,text)
{
var left = (screen.width-430)/2;
var top = 140;
var winShow = window.open("show_album_photo.asp?file="+ file + "&text=" + text, "AlbumPhotos","height=500,width=500,left=0,top=0,status=0,titlebar=0,toolbar=0,resizable=1");

winShow.focus();
}
 
function del_photo(i,p,a)
{
if(confirm('You are about to delete photo "' + p + '" from the photo album\nTo continue click "OK" to stop now click "Cancel"'))
    {
    document.location.href='del_photo_album_photo.asp?PhotoID=' + i + '&photo=' + p + '&albumid=' + a;
    }
}

function OnUpload()
{
  var path = document.forms[0].Photo.value;
  
 if (path.length == 0)
 {
  alert("You did not select a file.  First press the Browse button and select a photo, then press Upload.");
  return false;
 }
 if (path.indexOf("'") != -1)
 {
  alert("Your file path cannot contain an apostrophe ('). Please save the file to a new location. This is due to a bug in your browser software.");
  return false;
 }

 var imgSrc = "file:///"+path;
 if (navigator.userAgent.indexOf("Mac",1) >= 0) // it's a mac!
  imgSrc = "file://"+path;

 var left = (screen.width-430)/2;
 var top = 140;
 //(screen.height-170)/2;
 //winUpload = window.open("showfile.asp?file="+ path, "uploading","height=100,width=100,toolbar=no,status=no,screenx="+left+",screeny="+top+",left="+left+",top="+top);
 //var html = '<html><head><title>You Are Uploading</title>';
 //html += '</head>'
 //html += '<body topmargin=0 leftmargin=0 bgcolor="#F5F5F5" OnLoad=setTimeout("self.close()",5000);>';
 //html += '<table width="100%" cellspacing=5 cellpadding=5 border=0>';
 //html += '<td align="center" valign="middle"><img name="CurPhoto" src="' + imgSrc + '"></td></table></body></html>';

 //winUpload.document.writeln(html);
 //winUpload.document.close();
 //if (!winUpload.opener)
 //winUpload.opener = this;
 //winUpload.focus();
 return true;
}

function ShowProgress()
{
  strAppVersion = navigator.appVersion;
  if (document.uploadform.Photo.value != "")
  {
    if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
    {
        winstyle = "dialogWidth=375px; dialogHeight:130px; dialogTop:0px dialogLeft:500px center:no";
      window.showModelessDialog('<% = barref %>&b=IE',null,winstyle);
    }
    else
    {
        window.open('<% = barref %>&b=NN','','top=0,left=500,width=300,height=115', true);
    }
  }
  return true;
}

