var SetFotos = '';

var msgWindow;
function OpenWindow(file,window,inf) {
	msgWindow=open(file,window,inf);
	if (msgWindow.opener == null) msgWindow.opener = self;
}


function LoadSetFotos(Url)
{
	SetFotos = Url;
	//window.frames.Igallery.location.href = Url;
}

function LoadVideoGallery()
{
	window.frames.evideo.location.href = "/sites/video.asp";
}


function FinalLoadSetFotos()
{
	window.frames.Igallery.location.href = SetFotos;
}

function changeVideo(VideoName)
{
	document.getElementById('player').src = VideoName;
}

function GetOrderFromImage()
{
	var ImageOn = document.getElementById('mainImageM').src;
	ImageOn = ImageOn.replace('/art/publikationen/TEMP/','');
	ImageOn = ImageOn.replace('http://www.ffhsh.de.jingho.de','');
	ImageOn = ImageOn.replace('http://www.ffhsh.de','');
	ImageOn = ImageOn.replace('http://www.fchsh.de','');
	ImageOn = ImageOn.replace('?imgmax=800','');
	
	ImageOn = ImageOn.replace('/','');
	ImageOn = ImageOn.replace('?','');
	ImageOn = ImageOn.replace('.jpg','');
	if (document.getElementById('B' + ImageOn))
	{
		document.getElementById('B' + ImageOn).checked = true;
	}
	setValOn();
}
function showtermin(anAus)
{
	if (anAus==true)
	{
		
		document.getElementById('termin0').style.display = 'block';	
		document.getElementById('termin1').style.display = 'block';
		document.getElementById('termin2').style.display = 'block';
	}
	else
	{
		document.getElementById('termin0').style.display = 'none';	
		document.getElementById('termin1').style.display = 'none';
		document.getElementById('termin2').style.display = 'none';	
	}
}


function setValOn()
{
	var subs = document.getElementById('gallery_wrap').getElementsByTagName('img');
	var allSubs 	= subs.length;
	for (var i=0;i<=(allSubs);i++)
	{
		if (subs[i])
		{
			if (subs[i].id !='mainImageM')
			{
				var ThumbOn = subs[i].src;
				ThumbOn = ThumbOn.replace('/art/publikationen/','');
				ThumbOn = ThumbOn.replace('http://www.ffhsh.de.jingho.de','');
				ThumbOn = ThumbOn.replace('http://www.ffhsh.de','');
				ThumbOn = ThumbOn.replace('http://www.fchsh.de','');
				ThumbOn = ThumbOn.replace('?imgmax=800','');

				ThumbOn = ThumbOn.replace('/','');
				ThumbOn = ThumbOn.replace('?','');				
				
				ThumbOn = ThumbOn.replace('.jpg','');

				if (document.getElementById('B' + ThumbOn))
				{
					if (document.getElementById('B' + ThumbOn).checked)
					{

						document.getElementById('gvIIID' + (i-1)).style.border = '2px solid red';
						document.getElementById('PPT' + (i-1)).style.border = '2px solid red';
					}
					else
					{
						document.getElementById('gvIIID' + (i-1)).style.border = '0px';
						document.getElementById('PPT' + (i-1)).style.border = '0px';
					}
				}
			}
		}
	}

}
function WaitLoadSetFotos()
{
	
	window.frames.Igallery.location.href = '/wait.asp';
}

function LoadSetFotoInWin(picName)
{
	window.frames.Igallery.document.getElementById('mainImageM').src = picName;
}



function submitFormular(FieldName,Content)
{
	if (document.getElementById(FieldName).value==Content)
	{
		document.getElementById(FieldName).value = '';
	}
	
	document.eingabe.submit();
}

function removeField(FieldName,Content)
{
	if (document.getElementById(FieldName).value==Content)
	{
		document.getElementById(FieldName).value = '';
	}
}
function LoadPicInWin(picName)
{
	if (document.getElementById('mainImageM'))
	{
		document.getElementById('mainImageM').src = picName;
	}
	else
	{
		alert("Bitte warten Sie bis die Seite komplett geladen ist.")
	}
}

function AddField(FieldName,Content)
{
	if (document.getElementById(FieldName).value=='')
	{
		document.getElementById(FieldName).value = Content;
	}
}

function checkSearchForm()
{
	
	document.getElementById('search').value = getSearchValue();
	document.sucheoben.submit();
}

function getSearchValue()
{
	var sSearch= document.getElementById('sfield').getElementsByTagName('INPUT');
	var alleV = sSearch.length;
	for(var no=0;no<alleV;no++)
	{	
		if (sSearch[no].className !='FormSearch')
		{
			return sSearch[no].value;
		}
	
	}
}


			function openLocationWindow(theURL,winName,features) {
				msgWindow=open(theURL,winName,features);
				if (msgWindow.opener == null) msgWindow.opener = self;
				}

