/*
  Travel maps mouseovers
*/

function MapArea(cx,cy,cr,txt,link) {
  var str;
  if (link=='')
    link = "#map";
  str="";
  str=str+'<area shape="circle" coords="'+cx+','+cy+','+cr+'" href="'+link+'" ';
  str=str+'onmouseover="showTooltip(\''+txt+'\');return false;" onmouseout="hideTooltip();" onmousemove="moveTooltip(event);"'
  str=str+'>';
  str=str+'   ';
  return str;
}




/*
  Image thumb/popup script
*/

function Thumb(tw,th,pw,ph,p,c) {
// NOT THE SAME Thumb AS IN APPLICATION.JS!
// same but 20% cells, thumbs in subdir /thumbs
  var str;
  str="";
  str=str+"<td width=20% class=TDPicsThumb align=center><center>";
  str=str+'<a href="javascript:ShowPicture(' +pw+ ',' +ph+ ',';
  str=str+"'" +p+ "','" +c+ "')";
  str=str+'" border="0">';
  str=str+'<img src="thumbs/tn_' +p+ '" width="' +tw+ '" height="' +th+ '" alt="' +c+ '" title="' +c+ '" class=IMGThumbNSel onmouseout="this.className=';
  str=str+"'IMGThumbNSel';";
  str=str+'" onmouseover="this.className=';
  str=str+"'IMGThumbSel';";
  str=str+'"></a></center></td>   ';
  return str;
}


function ShowPicture(w,h,p,c) {
  var breedte;
  var hoogte;
  var resizable;
  var scrollbars;
  resizable = "yes";
  scrollbars = "no";
  breedte=w;
  hoogte=h;
  if (document.layers)
    breedte+=18;
  if (c!=null)
    hoogte+=55;
  if (c!=null&&w<h)
    hoogte+=20;
  if (c.length>100&&w<500)
    hoogte+=20;
  if (c.length > 200)
    hoogte+=20;
  if (c.length > 300)
    hoogte+=20;
  if (c.length > 400)
    hoogte+=20;
  if (c.length > 500)
    hoogte+=20;
  // scrollbars?
  if (screen.availheight < hoogte) {
    hoogte = screen.availheight - 30;
    breedte+=20;
    if (screen.availwidth < breedte)
      breedte = screen.availwidth - 10;
    scrollbars = "yes";
  } else {
    if (screen.availwidth < breedte) {
      breedte = screen.availwidth - 10;
      hoogte+=20;
      if (screen.availheight < hoogte)
        hoogte = screen.availheight - 20;
      scrollbars = "yes";
    }
  }
  //
  if (typeof(win) == "undefined")
    win = window.open("","","directories=no,location=no,menubar=no,resizable="+resizable+",scrollbars="+scrollbars+",status=no,toolbar=no,height="+hoogte+",width="+breedte);
  else
  {
    if (win.closed)
      win = window.open("","","directories=no,location=no,menubar=no,resizable="+resizable+",scrollbars="+scrollbars+",status=no,toolbar=no,height="+hoogte+",width="+breedte);
    else
    {
      if (document.all)
        hoogte+=29;
      win.resizeTo(breedte,hoogte);
      win.document.clear();
    }
  }
  win.document.writeln('<HTML>');
  win.document.writeln('<HEAD>');
  win.document.writeln('<TITLE>Photo - click to close</TITLE>');
  win.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=">');
  win.document.writeln('<link rel="stylesheet" href="../popup_photo.css" type="text/css">');
  win.document.writeln('</HEAD>');
  win.document.writeln('<BODY bgcolor="#000000" text="#FFFFCC" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" leftmargin="0" topmargin="0">');
  win.document.writeln('<center><IMG SRC="'+p+'" WIDTH="'+w+'" HEIGHT="'+h+'" onclick="window.close()"></center>');
  if (c!=null)
  {
    win.document.writeln('<DIV class=DIVPicCaption>');
    win.document.writeln(c);
    win.document.writeln('</DIV>');
  }
  win.document.writeln('</BODY>');
  win.document.write('</HTML>');
  win.document.close();
  win.focus();
  // return false;
}



