function changePortfolioMain(idx, img, width, height, popupImg, popupWidth, popupHeight)
{
   var elem = document.getElementById('mainImg');

   if (elem)
   {
      elem.src = img;
      elem.width = width;
      elem.height = height;
      elem.onclick = function() { Popup.showSimple('<div style="text-align:center"><img src="' + popupImg + '" width="' + popupWidth + '" height="' + popupHeight + '" vspace="10" hspace="10" alt="" /></div>', 'Image', 'center', 'center', popupWidth, popupHeight); }
   } // if

   var arr = new Array(
      'Title',
      'Data',
      'CityState',
      'Summary'
   );

   for (var i = 0; i < arr.length; i++)
   {
      elem = document.getElementById('main' + arr[i]);

      if (elem)
      {
         var txt = document.getElementById('list' + arr[i] + idx).firstChild.nodeValue;
         Utils.removeChildren(elem);
         elem.appendChild(document.createTextNode(txt));
      } // if
   } // for
} // changePortfolioMain


function next_project(next)
{
   if ((next == undefined) ||
       (next == null))
   {
      next = true;
   } // if

   if (document.getElementById('curId'))
   {
      var cur = document.getElementById('curId').value;

      document.getElementById('project' + cur).style.display = 'none';

      if (next)
      {
         cur = parseInt(cur) + 1;

         if (!document.getElementById('project' + cur))
         {
            cur = 0;
         } // if
      } // if
      else
      {
         cur = parseInt(cur) - 1;

         if (cur < 0)
         {
            cur = 0;

            while (document.getElementById('project' + (cur + 1)))
            {
               cur++;
            } // while
         } // if
      } // else

      document.getElementById('project' + cur).style.display = 'block';
      document.getElementById('curId').value = cur;
   } // if
} // next_project


function prev_project()
{
   next_project(false);
} // prev_project
