/* JavaScript-Content created by hurra! (hurra.cc) - a CMS by futuresign.com /*

/* JavaScript-Content rendered by hurra! (hurra.cc) - SiteType aut_de_xhtml*/
//flashintegration
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';
  document.write(str);
}
//fusi extension Set_AC_FL_RunContent_GET(?get=xx); is to use, before calling AC_FL_RunContent
var AC_FL_RunContent_GET = '';
function Set_AC_FL_RunContent_GET(get){AC_FL_RunContent_GET = get;}
function AC_SW_GetSWFObjectForMoz(name)
{
	var embeds = document.getElementsByTagName("embed");
	for(var i = 0; i < embeds.length; i++)
	{
		if(embeds[i].name == name){return embeds[i];}
	}
	return false;
}
//end fusi extension
function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf"+AC_FL_RunContent_GET, "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    
    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
	  	ret.embedAttrs[args[i]] = args[i+1];//mozilla bug - cant catche the Element - have to use AC_SW_GetSWFObjectForMoz(name) if you need the Object
      case "id":
	  	ret.objAttrs[args[i]] = args[i+1];
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
//flashintegration end
//reitermenü
function FlagMenu(flagId, numberOfFlags, activeFlag)
{
	this.flagId = flagId;
	this.numberOfFlags = numberOfFlags;
	this.activeFlag = activeFlag;
	this.additionalLeft = 110;
	this.activateFlag = function(No)
	{
		document.getElementById(this.flagId+'Text'+this.activeFlag).className="inActive";
		var aFlag = document.getElementById(this.flagId+'ActiveFlag');
		var visibleChild = null;
		if(No == 1 && No == this.numberOfFlags){var visibleChild = 0;}
		else if(No > 1 && No == this.numberOfFlags){var visibleChild = 1;}
		else if(No == 1 && No < this.numberOfFlags){var visibleChild = 2;}
		else if(No > 1 && No < this.numberOfFlags){var visibleChild = 3;}
		for(var i = 0; i < aFlag.childNodes.length; i++)
		{
			if(i != visibleChild)
			{
				aFlag.childNodes[i].style.display='none';
			}
			else
			{
				aFlag.childNodes[i].style.display='block';
			}
		}
		aFlag.style.left = (No-1)*this.additionalLeft+'px';
		document.getElementById(this.flagId+'Text'+No).className="active";
		this.activeFlag = No;
	}
}
//reitermenü ende
//eventhanlder
function addEvent( obj, type, fn )
{
   if (obj.addEventListener) {
      obj.addEventListener( type, fn, false );
   } else if (obj.attachEvent) {
      obj["e"+type+fn] = fn;
      obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
      obj.attachEvent( "on"+type, obj[type+fn] );
   }
}
function removeEvent( obj, type, fn )
{
   if (obj.removeEventListener) {
      obj.removeEventListener( type, fn, false );
   } else if (obj.detachEvent) {
      obj.detachEvent( "on"+type, obj[type+fn] );
      obj[type+fn] = null;
      obj["e"+type+fn] = null;
   }
}
//eventhandler end
//Hilfsfunktionen
function get_child_by_classname(obj, name)
{
	for(var i = 0; i < obj.childNodes.length; i++)
	{
		if(obj.childNodes[i].className == name){return obj.childNodes[i];}
	}
	return false;
}
//Hilfsfunktionen ende
function Element(object)
{
	this.object = object;
	this.re = new RegExp("px", "gi");

	this.clearStyleValue = function(value)
	{
		var value = value.replace(this.re, "");
		return parseInt(value);
	}
	this.return_width = function(){	return this.clearStyleValue(this.object.style.width);}
	this.return_height = function(){ return this.clearStyleValue(this.object.style.height);	}
	this.return_top = function(){	return this.clearStyleValue(this.object.style.top); }
	this.return_left = function(){ return this.clearStyleValue(this.object.style.left);	}
	this.change_width = function(changeValue){ this.object.style.width = (this.return_width() + changeValue)+"px"; }
	this.set_width = function(changeValue){ this.object.style.width = changeValue+"px";	}
	this.change_height = function(changeValue){ this.object.style.height = (this.return_height() + changeValue)+"px"; }
	this.set_height = function(changeValue){ this.object.style.height = changeValue+"px"; }
	this.change_top = function(changeValue){ this.object.style.top = (this.return_top() + changeValue)+"px"; }
	this.set_top = function(changeValue){ this.object.style.top = changeValue+"px"; }
	this.change_left = function(changeValue){ this.object.style.left = (this.return_left() + changeValue)+"px"; }
	this.set_left = function(changeValue){ this.object.style.left = changeValue+"px"; }
	this.show = function(){ this.object.style.display = "block"; }
	this.show_inline = function(){ this.object.style.display = "inline"; }
	this.hide = function(){ this.object.style.display = "none"; }
	this.return_offsetHeight = function(){ return this.object.offsetHeight; }
	this.return_offsetWidth = function(){ return this.object.offsetWidth; }
	this.setAlpha = function(value)
	{
		this.object.style.filter = 'alpha(opacity='+value+')';
		this.object.style.opacity = value/100;
	}
	this.show_hide = function()
	{
		if(this.object.style.display == 'block') { this.object.style.display = 'none'; return 'none';}
		else if(this.object.style.display == 'none') { this.object.style.display = 'block'; return 'block';}
	}
	this.set_src = function(src){ this.object.src = src; }
	this.changeHTML = function(txt){ this.object.innerHTML = txt; }
	this.return_absolute_pos = function()
	{
		var obj = this.object;
		var pos = new Object();
		pos.top = 0;
		pos.left = 0;
		while(obj && obj.nodeName.toLowerCase() != 'body')
		{
			pos.top += obj.offsetTop;
			pos.left += obj.offsetLeft;
			obj = obj.offsetParent;
		}
		return pos;
	}
}
//http request
var requestQue = new HttpRequestQue();
function HttpRequestQue()
{
	this.List = new Array();
	this.requestAddWork = false;
	
	this.add = function(http)
	{
		var index = this.List.length;
		this.List[index] = new Http(http.url, http.onreadyst, http.method, http.body, http.headers, http.sync);
		this.List[index].onreadyst = http.onreadyst;
		this.send();
	}
	
	this.send = function()
	{
		if(this.requestAddWork === false)
		{
			if(this.List.length>0)
			{
				this.requestAddWork = true;
				this.List[0].doRequest();
			}
		}
	}
	
	this.requExecuted = function()
	{
		var cacheList = new Array();
		for (var i = 0; i < (this.List.length - 1); i ++)
		{
			cacheList[i] = this.List[i+1];
		}
		this.List = cacheList;
		cacheList = null;
		this.requestAddWork = false;
		this.send();
	}
}
var request = null;
function Http(url, onreadyst, method, body, headers, sync)
{
	this.url = url;
	this.onreadyst = onreadyst || function(){};
	this.method = method || 'GET';
	this.body = body || null;
	this.headers = headers || false;
	this.sync = sync || true;
	this.abortReq = false;
	this.req = (window.XMLHttpRequest)
		?
		new XMLHttpRequest()
		:
		((window.ActiveXObject)
		?
		new ActiveXObject("Microsoft.XMLHTTP")
		:
		false
		);
	this.doRequest = function()
	{
		this.req.open(this.method,this.url,this.sync);
		if (this.headers)
		{
			for (var i = 0; i < this.headers.length; i += 2)
			{
				this.req.setRequestHeader(
					this.headers[i], this.headers[i+1]
				);
			}
		}
		this.req.onreadystatechange = this.onreadyst;
		this.req.send(this.body);
	}
}
//http request end