function dropMenuA()
{}

			function SelectDropdown(Box,auswahl)
			{
				var BoxElement = document.getElementById(Box);
				if (BoxElement)
				{
					for (var i = 0; i < BoxElement.options.length; i++)
					{
						if (BoxElement.options[i].value == auswahl)
						{
							BoxElement.options[i].selected = true; 
						}
					}
				}
			}


			function checkAll(theForm,boxname) {
			    for (i=0,n=theForm.elements.length;i<n;i++)
				if (theForm.elements[i].name.indexOf(boxname) !=-1)
				{
				    if (theForm.elements[i].checked){
					theForm.elements[i].checked = false;
					}
				    else{
					theForm.elements[i].checked = true;
				    }
				}
			}


			function HideAllLayers(){
 				for(i=0; i<document.layers.length; i++)
				{
				 alert('Der Layer '+i+' hat die ID: ' + document.layers[i].id);
				}
			}
			
			
				function clearstatus()  {
					self.status ='FimFörderung Hamburg';
					return true;
				}
				clearstatus();

				function CheckForm(actione,was) {
						document.eingabe.action = actione;
						var agree=confirm('Möchten Sie  ' + was + ' wirklich löschen?');

						if (agree){
							parent.content.location.href=actione;
							return true ;
							}
						else{
							//return true ;
						}
				}


				function CheckFormSubmit(actione,was) {
						document.eingabe.action = actione;
						var agree=confirm('Möchten Sie  ' + was + '  wirklich löschen?');

						if (agree){
							document.eingabe.action = actione;
							document.eingabe.submit();

							//parent.content.location.href=actione;
							//return true ;
							}
						else{
							//return true ;
						}
				}
			
			
			
			
			function MM_reloadPage(init) {  //reloads the window if Nav4 resized
			  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
			  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
			}
			MM_reloadPage(true);

			function MM_findObj(n, d) { //v4.01
			  var p,i,x;  
			  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
			    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
			    }
			  if(!(x=d[n])&&d.all) x=d.all[n]; 
			  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
			  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
			  x=MM_findObj(n,d.layers[i].document);
			
			  if(!x && d.getElementById)
			  x=d.getElementById(n); 
			  return x;
			}

			function MM_showHideLayers() { //v6.0
			  var i,p,v,obj,args=MM_showHideLayers.arguments;
			  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
			    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
			    obj.visibility=v; }
			}


			function MM_showHideLayersX(name) {
			//if (ns)
			//{parent.TopContent.document.layers['' + name].visibility = "hide";}
			//else
			parent.TopContent.document.all['' + name].style.visibility = "hide";
			}




			var ok=0;if ((parseInt(navigator.appVersion) > 3) || ((parseInt(navigator.appVersion) == 3) && (navigator.appName=="Netscape"))){ok=1;}
			function change(name, newpic){
				if (ok==1){
					this.document[name].src=newpic;
					return true;
				}
				}
				
		
				
				
				
				
				
				
			var restoreArray = new Array;
			var restoreCount = 0;
			var restoreTimer = 0;
			function  restoreImages  (DelaySeconds)
			 {
			 if  (restoreTimer > 0)
			     {
			     clearTimeout (restoreTimer);
			     restoreTimer = 0;
			     }
			 if  ((restoreArray == null) || (restoreCount < 1))  return;
			 if  (DelaySeconds > 0)
			     {
			     restoreTimer = window.setTimeout ('restoreImages ();', DelaySeconds * 1000);
			     return;
			     }
			 while (restoreCount > 0)
			     {
			     imageObject = restoreArray [--restoreCount];
			     fileName = restoreArray [--restoreCount];
			     if  ((imageObject != null) && (fileName != null) && (fileName != ''))  imageObject.src = fileName;
			     }
			 }

			function  replaceImage  (ImageName, FileName)
			 {
			 imageObject = eval ('document.' + ImageName);
			 if  ((imageObject == null) || (FileName == null) || (FileName == ''))  return;
			 if  (restoreArray != null)
			     {
			     restoreArray [restoreCount++] = imageObject.src;
			     restoreArray [restoreCount++] = imageObject;
			     }
			 imageObject.src = FileName;
			 }

				
		
			function CheckFormSubmitNachricht(actione,was) {
					document.eingabe.action = actione;
					var agree=confirm(was);

					if (agree){

						document.eingabe.action = actione;
						document.eingabe.submit();			
					
						//parent.content.location.href=actione;
						//return true ;
						}
					else{
						//return true ;
					}
			}				
			
			function CheckClick(actione,was) {
					document.eingabe.action = actione;
					var agree=confirm(was);

					if (agree){

						parent.content.location.href=actione;
						return true ;
						}
					else{
						//return true ;
					}
			}			
			
			function clickCategory(CatidStr)
			{
			  var txtObj = document.all("t_" + CatidStr);
			  var imgObj = document.all("i_" + CatidStr);

			  if (txtObj.style.display == 'none')
			  {
				txtObj.style.display = '';
				
			  }
			  else
			  {
				txtObj.style.display = 'none';
				
			  }
			}
			var newWindow;
			function printwindow()
			{
				
				newWindow=window.open('/sites/Eprint.asp','eprintX',  'width=600,height=600, resizable, top=20,scrollbar');
				
				newWindow.creator=self;
				
			}
			
			function print() 
			{
				if (navigator.userAgent.indexOf("IE")>-1)
				{
					var EIfr = document.getElementById('eprint').contentWindow;
					EIfr.focus();
					EIfr.print();
				}
				else
				{
				
				var OldHeight = document.getElementById('eprint').style.height;
				
				var temp = document.getElementById('eprint').offsetHeight;
				
				
				var EIfr = document.getElementById('eprint').contentWindow;
				var ContentIframe = EIfr.document.getElementById('print_content');	
				var tempneu = ContentIframe.offsetHeight;
	
	
				//ContentIframe.style.height = (tempneu) +'px';
				//document.getElementById('eprint').style.height = (tempneu) +'px';
				
			
				EIfr.focus();
			        EIfr.print();
				
			        
			        //parent.frames['eprint'].setHeightY(temp);
			        //document.getElementById('eprint').style.height = temp +'px';
			        }
				return ;
			}
			
			function sendForm()
			{
			
				if (document.getElementById('von'))
				{
					document.getElementById('von').value = '';
				}
				if (document.getElementById('bis'))
				{
					document.getElementById('bis').value = '';			
				}
			
				document.eingabe.submit();
			}
			function sendFormTaget(wohin,tar) {
				document.eingabe.action = wohin;
				document.eingabe.target = tar;
				document.eingabe.submit();
			}		
			function sendFormDahin(wohin){
				document.eingabe.action = wohin;
				document.eingabe.submit();
			}
			function sendFormDahinGET(wohin,von,bis)
			{	
				var rand = Math.random()*10000000;
				
				if (wohin.indexOf('?')>-1)
				{
					wohin = wohin + "&rand=" + rand;
				}
				else
				{
					wohin = wohin + "?rand=" + rand;
				}
				
				if (document.getElementById('textsuchen'))
				{
					var suchB = document.getElementById('textsuchen').value.toLowerCase();
					//alert(suchB.indexOf('suchen'));
					if ((suchB.indexOf('suchen')>-1) || (suchB.indexOf('search')>-1))
					{
						document.getElementById('textsuchen').value = '';
					}
				}
				document.getElementById('von').value = von;
				document.getElementById('bis').value = bis;
				document.eingabe.action = wohin;
				document.eingabe.submit();
			}			
			function sendFormEmptyGET(wohin,von,bis)
			{	
				
				document.getElementById('von').value = von;
				document.getElementById('bis').value = bis;
				document.eingabe.action = wohin;
				document.eingabe.submit();
			}	
			
			
			function SendFormInklusiveSelectingDahin(wohin){
				for(i = 0; i < document.eingabe.rid2.options.length; i++) {
					document.eingabe.allewerten.value = document.eingabe.allewerten.value + ',' + document.eingabe.rid2.options[i].value
					}
				document.eingabe.action = wohin;
				document.eingabe.submit();
			}			
			
			function move(fbox, tbox) {
				var arrFbox = new Array();
				var arrTbox = new Array();
				var arrLookup = new Array();
				var i;
				
				for (i = 0; i < tbox.options.length; i++) {
					arrLookup[tbox.options[i].text] = tbox.options[i].value;
					arrTbox[i] = tbox.options[i].text;
				}

				var fLength = 0;
				var tLength = arrTbox.length;

				for(i = 0; i < fbox.options.length; i++) {
					arrLookup[fbox.options[i].text] = fbox.options[i].value;
					if (fbox.options[i].selected && fbox.options[i].value != "") {
						arrTbox[tLength] = fbox.options[i].text;
						tLength++;
						}
					else {
						arrFbox[fLength] = fbox.options[i].text;
						fLength++;
					}
				}

				arrFbox.sort();
				arrTbox.sort();
				fbox.length = 0;
				tbox.length = 0;

				var c;

				for(c = 0; c < arrFbox.length; c++) {
					var no = new Option();
					no.value = arrLookup[arrFbox[c]];
					no.text = arrFbox[c];
					fbox[c] = no;
				}
				for(c = 0; c < arrTbox.length; c++) {
					var no = new Option();
					no.value = arrLookup[arrTbox[c]];
					no.text = arrTbox[c];
					tbox[c] = no;
				}
			}


			function SendFormInklusiveSelecting(){
				for(i = 0; i < document.eingabe.rid2.options.length; i++) {
					document.eingabe.allewerten.value = document.eingabe.allewerten.value + ',' + document.eingabe.rid2.options[i].value
					}
				document.eingabe.submit();
			}

			function SendFormInklusiveSelectingPakete(){
				for(i = 0; i < document.eingabe.rid2.options.length; i++) {
					document.eingabe.allewertenModul.value = document.eingabe.allewertenModul.value + ',' + document.eingabe.rid2.options[i].value
					}
				for(i = 0; i < document.eingabe.rid4.options.length; i++) {
					document.eingabe.allewertenKunde.value = document.eingabe.allewertenKunde.value + ',' + document.eingabe.rid4.options[i].value
					}					
				document.eingabe.submit();
			}

			function loadseit(){
				var fill = document.eingabe.m_id.options[document.eingabe.m_id.selectedIndex].value;
				var innachricht = document.forms[0].i_text.value;

				if (fill != '0') {
					document.forms[0].i_text.value = innachricht + fill;
					document.forms[0].i_text.focus();
					}
				}
				
			function loadModul(wohin){
				var fill = document.eingabe.m_id.options[document.eingabe.m_id.selectedIndex].value;
				

				if (fill != '0') {
					document.eingabe.action = wohin + '?ModulleAdd=' + fill;
					document.eingabe.submit();
					}
				}				
			function newWindow(file,window,inf) {
			    msgWindow=open(file,window,inf);
			    if (msgWindow.opener == null) msgWindow.opener = self;
			}

			function openBrWindow(theURL,winName,features) { //v2.0
			  window.open(theURL,winName,features);
			}
			function MM_openBrWindow(theURL,winName,features) { //v2.0
			  window.open(theURL,winName,features);
			}			
			function OpenWindowSendTag(theURL,winName,features,tags){
			  theURL = theURL + "?modulinfon=" + tags;
			  window.open(theURL,winName,features);
			}
			

			function remoteSuche(url,tags){


				if (opener && !opener.closed)
					opener.location.href = '../../menu/menulinks/menulinks.asp?ZuUrl=' + url + '&menu=' + tags ;
				else {
					alert ('Das hauptfenster ist zu bitte gehen Sie zu: http://www.lbhh.de/');
				}
			}



			function Eingabe1(InputStr,laenge,Counterobject) {
				var TempCount
				TempCount = Counterobject + '';
					StrLen = InputStr.value.length
					if (StrLen == 1 && InputStr.value.substring(0,1) == " ") {
					InputStr.value = ""
					StrLen= 0
				}
					else {
					CharsLeft = laenge - StrLen
				}
			  document.eingabe.elements[TempCount].value = CharsLeft
			}

			function OnKeyDownInTextArea( item, maxlen ) {
					if ( item.value.length > maxlen - 1 ) {
							if ( event.keyCode != 8 && event.keyCode <= 32 || event.keyCode > 46 ) {
									event.returnValue = false;
							}
					}
			}				
			
