function SymError()
{
    return true;
}

function cm()
{
    return false;
}

function dd()
{
    return false;
}

function chkGB() 
{	
	var goon = 1;
	document.getElementById("gberror").style.display = "none";					
	document.getElementById("gbname").style.color = "black";						
	document.getElementById("gbtext").style.color = "black";	
	if (document.FormularGB.User.value == "")  {document.getElementById("gbname").style.color   = "red";goon = 0;}	
	if(document.FormularGB.Text.value == "")   {document.getElementById("gbtext").style.color   = "red";goon = 0;}
	if(goon == 0)
	{
	  document.getElementById("gberror").style.display = "block";
	  return false;
	}		
}


function chkFormular () 
{
	var goon = 1;
	document.getElementById("kontakterror").style.display = "none";				
	document.getElementById("kontaktname").style.color = "black";					
	document.getElementById("kontakttopic").style.color = "black";					
	document.getElementById("kontakttext").style.color = "black";	
	if (document.Formular.User.value == "")  {document.getElementById("kontaktname").style.color   = "red";goon = 0;}
	if (document.Formular.Topic.value == "") {document.getElementById("kontakttopic").style.color  = "red";goon = 0;}
	if(document.Formular.Text.value == "")   {document.getElementById("kontakttext").style.color   = "red";goon = 0;}
	if(goon == 0)
	{
	  document.getElementById("kontakterror").style.display = "block";
	  return false;
	}		
}
function chkAccFormular () 
{
    var goon = 1;
	document.getElementById("AUser").style.color = "black";					
	document.getElementById("AMail").style.color = "black";					
	document.getElementById("AStreet").style.color = "black";					
	document.getElementById("ANumber").style.color = "black";					
	document.getElementById("ACode").style.color = "black";					
	document.getElementById("ACity").style.color = "black";	
	document.getElementById("error").style.display = "none";				
	document.getElementById("Accommodation_type").style.color = "black";						
	if (document.Formular.User.value == ""){document.getElementById("AUser").style.color   = "red";goon = 0;}
	if (document.Formular.Mail.value == ""){document.getElementById("AMail").style.color   = "red";goon = 0;}
	//if (document.Formular.Mail.value.indexOf("@") == -1){document.getElementById("AMail").style.color   = "red";goon = 0;}
	if (document.Formular.Street.value == ""){document.getElementById("AStreet").style.color = "red";goon = 0;}	
	if (document.Formular.Number.value == ""){document.getElementById("ANumber").style.color = "red";goon = 0;}
	if (document.Formular.Code.value == ""){document.getElementById("ACode").style.color   = "red";goon = 0;}	
	if (document.Formular.City.value == ""){document.getElementById("ACity").style.color   = "red";goon = 0;}	
	if(goon == 0)
	{
	  document.getElementById("error").style.display = "block";
	  return false;
	}	
}
function chkRecommendationFormular() 
{	
	var goon = 1;
	document.getElementById("recommname").style.color = "black";					
	document.getElementById("recommmail").style.color = "black";					
	if ((document.Recommendation.recommendationName.value == ""))
	{
		document.getElementById("recommname").style.color = "red";
		goon = 0;		
	}  
	if ((document.Recommendation.recommendationReceiver.value == "")||(document.Recommendation.recommendationReceiver.value.indexOf("@") == -1)) 
	{
		document.getElementById("recommmail").style.color = "red";					
		goon = 0;	
	}  	
	if(goon == 0)
	{
	 document.getElementById("recommerror").style.display = "block";
	 return false;
	}
}

function showMorePics()
{
	document.getElementById("hidden_pics").style.display = "block";
	document.getElementById("show_hidden_pics_link").style.display = "none";
	document.getElementById("show_visible_pics_link").style.display = "block";	
}
function hideMorePics()
{
	document.getElementById("hidden_pics").style.display = "none";
	document.getElementById("show_hidden_pics_link").style.display = "block";
	document.getElementById("show_visible_pics_link").style.display = "none";	
}

function showHistory()
{
	document.getElementById("hidden_history").style.display = "block";
	document.getElementById("show_hidden_history_link").style.display = "none";
	document.getElementById("show_visible_history_link").style.display = "block";	
}
function hideHistory()
{
	document.getElementById("hidden_history").style.display = "none";
	document.getElementById("show_hidden_history_link").style.display = "block";
	document.getElementById("show_visible_history_link").style.display = "none";	
}
function showAktuell()
{	
	document.getElementById("hidden_aktuell").style.display = "block";
	document.getElementById("show_hidden_aktuell_link").style.display = "none";
	document.getElementById("show_visible_aktuell_link").style.display = "block";	
}
function hideAktuell()