/* JavaScript-Content rendered by hurra! (hurra.cc) - Template 1 | Start | template/start/ */
function show_prev(type)
{
	switch(type)
	{
		case'news':
			PrevFlags.activateFlag(1)
			document.getElementById('standings').style.display='none';
			document.getElementById('news').style.display='block';
			break;
		case'standings':
			PrevFlags.activateFlag(2)
			document.getElementById('news').style.display='none';
			document.getElementById('standings').style.display='block';
			break;
	}
}

/* JavaScript-Content rendered by hurra! (hurra.cc) - Module 11 | Static_Module_Victorys | module/content/static/victorys/ */
//medaillienscroller startseite
var myScrollInterval = null;
var myScrollLayer = null;
var myScrollLayerLeft = 0;
var myScrollLayerWidth = 0;
var myScrollWindowWidth = 725;
var myScrollWidthDiff = 0;
function myscroll(direction)
{
	myScrollLayer = document.getElementById('prospertiesScrollLayer');
	myScrollLayerWidth = myScrollLayer.offsetWidth;
	if (myScrollLayerWidth > myScrollWindowWidth)
	{		
		myScrollWidthDiff = myScrollWindowWidth - myScrollLayerWidth;
		if (direction == 'left' && myScrollLayerLeft >= 0){return false;}
		else if (direction == 'right' && myScrollLayerLeft <= myScrollWidthDiff){return false;}
		myScrollInterval = window.setInterval('scrolling("'+direction+'")', 10);
	}
}
function myscrollstop()
{
	try
	{
		window.clearInterval(myScrollInterval);
	}
	catch(e)
	{
		null;
	}
	myScrollInterval = null;
}
function scrolling(direction) {
	if (direction == 'left')
	{
		myScrollLayerLeft += 2;
	}
	else if (direction == 'right')
	{
		myScrollLayerLeft -= 2;
	}
	myScrollLayer.style.left = myScrollLayerLeft + 'px';
	if(myScrollLayerLeft >= 0)
	{
		myscrollstop();
		myScrollLayer.style.left = '0px';
	}
	if(myScrollLayerLeft <= myScrollWidthDiff)
	{
		myscrollstop();
		myScrollLayer.style.left = myScrollWidthDiff+'px';
	}
}
//medaillienscroller startseite ende

