﻿// JScript File
function onClickComments()
{
   //Because of how tabs are hidden and shown, the only one that we
   //know will exist is the media details tab.  Everything else might
   //not exist, so they're in a try/catch to not throw an exception
   document.getElementById("mediaDetailsArea").style.display="none";
   document.getElementById("mediaDetailsTab").className="tabUnselected";
   
   try
   {
      document.getElementById("mediaCommentsArea").style.display="block";
      document.getElementById("commentsTab").className="tabSelected";
   }
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("shareThisMediaArea").style.display="none";
      document.getElementById("shareThisMediaTab").className="tabUnselected";
   } 
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("emailArea").style.display="none";
      document.getElementById("emailTab").className="tabUnselected";
   }
   catch(e)
   {
   }
   
   try 
   {
       document.getElementById("attachmentsArea").style.display="none";
       document.getElementById("attachmentsTab").className="tabUnselected";
   }
   catch(e)
   {
   } 
}

function onClickMediaDetails()
{
   //Because of how tabs are hidden and shown, the only one that we
   //know will exist is the media details tab.  Everything else might
   //not exist, so they're in a try/catch to not throw an exception
   document.getElementById("mediaDetailsArea").style.display="block";
   document.getElementById("mediaDetailsTab").className="tabSelected";
   
   try
   {
      document.getElementById("mediaCommentsArea").style.display="none";
      document.getElementById("commentsTab").className="tabUnselected";
   }
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("shareThisMediaArea").style.display="none";
      document.getElementById("shareThisMediaTab").className="tabUnselected";
   } 
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("emailArea").style.display="none";
      document.getElementById("emailTab").className="tabUnselected";
   }
   catch(e)
   {
   }
   
   try 
   {
       document.getElementById("attachmentsArea").style.display="none";
       document.getElementById("attachmentsTab").className="tabUnselected";
   }
   catch(e)
   {
   } 
}
         
function onClickShare()
{
   //Because of how tabs are hidden and shown, the only one that we
   //know will exist is the media details tab.  Everything else might
   //not exist, so they're in a try/catch to not throw an exception
   document.getElementById("mediaDetailsArea").style.display="none";
   document.getElementById("mediaDetailsTab").className="tabUnselected";
   
   try
   {
      document.getElementById("mediaCommentsArea").style.display="none";
      document.getElementById("commentsTab").className="tabUnselected";
   }
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("shareThisMediaArea").style.display="block";
      document.getElementById("shareThisMediaTab").className="tabSelected";
   }
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("emailArea").style.display="none";
      document.getElementById("emailTab").className="tabUnselected";
   }
   catch(e)
   {
   }
            
   try
   {
       document.getElementById("attachmentsArea").style.display="none";
       document.getElementById("attachmentsTab").className="tabUnselected";
   }
   catch(e)
   {
   }
}
         
function onClickEmail()
{
   //Because of how tabs are hidden and shown, the only one that we
   //know will exist is the media details tab.  Everything else might
   //not exist, so they're in a try/catch to not throw an exception
   document.getElementById("mediaDetailsArea").style.display="none";
   document.getElementById("mediaDetailsTab").className="tabUnselected";
   
   try
   {
      document.getElementById("mediaCommentsArea").style.display="none";
      document.getElementById("commentsTab").className="tabUnselected";
   }
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("shareThisMediaArea").style.display="none";
      document.getElementById("shareThisMediaTab").className="tabUnselected";
   }
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("emailArea").style.display="block";           
      document.getElementById("emailTab").className="tabSelected";
   }
   catch(e)
   {
   }
           
   try
   {
      document.getElementById("attachmentsTab").className="tabUnselected";
      document.getElementById("attachmentsArea").style.display="none";
   }
   catch(e)
   {
   }
}
         
function onClickAttachments()
{
   //Because of how tabs are hidden and shown, the only one that we
   //know will exist is the media details tab.  Everything else might
   //not exist, so they're in a try/catch to not throw an exception
   document.getElementById("attachmentsWaiting").style.display="none";
   document.getElementById("mediaDetailsArea").style.display="none";
   document.getElementById("mediaDetailsTab").className="tabUnselected";
   
   try
   {
      document.getElementById("mediaCommentsArea").style.display="none";
      document.getElementById("commentsTab").className="tabUnselected";
   }
   catch(e)
   {
   }
         
   try
   {
      document.getElementById("shareThisMediaTab").className="tabUnselected";
      document.getElementById("shareThisMediaArea").style.display="none";
   }
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("emailTab").className="tabUnselected";  
      document.getElementById("emailArea").style.display="none";
   }
   catch(e)
   {
   }
   
   try
   {
      document.getElementById("attachmentsArea").style.display="block";
      document.getElementById("attachmentsTab").className="tabSelected";
   }
   catch(e)
   {
   }
}

function viewSetup()
{
   try
   {
      document.getElementById('attachmentsWaiting').style.display = 'none';
   }
   catch(e)
   {
   }
}

function showCommentOptions()
{
   document.getElementById("commentOptionsPopup").style.display = "block";
   document.getElementById("commentOptionsLabel").className = "commentOptionsSelected";
}

function hideCommentOptions()
{
   document.getElementById("commentOptionsPopup").style.display = "none";
   document.getElementById("commentOptionsLabel").className = "";
} 