
function fixcon() 
{var myHeight = 0;
 if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && (  document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
 if (myHeight>0) 
   document.getElementById('condiv').style.height=(myHeight-155)+"px";  
}

function LoadPage()
 {//back-ward compatibility, load sub page
  var name=document.URL;
  var base;
  var i,index;
  index=name.indexOf('?');
  if (index>0) name=name.substr(0,index);
  index=name.lastIndexOf('/');
  i=name.lastIndexOf('\\');
  if (i>index) index=i;
  if (index>0) 
   {base=name.substr(0,index+1);
    name=name.substr(index+1);
   }
  if ((name=="index.html")||(name.length==""))
   {//check for ?
    if (document.location.search!="")
     {//strip question mark
      txt=document.location.search.substring(1,document.location.search.length);
      //strip any trailing stuff
      for (i=0;i<txt.length;i++)
       if (txt[i]=='/')
        {txt=txt.substring(0,i);
         break;
        }
      if ((txt=='coco')||
          (txt=='scanit')||
          (txt=='introductionscanit')||
          (txt=='winviprojects')||
          (txt=='winvichanges')||
          (txt=='downloads')||
          (txt=='contact')||
          (txt=='services')||
          (txt=='links')||
          (txt=='aboutus')||
          (txt=='publications')||
          (txt=='engineering')||
          (txt=='software')||
          (txt=='onlinehelp'))
       {//reload a different page
        window.location.href=base+txt+".html";
        return;
       }
     }
   }
  //fix size
  fixcon();
 }

var scanitTable 
scanitTable = new Array(
"ScanIt is a program that facilitates extracting data from scientific graphs. You may import graphs in various image formats or simply by pasting an image (screenshot) from the clipboard. Scanit also provides the opportunity to crop an image. A zoom window will show you all details of the graph.",
"First you have to define the axis. This is simply done by specifying three points on the graph and entering the corresponding coordinates. You may also define the axis as logarithmic.",
"ScanIt also provides several filters to manipulate the bitmap. You may remove noise from an image, convert the image to black and white, invert it or apply an edge filter. All these functionalities may help to extract your data.",
"One of the many useful options of ScanIt is the automatic trace of curves. In some cases the algorithm does not follow the intended path. Undesired points can easily be removed; see green points. The data is displayed at the top of the graph. ScanIt allows you to adjust the data format. ",
"You also can pick data points manually. You can reorder data points and collect them in data sets. These data sets are stored with the image in a sid-file, when saving the document.  However, most convenient and useful is copying data to the clipboard and paste them in any other application."
)

function setscanit(index)
{var im=document.getElementById('scanitpreview_image');
 im.src="pics_scanit/scr"+index+".gif";
 var sitxt=document.getElementById('scanitpreviewtext');
 sitxt.innerHTML=scanitTable[index];
 sitxt=document.getElementById('scanitpreviewlinks');
 var s;
 if (index>0) 
  {s='<a class=\"indexTable\" href=\"javascript:setscanit('+(index-1)+')\"\>previous</a>';
   if (index<4) s+='|'; 
  }
 else s="";
 if (index<4) s+='<a class=\"indexTable\" href=\"javascript:setscanit('+(index+1)+')\"\>next</a>'
 sitxt.innerHTML=s;
}

function SetImageTable(select, ImTab)
{  if (ImTab == 1) 
     {tablen = scanitTable.length
      tabcaption = scanitTable[select]
      tabimage   = "pics_scanit/scr"+select+".gif"
     }
    else
     {alert("Internal error in the javascript")}
   if (select>=tablen) alert("Internal error: wrong selection")
   var content
   content= WriteFrameHeader("imageTable") 
   content+="<table width=420 style=\"margin-left: auto; margin-right: auto;\">\n"
   content+="<tr><td align=\"center\">\n"
   content+="<img src=\""+tabimage+"\" ALT=\"screenshot.\">\n"
   content+="</td></tr>\n"
   content+="<tr><td class=\"cap\">\n"
   content+=tabcaption
   txt = "<p align=\"center\">["
   if (select >0)
       {txt = txt + "<a class=\"indexTable\" href=\"javascript:top.SetImageTable("
        txt = txt + (select-1)+","+ImTab+")\">previous</a>"
       }
   if ((select >0) && (select < tablen-1))
      txt = txt + "|"
   if (select < tablen-1)
       {txt = txt + "<a href=\"javascript:top.SetImageTable("
        txt = txt +(select+1)+","+ImTab+")\">next</a>"
       }
   txt = txt + "]\n"
   content+=txt
   content+="</td></tr>\n"
   content+="</table>\n"
   content+="</BODY>\n"
   content+="</HTML>\n"

   var doc=frames["contentFrame"].document  
   doc.open("text/html","replace")
   doc.write(content)
   doc.close()
 }

function checkThisForm() {
  var error = 0;
  fields = new Array("email", "name");
  for(i=0;i<fields.length;i++) 
   if(document.forms['mlist'].elements[fields[i]].value == "") 
    error = 1;
  if(error == 1) alert("Enter your name and e-mail address before submitting this form.");
  else document.forms['mlist'].submit();
}

function checkFreeForm() {
  var error = 0;
  fields = new Array("email", "name");
  for(i=0;i<fields.length;i++) 
   if(document.forms['freereg'].elements[fields[i]].value == "") 
    error = 1;
  if(error == 1) alert("Enter your name and e-mail address before submitting this form.");
  else 
   {if(document.forms['freereg'].elements["type"].value == "") alert("You must select Academic, Personal or Other before submitting this form");
    else document.forms['freereg'].submit();
   }
}

function checkComForm() {
  var error = 0;
  fields = new Array("email", "name", "address1", "country");
  for(i=0;i<fields.length;i++) 
   if(document.forms['comreg'].elements[fields[i]].value == "") 
    error = 1;
  if(error == 1) alert("Not all required data has been entered; make sure to enter your name, e-mail, address and country before proceeding");
  else document.forms['comreg'].submit();
}

