function jumpTo(url)
{
	win = window.open(url,target="content");
}

// MAP
function mapchange(wert)
{
ausgabe(wert)
mapgo(wert)
}


// onload gastronomie
function gastrogo(adrid){
change(3,3)
//<?php if ($rest_id != ''): echo "ausgabe(adrid)\n"; echo "mapgo(adrid)"; endif; ?>
ausgabe(adrid)
mapgo(adrid)
}

function showSubLink(){
	parent.document.getElementById('subLink').style.display    = 'block';
}

function hideSubLink(){
	parent.document.getElementById('subLink').style.display    = 'none';
}

// Austauschen von Bildern
NewImg = new Array (
"frontend/img/pic_00.jpg", //home
"frontend/img/pic_01.jpg", //rezepte
"frontend/img/pic_02.jpg", //kalender
"frontend/img/pic_03.jpg", //gastronomie
"frontend/img/pic_04.jpg", //verein
"frontend/img/pic_05.jpg", //kalender2
"frontend/img/pic_06.jpg", //gastronomie2
"frontend/img/pic_07.jpg"  //restaurant des monats
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;

function chgImg(direction) {
if (parent.document.images) {
ImgNum = direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
parent.document.picture.src = NewImg[ImgNum];
   }
}

// onload stabdard
function change(frame,pic)
{
	//alert ('Hello');
navigo(frame);
chgImg(pic);
}


// Flash Steuerung 
var MSIE= "Microsoft Internet Explorer";
var NETSC= "Netscape";

var bName = navigator.appName;
var bVers = navigator.appVersion;
var bVers = bVers.substring(0,3);
var bVers = Number(bVers);

function navigo(wert) {
    if(bName==MSIE && bVers>=4.0) {
     parent.document['navi'].TGotoFrame("_flash0",wert);

    } else {
        if(bName==NETSC && bVers>=6.0){
          parent.document.embeds['navi'].TGotoFrame("_flash0",wert);
		 
         } else {
          parent.document['navi'].TGotoFrame("_flash0",wert);
        }
    }	
}

function mapgo(wert) {
 document['karte'].TGotoFrame("_flash0",wert);
}

//drucken
function drucken()
{
f1=window.open("","","width=200,height=200")

txt=document.getElementById("druck").innerHTML

with(f1.document)
{
open()
write(txt)
close()
}
f1.focus()
f1.print()
f1.close()
}

//drucken
function ausdrucken()
{
f1=window.open("gastro_liste.html","","width=200,height=200")

txt=document.getElementById("druck").innerHTML

with(f1.document)
{
open()
write(txt)
close()
}
f1.focus()
f1.print()
f1.close()
}


//PopUp Fenster 
function winOpen(url, breite, hoehe,sbar) {
links = (screen.width/2)-(breite/2);
oben = (screen.height/2)-(hoehe/2);
window.open(url,"window"+breite,"height="+hoehe+",width="+breite+",status = no,toolbar = no,menubar = no,location = no,resizable = no,titlebar = no,scrollbars="+sbar+" ,fullscreen = no,target='_blank',top ="+oben+",left ="+links);
}

// Ein-und Ausblenden von div Elementen
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_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function showRecipeForm() {	
	if( document.getElementById('recipeUploadForm').style.display == 'block' ) {
		document.getElementById('recipeUploadForm').style.display = 'none';			
		document.getElementById('linkRecipeForm').innerHTML = '<img width="9" height="9" border="0" src="/frontend/img/dot_red.gif" name="Ired1" alt=""> Hier können Sie ihr Rezept veröffentlichen.';
		document.getElementById('linkRecipeForm').title = 'Hier können Sie ihr Rezept veröffentlichen';
	}
	else {
		document.getElementById('linkRecipeForm').innerHTML = '<img width="9" height="9" border="0" src="/frontend/img/dot_red.gif" name="Ired1" alt=""> Formular schliessen';			
		document.getElementById('linkRecipeForm').title = 'Formular schliessen';
		document.getElementById('recipeUploadForm').style.display = 'block';
	}
}

function checkRecipeForm() {	
	var err = false;
	if( document.getElementById('recipename').value == '' ||  document.getElementById('recipetext').value == '' ||  document.getElementById('recipeingredients').value == '' ) {
		err = true;
	}
	
	if( !err ) {
		return true;
	}
	else{
		alert('Bitte füllen Sie alle als * Pflichtfeld gekennzeichneten Felder aus!')
		return false;
	}
}

function checkRecommendForm() {	
	var err = false;
	if( document.getElementById('to').value == '' ||  document.getElementById('to_email').value == '' ||  document.getElementById('from_firstname').value == '' ||  document.getElementById('from_lastname').value == '' ||  document.getElementById('from_email').value == '' ) {
		err = true;
	}
	
	if( !err ) {
		return true;
	}
	else{
		alert('Bitte füllen Sie alle als * Pflichtfeld gekennzeichneten Felder aus!')
		return false;
	}
}

function showRecommendForm(){
	document.getElementById('recommend_box').style.display = 'block';
}

function closeRecommendForm(){
	document.getElementById('recommend_box').style.display = 'none';
}