/* JavaScript-Content rendered by hurra! (hurra.cc) - Module 14 | Module_Helper_Mediacenter | module/helper/mediacenter/ */
var MediaCenterVideoFileArray = new Array();
var MediaCenterActiveVideoFileIndex = 0;
var MediaCenterAudioFileArray = new Array();
var MediaCenterActiveAudioFileIndex = 0;
var MediaCenterActiveImg = 'module/helper/mediacenter/icons/mediacenterDotRed.gif';
var MediaCenterInActiveImg = 'module/helper/mediacenter/icons/mediacenterDotWhite.gif';
var MediaCenterActiveColor = '#E1020E';
var MediaCenterInActiveColor = '#ffffff';

function switchMovie(index)
{
	if(index == 'next')
	{
		if((MediaCenterVideoFileArray.length-1) <= MediaCenterActiveVideoFileIndex){index = 0;}
		else{index = MediaCenterActiveVideoFileIndex+1;}
	}
	else if(index == 'last')
	{
		if((MediaCenterActiveVideoFileIndex == 0) >= MediaCenterActiveVideoFileIndex){index = MediaCenterVideoFileArray.length-1;}
		else{index = MediaCenterActiveVideoFileIndex-1;}
	}
	var movie = (navigator.userAgent.toLowerCase().indexOf("msie") > -1 ? fusiFlvPlayer : AC_SW_GetSWFObjectForMoz('fusiFlvPlayer'));
	movie.GotoFrame(1);
	movie.SetVariable('dateiLoadByJs', MediaCenterVideoFileArray[index]);
	movie.GotoFrame(0);
	var oldIndex = MediaCenterActiveVideoFileIndex;
	MediaCenterActiveVideoFileIndex = index;
	MCOutVideo(oldIndex);
	MCOverVideo(index);
}
function switchMusic(index)
{
	if(index == 'next')
	{
		if((MediaCenterAudioFileArray.length-1) <= MediaCenterActiveAudioFileIndex){index = 0;}
		else{index = MediaCenterActiveAudioFileIndex+1;}
	}
	else if(index == 'last')
	{
		if((MediaCenterActiveAudioFileIndex == 0) >= MediaCenterActiveAudioFileIndex){index = MediaCenterAudioFileArray.length-1;}
		else{index = MediaCenterActiveAudioFileIndex-1;}
	}
	var movie = (navigator.userAgent.toLowerCase().indexOf("msie") > -1 ? fusiMP3Player : AC_SW_GetSWFObjectForMoz('fusiMP3Player'));
	movie.GotoFrame(1);
	movie.SetVariable('dateiLoadByJs', MediaCenterAudioFileArray[index]);
	movie.GotoFrame(0);
	var oldIndex = MediaCenterActiveAudioFileIndex;
	MediaCenterActiveAudioFileIndex = index;
	MCOutAudio(oldIndex);
	MCOverAudio(index);
}
function MCOutVideo(index)
{
	if(index != MediaCenterActiveVideoFileIndex)
	{
		var ob = document.getElementById('MC_VideoFile_'+index);
		ob.firstChild.src = MediaCenterInActiveImg;
		ob.style.color = MediaCenterInActiveColor;
	}
}
function MCOverVideo(index)
{
	var ob = document.getElementById('MC_VideoFile_'+index);
	ob.firstChild.src = MediaCenterActiveImg;
	ob.style.color = MediaCenterActiveColor;
}
function MCOutAudio(index)
{
	if(index != MediaCenterActiveAudioFileIndex)
	{
		var ob = document.getElementById('MC_AudioFile_'+index);
		ob.firstChild.src = MediaCenterInActiveImg;
		ob.style.color = MediaCenterInActiveColor;
	}
}
function MCOverAudio(index)
{
	var ob = document.getElementById('MC_AudioFile_'+index);
	ob.firstChild.src = MediaCenterActiveImg;
	ob.style.color = MediaCenterActiveColor;
}
function show_hide_VideoScroll(type)
{
	switch(type)
	{
		case'show':
			document.getElementById("mediacenterVideoLeftScroll").style.display = "block";
			document.getElementById("mediacenterVideoRightScroll").style.display = "block";
			break;
		case'hide':
			document.getElementById("mediacenterVideoLeftScroll").style.display = "none";
			document.getElementById("mediacenterVideoRightScroll").style.display = "none";
			break;
	}
}
function show_hide_AudioScroll(type)
{
	switch(type)
	{
		case'show':
			document.getElementById("mediacenterAudioLeftScroll").style.display = "block";
			document.getElementById("mediacenterAudioRightScroll").style.display = "block";
			break;
		case'hide':
			document.getElementById("mediacenterAudioLeftScroll").style.display = "none";
			document.getElementById("mediacenterAudioRightScroll").style.display = "none";
			break;
	}
}

