

var ddshown = null;
function f_ShowDropdownMenu(oMenuCellElem, sMenuId)
{
  var ddMenu = document.getElementById(sMenuId);
  var ddMenuContainer = ddMenu.parentNode;
  if (ddMenuContainer == ddshown)
    return;
    
  if (ddshown != null)
  {
    f_HideDropdownMenu();
  }
  var menuCellPosition = f_GetAbsolutePosition(oMenuCellElem);
  with (ddMenuContainer)
  {
    style.left = menuCellPosition.left - 2;
    style.top = menuCellPosition.top + oMenuCellElem.offsetHeight - 5;
    style.height = 5;
    style.display = "block";
    setTimeout(f_UnfoldMenu, 50);
  }
  ddshown = ddMenuContainer;
  
  function f_UnfoldMenu()
  {
    var nMenuHeight = ddMenuContainer.scrollHeight;
    var nCurMenuHeight = ddMenuContainer.offsetHeight;
    if (nCurMenuHeight < nMenuHeight - 1)
    {
      ddMenuContainer.style.height = nCurMenuHeight + (nMenuHeight - nCurMenuHeight) / 4;
      ddMenuContainer.scrollTop = nMenuHeight - nCurMenuHeight;
      setTimeout(f_UnfoldMenu, 50);
    }
    else
    {
      ddMenuContainer.style.height = nMenuHeight;
    }

  }
}
function f_OnMouseOutDropdownMenu(event)
{
  var toElement = event.relatedTarget || event.toElement;
  var oTopMenuElem = document.getElementById("TopMenu");
  if (!f_Contains(ddshown, toElement) && !f_Contains(oTopMenuElem, toElement))
  {
    setTimeout(f_HideDropdownMenu, 50);
  }
}
function f_HideDropdownMenu()
{
  if (ddshown != null)
  {
    with(ddshown)
    {
      style.display = "none";
    }
    ddshown = null;
  }
}

function f_GetAbsolutePosition(oElem)
{
   var oCurrentNode=oElem;
   var iLeft = 0;
   var iTop = 0;
   while(oCurrentNode.tagName != "BODY")
   {
      iLeft += oCurrentNode.offsetLeft;
      iTop += oCurrentNode.offsetTop;
      oCurrentNode = oCurrentNode.offsetParent;
   }
   return {left: iLeft, top: iTop};
}
function f_Contains(oContainerElem, oElem)
{
  var oCurElem = oElem;
  
  while (oCurElem != null && oCurElem.tagName != "BODY")
  {
    if (oCurElem == oContainerElem)
      return true;
      
    oCurElem = oCurElem.parentNode;
  }
  return false;
}

function f_NavigateTo(url)
{
  document.location = url;
}
function f_OnMouseOverNavLink(linkElem)
{
  if (linkElem.className == "aNavLinkCurrentPage")
    return true;
    
  linkElem.className = "aNavLinkHover";
}
function f_OnMouseOutNavLink(linkElem)
{
  if (linkElem.className == "aNavLinkCurrentPage")
    return true;
    
  linkElem.className = "aNavLink";
}


function writeSupportEmail()
{
document.write('<A class="email" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;' + '&#83;&#117;&#112;&#112;&#111;&#114;&#116;&#64;&#90;&#97;&#99;&#104;&#97;&#114;&#121;&#83;&#121;&#115;&#116;&#101;&#109;&#115;&#46;&#99;&#111;&#109;' + '">' + '&#83;&#117;&#112;&#112;&#111;&#114;&#116;&#64;&#90;&#97;&#99;&#104;&#97;&#114;&#121;&#83;&#121;&#115;&#116;&#101;&#109;&#115;&#46;&#99;&#111;&#109;' + '</a>')
}

function writeSalesEmail()
{
document.write('<A class="email" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;' + '&#83;&#97;&#108;&#101;&#115;&#64;&#90;&#97;&#99;&#104;&#97;&#114;&#121;&#83;&#121;&#115;&#116;&#101;&#109;&#115;&#46;&#99;&#111;&#109;' + '">' + '&#83;&#97;&#108;&#101;&#115;&#64;&#90;&#97;&#99;&#104;&#97;&#114;&#121;&#83;&#121;&#115;&#116;&#101;&#109;&#115;&#46;&#99;&#111;&#109;' + '</a>')
}

function writeInfoEmail()
{
document.write('<A class="email" href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;' + '&#73;&#110;&#102;&#111;&#64;&#90;&#97;&#99;&#104;&#97;&#114;&#121;&#83;&#121;&#115;&#116;&#101;&#109;&#115;&#46;&#99;&#111;&#109;'+ '">' + '&#73;&#110;&#102;&#111;&#64;&#90;&#97;&#99;&#104;&#97;&#114;&#121;&#83;&#121;&#115;&#116;&#101;&#109;&#115;&#46;&#99;&#111;&#109;' + '</a>')
}



var bannerImg = new Array();
  // Enter the names of the images below
  bannerImg[0]="images/quote_1.gif";
  bannerImg[1]="images/quote_2.gif";
  bannerImg[2]="images/quote_3.gif";
  bannerImg[2]="images/quote_4.gif";

var newBanner = 0;
var totalBan = bannerImg.length;

function cycleBan() {
  newBanner++;
  if (newBanner == totalBan) {
    newBanner = 0;
  }
  document.banner.src=bannerImg[newBanner];
  // set the time below for length of image display
  // i.e., "4*1000" is 4 seconds
  setTimeout("cycleBan()", 8*1000); 
}


function PopupPic(sPicURL) { 
     window.open( "PopScreen.htm?"+sPicURL, "",  
     "resizable=1,HEIGHT=300,WIDTH=300"); 
}
function PopupDemo(sDemoURL) { 
     window.open( sDemoURL, "",  'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1'); 
}
function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=400,left = 390,top = 150');");
}

function resizeFrame(myFrame)
{
   var ifrm = document.getElementById(myFrame);
  ifrm.style.height = "500px";
  ifrm.style.width = "760px";
}
    
    
          function resize_iframe(myFrame) {
            var myWidth = 0, myHeight = 0;
            if( typeof( window.innerWidth ) == 'number' ) {
                //Non-IE
                myWidth = window.innerWidth;
                myHeight = window.innerHeight;
            } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
            } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
            }
            
            var iNewHeight;
            iNewHeight = parseInt(myHeight)-40;
            if (myFrame != null)
                document.getElementById(myFrame).style.height = iNewHeight;     
        }

        //-- see if there is already something on the onresize
        var tempOnresize = window.onresize; 
        //-- create our event handler
        window.onresize = function(){ 
            //-- if tempFunc is a function, try to call it
            if (typeof (tempOnresize) == "function"){ 
                try{ 
                    tempOnresize(); 
                } catch(e){} //--- if it errors, don't let it crash our script
            } 
            resize_iframe();
        }
