﻿function fix(tl, n, el) {
    var sc = 'scroll'+tl, d = document, c = 'compatMode',
    b = d[c]&&d[c]=='CSS1Compat'? d.documentElement : d.body;
    n = n-0; if(typeof n!='number')return 0;
    if(/^(Top|Left)$/.test(tl))
    return b[sc]+n+'px';
    if(/^(Bottom|Right)$/.test(tl)&&typeof el=='object'){
    tl = tl=='Right'? 'Left' : 'Top', sc = 'scroll'+tl;
    var dim = 'client' + (tl=='Top'? 'Height' : 'Width');
    return b[sc]+b[dim]-el[dim]-n+'px';
}
    return 0;
}

function popup(url,w,h,s){var oW=window.open(url,'popup','width='+w+',height='+h+',directories=0,location=0,menubar=0,resizable=1,scrollbars='+s+',status=0,toolbar=0,marginleft=0,margintop=0,left=0,top=0');}

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 abreFlas(objStr,x,cmdName,frameNum) { //v4.0
  var obj=MM_findObj(objStr);
  if (obj && obj[1]) obj=obj[1];
  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
}

