<!--
var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0;

/* DEFINES Brovwser types */
//function DHTML_init() {

 if (window.opera) {
     OP = 1;
 }
 if(document.getElementById) {
   DHTML = 1;
   DOM = 1;
 }
 if(document.all && !OP) {
   DHTML = 1;
   MS = 1;
 }
if(document.layers && !OP) {
   DHTML = 1;
   NS = 1;
 }
//}


/*function setFormValue(val) {
//alert(gFormVal)
	gFormVal = val;
} */



function sendSearch(){

    gFormVal = document.thisform.searchexp.value
    if (gFormVal == "" || gFormVal.length <= 2)
    {
		alert(gMsgNoExp)
    } else {
		location.href= gPath + "main.php?db_id=" + gDbIdSearch + "&lang_id=" + gLang_id + "&searchexp=" + gFormVal
	}
}


function findPosX(obj){
	var curleft = 0;
	if (document.getElementById || document.all)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (document.layers) {
		curleft += obj.x;
    }
	    return curleft;
}


function findPosY(obj){
	var curtop = 0;
	if (document.getElementById || document.all)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (document.layers) {
		curtop += obj.y;

    }
	return curtop;
}


function setAcMainButton()  {
	
	if(gArrMainNavCol[gCurrMainId]) {
		
       obj = eval(document.getElementById("mna"+gCurrMainId));
	   obj.style.color = gArrMainNavCol[gCurrMainId];
	}
}

function AcButt(id) {
    
    id = getLayerId(id);
    //obj = eval(document.getElementById("mntd"+id));
    //obj.style.backgroundColor = gArrMainNavbgCol[id];
    sLayPos(id);
}


function IacButt(id) {

    id = getLayerId(id);
    //obj = eval(document.getElementById("mntd"+id));
    //obj.style.backgroundColor  = gMainNavColIac;
    hLayPos(id);
}


function IacButtSubNav(id) {

    id = getLayerId(id);
    obj = eval(document.getElementById("mntd"+id));
    obj.style.backgroundColor  = gMainNavColIac;
    //hLayPos(id);
}


function AcButtSubNav(id,pid) {
    
    id = getLayerId(id);
    obj = eval(document.getElementById("mntd"+id));
    //obj.style.backgroundColor = gArrMainNavbgCol[pid];
	obj.style.backgroundColor = gArrMainNavbgCol;
}



function IacSearch(id){

    obj = eval(document.getElementById(id));
    obj.style.backgroundColor  = "#c7c2c2";
}


function AcSearch(id){

    obj = eval(document.getElementById(id));
    obj.style.backgroundColor  = "#ffffff";
}


// Returns layer id whithout prefixes;
function getLayerId(id) {

     id = id.replace( "mntd","");
     id = id.replace( "mna","");
     id = id.replace( "subnav","");

     return id;
}

function AcImg(name) {

    document.images[name].src = gPathImgG + "butt_" + name + "_ac.gif";
}

function IacImg(name) {

    document.images[name].src = gPathImgG + "butt_" + name + "_iac.gif";
}

/* Hides and shows layer IE 4.x style */
function _ie4xLayer_change(id, status) {

    document.all[id].style.visibility = status;
}



/* Hides and shows layer DOM style */
function _domLayer_change(id, status) {
    
    document.getElementById(id).style.visibility = status;
}


function _NS4xLayer_change (id, status) {

   status == gLv ? status = "show" : status = "hide";
   document.layers[""+id].visibility = status;
}



function _layerVisiChange(id, status) {

        if (DOM && DHTML) {
            
            _domLayer_change(id, status);
        }

        else if (MS && DHTML) {
        
            _ie4xLayer_change(id, status)
        }

	    else if (NS && DHTML) {

			_NS4xLayer_change (id, status)
	    }
}


function hideLayer(id) {
	
	_layerVisiChange(id, gLh);
}


function showLayer(id) {
     
	_layerVisiChange(id, gLv);
}


function sLayPos(id) {
     
	 if (gUnlockMainNav)
	 {

     omain = eval(document.getElementById("mna" + id));
     o  = eval(document.getElementById("subnav" + id));
     o.style.left = findPosX(omain) -5;
     o.style.top = 150;

     showLayer("subnav" + id);
     gSubLayOldId != 0 ? hideLayer("subnav" + gSubLayOldId) : gSubLayOldId;
     gSubLayOldId = id;
	 }
}


function hLayPos(id) {

        gSubLayOldId = 0;
        hideLayer("subnav" + id);
}


function openPrint() {
   
   var url = gPath + "print.php?db_id=" + gDb_id + "&lang_id=" + gLang_id; 
   w = window.open(url,"Print","width=720,height=540,toolbar=no,scrollbars=yes,menubar=yes")
}


function openAgb() {
   
   var url = gPath + "agb.php"; 
   w = window.open(url,"AGB","width=720,height=540,toolbar=no,scrollbars=yes,menubar=yes")
}

function openRecommend() {

    xpos = ( screen.width / 2 ) - 150  
	ypos = ( screen.height / 2 ) - 125
    

	    w = window.open(gPath + "recommend.php?db_id=" + gDb_id + "&lang_id=" + gLang_id ,"recommend","width=360,height=400,left=" + xpos + ",top=" + ypos);

	w.focus();
}

function unLockMainNav () {

 gUnlockMainNav = true;

}






//-->