var oldsearchValue = '';

function OnFocusSearchField()
{
	var SearchElement = document.getElementById('search');
	oldsearchValue = SearchElement.value;
	if (SearchElement.value=='search' || SearchElement.value=='Suche')
	{
		document.getElementById('search').value = '';
	
	}

}
function OnBlurSearchField()
{
	var SearchElement = document.getElementById('search');
	if (SearchElement.value=='')
	{
		document.getElementById('search').value = oldsearchValue;
	
	}

}
			
var Pictures = [
"/art/bg_suchen_loading.gif",
"/art/310_dropfield_83_ro.png",
"/art/310_dropfield_83.png",
"/art/bg_suchen_loading.gif",
"/art/bg_suchen_loading.gif",
"/art/bg_suchen_loading.gif"
]
	
function loadpics(){
	var preImages = [];
	for (var i = 0; i < Pictures.length; i++){
		preImages[i] = new Image();
		preImages[i].src = Pictures[i];
	}
}
loadpics();
			
			
			
function setMain()
{
	
	//var hoehe = document.getElementById('impressum').offsetTop +80;
	var hoehe = document.getElementById('content_mid_bottom').offsetTop + document.getElementById('content_mid_bottom').offsetHeight;
	
	
	
	document.getElementById('wrapper').style.height = hoehe + 'px';
}

function getV(value)
{
document.getElementById('kperson').value = value

}