function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function GetCount() {
    var input = Array ('ks1','ks2','ks3');
    var sum = 0;

    sum = sum + (parseFloat(document.getElementById(input[0]).value)*260);
    sum = sum + (parseFloat(document.getElementById(input[1]).value)*260);
    sum = sum + (parseFloat(document.getElementById(input[2]).value)*260);

    document.getElementById('sum').value = sum;
}







var timer, i, menuId, menuId2;

var dom = document.getElementById ? true : false;
var ie4 = ((document.all) && (!dom)) ? true : false;
var ns4 = document.layers ? true : false;
var opera = navigator.userAgent.indexOf('Opera') != -1 ? true : false;
var dhtml = dom ? true : ie4 ? true : ns4 ? true : false;

if (dhtml) document.write ('<style type="text/css">#scriptSupport {display: none;} #menuHolder {position: relative; visibility: hidden; z-index: 10000;} #hiddenMenu1, #hiddenMenu2, #hiddenMenu3, #hiddenMenu4, #hiddenMenu5 {position: absolute; visibility: hidden;} #visibleMenu1 {position: absolute; left: 40px; top: 0px;} #visibleMenu2 {position: absolute; left: 40px; top: 33px;} #visibleMenu3 {position: absolute; left: 40px; top: 66px;} #visibleMenu4 {position: absolute; left: 40px; top: 99px;} #visibleMenu5 {position: absolute; left: 40px; top: 132px;} #visibleMenu6 {position: absolute; left: 40px; top: 165px;} #visibleMenu7 {position: absolute; left: 40px; top: 198px;} #visibleMenu8 {position: absolute; left: 40px; top: 231px;} #visibleMenu9 {position: absolute; left: 40px; top: 264px;} #hiddenMenu1 {left: 200px; top: 66px;} #hiddenMenu2 {left: 217px; top: 195px;} #hiddenMenu3 {left: 400px; top: 132px;} #hiddenMenu4 {left: 400px; top: 0px;} #hiddenMenu5 {left: 198px; top: 235px;}' + (ns4 ? ' #hiddenMenu1 {height: 48px;} #helpMenu1 {position: absolute; left: 400px; top: 0px;} #helpMenu2 {position: absolute; left: 400px; top: 33px;} #helpMenu3 {position: absolute; left: 400px; top: 66px;}' : '') + '</style>');

function setVisibility(element,newVisibility)
{
  if (dhtml)
  {
    if (dom) document.getElementById(element).style.visibility = newVisibility;
    else if (ie4) document.all[element].style.visibility = newVisibility;
    else if (ns4) eval('document.' + element + '.visibility = newVisibility');
  }
}

function menu()
{
  if (dhtml)
  {
    if (opera) for (i = 1; i <= 3; i++) document.getElementById('hiddenMenu' + i).style.top = 20;
    if (ie4) for (i = 1; i <= 3; i++) document.all['hiddenMenu' + i].style.top = 18;
    setVisibility('menuHolder','visible');
  }
}

function showMenu(id,id2)
{
  if (dhtml)
  {
    clearTimeout(timer);
    for (i = 1; i <= 5; i++) if ((i != id) && (i != id2)) setVisibility((ns4 ? 'menuHolder.document.' : '') + 'hiddenMenu' + i,'hidden');
    setVisibility((ns4 ? 'menuHolder.document.' : '') + 'hiddenMenu' + id,'visible');
    if (id2 != 0) setVisibility((ns4 ? 'menuHolder.document.' : '') + 'hiddenMenu' + id2,'visible');
  }
}

function hideMenu(id,id2)
{
  if (dhtml)
  { 
    if ((id >= 4) && (id2 == 0)) setVisibility((ns4 ? 'menuHolder.document.' : '') + 'hiddenMenu' + id,'hidden');
    else
    {
      menuId = (ns4 ? 'menuHolder.document.' : '') + 'hiddenMenu' + id;
      if (id2 != 0) 
      {
        menuId2 = (ns4 ? 'menuHolder.document.' : '') + 'hiddenMenu' + id2;
        timer = setTimeout("setVisibility(menuId,'hidden'); setVisibility(menuId2,'hidden')",(ns4 ? 150 : 50));
      }
      else timer = setTimeout("setVisibility(menuId,'hidden')",(ns4 ? 150 : 50));
    }
  }
}

function dontHideMenu()
{
  if (dhtml) clearTimeout(timer);
}


