﻿endtext="";
var v_restarea=6
var v_maxgesch=7
var v_endofgallerymsg=endtext;

var v_iedom=document.all||document.getElementById
var v_scrollgeschwind=0
var v_movestate=""

var v_actualheight=''
var v_cross_scroll
var v_loadedyes=0

function v_ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function v_creatediv(){
	vstatusdiv=document.createElement("div")
	vstatusdiv.setAttribute("id","vstatusdiv")
	document.body.appendChild(vstatusdiv)
	vstatusdiv=document.getElementById("vstatusdiv")
	vstatusdiv.innerHTML=v_endofgallerymsg
}

function v_positiondiv(){
	v_menuwidth=parseInt(vcrossmain.offsetWidth)
	v_mainobjoffsetW=v_getposOffset(vcrossmain, "left")
	vstatusdiv.style.left=v_mainobjoffsetW+(v_menuwidth/2)-(vstatusdiv.offsetWidth/2)+"px"
	vstatusdiv.style.top=v_menu_height+v_mainobjoffset+10+"px"
}

function v_showhidediv(what){
	if (v_endofgallerymsg!=""){
		vstatusdiv.style.visibility=what;
	}
}

function v_getposOffset(what, offsettype){
	var v_totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop;
	var v_parentEl=what.offsetParent;
	while (v_parentEl!=null){
		v_totaloffset=(offsettype=="left")? v_totaloffset+v_parentEl.offsetLeft : v_totaloffset+v_parentEl.offsetTop;
		v_parentEl=v_parentEl.offsetParent;
	}
	return v_totaloffset;
}


function v_moveup(){
	if (v_loadedyes){
		v_movestate="up"
		if (v_iedom&&parseInt(v_cross_scroll.style.top)>(v_menu_height-v_actualheight)){
			v_cross_scroll.style.top=parseInt(v_cross_scroll.style.top)-v_scrollgeschwind+"px"
			v_showhidediv("hidden")
		}
	else
		v_showhidediv("visible")
	}
	uptime=setTimeout("v_moveup()",10)
}

function v_movedown(){
	if (v_loadedyes){
		v_movestate="down"
		if (v_iedom&&parseInt(v_cross_scroll.style.top)<0){
			v_cross_scroll.style.top=parseInt(v_cross_scroll.style.top)+v_scrollgeschwind+"px"
			v_showhidediv("hidden")
		}
	else
		v_showhidediv("visible")
	}
	downtime=setTimeout("v_movedown()",10)
}

function v_motionengine(e){
	var v_dsocx=(window.pageXOffset)? pageXOffset: v_ietruebody().scrollLeft;
	var v_dsocy=(window.pageYOffset)? pageYOffset : v_ietruebody().scrollTop;
	var v_curposy=window.event? event.clientY : e.clientY? e.clientY: ""
	v_curposy-=v_mainobjoffset-v_dsocy
	var v_leftbound=(v_menu_height-v_restarea)/2
	var v_rightbound=(v_menu_height+v_restarea)/2
	if (v_curposy>v_rightbound){
		v_scrollgeschwind=(v_curposy-v_rightbound)/((v_menu_height-v_restarea)/2) * v_maxgesch
	if (window.downtime) clearTimeout(downtime)
		if (v_movestate!="up") v_moveup()
		}
		else if (v_curposy<v_leftbound){
			v_scrollgeschwind=(v_leftbound-v_curposy)/((v_menu_height-v_restarea)/2) * v_maxgesch
			if (window.uptime) clearTimeout(uptime)
			if (v_movestate!="down") v_movedown()
		}
	else
		v_scrollgeschwind=0
}

function v_contains_ns6(a, b) {
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
	return false;
}

function v_stopmotion(e){
	if ((window.event&&!vcrossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !v_contains_ns6(e.currentTarget, e.relatedTarget))){
	if (window.downtime) clearTimeout(downtime)
	if (window.uptime) clearTimeout(uptime)
		v_movestate=""
	}
}

function v_fillup(container, meintext){
endtext=meintext;
v_endofgallerymsg=endtext;
gal=document.getElementById(container).firstChild.id;
if (v_iedom){
vcrossmain=document.getElementById? document.getElementById(container) : document.all.vcontainer
v_menu_height=parseInt(vcrossmain.style.height)
v_mainobjoffset=v_getposOffset(vcrossmain, "top")
v_cross_scroll=document.getElementById? document.getElementById(gal) : document.all.vgallery
v_actualheight=v_cross_scroll.offsetHeight

vcrossmain.onmousemove=function(e){
v_motionengine(e)
}

// ---------------


vcrossmain.onmouseout=function(e){
v_stopmotion(e)
v_showhidediv("hidden")
}
}
if (window.opera){
v_cross_scroll.style.top=v_menu_height-v_actualheight+'px'
setTimeout('v_cross_scroll.style.top=0', 10)
}
v_loadedyes=1
if (v_endofgallerymsg!=""){
v_creatediv()
v_positiondiv()
}
}
window.onload=v_fillup