var LargeActive = null;
var LargePassive = null;
var UpActive = null;
var UpPassive = null;
var TextActive = null;
var TextPassive = null;

function showHint(HId) 
	{
	LargePassive = document.getElementById('info-lay-' + HId);
	UpPassive = document.getElementById('up-' + HId);
		if(LargePassive != LargeActive) 
		{
		if(LargeActive) 
			{
			LargeActive.style.display = 'none';
			UpActive.className = 'up-1';
		//	LargePassive = LargeActive;	
			}
		if(LargePassive) 
			{
			LargePassive.style.display = 'block';
			UpPassive.className = 'up-2';
			LargeActive = LargePassive;
			UpActive = UpPassive;
			}
		}
}

function showText(HId) 
	{
	TextPassive = document.getElementById('text-' + HId);
		if(TextPassive != TextActive) 
		{
		if(TextActive) 
			{
			TextActive.style.display = 'none';
			}
		if(TextPassive) 
			{
			TextPassive.style.display = 'block';
			TextActive = TextPassive;
			}
		}
}

function closeHint(HId) 
	{
	//LargeActive = document.getElementById('info-lay-' + HId);
	TextActive.style.display = 'none';
	TextActive = null;
	}
	
	
	
	
function init() {
	AdCookie = getCookie("progimp-links-close");
	if (AdCookie == "yes") close_ad();
//	if (self.parent && !(self.parent === self)) self.parent.location = document.location;
	document.onkeydown = register;
}

function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}

function register(e) {
	var event = e || window.event; 
	if($('prev_page')) {
		if(event.ctrlKey == true && event.keyCode == 37) {
			window.location =  $('prev_page').href;
		};
	}
	if($('next_page')) {
		if(event.ctrlKey == true && event.keyCode == 39) {
			window.location =  $('next_page').href;
		};
	}
}

function ad_cookie() {
    var d = new Date();
    d.setDate(d.getDate()+1000);
    var str = "progimp-links-close=yes; path=/; expires="+d.toUTCString();
    document.cookie = str;
	close_ad();
    return false;
}

function close_ad() {
	var Links = document.getElementById("sp");
	if (Links) Links.style.display = "none";
	Links = null;
}
