
sniffer();

if ( is_ie4up ) {
   document.onmousemove = getMouseXY;
   div_name = false;
}



function getMouseXY(e) {
   if ( is_ie4up ) {
   	if (div_name != false) {
   		tempX = event.clientX;
   		tempY = event.clientY;
   		if ( (tempX + div_name.clientWidth + 5) > document.body.clientWidth ) {
   		   tempX -= (div_name.clientWidth + 10);
   		} else {
            tempX += 10;
   		}
   		if ( (tempY + div_name.clientHeight + 5) > document.body.clientHeight ) {
   		   tempY -= (div_name.clientHeight + 10);
   		} else {
            tempY += 10;
   		}
   		tempX += document.body.scrollLeft;
   		tempY += document.body.scrollTop;
   	   div_name.style.pixelLeft = tempX;
   	   div_name.style.pixelTop = tempY;
      }
	}
}



function show_div(helpinfo) {
   if ( is_ie4up ) {
  	   div_name = document.all(helpinfo);
      getMouseXY();
     	div_name.style.visibility = 'visible';
   }
}



function hide_div() {
   if ( is_ie4up ) {
     	if (div_name != false) {
         div_name.style.visibility = 'hidden';
      }
      div_name = false;
   }
}



function update_div(div_mark, doc)
{
   if ( is_ie4up ) {
     	document.all(div_mark).innerHTML = doc;    	
   }
}



function frameBooker_hp(url,t) // установка закладки
{
	var is_4up  = parseInt(navigator.appVersion);
	var is_mac  = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
	var is_ie   = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
	var thePage = location.href;
	if (thePage.lastIndexOf('#')!=-1)
		thePage = thePage.substring(0,thePage.lastIndexOf('#'));
	if (is_ie && is_4up && !is_mac) 
		window.external.AddFavorite(url,t);
	else if (is_ie || document.images)
		booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60');
	window.focus();
	return true;
}



function sniffer() {
// *** BROWSER VERSION ***
   var agt = navigator.userAgent.toLowerCase();
   
   // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
   var is_major = parseInt(navigator.appVersion);
   var is_minor = parseFloat(navigator.appVersion);

   is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
   is_ie4up  = (is_ie && (is_major >= 4));
}


