﻿function loaded(myimg,mywidth,myheight){
var tmp_img = new Image();
tmp_img.src=myimg.src;
image_x=tmp_img.width;
image_y=tmp_img.height;
	if(image_x > mywidth){
	tmp_img.height=image_y * mywidth / image_x;
	tmp_img.width=mywidth;
		if(tmp_img.height>myheight){
			tmp_img.width=tmp_img.width * myheight / tmp_img.height;
			tmp_img.height=myheight;
			}
	}else if(image_y > myheight)
	{
	tmp_img.width=image_x * myheight / image_y;
	tmp_img.height=myheight;
		if(tmp_img.width>mywidth){
			tmp_img.height=tmp_img.height * mywidth / tmp_img.width;
			tmp_img.width=mywidth;
			}
	}
	myimg.width=tmp_img.width;
	myimg.height=tmp_img.height;
}


function w(vd)
{
  var ob=document.getElementById(vd);
  if(ob.style.display=="block" || ob.style.display=="")
  {
     ob.style.display="none";
     var ob2=document.getElementById('s'+vd);
     ob2.style.backgroundImage="url(images/ico080426_open.gif)";
  }
  else
  {
    ob.style.display="block";
    var ob2=document.getElementById('s'+vd);
    ob2.style.backgroundImage="url(images/ico080426_close.gif)";
  }
}
function k(vd)
{
  var ob=document.getElementById(vd);  
  if(ob.style.display=="block")
  {
     ob.style.display="none";
     var ob2=document.getElementById('s'+vd);
     ob2.style.backgroundImage="url(images/ico080426_open.gif)";
  }
  else
  {
    ob.style.display="block";
    var ob2=document.getElementById('s'+vd);
    ob2.style.backgroundImage="url(images/ico080426_close.gif)";
  }
}

 function SetCwinHeight(){
  var bobo=document.getElementById("bobo"); //iframe id
  if (document.getElementById){
   if (bobo && !window.opera){
    if (bobo.contentDocument && bobo.contentDocument.body.offsetHeight){
     bobo.height = bobo.contentDocument.body.offsetHeight;
    }else if(bobo.Document && bobo.Document.body.scrollHeight){
     bobo.height = bobo.Document.body.scrollHeight;
    }
   }
  }
 }

 function opencat(cat) {

     var obj = document.getElementById(cat);
     if (!obj) return;
     obj.style.display = (obj.style.display != "block") ? "block" : "none";
     return false;
 }

var visMnu = "";
var actMnu, url;

function flipMenu(actMnu)
{
   if (visMnu == "")
      showMenu(actMnu);
   else
   {
      if (visMnu == actMnu)
         showMenu(actMnu);
      else
      {
         hideMenu(visMnu);
         showMenu(actMnu);
      }
   }
}
function showMenu(actMnu)
{
   actMnu.style.display = "block";
   visMnu = actMnu;
}
function hideMenu(actMnu)
{
   actMnu.style.display = "none";
   visMnu = "";
}


