function showimage(tab,n,wdt,hgt,type){ 
  window.open("showimg.php?table="+tab+"&id="+n+"&fld="+type,"img"+n,"width="+wdt+",height="+hgt);
}
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function moreInfo(id){
  window.open("moreInfo.php?id="+id,"img","width=600, height=500");
}
function addComment(id){
  window.open("addComment.php?id="+id, "commentWin", "width=600, height=400");
}
function print(i, id){
  window.open("print.php?i="+i+"&id="+id, "printWin", "width=1000, height=700");
}


function show_div(item){
  if(!item){
    return;
  }
  item.style.display = "";
}
function hide_div(item){
  if(!item){
    return;
  }
  item.style.display = "none";
}



function div_up( current_div, next_div ){

  current_div_id = document.getElementById( current_div );
  next_div_id    = document.getElementById( next_div );

  show_div( next_div_id );
  hide_div( current_div_id );

}
function div_down( current_div, prev_div ){

  current_div_id = document.getElementById( current_div );
  prev_div_id    = document.getElementById( prev_div );

  show_div( prev_div_id );
  hide_div( current_div_id );

}

function show_gallery(){

  i_content_id = document.getElementById( 'icon_content' );
  i_gallery_id = document.getElementById( 'icon_gallery' );

  i_content_id.style.display = "";
  i_gallery_id.style.display = "none";  

  // * * * * * * * * * * *

  content_id = document.getElementById( 'content_1' );
  gallery_id = document.getElementById( 'gallery_1' );

  content_id.style.display = "none";
  gallery_id.style.display = "";  

}


function show_content(){

  i_content_id = document.getElementById( 'icon_content' );
  i_gallery_id = document.getElementById( 'icon_gallery' );

  i_gallery_id.style.display = "";  
  i_content_id.style.display = "none";

  // * * * * * * * * * * * 

  content_id = document.getElementById( 'content_1' );
  content_id.style.display = "";

  for( i = 1; i <= 10; i++ ){
    gallery_id = document.getElementById( 'gallery_' + i );
    if( !gallery_id ){
      return;
    }
    gallery_id.style.display = "none";
  }  

}


function scroll_plus( page_qnty ){

  for( i = 1; i < page_qnty; i++ ){

    content_id = document.getElementById( 'content_' + i );

    if( content_id.style.display == "" ){

      content_id.style.display = "none";

      z = i + 1;
      content_id = document.getElementById( 'content_' + z );
      content_id.style.display = "";

      break;

    }

  }  

}


function scroll_minus( page_qnty ){

  for( i = page_qnty; i > 1; i = i - 1 ){

    content_id = document.getElementById( 'content_' + i );

    if( content_id.style.display == "" ){

      content_id.style.display = "none";

      z = i - 1;
      content_id = document.getElementById( 'content_' + z );
      content_id.style.display = "";

      break;

    }

  }  

}

