﻿// JScript File
/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

var timer_id;
function scroll_iframe(frm,inc,dir) {
  if (timer_id) clearTimeout(timer_id);
  if (window.frames[frm]) {
    if (dir == "v") window.frames[frm].scrollBy(0, inc);
    else window.frames[frm].scrollBy(inc, 0);
    timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" + dir + "')", 20);
  }
}

function stopScroll() { if (timer_id) clearTimeout(timer_id); }

//==========================================================================

if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}

function detectBrowser(){
 var browser=navigator.appName;
 var b_version=navigator.appVersion;
 var version=parseFloat(b_version);
 if ((browser=="Netscape"||browser=="Microsoft Internet Explorer") && (version>=4)){
  alert("Your browser is good enough!");
 }
 else
 {
  alert("It's time to upgrade your browser!");
 }
}
function resizeText(multiplier) {   
  if (document.body.style.fontSize == "")
  {   
    document.body.style.fontSize = "1.0em";   
  }   
  document.body.style.fontSize = parseFloat(document.body.style.fontSize) + (multiplier * 0.2) + "em";   
}
//var c = document.getElementById("content"); function resizeText(multiplier) { if (c.style.fontSize == "") { c.style.fontSize = "1.0em"; } c.style.fontSize = parseFloat(c.style.fontSize) + (multiplier * 0.2) + "em"; } 
function Zoom(container, pct)
{
  var c = document.getElementById("content");
  //var c = document.body;
  //var c = container;
  var browser = navigator.appName;
  if (browser == "Microsoft Internet Explorer")
  {
    c = container;
  }
   if (pct == 0)
   {
     c.style.fontSize = "1.0em";
     //document.body.style.fontSize = "1.0em";
     return;
   }
   var currFontSize = c.style.fontSize;
   //var currFontSize = document.body.style.fontSize;
//alert("currFontSize = " + currFontSize);
   if (currFontSize == "") currFontSize = "1.0em";
//alert("currFontSize = " + currFontSize);
   currFontSize = currFontSize.substring(0, currFontSize.length - 2);
   currFontSize = parseFloat(currFontSize, 10);
//alert("currFontSize = " + currFontSize);
   var newFontSize = currFontSize + pct/100;

   if (newFontSize > 100 || newFontSize < 0.1) return;

   c.style.fontSize = newFontSize + "em";
//alert("c.style.fontSize = " + c.style.fontSize);
   //document.body.style.fontSize = newFontSize + "em";
  //} else /*if (browser=="Netscape")*/ {
  //  alert("ZOOM supported only for Microsoft Intenet Explorer");
  //alert(document.body.style.zoom);
  //document.body.style.zoom = 1.5;
  //alert(document.body.style.zoom);
//   var zoom = 1.0 + pct / 100.0;
//   
//   alert(navigator.mCurrentBrowser);
//   var docViewer = navigator.mCurrentBrowser.markupDocumentViewer;
//docViewer.fullZoom = zoom;
   
//   alert(container);
//   var iframe = document.getElementById("main_window");
//   alert(iframe);
////   alert(iframe.docShell);
////   var contViewer = iframe.docShell.contentViewer;
////   alert(contViewer);
////   var docViewer = contViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
////   docViewer.fullZoom = zoom;
//   alert(iframe.style.fullZoom);
//   var currZoom = iframe.style.zoom;
//   if (currZoom == "") currZoom = "100%";
//   currZoom = currZoom.substring(0, currZoom.length - 1);
//   currZoom = parseInt(currZoom, 10);
//   var newZoom = currZoom + pct;

//   if (newZoom > 10000 || newZoom < 1) return;

//   iframe.style.zoom = newZoom + "%";
  //}
}
function ZoomZoom(container, pct)
{
//alert("AAA");
  var browser=navigator.appName;
  if (browser=="Microsoft Internet Explorer")
  {
   if (pct == 0)
   {
     container.style.zoom = "100%";
     //container.style.fontSize = "1.0em";
     return;
   }
   var currZoom = container.style.zoom;
   if (currZoom == "") currZoom = "100%";
   currZoom = currZoom.substring(0, currZoom.length - 1);
   currZoom = parseInt(currZoom, 10);
   var newZoom = currZoom + pct;

   if (newZoom > 10000 || newZoom < 1) return;

   container.style.zoom = newZoom + "%";
  } else /*if (browser=="Netscape")*/ {
    alert("ZOOM supported only for Microsoft Intenet Explorer");
  //alert(document.body.style.zoom);
  //document.body.style.zoom = 1.5;
  //alert(document.body.style.zoom);
//   var zoom = 1.0 + pct / 100.0;
//   
//   alert(navigator.mCurrentBrowser);
//   var docViewer = navigator.mCurrentBrowser.markupDocumentViewer;
//docViewer.fullZoom = zoom;
   
//   alert(container);
//   var iframe = document.getElementById("main_window");
//   alert(iframe);
////   alert(iframe.docShell);
////   var contViewer = iframe.docShell.contentViewer;
////   alert(contViewer);
////   var docViewer = contViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
////   docViewer.fullZoom = zoom;
//   alert(iframe.style.fullZoom);
//   var currZoom = iframe.style.zoom;
//   if (currZoom == "") currZoom = "100%";
//   currZoom = currZoom.substring(0, currZoom.length - 1);
//   currZoom = parseInt(currZoom, 10);
//   var newZoom = currZoom + pct;

//   if (newZoom > 10000 || newZoom < 1) return;

//   iframe.style.zoom = newZoom + "%";
  }
}



