var originalURL, link_lang_1, link_lang_2, link_lang_3;
link_lang_1=link_lang_2=link_lang_3=originalURL=document.URL;

if(originalURL.search("_deutsch")!=-1)
{ link_lang_1=link_lang_1.replace("_deutsch","_englisch");
  link_lang_2=link_lang_2.replace("_deutsch","_franzoesisch");
  link_lang_3=link_lang_3.replace("_deutsch","_spanisch");
}
if(originalURL.search("_franzoesisch")!=-1)
{ link_lang_1=link_lang_1.replace("_franzoesisch","_deutsch");
  link_lang_2=link_lang_2.replace("_franzoesisch","_englisch");
  link_lang_3=link_lang_3.replace("_franzoesisch","_spanisch");
}
if(originalURL.search("_englisch")!=-1)
{ link_lang_1=link_lang_1.replace("_englisch","_deutsch");
  link_lang_2=link_lang_2.replace("_englisch","_franzoesisch");
  link_lang_3=link_lang_3.replace("_englisch","_spanisch");
}
if(originalURL.search("_spanisch")!=-1)
{ link_lang_1=link_lang_1.replace("_spanisch","_deutsch");
  link_lang_2=link_lang_2.replace("_spanisch","_englisch");
  link_lang_3=link_lang_3.replace("_spanisch","_franzoesisch");
}

//Links zu nicht fertiggestellten Sprachen überschreiben
link_lang_2='../../_data/globals/under_construction_fr.htm';
link_lang_3='../../_data/globals/under_construction_esp.htm';

function MM_swapImgRestore()
{
  var i,x,a=document.MM_sr;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
    x.src=x.oSrc;
}

function MM_preloadImages()
{
  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 MM_swapImage()
{
  var i,j=0,x,a=MM_swapImage.arguments;
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
    if((x=MM_findObj(a[i]))!=null)
	{ document.MM_sr[j++]=x;
	  if(!x.oSrc)
	    x.oSrc=x.src;
	  x.src=a[i+2];
	}
}

function MM_findObj(n, d)
{
  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 && document.getElementById)
    x=document.getElementById(n);
  return x;
}

function openWin(URL,winName,features)
{ win=window.open(URL,winName,features);
  win.focus();
}

function openDoc(URL,winName,features)
{ if(navigator.appName=="Microsoft Internet Explorer")
  { win=window.open(URL,winName,features);
    win.focus();
  }
  else 
    location.href=URL;
}

function addInfo()
{ if(self.document.kontaktform.comment.value.search("Angefordertes Informationsmaterial:")!=-1)
  { self.document.kontaktform.comment.value=self.document.kontaktform.comment.value.slice(0,self.document.kontaktform.comment.value.search(" / Angefordertes Informationsmaterial:")+1);
    self.document.kontaktform.comment.value=self.document.kontaktform.comment.value.slice(0,self.document.kontaktform.comment.value.search("Angefordertes Informationsmaterial:"));
  }
  if(self.document.kontaktform.info1.checked || self.document.kontaktform.info2.checked || self.document.kontaktform.info3.checked || self.document.kontaktform.info4.checked || self.document.kontaktform.info5.checked || self.document.kontaktform.info6.checked || self.document.kontaktform.info7.checked)
  { self.document.kontaktform.info.value=0;
    if(self.document.kontaktform.comment.value=="")
      self.document.kontaktform.comment.value="Angefordertes Informationsmaterial:";
    else
      self.document.kontaktform.comment.value=self.document.kontaktform.comment.value+" / Angefordertes Informationsmaterial:";
  }
  else	
  { self.document.kontaktform.info.value=1;
  }
  if(self.document.kontaktform.info1.checked) self.document.kontaktform.comment.value=self.document.kontaktform.comment.value+" Patientenspezifische Implantate,";
  if(self.document.kontaktform.info2.checked) self.document.kontaktform.comment.value=self.document.kontaktform.comment.value+" 3D-Modelle,";
  if(self.document.kontaktform.info3.checked) self.document.kontaktform.comment.value=self.document.kontaktform.comment.value+" Felsenbeinmodelle,";
  if(self.document.kontaktform.info4.checked) self.document.kontaktform.comment.value=self.document.kontaktform.comment.value+" Gehörknöchelchen,";
  if(self.document.kontaktform.info5.checked) self.document.kontaktform.comment.value=self.document.kontaktform.comment.value+" Trachea-Stützspangen,";
  if(self.document.kontaktform.info6.checked) self.document.kontaktform.comment.value=self.document.kontaktform.comment.value+" Faciale Kieferhöhlenwand,";
  if(self.document.kontaktform.info7.checked) self.document.kontaktform.comment.value=self.document.kontaktform.comment.value+" Software - MedicPlan";
  while(self.document.kontaktform.comment.value.charAt(self.document.kontaktform.comment.value.length-1)==',')
    self.document.kontaktform.comment.value=self.document.kontaktform.comment.value.slice(0,self.document.kontaktform.comment.value.length-1);
}
