function previewWindow(itemID, projectID, strWidth, strHeight, strType, strImageType, strImageName)
{
  intWidth = parseInt(strWidth);
  intHeight = parseInt(strHeight);

  var leftPosition = screen.width - intWidth;
  var topPosition = screen.height - intHeight;

  leftPosition = (leftPosition < 0) ? 0 : leftPosition/2;
  topPosition  = (topPosition < 0)  ? 0 : topPosition /2;

  window.open ("/preview/"+itemID+"/"+projectID+"/"+intWidth+"/"+intHeight+"/"+strType+"/"+strImageType+"/"+strImageName+"", "", "scrollbars=no,width="+intWidth+", height="+intHeight+", top="+topPosition+",left="+leftPosition+"");
}

function showWindow(__path, __width, __height, __title)
{
  intWidth = parseInt(__width);
  intHeight = parseInt(__height);
  window.open ("/show/"+__path+"/"+intWidth+"/"+intHeight+"/"+__title, "", "scrollbars=no,width="+intWidth+",height="+intHeight+"");
}

function popup_scroll(url, width, height, name)
{
  window.open(url, name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,resizable=1,location=0,scrollbars=1,copyhistory=0");
  return false;
}

function disableHtmlObject(formName, htmlObj)
{
  thisForm = document.forms[formName];
  thisForm.elements[htmlObj].disabled = (thisForm.elements[htmlObj].disabled) ? 0 : 1;
}