//gallery
var EntryList = new Array();
var Gallery = null;
var loaderPath = "";
var path = "";
addEvent( window, "load", MediacenterGalleryLoader);
function MediacenterGalleryLoader()
{
	if(EntryList.length == 0){return false;}
	Gallery = new MediacenterGallery(EntryList);
	Gallery.start(true);
}
function MediacenterGalleryIcon(headline, text, thumb, img, imgOnly)
{
	this.headline = headline;
	this.text = text;
	this.thumb = thumb;
	this.img = img;
	this.imgOnly = imgOnly;
}
function MediacenterGallery(Entrylist)
{
	this.EntryList = EntryList;
	this.ThumbContainer = new Array();
	this.ImgContainer = null;
	this.TxtContainer = null;
	this.TxtContainerIcon = null;
	this.TxtContainerBg = null;
	this.CurrentImgContainer = null;
	this.ScrollBigLeft = null;
	this.ScrollBigRight = null;
	this.ScrollThumbLeft = null;
	this.ScrollThumbRight = null;
	this.IconBar = null;
	
	this.Ecard = null;
	this.EcardBg = null;
	this.EcardSenderName = null;
	this.EcardSenderMail = null;
	this.EcardRecName = null;
	this.EcardRecMail = null;
	this.EcardText = null;
	this.EcardMessageBox = null;
	this.ecardSuccessMessage = "Die eCard wurde erfolgreich versandt!";
	this.ecardSendingMessage = "Die eCard wird gesendet!";
	
	this.loaderPath = loaderPath;
	this.path = path;
	
	this.visibleStartIndex = null;
	this.visibleEndIndex = null;
	this.functionAllow = false;
	
	this.showInterval = false;
	this.nextShowIndex = false;
	this.hideInterval = false;
	this.nextHideIndex = false;
	
	this.activeClass = "thumbMarked";
	this.inactiveClass = "thumbs";
	
	this.currentIndex = null;
	this.start = function(first)
	{
		window.clearInterval(this.showInterval);
		window.clearInterval(this.hideInterval);
		this.visibleStartIndex = 0;
		this.currentIndex = 0;
		if(this.EntryList.length >= 8){this.visibleEndIndex = 7;}
		else{this.visibleEndIndex = this.EntryList.length - 1;}
		for(var i = 0; i < 8; i++)
		{


			var index = this.ThumbContainer.length;
			this.ThumbContainer[index] = document.getElementById("MediacenterFotoThumb"+i);
			this.ThumbContainer[index].style.visibility = "hidden";
			this.ThumbContainer[index].className = this.inactiveClass;
			this.ThumbContainer[index].style.opacity = 0.7;
			this.ThumbContainer[index].style.filter = "alpha(opacity=70)";
		}
		this.ImgContainer = document.getElementById("bigPic");
		this.ImgContainer.src = loaderPath;
		this.TxtContainerBg = document.getElementById("mediacenterPicLabel");
		this.TxtContainerIcon = document.getElementById("mediacenterPicLabelIcon");
		this.TxtContainer = document.getElementById("mediacenterPicLabelOver");
		this.CurrentImgContainer = document.getElementById("mediacenterPageCounterFOTO");
		this.IconBar = document.getElementById("mediacenterIconBar");
		this.IconBar.style.visibility = "hidden";
		
		this.ScrollBigLeft = document.getElementById("mediacenterPicLeftScroll");
		this.ScrollBigRight = document.getElementById("mediacenterPicRightScroll");
		this.ScrollThumbLeft = document.getElementById("mediacenterThumbLeftScroll");
		this.ScrollThumbLeft.style.display = "none"; 
		this.ScrollThumbRight = document.getElementById("mediacenterThumbRightScroll");
		this.ScrollThumbRight.style.display = "none";
		this.Ecard = document.getElementById("ecard");
		this.EcardBg = document.getElementById("bg_ecard");
		this.EcardSenderName = document.getElementById("sender_name");
		this.EcardSenderMail = document.getElementById("sender_mail");
		this.EcardRecName = document.getElementById("rec_name");
		this.EcardRecMail = document.getElementById("rec_mail");
		this.EcardText = document.getElementById("ecard_message");
		this.EcardMessageBox = document.getElementById("ecard_successful");
		
		this.showInterval = window.setInterval("Gallery.showVisibles(\'start\')", 150);
		if(first === true)
		{
			var keyupEvent = function(e)
			{
				if(! Gallery.functionAllow){return false;}
				if (navigator.appName.indexOf("Explorer") > -1)
				{
					var key = e.keyCode;
				}
				else
				{
					var key = e.which;
				}
				if(key == 37){Gallery.swapImg("last");}
				else if(key == 38){return false;}
				else if(key == 39){Gallery.swapImg("next");}
				else if(key == 40){return false;}
			}
			addEvent( document, "keyup", keyupEvent);
		}
	}
	this.thumbOver = function(index)
	{
		if(!this.functionAllow){return false;}
		this.ThumbContainer[index].className = this.activeClass;
		this.ThumbContainer[index].style.opacity = 1;
		this.ThumbContainer[index].style.filter = "alpha(opacity=100)";
	}
	this.thumbOut = function(index)
	{
		if(this.visibleStartIndex + index != this.currentIndex)
		{
			this.ThumbContainer[index].className = this.inactiveClass;
			this.ThumbContainer[index].style.opacity = 0.7;
			this.ThumbContainer[index].style.filter = "alpha(opacity=70)";
		}
	}
	this.show_hide_ImgScroll = function(type)
	{
		switch(type)
		{
			case'show':
				this.ScrollBigLeft.style.visibility = "visible";
				this.ScrollBigRight.style.visibility = "visible";
				break;
			case'hide':
				this.ScrollBigLeft.style.visibility = "hidden";
				this.ScrollBigRight.style.visibility = "hidden";
				break;
		}
	}
	this.show_hide_text = function(type)
	{
		if(this.TxtContainer.innerHTML.length < 1){return;}
		switch(type)
		{
			case'show':
				this.TxtContainerBg.style.display="block";
				this.TxtContainer.style.display="block";
				break;
			case'hide':
				this.TxtContainerBg.style.display="none";
				this.TxtContainer.style.display="none";
				break;
		}
	}
	this.showVisibles = function(visibleIndex)
	{
		if(this.nextShowIndex === false){this.nextShowIndex = this.visibleStartIndex;}
		if(this.nextShowIndex <=  this.visibleEndIndex)
		{
			this.ThumbContainer[this.nextShowIndex - this.visibleStartIndex].src = this.EntryList[this.nextShowIndex].thumb;
			this.ThumbContainer[this.nextShowIndex - this.visibleStartIndex].style.visibility = "visible";
			this.nextShowIndex ++;
		}
		else
		{
			window.clearInterval(this.showInterval);
			this.showInterval = false;
			this.nextShowIndex = false;
			this.show_nav();
			switch(visibleIndex)
			{
				case "start":
					this.showEntry(this.visibleStartIndex);
					break;
				case "end":
					this.showEntry(this.visibleEndIndex);
					break;
				default:
					this.showEntry(this.visibleStartIndex);
					break;
			}
			this.functionAllow = true;
		}
	}
	this.hideVisibles = function(visibleIndex)
	{
		if(this.nextHideIndex === false){this.nextHideIndex = 0}
		if(this.nextHideIndex < this.ThumbContainer.length)
		{
			this.ThumbContainer[this.nextHideIndex].style.visibility = "hidden";
			this.ThumbContainer[this.nextHideIndex].className = this.inactiveClass;
			this.ThumbContainer[this.nextHideIndex].style.opacity = 0.7;
			this.ThumbContainer[this.nextHideIndex].style.filter = "alpha(opacity=70)";
			this.nextHideIndex ++;
		}
		else
		{
			window.clearInterval(this.hideInterval);
			this.hideInterval = false;
			this.nextHideIndex = false;
			this.showInterval = window.setInterval("Gallery.showVisibles(\'"+visibleIndex+"\')", 150);
		}
	}
	this.swapImg = function(index)
	{
		if(!this.functionAllow){return false;}
		this.ThumbContainer[this.currentIndex-this.visibleStartIndex].className = this.inactiveClass;
		this.ThumbContainer[this.currentIndex-this.visibleStartIndex].style.opacity = 0.7;
		this.ThumbContainer[this.currentIndex-this.visibleStartIndex].style.filter = "alpha(opacity=70)";
		if(index == "next")
		{
			if(this.currentIndex < this.visibleEndIndex){index = this.currentIndex + 1;}
			else
			{
				if(this.EntryList.length >= 8)
				{
					this.swapList("next");
					return false;
				}
				else
				{
					index = 0;
				}
			}
		}
		else if(index == "last")
		{
			if(this.currentIndex > this.visibleStartIndex){index = this.currentIndex - 1;}
			else
			{
				if(this.EntryList.length >= 8)
				{
					this.swapList("last");
					return false;
				}
				else
				{
					index = this.visibleEndIndex;
				}
			}
		}
		else
		{
			index = this.visibleStartIndex + index;
		}
		this.showEntry(index);
	}
	this.swapList = function(direction)
	{
		if(!this.functionAllow){return false;}
		if(direction == "next")
		{
			if(this.visibleEndIndex < this.EntryList.length - 1)
			{
				this.visibleStartIndex = this.visibleEndIndex + 1;
				if(this.visibleStartIndex + 7 < this.EntryList.length -1){this.visibleEndIndex = this.visibleStartIndex + 7;}
				else{this.visibleEndIndex = this.EntryList.length -1;}
			}
			else if(this.visibleEndIndex >= this.EntryList.length -1)
			{
				this.visibleStartIndex = 0;
				if(this.EntryList.length >= 8){this.visibleEndIndex = 7;}
				else{this.visibleEndIndex = this.EntryList.length - 1;}
			}
			var toHighlight = "start";
		}
		else if(direction == "last")
		{
			if(this.visibleStartIndex > 0)
			{
				this.visibleStartIndex = this.visibleStartIndex - 8;
				this.visibleEndIndex = this.visibleStartIndex + 7;
			}
			else
			{
				this.visibleEndIndex = this.EntryList.length - 1;
				if(Math.floor(this.EntryList.length / 8) != this.EntryList.length / 8)
				{
					this.visibleStartIndex = (Math.floor(this.EntryList.length / 8) * 8);
				}
				else
				{
					this.visibleStartIndex = this.visibleEndIndex - 8;
				}
			}
			var toHighlight = "end";
		}
		this.functionAllow = false;
		this.hideEntry();
		this.hide_nav();
		this.hideInterval = window.setInterval("Gallery.hideVisibles(\'"+toHighlight+"\')", 50);
	}
	this.showEntry = function(index)
	{
		this.currentIndex = index;
		this.ImgContainer.src = this.EntryList[index].img;
		headline = "";
		if(this.EntryList[index].headline.length > 1){headline = "<strong>"+this.EntryList[index].headline+"</strong><br />";}
		this.TxtContainer.innerHTML = headline+this.EntryList[index].text;
		if(this.TxtContainer.innerHTML.length >0){this.TxtContainerIcon.style.display= "block";}else{this.TxtContainerIcon.style.display= "none";}
		this.CurrentImgContainer.innerHTML = (index+1) + " / "+this.EntryList.length;
		
		this.ThumbContainer[index-this.visibleStartIndex].className = this.activeClass;
		this.ThumbContainer[index-this.visibleStartIndex].style.opacity = 1;
		this.ThumbContainer[index-this.visibleStartIndex].style.filter = "alpha(opacity=100)";
	}
	this.hideEntry = function()
	{
		this.ImgContainer.src = this.loaderPath;
		this.TxtContainer.innerHTML = "&nbsp;";
		this.CurrentImgContainer.innerHTML = "&nbsp;";
	}
	this.show_nav = function()
	{
		this.ScrollBigLeft.style.display = "block";
		this.ScrollBigRight.style.display = "block";
		this.IconBar.style.visibility = "visible";
		if(this.EntryList.length >= 8)
		{
			this.ScrollThumbLeft.style.display = "block";
			this.ScrollThumbRight.style.display = "block";
		}
	}
	this.hide_nav = function()
	{
		this.ScrollBigLeft.style.display = "none";
		this.ScrollBigRight.style.display = "none";
		this.ScrollThumbLeft.style.display = "none";
		this.ScrollThumbRight.style.display = "none";
		this.IconBar.style.visibility = "hidden";
	}

	this.show_ecard = function()
	{
		this.functionAllow = false;
		this.Ecard.style.display = "block";
		this.EcardBg.style.display = "block";
	}
	this.hide_ecard = function()
	{
		this.functionAllow = true;
		this.Ecard.style.display = "none";
		this.EcardBg.style.display = "none";
		this.EcardSenderName.value = "";
		this.EcardSenderMail.value = "";
		this.EcardRecName.value = "";
		this.EcardRecMail.value = "";
		this.EcardText.value = "";
	}
	this.check_form = function()
	{
		var foundError = false;
		var re = /^[a-zA-Z0-9_\.\-]+@([a-zA-Z0-9\-_]|\.)*[a-zA-Z0-9]{2,3}\.[a-zA-Z0-9]{2,4}/;
		if(this.EcardSenderName.value.length < 1 || this.EcardSenderName.value == "Pflichtfeld!")
		{
			this.EcardSenderName.value = "Pflichtfeld!";
			foundError = true;
		}
		if(this.EcardRecName.value.length < 1 || this.EcardRecName.value == "Pflichtfeld!")
		{
			this.EcardRecName.value = "Pflichtfeld!";
			foundError = true;
		}
		if(!re.test(this.EcardSenderMail.value))
		{
			this.EcardSenderMail.value = "Ungültige Adresse!";
			foundError = true;
		}
		else if(this.EcardSenderMail.value.length < 1 || this.EcardSenderMail.value == "Pflichtfeld!")
		{
			this.EcardSenderMail.value = "Pflichtfeld!";
			foundError = true;
		}
		if(!re.test(this.EcardRecMail.value))
		{
			this.EcardRecMail.value = "Ungültige Adresse!";
			foundError = true;
		}
		else if(this.EcardRecMail.value.length < 1 || this.EcardRecMail.value == "Pflichtfeld!")
		{
			this.EcardRecMail.value = "Pflichtfeld!";
			foundError = true;
		}

		return !foundError;
	}
	this.ecard_was_send_to = function()
	{
		this.functionAllow = true;
		this.EcardMessageBox.innerHTML = "";
		this.EcardMessageBox.style.display = "none";
		Gallery.EcardMessageBox.style.backgroundColor = "#cccccc";
	}
	this.send_ecard = function()
	{
		if(!this.check_form()){return false;}
		this.functionAllow = false;
		var orgRe = /<br \/>/gi;
		var orgText = this.TxtContainer.innerHTML.replace(orgRe, "\n");
		request = new Http(
			this.path+"files/send_ecard.php",
			null,
			"POST",
			"senderName="+this.EcardSenderName.value+"&senderMail="+this.EcardSenderMail.value+"&senderText="+this.EcardText.value+"&recName="+this.EcardRecName.value+"&recMail="+this.EcardRecMail.value+"&orgText="+orgText+"&img="+this.EntryList[this.currentIndex].imgOnly,
			["Content-Type", "application/x-www-form-urlencoded"]
		);
		this.hide_ecard();
		this.EcardMessageBox.innerHTML = this.ecardSendingMessage;
		this.EcardMessageBox.style.display = "block";
		request.onreadyst = function()
		{
			if (requestQue.List[0].req.readyState == 4)
			{
				if (requestQue.List[0].req.status == 200)
				{
					Gallery.EcardMessageBox.innerHTML = Gallery.ecardSuccessMessage;
					Gallery.EcardMessageBox.style.backgroundColor = "#18C80B";
					window.setTimeout("Gallery.ecard_was_send_to()", 1000);
					//alert(requestQue.List[0].req.responseText);
					requestQue.requExecuted();
				}
				else
				{
					alert( "Fehler: Der Server antwortet nicht!");
					requestQue.requExecuted();
					Gallery.hide_ecard();
				}
			}
		}
		requestQue.add(request);
	}
}


