
function div_hide(id) {
	document.getElementById(id).className = 'aural';
}


function div_show(id) {
	document.getElementById(id).className = 'nonaural';
}


/**
 *	FAQ szeru div elrejto/megjelenito.
 *	Kell hozza cssben aural es nonaural osztalyok. 
 *	@see	div_show
 *	@see	div_hide
 *	@author	Adam Maschek (maschek@aitia.ai)
 *	@date	2006-09-18 15:53:44
 */     
function div_toggle(id) {
	if (document.getElementById(id).className != 'nonaural') {
		div_show(id);
	}
	else {
		div_hide(id);
	}
}

var myrules = {

	'A' : function(el) {
		if (!el.onclick) {
			//ha meg nincs onclick esemeny rahuzva
			el.onclick = function() {
				var link = this.getAttribute('href');
				//ha nincs hrefje
				if (!link) return;
				//ha oldalon beluli link
				if (link.indexOf('#') == 0) return true;
				var inner_links = new Array(
					'visegradgroup.org',
					'visegradgroup.eu',
					'main.php',
					'download.php',
					'setlang.php',
					'openlink.php'
					);
				for (var i=0; i<inner_links.length; i++) {
					//ha belso link
					if (link.indexOf(inner_links[i]) != -1) {
						return;
					}
				}
				//ha kulso link, akkor uj ablakban nyiljon
				this.setAttribute('target', '_blank');
			}
		}
	},
		'A.gallery_link' : function(el) {
		el.onclick = function() {
			window.open(el.href, '', 'scrollbars=no,status=no,resizable=no,width=607,height=648');
			return false;
    }
    },
	'.poplink' : function(el) {
		var popid = el.getAttribute('rel');
		div_hide(popid);
		el.onclick = function() {
			div_toggle(this.getAttribute('rel'));

		}
	},
	
	'AREA' : function(el) {
		el.setAttribute('altx', el.alt);
		el.setAttribute('titlex', el.title);
		el.alt = '';
		el.title = '';
		el.onmouseover = function() {
			overlib(el.getAttribute('altx'));
		}
		el.onmouseout = function() {
			nd();
		}
	}
};

Behaviour.register(myrules);
