
function applyFilter(num) {
	var filter = "alpha(opacity=" + num + ")";
	document.body.style.filter = filter;
}


function openPopup(mylink, windowname)
{
if (!window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'top=' + ((window.screen.height - 600) / 2) + ',left=' + ((window.screen.width - 550) / 2) + ',width=550,height=520,scrollbars=yes');
return false;
}

function openCamera(mylink)
{
if (!window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, 'camera', 'top=' + ((window.screen.height - 500) / 2) + ',left=' + ((window.screen.width - 400) / 2) + ',width=400,height=360,scrollbars=no');
return false;
}

function centerWindow(w, h){
  var width = w;
  var height = h;
  window.resizeTo(width, height);
  var left = (window.screen.width - width) / 2;
  var top = (window.screen.height - height) / 2;
  window.moveTo(left, top);
  width = width + (screenLeft - left);
  height = height + (screenTop - top);
  window.resizeTo(width, height);
  left = (window.screen.width - width) / 2;
  top = (window.screen.height - height) / 2;
  window.moveTo(left, top);
  return false;
}

function toggleMenuTree(id){
  if (!document.getElementById) return;
  var menuchild=document.getElementById(id).style;
  var menuparent=document.getElementById('mnu'+id);
  if (menuchild.display=="none") { 
    menuchild.display="block";
    menuparent.src = menuparent.getAttribute('minus');
  }
  else {
    menuchild.display="none";
    menuparent.src = menuparent.getAttribute('plus');
  }
  return false;
}

function showElement(id){
  if (!document.getElementById) return;
  var element=document.getElementById(id).style;
  if (element.display=="none") element.display="block";
  return false;
}

function hideElement(id){
  if (!document.getElementById) return;
  var element=document.getElementById(id).style;
  if (element.display=="block") element.display="none";
  return false;
}

function nowUseeMe(thisOne){
     theImage=thisOne
	 thisOne.filters.alpha.opacity=50
     reveal=setInterval("incFilter(theImage)",10)
                                         
}

function incFilter(current){
     if (current.filters.alpha.opacity<100)
     current.filters.alpha.opacity+=5
else      clearInterval(reveal)
}
function nowUdont(thisOne){
     theImage=thisOne
	 thisOne.filters.alpha.opacity=100
     reveal=setInterval("decFilter(theImage)",10)
                                         
}
function decFilter(current){
     if (current.filters.alpha.opacity>50)
     current.filters.alpha.opacity-=5
else      clearInterval(reveal)
}