// JavaScript Document
// Script pentru iframe



var mpr = 'Vezi detalii';
var mcpr = 'Inchide detalii';
var psize = '320';
var state = '';
var recluster = '';


var args = new Object();
var query = location.search.substring(1);
var pairs = query.split(/[&]/);

for(var i = 0; i < pairs.length; i++) {
  var pos = pairs[i].indexOf('=');
  if (pos == -1) continue;
  var argname = pairs[i].substring(0,pos);
  var value = pairs[i].substring(pos+1);
  args[argname] = unescape(value);
}

var sources = new Object();
var tip = null;
var tip_shadow = null;
var tip_shown = 0;
var doc_elt = null;
if (document.documentElement) doc_elt = document.documentElement;
else if (document.body) doc_elt = document.body;

if (doc_elt) {
    doc_elt.onclick = function () { return showTip(); }
}

function showTip(e, id) {
   var mx, my;

   if (!e) e = window.event;

   if (tip_shown == 1 && !id) {
       tip_shown = 0;
       return;
   }

   if (tip) tip.style.visibility = 'hidden';
   if (tip_shadow) tip_shadow.style.visibility = 'hidden';

   if (! id) {
        return;
   }

   tip_shown = 1;

   if (e.clientX) {
       mx = e.clientX;
       my = e.clientY;
   } else if (e.pageX) {
       mx = e.pageX;
       my = e.pageY;
   } else {
       return;
   } 

   if (mx + 210 > doc_elt.offsetWidth) mx = doc_elt.offsetWidth - 210;
   if (my + 50 >  doc_elt.offsetHeight) my = my - 150;

   if (document.documentElement && 
       document.documentElement.scrollTop)
   {
       menx = document.documentElement.scrollLeft + mx;
       meny = document.documentElement.scrollTop + my;
   } else if (document.body) {
       menx = document.body.scrollLeft + mx;
       meny = document.body.scrollTop + my;
   } else {
       menx = window.pageXOffset + mx;
       meny = window.pageYOffset + my;
   }

   var node = document.getElementById(id);
   var shadow = document.getElementById(id + "_shadow");
   if (! node) {
        alert("No node with id " + id);
   } else {
        node.style.left = menx + 'px';
        node.style.top = meny + 'px';
        node.style.visibility = 'visible';
        tip = node;

        if (shadow) {
          shadow.style.left = (menx + 5) + 'px';
          shadow.style.top = (meny + 6) + 'px';
          shadow.style.visibility = 'visible';
          tip_shadow = shadow;
        }
   }  

   return false;
};
function pv(url, id) {
  if(document.all || document.getElementById) {
    document.write('<a class="anlist1" href="'+url+'" id="lk'+id+'" onClick="pview(this);return false">'+mpr+'</a>');
  }
}

function pview(link) {

  var ie4 = (document.all && !document.getElementById) ? true : false;

  if (ie4 == 1) {
    var iframe = document.all['if'+link.id];
  }
  else {
    var iframe = document.getElementById('if'+link.id);
  }

  if(link.innerHTML == mpr) {
    if(iframe) {
      // should never happen
      iframe.src = link.href;
      iframe.style.height = psize;
      iframe.style.visibility = 'visible';
    } else {
      // generate an inline frame containing the link
      myBR = document.createElement('br');
      myBR.setAttribute('id','br'+link.id);
      link.parentNode.appendChild(myBR);
      myIframe = document.createElement('iframe');
      //myIframe.setAttribute('security','restricted');
      myIframe.setAttribute('id','if'+link.id);
      myIframe.setAttribute('width','100%');
      myIframe.setAttribute('height',psize);
      myIframe.setAttribute('src',link.href);
      link.parentNode.appendChild(myIframe);
    }
    //link.innerText = mcpr;
    link.innerHTML = mcpr;
  } else if(iframe) {
    if (ie4 == 1) {
      myBR = document.all['br'+link.id];
    } else {
      myBR = document.getElementById('br'+link.id);
    }
    link.innerHTML = mpr;
    link.parentNode.removeChild(iframe);
    link.parentNode.removeChild(myBR);
  }
}

function setts(link) {
  var tf = parent.frames['tree'];
  if (! tf) return;
  var state = tf.state;
  var recluster = tf.recluster;
  var addparams = "?";
  if (state) addparams += "v:state=" + state + "&";
  if (recluster) addparams += "v:recluster=" + recluster + "&";
  link.search = addparams + link.search.substr(1);
}

function deschide(url){
var winfeatures="width=570,height=600,scrollbars=1,resizable=0,toolbar=0,location=0,menubar=0,status=0,directories=0";
window.open(url,"",winfeatures)
}
function deschide_mic(url){
var winfeatures="width=570,height=600,scrollbars=1,resizable=0,toolbar=0,location=0,menubar=0,status=0,directories=0";
window.open(url,"",winfeatures)
}

-->