var nNavigatorIndex = 1;
var nNavigatorLinksIndex = 3;

function MM_swapImgRestore()
{ //v3.0
	var doc = parent.frames[nNavigatorIndex].document;
  var i,x,a=document.MM_sr;
  var bTest = false;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
  {
		if (doc.title == null)
		{
			bTest = true;
		}
		else
		{
			bTest = (a[i] != doc.title);
		}
		if (bTest)
	  	x.src=x.oSrc;
  }
}

function MM_findObj(n, d) { //v3.0
  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); return x;
}

function MM_swapImage()
{ //v3.0
  var i,j=0,x,a=MM_swapImage.arguments;
	var doc = parent.frames[nNavigatorIndex].document;
  var bTest = false;
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null)
		{
			if (doc.title == null)
			{
				bTest = true;
			}
			else
			{
				bTest = (a[i] != doc.title);
			}
			if (bTest)
			{
				document.MM_sr[j++]=x;
				if(!x.oSrc)
					x.oSrc=x.src;
				x.src=a[i+2];
			}
		}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function ZweiFrames(URL1,F1,URL2,F2,IMG_NAME)
{
  parent.frames[F1].location.href=URL1;
  parent.frames[F2].location.href=URL2;
  var doc = parent.frames[nNavigatorLinksIndex].document;
  var sNameOld = doc.title;
  doc.title = IMG_NAME;
  
	var image;
	if (sNameOld != null)
	{
		if ((image=MM_findObj(sNameOld, doc))!=null)
		{
			image.src = "../img/strich-k.gif";
		}
	}


	if ((image=MM_findObj(IMG_NAME, doc))!=null)
	{
			image.src = "../img/strich-k1.gif";
	}
}

function FuenfFrames(URL1,F1,URL2,F2,URL3,F3,URL4,F4,URL5,F5,IMG_NAME)
{
  parent.frames[F1].location.href=URL1;
  parent.frames[F2].location.href=URL2;
  parent.frames[F3].location.href=URL3;
  parent.frames[F4].location.href=URL4;
  parent.frames[F5].location.href=URL5;
  var doc = parent.frames[nNavigatorIndex].document;
  var sNameOld = doc.title;
  doc.title = IMG_NAME;
  
	var image;
	if (sNameOld != null)
	{
		if ((image=MM_findObj(sNameOld, doc))!=null)
		{
			image.src = "../img/" + sNameOld + "1.gif";
		}
	}


	if ((image=MM_findObj(IMG_NAME, doc))!=null)
	{
			image.src = "../img/" + IMG_NAME + ".gif";
	}
	doc.MM_sr = new Array;
}

function checkFrameset()
{
	if(!parent.text)
	{
		if ((location.pathname.search(/titel.htm/) == -1) &&
			(location.pathname.search(/navigator.htm/) == -1))
		{
			
			location.href="http://www.feel-good-look-good.ch/index.html";// + location.pathname;
		}
		else
		{
			location.href="http://www.feel-good-look-good.ch/index.html";
		}
	}
}

function checkFramecall()
{
	var Adressanhang=location.search;
	if(Adressanhang)
	{
		frames.text.location.href=Adressanhang.substring(1,Adressanhang.length);
	}
}

function chkFormular()
{	
	if (document.Formular.Name.value.length <3) 
	{
		alert ("Bitte Namen eingeben!");
		document.Formular.Name.focus();
		return false;
	}
	if (document.Formular.Strasse.value.length <5) 
	{
		alert ("Bitte Strasse eingeben!");
		document.Formular.Strasse.focus();
		return false;
	}
	
	if (document.Formular.Ort.value.length <8) 
	{
		alert ("Bitte PLZ und Wohnort eingeben!");
		document.Formular.Ort.focus();
		return false;
	}
	
	if (document.Formular.Email.value.length <3) 
	{
			alert ("Bitte E-mail eingeben!");
			document.Formular.Email.focus();
			return false;
	}
	if (document.Formular.Tel.value.length <3) 
	{
			alert ("Bitte Telefon eingeben!");
			document.Formular.Tel.focus();
			return false;
	}
	return true;
}

