//---------- Get Dinamic Submenu----------
var linkset=new Array()
	jQuery(document).ready(function($){
		$.ajax({
			url: "http://www.oktal.ro/comp/servere/submenu.php?action=left&site=1", //path to external menu file
			async: true,
			success:function(content){
				var xml = content;
	            if (xml) {
	              var raspuns = xml.getElementsByTagName("raspuns");
	              var nrc_subm = 0;
	              var nr_subm, link, nlink;

	              for(i=0; i<raspuns.length; i++){
	                nr_subm = raspuns[i].attributes.getNamedItem("nr_subm").value;
	                link =  decodeURIComponent(raspuns[i].attributes.getNamedItem("url").value);
	                nlink = decodeURIComponent(raspuns[i].attributes.getNamedItem("nlink").value);
	                if (nrc_subm!=nr_subm){
	                  linkset[nr_subm] = "<a href=\"" + link + "\">&bull; " + nlink +"</a>";
	                  nrc_subm = nr_subm;
	                } else
	                  linkset[nr_subm] += "<a href=\"" + link + "\">&bull; " + nlink +"</a>";
	              }
				}
			}
		});
	});
//-------End Get Dinamic Submenu----

//-------Show Submenu---------------
////No need to edit beyond here
var defaultMenuWidth="200px" //set default menu width.
var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')
function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body}

  function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1)
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }


function showmenu(objgen, e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
//menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")

menuobj=document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
//aici gasim pozitia mouse - dar vreau pozitia div-ului ca sa pun meniul
//alert ("x=" + findPosX(objgen) + " - y=" + findPosY(objgen));
//eventX=ie5? event.clientX : e.clientX
//eventY=ie5? event.clientY : e.clientY
eventX = findPosX(objgen)+163;
eventY = findPosY(objgen);

//alert (findPosY(objgen));
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
/*
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
*/
//position the horizontal position of the menu where the mouse was clicked
//menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
menuobj.style.left=eventX+"px"
//same concept with the vertical position
/*
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
*/
//menuobj.style.top=ie5? iecompattest().scrollTop+eventY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.top=eventY+"px"
menuobj.style.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",2000)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu
//---------End Show submenu------------------

//---------- Log TRAFIC-------------
function pr2(){
//----------- Variabile Globale ----------------
var host_traf = "oktal.ro";
var nav = navigator;
var url_full = location.href;
var url_protocol = location.protocol;
var url_host = location.host;
var url_path = location.pathname;

var app_name = nav.appName;
var app_codn = nav.appCodeName;
var app_ver_minor = nav.appMinorVersion;
var app_ver =nav.appVersion;
var app_cookie_enabled = nav.cookieEnabled;
var app_cpu = nav.cpuClass;
var app_online = nav.onLine;
var app_platf = nav.platform;
var app_UA = nav.userAgent;
var app_BL = nav.browserLanguage;
var app_SL = nav.systemLanguage;
var app_UL = nav.userLanguage;

var screen_width = 'na';
var screen_height = 'na';
var srb = 'na';

if (self.screen) {     // for NN4 and IE4
        screen_width = screen.width
        screen_height = screen.height
} else if (self.java) {   // for NN3 with enabled Java
       var jkit = java.awt.Toolkit.getDefaultToolkit();
       var scrsize = jkit.getScreenSize();
       screen_width = scrsize.width;
       screen_height = scrsize.height;
} else
  screen_width = screen_height = 'na'; // N2, E3, N3 w/Java off, probably Opera and WebTV

app_name != "Netscape" ? srb=screen.colorDepth : srb=screen.pixelDepth;
//------------- End variabile Globale ----------
  document.write("<img src=\"http://www.oktal.ro/logt1.php?",
        "protocol=" + escape(url_protocol),
        "&host=" + escape(host_traf),
        "&page=" + escape(url_path),
        "&refer=" + escape(document.referrer),
        "&ua=" + escape(app_UA),
        "&lang=" + escape(app_SL),
        "&srw=" + screen_width,
        "&srh=" + screen_height,
        "&srb=" + srb,
        "\" height='1' width='1'>");
}
//---------- End log TRAFIC---------


  

