/**
 * Глобальный JavaScript
 */

function CreateBookmarkLink() {
	title = document.title;
	url = document.location;
	if (window.sidebar) {
		// Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external && window.navigator.userAgent.indexOf ("MSIE") >= 0) {
		// IE Favorite
		window.external.AddFavorite( url, title);
	} else alert('Для добавления закладки нажмите Ctrl+D');
}


var mouseY = 0, mouseX = 0;
document.onmousemove = mouseMove;

function mouseMove(event){
	scrollX = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;
	scrollY = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;	
	if(window.event){		
		mouseX = window.event.clientX + scrollX;
		mouseY = window.event.clientY + scrollY;
	}else{
		mouseX = event.pageX + document.body.scrollLeft;
		mouseY = event.pageY + document.body.scrollTop;
	}
}


function showHint(text){
	var hinter = document.getElementById('hinter');
	hinter.innerHTML = text;
	if(window.innerWidth === undefined) {
		var width = 1280;
	} else {
		var width = window.innerWidth;
	}
	if(mouseX + 310 > width) {
		hinter.style.left    = (mouseX - 310) + 'px';
	} else {
		hinter.style.left    = (mouseX + 10) + 'px';
	}
	hinter.style.top     = mouseY + 'px';
	hinter.style.display = 'block';
}

function hideHint(){
	document.getElementById('hinter').style.display = 'none';
	//alert(window.screen.availWidth + ' ' + mouseX);
}