{
	document.getElementById("hidden_aktuell").style.display = "none";
	document.getElementById("show_hidden_aktuell_link").style.display = "block";
	document.getElementById("show_visible_aktuell_link").style.display = "none";	
}  
function hoverIE() 
{
    
	var LI = document.getElementById("Navigation").firstChild;
	do 
	{
		if(LI.firstChild) 
		{  
			if(LI.firstChild.nextSibling) 
			{  			
				if(LI.firstChild.nextSibling.nextSibling) 
				{  				
					LI.onmouseover=show; LI.onmouseout=hide;
				}
			}
		}
		LI = LI.nextSibling;
	}
	while(LI);

}

function initAccDetails()
{
    var i = 0;
    var j = 0;	
	for(j=0;j<50;j++)
	{		
		var tmpString2 = "ad" + j;		
		for(i=0;i<document.getElementsByName(tmpString2).length;i++)
		{	
			document.getElementsByName(tmpString2)[i].style.display = "none";						
		}		
	}
}

function showAccDetails(element)
{
    var i = 0;
	var tmpString = element + "b";	
	document.getElementsByName(tmpString)[0].style.display = "none";
    for(i=0;i<document.getElementsByName(element).length;i++)
	{	
		document.getElementsByName(element)[i].style.display = "block";
	}
}

function hideAccDetails(element)
{
    var i = 0;
	var tmpString = element + "b";	
	document.getElementsByName(tmpString)[0].style.display = "block";    
    for(i=0;i<document.getElementsByName(element).length;i++)
	{	
		document.getElementsByName(element)[i].style.display = "none";
	}
}

function show() 
{
    this.firstChild.nextSibling.nextSibling.style.display = "block";
    this.firstChild.nextSibling.nextSibling.style.backgroundColor = "silver";
    
}

function hide() 
{
    this.firstChild.nextSibling.nextSibling.style.display = "none";
}

function scrollTop () 
{
  var y = 0;
  if (window.pageYOffset) 
  {
    y = window.pageYOffset;
  } else if (document.body && document.body.scrollTop) 
  {
    y = document.body.scrollTop;
  }
  var max = y/30;
  var scroll_str = "window.scrollBy(0, -"+max+")"
  while (y > 0) 
  {
    setTimeout(scroll_str, 10);
    y = y - max;
  }
}

function openWindow(url, windowName, width, height)
{
	var DEFAULT_FEATURES = "location=0,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=1,toolbar=0,screenX=0,left=0,screenY=0,top=0";
	if (width == null && height == null)
    {
        switch(windowName)
        {
		case "01":
			width = 695;
			height = 492;
			break;
		case "02":
			width = 450;
			height = 495;
			break;			
		default:
			width = DEFAULT_WIDTH;
			height = DEFAULT_HEIGHT;
			break;
		}
	}	
	else
    {
		if (width == null) width = DEFAULT_WIDTH;
		if (height == null) height = DEFAULT_HEIGHT;
	}	
	var features = "width=" + width + ",height=" + height + "," + DEFAULT_FEATURES;
	var newWin = window.open(url, windowName, features);
	newWin.focus();
	return newWin;
}

function popup(aEl) 
{
	var windowName = aEl.getAttribute("target") ? aEl.getAttribute("target") : DEFAULT_TARGET;
	alert(windowName);
	return openWindow(aEl.getAttribute("href"), windowName);
}

function popupP(url,format) 
{
    var DEFAULT_FEATURES = "location=0,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=1,toolbar=0,screenX=0,left=0,screenY=0,top=0";
	var height;
	var width;
		
    switch(format)
    {
	/*case 1:
		width = 695;
		height = 492;
		break;
	case 2:
		width = 450;
		height = 520;
		break;			
	case 3:
		width = 750;
		height = 380;
		break;			
	case 4:
		width = 950;
		height = 380;
		DEFAULT_FEATURES = "location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=1,toolbar=0,screenX=0,left=0,screenY=0,top=0";
		break;
		*/
	case 5:
		width = 570;
		height = 370;
		break;										
	case 6:
		width = 570;
		height = 470;
		break;			
	default:
		width = 1024;
		height = 700;
		break;
	}	
	//width = 950;
	//height = 600;
	var features = "width=" + width + ",height=" + height + "," + DEFAULT_FEATURES;
	var newWin = window.open(url, "Foto", features);
	newWin.focus();	
}

function w_close()
{	
	window.close();
}

function init()
{
	window.onerror = SymError;	
	initAccDetails();
	hoverIE();	
	if(top.frames.length > 0) top.location.href=self.location;      
	//document.getElementById("show_hidden_history_link").style.display = "block";		
	//document.getElementById("show_hidden_aktuell_link").style.display = "block";		
	document.getElementById("scrollTop").style.display = "block";		
	
}

function init_foto_show()
{    
    document.oncontextmenu  = cm;
    window.onerror = SymError;
    if(top.frames.length > 0) top.location.href=self.location;   
	document.ondragstart = menu();
}

function cookieKiller()
{
 var end = new Date();
 document.cookie = "session=; expires=" + end.toGMTString();
 alert("erfolgreich ausgeloggt");
}

window.onload = init;