function createDynamicTable() {

    var TABLE_WIDTH = 750;

    var wstr = "100%";
    var width = document.body.offsetWidth;
    if (width>TABLE_WIDTH)
	wstr = Math.round(TABLE_WIDTH*100/width) + "%";
    document.write("<TABLE WIDTH=\"" + wstr + "\" BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" ALIGN=\"center\">");
}

function LmOver(elem) {
   elem.style.backgroundColor = "#cddeed";
   elem.children.tags('A')[0].style.color = "#3366cc";
   elem.style.cursor = 'hand';
}

function LmOut(elem) {
   elem.style.backgroundColor = "";
   elem.children.tags('A')[0].style.color = "#3366cc";
}

function LmDown(elem) {
   elem.style.backgroundColor = "#9CB6D6";
   elem.children.tags('A')[0].style.color = "#3366cc";
   elem.style.cursor = 'hand';
}

function LmUp(path) {
   top.location.href = path;
}

function popupform(myform, windowname) {
   if (!window.focus) 
      return true;
   window.open('', windowname, 'height=550,width=750,scrollbars=yes,menubar=no,toolbar=no,resizable=yes,statusbar=yes');
   myform.target=windowname;
   return true;
}

function formHandler() {
   var URL = document.formlang.sellang.options[document.formlang.sellang.selectedIndex].value;
   window.location.href = URL;
}

// functions used by the viewlets to open in new window of correct size
function isViewletCompliant() 
{
  answer=true;
  version=Math.round(parseFloat(navigator.appVersion) * 1000);
  if (navigator.appName.substring(0,9) == "Microsoft")
  {
    if(version<4000) answer=false;
  }
  if (navigator.appName.substring(0,8) == "Netscape")
  {
    if ((navigator.appVersion.indexOf("Mac")> 0) && (version<5000))
      answer=false;
    else
    if (version<4060)
      answer=false;
  }

  plugins=navigator.plugins;
  if (answer==false && plugins!=null)
  {
    for(i=0;i!=plugins.length;i++)
    if((plugins[i].name.indexOf("Java Plug-in")>=0) && (plugins[i].name.indexOf("1.0")<0))
    answer=true;
  }
  return answer;
}

function openViewlet(htmlFile,htmlWidth,htmlHeight)
{
  str = 'resizable=0,toolbar=0,menubar=0,';
  str = str + 'scrollbars=0,status=0,location=0,directory=0,width=350,height=200';

  version=Math.round(parseFloat(navigator.appVersion) * 1000);

  if(navigator.appName.indexOf("Konqueror")!=-1) // konqueror
  {
    htmlWidth+=18;
    htmlHeight+=96;
  }

  if(navigator.appName.indexOf("Netscape")!=-1)
  {
    if(version>=5000)
    {
      if(navigator.appVersion.indexOf("Mac")!=-1) // Netscape6+ on mac
      {
        htmlHeight+=5;
      }
    }
  }

  if(navigator.appName.indexOf("Microsoft")!=-1)
  {
    if(navigator.appVersion.indexOf("Mac")!=-1) // IE on Mac
    {
       htmlWidth  -= 11;
       htmlHeight -= 11;
    }
  }

    if(!isViewletCompliant())
    {
      open("http://www.qarbon.com/warning/index.html",'Leelou',str);
    }
    else
    {
      window.open(htmlFile,'Leelou','width='+htmlWidth+',height='+htmlHeight+',top=10,left=20');
    }

}

