// Browser-specific detectors

var agt = navigator.userAgent.toLowerCase () ;
var is_major = parseInt (navigator.appVersion) ;
var is_minor = parseFloat (navigator.appVersion) 

var is_safari = (agt.indexOf ("safari") != -1) ;

var is_nav  = ((agt.indexOf ('mozilla') != -1) && (agt.indexOf ('spoofer') == -1) && (agt.indexOf ('compatible') == -1) && (agt.indexOf ('opera') == -1) && (agt.indexOf ('webtv') == -1) && (agt.indexOf ('hotjava') == -1) && (agt.indexOf ('safari') == -1)) ;

var is_nav2 = (is_nav && (is_major == 2)) ;
var is_nav3 = (is_nav && (is_major == 3)) ;
var is_nav4 = (is_nav && (is_major == 4)) ;
var is_nav4up = (is_nav && (is_major >= 4)) ;
var is_navonly = (is_nav && ((agt.indexOf (";nav") != -1) || (agt.indexOf ("; nav") != -1))) ;
var is_nav6 = (is_nav && (is_major == 5) && (agt.indexOf("netscape") != -1) && (agt.indexOf ("netscape/7") == -1));
var is_nav6up = ((is_nav && (is_major >= 5)) || (is_nav && (agt.indexOf ('netscape/7') != -1))) ;
var is_gecko = (agt.indexOf ('gecko') != -1) ;

var is_ie     = ((agt.indexOf ("msie") != -1) && (agt.indexOf ("opera") == -1) && (agt.indexOf ("safari") == -1)) ;
var is_ie3    = (is_ie && (is_major < 4)) ;
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf ("msie 4")!=-1) ) ;
var is_ie4up  = (is_ie && (is_major >= 4)) ;
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf ("msie 5.0") != -1) ) ;
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf ("msie 5.5") != -1)) ;
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4) ;
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5) ;
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf ("msie 6.") != -1)) ;
var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5 && !is_safari) ;
var is_ieMac = ((agt.indexOf ("msie") != -1) && (agt.indexOf ("mac_") != -1)) ;

var is_opera = (agt.indexOf ("opera") != -1) ;
var is_opera2 = (agt.indexOf ("opera 2") != -1 || agt.indexOf ("opera/2") != -1) ;
var is_opera3 = (agt.indexOf ("opera 3") != -1 || agt.indexOf("opera/3") != -1) ;
var is_opera4 = (agt.indexOf ("opera 4") != -1 || agt.indexOf("opera/4") != -1) ;
var is_opera5 = (agt.indexOf ("opera 5") != -1 || agt.indexOf("opera/5") != -1) ;
var is_opera6 = (agt.indexOf ("opera 6") != -1 || agt.indexOf("opera/6") != -1) ;
var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5) ;
var is_opera7 = ((agt.indexOf ("opera/7.") != -1) || (agt.indexOf ("opera 7.") != -1)) ;

// Custom handling for zakaz page
function getX (_obj) {
	var x = 0 ;
	while (_obj.tagName != "BODY") {
		if (typeof (arguments [1]) != 'undefined') {
			if (_obj.tagName != "DIV") {
				x += _obj.offsetLeft ;
			}
		}
		else {
			x += _obj.offsetLeft ;
		}
		_obj = _obj.parentNode ;
	}
	if (is_opera5up && !is_opera7 && typeof (arguments [1]) == 'undefined') {
		x = document.body.offsetWidth / 2 + 2 ;
	}
	else if (is_opera5up && typeof (arguments [1]) != 'undefined') {
		x = x + 17 ;
	}
	else if (is_opera7 && typeof (arguments [1]) != 'undefined') {
		x = x + 10 ;
	}
	return x ;
}
function getY (_obj) {
	var y = 0 ;
	var _id = _obj.id ;
	var obj = _obj ;
	while (_obj.tagName != "BODY") {
		if (_obj.tagName != "TR") y += _obj.offsetTop ;
		_obj = _obj.parentNode ;
	}
	if (is_ie) {
		return y - 9 ;
	}
	else if (is_opera7 && typeof (arguments [1]) == 'undefined') {
		return y - 15 ;
	}
	else if (is_opera7 && typeof (arguments [1]) != 'undefined') {
		return y ;
	}
	else if (is_opera5up) {
		var _div = document.getElementById ("mainDiv") ;
		if (typeof (_div) != 'undefined') {
			divy = _div.offsetTop
		}
		else {
			divy = 26 ;
		}
		var dy = document.images.logo_header.height ;
		if (typeof (arguments [1]) != 'undefined') {
			return y + dy + divy - 17 ;
		}
		else {
			return dy + divy ;
		}
	}
}

function WinOpen(url) {
   myWin=open(url);
}



// hot text due mouse courses over
function ShowDD(id){
        var menu = 'tex' + id;
        if(document.all(menu) != null){
                if(document.all(menu).style.display == 'none')
                {document.all(menu).style.display = '';}
                else{document.all(menu).style.display = 'none';}
        }
}

function out (n) {
   // WinOpen(lang+"_proj.htm")
	//eval ("document.images.i" + n).src = "images/spacer.gif" ;
	document.getElementById ("d" + n).style.display = "none" ;
	document.getElementById ("d" + n).style.pixelLeft = "-1000px" ;
	document.getElementById ("d" + n).style.pixelTop = "-1000px" ;
}

function over (n, c) {
   // WinOpen("ru_proj"+1+".htm")
    
    myWin= open("");
  
    // открыть документ для последующей печати
    myWin.document.open();

 // генерировать новый документ 
 // myWin.document.write("<html><head><title>On-the-fly");
 // myWin.document.write("</title></head><body>");
 // myWin.document.write("<center><font size=+3>");
 // myWin.document.write("This HTML-document has been created ");
 // myWin.document.write("with the help of JavaScript!");
 // myWin.document.write("</font></center>");
 // myWin.document.write("</body></html>");

  // закрыть документ - (но не окно!)
  //myWin.document.close();  


	_img = eval ("document.images.i" + n) ;
	//_img.src = "../images/arrow_st_" + c + ".gif" ;
    
	_div =document.getElementById ("d" + n) ;

/*        _div.style.pixelLeft = getX (_img, true) - 5;
        _div.style.pixelTop = getY (_img, true);
*/

/*	if (!is_opera5up || is_opera7) {
		_div.style.pixelLeft = getX (_img, true) - 100 ; //7
		_div.style.pixelTop = getY (_img, true) + 7 ;
	}
	else {
		if (n != '00') {
			_div.style.pixelLeft = getX (_img, true) - 5 ; //5
			_div.style.pixelTop = getY (_img, true) - 18 ;
		}
		else {
			_div.style.pixelLeft = getX (_img, true) - 7 ; //7
			_div.style.pixelTop = getY (_img, true) - 50 ;
		}
	}
*/	
// first and dirty hack	
//	_div.style.pixelLeft = _div.style.pixelLeft - 26;
//	_div.style.pixelTop = _div.style.pixelTop + 170;
	
	_div.style.display = "block" ;
	//myWin.document.write(_div.);
}





