var $OBJ = function(Obj,Parent)
{
	return (Parent||document).getElementById(Obj);
}
var $TAG = function(Tag,Parent)
{
	Tag=Tag?Tag:'*';
	return ((document.getElementsByTagName('*').length == 0) && (Tag=='*'))?(Parent||document).all:(Parent||document).getElementsByTagName(Tag);
}
var $GLOBALS = {};
function ifrinit()
{
	if(!!window.QuickEdit === false) {
		window.QuickEdit = false;	
	}
	var a=$TAG('a');
	for(var i=0;i<a.length;i++){
		a[i].onmousedown = function()
		{
			this.onfocus = function()
			{
				this.blur();
			}
		}
		a[i].onmouseout = function()
		{
			this.onfocus = function(){}
		}
		a[i].onmousemove = a[i].onmouseout;
		if(a[i].className=='QE_Link' && !window.QuickEdit) {
			a[i].style.display = 'none';	
		}
	}
	$GLOBALS.galery = $TAG('a', $OBJ('galerie'));
	$GLOBALS.thumbs = $TAG('div', $OBJ('galerie'));
	$GLOBALS.length = $GLOBALS.galery.length;
	$GLOBALS.LENGTH = $GLOBALS.length;
	if($GLOBALS.galery.length > 7) {
		$TAG('a', $OBJ('galerie_right'))[0].onclick = function()
		{
			if($GLOBALS.length > 7) {
				$GLOBALS.thumbs[($GLOBALS.LENGTH - $GLOBALS.length + 1)].style.display = 'none';
				$GLOBALS.length--;
			}
		}
		$TAG('a', $OBJ('galerie_left'))[0].onclick = function()
		{
			if($GLOBALS.length < $GLOBALS.LENGTH) {
				$GLOBALS.thumbs[($GLOBALS.LENGTH - $GLOBALS.length)].style.display = 'block';
				$GLOBALS.length++;
			}
		}
	}
}
window.onload = ifrinit;