/* JavaScript-Content rendered by hurra! (hurra.cc) - Module 15 | Static_Module_Gallery | module/content/static/gallery/ */
function get_mouse_Coords(e)
{
	var pos = new Object();
	pos.x = (document.layers || (document.getElementById && !document.all)) ? e.pageX : document.body.scrollLeft + event.clientX;
	pos.y = (document.layers || (document.getElementById && !document.all)) ? e.pageY : document.body.scrollTop + event.clientY;
	return pos;
}
function Scroller(name)
{
	this.obName = name;
	this.scrollWindow = null;
	this.scrollWindowHeight = null;
	this.scrollContent = null;
	this.scrollContentHeight = null;
	this.ScrollContentTop = null;
	this.moverContainer = null;
	this.moverContainerHeight = null;
	this.scrollerShowHide = null;
	this.mover = null;
	this.moverHeight = null;
	this.moverMinheight = 18;
	this.moverImgCornerHeight = 4;
	this.moverMaxMovement = null;
	this.moverMaxTop = null;
	this.moverMoveDiffFaktor = 0;
	this.scrollInterval = false;
	this.oldMouseY = false;
	this.mouseY = null;
	this.mouseMaxX = null;
	this.mouseMinX = null;
	this.mouseMaxY = null;
	this.mouseMinY = null;
	this.mouseDragTol = 100;
	this.isDragging = false;
	
	this.construct = function(scrollWindowId, scrollContentId, scrollerShowHideId, moverContainerId, moverId)
	{
		this.scrollWindow = new Element(document.getElementById(scrollWindowId));
		this.scrollWindow.object.onselectstart=new Function ("return false");
		this.scrollWindowHeight = this.scrollWindow.return_offsetHeight();
		this.scrollContent = new Element(document.getElementById(scrollContentId));
		this.scrollContentHeight = this.scrollContent.return_offsetHeight();
		this.ScrollContentTop = this.scrollContent.return_top();
		this.scrollerShowHide = new Element(document.getElementById(scrollerShowHideId));
		this.moverContainer = new Element(document.getElementById(moverContainerId));
		this.moverContainer.object.onselectstart=new Function ("return false");
		this.moverContainerHeight = this.moverContainer.return_height();
		this.mover = new Element(document.getElementById(moverId));
		this.set_mover_height();
		if(this.scrollContentHeight > this.scrollWindowHeight)
		{
			this.scrollerShowHide.object.style.visibility="visible";
			var pos = this.moverContainer.return_absolute_pos();
			this.moverContainerTop = pos;
			this.mouseMaxX = pos.left + this.mouseDragTol + this.moverContainer.return_offsetWidth();
			this.mouseMinX = pos.left - this.mouseDragTol;
			this.mouseMinY = pos.top - this.mouseDragTol;
			this.mouseMaxY = pos.top + this.mouseDragTol + this.moverContainerHeight;
		}
	}
	this.set_mover_height = function()
	{
		var diff = Math.floor((this.scrollContentHeight - this.scrollWindowHeight)/2);
		this.moverHeight = 18;
		if(this.moverContainerHeight - diff > this.moverMinheight)
		{
			this.moverHeight = this.moverContainerHeight - diff;
		}
		this.mover.object.childNodes[1].style.height = (this.moverHeight-(2*this.moverImgCornerHeight))+'px';
		this.moverMaxMovement = this.moverContainerHeight - this.moverHeight;
		this.moverMaxTop = this.moverMaxMovement;
		this.moverMoveDiffFaktor = this.moverMaxMovement/(this.scrollContentHeight - this.scrollWindowHeight);
	}
	this.scroll_by_button = function(direction)
	{
		if(this.scrollContentHeight <= this.scrollWindowHeight){return false;}
		if(this.scrollInterval !== false){ window.clearInterval(this.scrollInterval); this.scrollInterval = false;}
		switch(direction)
		{
			case 'up':
				this.scrollInterval = window.setInterval(this.obName+'.scroll_up(-5)', 10);
				break;
			case 'down':
				this.scrollInterval = window.setInterval(this.obName+'.scroll_down(5)', 10);
				break;
		}
	}
	this.scroll_up = function(add)
	{
		if(this.scrollWindowHeight > this.scrollContentHeight + add + this.ScrollContentTop)
		{
			if(this.scrollInterval !== false){window.clearInterval(this.scrollInterval);}
			this.scrollContent.set_top((this.scrollWindowHeight - this.scrollContentHeight));
			this.ScrollContentTop = this.scrollContent.return_top();
			this.mover.set_top(this.moverMaxTop);
			this.scrollInterval = false;
		}
		else
		{
			var newTop = this.ScrollContentTop + add;
			this.scrollContent.set_top(newTop);
			this.mover.set_top(newTop*this.moverMoveDiffFaktor*-1);
			this.ScrollContentTop = this.scrollContent.return_top();
		}
	}
	this.scroll_down = function(add)
	{
		if(0 <= this.ScrollContentTop + add)
		{
			if(this.scrollInterval !== false){window.clearInterval(this.scrollInterval);}
			this.scrollContent.set_top(0);
			this.ScrollContentTop = this.scrollContent.return_top();
			this.mover.set_top(0);
			this.scrollInterval = false;
		}
		else
		{
			var newTop = this.ScrollContentTop + add;
			this.scrollContent.set_top(newTop);
			this.mover.set_top(newTop*this.moverMoveDiffFaktor*-1);
			this.ScrollContentTop = this.scrollContent.return_top();
		}
	}
	this.scroll_by_button_stop = function()
	{
		window.clearInterval(this.scrollInterval);
		this.scrollInterval = false;
	}
	this.drag = function()
	{
		this.isDragging = true;
		return false;
	}
	this.dragging = function(e)
	{
		if(!this.isDragging){return null;}
		var coords = get_mouse_Coords(e)
		this.mouseY = coords.y;
		if(coords.x > this.mouseMaxX || coords.x < this.mouseMinX || coords.y > this.mouseMaxY || coords.y < this.mouseMinY)
		{
			this.drop();
			return null;
		}
		this.mouseY = coords.y;
		if(this.oldMouseY !== false)
		{
			if(this.oldMouseY < this.mouseY)
			{
				var diff = this.oldMouseY - this.mouseY;
				this.scroll_up(diff/this.moverMoveDiffFaktor);
			}
			else if(this.oldMouseY > this.mouseY)
			{
				var diff = this.oldMouseY - this.mouseY;
				this.scroll_down(diff/this.moverMoveDiffFaktor);
			}
		}
		this.oldMouseY = this.mouseY;
	}
	this.drop = function()
	{
		this.isDragging = false;
		this.oldMouseY = false;
	}
}
var mcSelTable = new Scroller('mcSelTable');
function dragging(e)
{
	mcSelTable.dragging(e);
}
document.onmousemove = dragging;
