function right(e) {
  var msg = "Images and HTML source\ncopyright Comunick-8 (c) 2002";

  if (navigator.appName == 'Netscape' && e.which == 3) {
    alert(msg);
    return false;
  }
  else {
    if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
      alert(msg);
      return false;
    }
  }
  return true;
}

document.onmousedown = right;

maxImageNum = 5;
srcDir = parseInt((Math.random()*maxImageNum)+1);

function drawTable (srcNum) {
  document.writeln ('<a name="TOP"><p></a>');
  document.writeln ('<table align=center border=0 cellspacing=0 cellpadding=0 width=640 height=451>');
  document.writeln ('<tr>');
  document.writeln ('<td><a href="javascript:incTable(1)"><img name="r1c1" src="./Support/Intros/'+srcNum+'-r1c1.jpg" border=0 width=160 height=125></a></td>');
  document.writeln ('<td><img name="r1c2" src="./Support/Intros/'+srcNum+'-r1c2.jpg" border=0 width=320 height=125></td>');
  document.writeln ('<td><a href="javascript:incTable(1)"><img name="r1c3" src="./Support/Intros/'+srcNum+'-r1c3.jpg" border=0 width=160 height=125></a></td>');
  document.writeln ('</tr>');
  document.writeln ('<tr>');
  document.writeln ('<td><img name="r2c1" src="./Support/Intros/'+srcNum+'-r2c1.jpg" border=0 width=160 height=201></td>');
  document.writeln ('<td><img name="r2c2" src="./Support/Intros/'+srcNum+'-r2c2.jpg" border=0 width=320 height=201 usemap="#HOMELINK"></td>');
  document.writeln ('<td><img name="r2c3" src="./Support/Intros/'+srcNum+'-r2c3.jpg" border=0 width=160 height=201></td>');
  document.writeln ('</tr>');
  document.writeln ('<tr>');
  document.writeln ('<td><a href="javascript:incTable(1)"><img name="r3c1" src="./Support/Intros/'+srcNum+'-r3c1.jpg" border=0 width=160 height=125></a></td>');
  document.writeln ('<td><img name="r3c2" src="./Support/Intros/'+srcNum+'-r3c2.jpg" border=0 width=320 height=125></td>');
  document.writeln ('<td><a href="javascript:incTable(1)"><img name="r3c3" src="./Support/Intros/'+srcNum+'-r3c3.jpg" border=0 width=160 height=125></a></td>');
  document.writeln ('</tr>');
  document.writeln ('</table>');
  return true;
}

function incTable (direction) {
  srcDir += direction;
  if (srcDir > maxImageNum) srcDir = 1;
  if (srcDir < 1) srcDir = maxImageNum;

  if (navigator.appName == 'Microsoft Internet Explorer') {
    window.document.r1c1.src="./Support/Intros/"+srcDir+"-r1c1.jpg";
    window.document.r1c2.src="./Support/Intros/"+srcDir+"-r1c2.jpg";
    window.document.r1c3.src="./Support/Intros/"+srcDir+"-r1c3.jpg";
    window.document.r2c1.src="./Support/Intros/"+srcDir+"-r2c1.jpg";
    window.document.r2c2.src="./Support/Intros/"+srcDir+"-r2c2.jpg";
    window.document.r2c3.src="./Support/Intros/"+srcDir+"-r2c3.jpg";
    window.document.r3c1.src="./Support/Intros/"+srcDir+"-r3c1.jpg";
    window.document.r3c2.src="./Support/Intros/"+srcDir+"-r3c2.jpg";
    window.document.r3c3.src="./Support/Intros/"+srcDir+"-r3c3.jpg";
  }
  else {
    document.images["r1c1"].src="./Support/Intros/"+srcDir+"-r1c1.jpg";
    document.images["r1c2"].src="./Support/Intros/"+srcDir+"-r1c2.jpg";
    document.images["r1c3"].src="./Support/Intros/"+srcDir+"-r1c3.jpg";
    document.images["r2c1"].src="./Support/Intros/"+srcDir+"-r2c1.jpg";
    document.images["r2c2"].src="./Support/Intros/"+srcDir+"-r2c2.jpg";
    document.images["r2c3"].src="./Support/Intros/"+srcDir+"-r2c3.jpg";
    document.images["r3c1"].src="./Support/Intros/"+srcDir+"-r3c1.jpg";
    document.images["r3c2"].src="./Support/Intros/"+srcDir+"-r3c2.jpg";
    document.images["r3c3"].src="./Support/Intros/"+srcDir+"-r3c3.jpg";
  }
}

function showImages(project, filename, description, width, height, check) {

// Determine the basic information, project and filename must be supplied
  if (!description) description = '';
  if (width == 0 || !width) width = 640;
  if (height == 0 || !height) height = 480;
  if (!check) check = 0;
  iSource = 'Hires';

// Check to see if you can display a larger image, and if you can, set up the parameters
  if (check == 1 && screen.width >= 1024) {
    iSource = 'Hires2';
    width = Math.round(width*1.6);
    height = Math.round(height*1.6);
  }

// Check the size of the image against the available screen size
  maxImageWidth = screen.width-92;
  maxImageHeight = screen.height-138;

// If the image is too big, adjust it
  if (check == 1 && (width > maxImageWidth || height > maxImageHeight)) {
    ratio = (maxImageWidth/width < maxImageHeight/height) ? maxImageWidth/width : maxImageHeight/height;
    width = Math.round(width*ratio);
    height = Math.round(height*ratio);
  }

// Set up the call to the CGI file
//  cgiString = "http://cgi.www.unick.com/cgi-bin/www.unick.com/ShowImage.cgi?file="+filename+"&url=http://www.unick.com/comunick-8/Images/"+project+"&desc="+description+"&width="+width+"&isrc="+iSource;
  cgiString = "http://internet.unick.com/cgi-bin/ShowImage.cgi?file="+filename+"&url=http://internet.unick.com/comunick-8/Images/"+project+"&desc="+description+"&width="+width+"&isrc="+iSource;

// Set up the correct browser size
  width = width+80;
  height = height+80;

// Set up the browser parameters
  ctrlString = "scrollbars=yes,toolbar=no,location=no,status=no,directories=no,menubar=no,resizable=yes,width="+width+",height="+height+",color=#000000"

// Open the window
  window.open(cgiString, "_blank", ctrlString);
}

