/**
 * Opens a popup window
 * No scrollbar
 */
function popup_spez(adr,windowName,features) { 
  window.open(adr,windowName,features);
} 

/**
 * Opens a popup window
 *
 */
 
function popup(url, width, height)
{
	marginLeft = 40;
	marginTop = 40;
	if (width > document.body.clientWidth)
	{
		marginLeft = 0;
	}
	if (width > document.body.clientHeight)
	{
		marginTop = 0;
	}
	var args = "width=" + width + ",height=" + height + ",resizable=yes,dependent=no,scrollbars=yes,left="
		+ marginLeft + ",top=" + marginTop;
	window.open(url, "popup", args);
}

/**
 * Ticker
 */
var swidth=400;
var sheight=10;
var sbcolor="#e0e0e0";
var sspeed=1;
var resumespeed=1;


wholemessage = "";

var resumesspeed=sspeed;
var sizeup=0;
var broper=navigator.userAgent.toLowerCase().indexOf('opera');

function start(langCode)
{
	if (langCode == "de")
	{
		wholemessage = document.form.de.value;
	}
	if (langCode == "fr")
	{
		wholemessage = document.form.fr.value;
	}
	if (langCode == "it")
	{
		wholemessage = document.form.it.value;
	}
	
	if (document.all)
		iemarquee(slider);
	else if (document.getElementById)
		ns6marquee(document.getElementById('slider'));
	else if(document.layers)
		ns4marquee(document.slider1.document.slider2);
}


function iemarquee(whichdiv)
{	iediv=eval(whichdiv)
	iediv.style.pixelLeft=swidth
	iediv.innerHTML='<nobr>'+wholemessage+'</nobr>'
	sizeup=iediv.offsetWidth
	ieslide()
}


function ieslide()
{	if (iediv.style.pixelLeft>=sizeup*(-1))
	{	iediv.style.pixelLeft-=sspeed
	setTimeout("ieslide()",20)
	}
	else
	{	iediv.style.pixelLeft=swidth
		ieslide()
	}
}


function ns4marquee(whichlayer)
{	ns4layer=eval(whichlayer)
	ns4layer.left=swidth
	ns4layer.document.write('<nobr>'+wholemessage+'</nobr>')
	ns4layer.document.close()
	sizeup=ns4layer.document.width
	ns4slide()
}


function ns4slide()
{	if (ns4layer.left>=sizeup*(-1))
	{	ns4layer.left-=sspeed
		setTimeout("ns4slide()",20)
	}
	else
	{	ns4layer.left=swidth
		ns4slide()
	}
}


function ns6marquee(whichdiv)
{
	ns6div=eval(whichdiv);
	ns6div.style.left=swidth + "px";
	ns6div.innerHTML='<nobr>'+wholemessage+'</nobr>';
	sizeup=ns6div.offsetWidth;
	ns6slide();
}


function ns6slide()
{	if (parseInt(ns6div.style.left)>=sizeup*(-1))
	{	ns6div.style.left=parseInt(ns6div.style.left)-sspeed + "px";
		setTimeout("ns6slide()",20)
	}
	else
	{	ns6div.style.left=swidth + "px";
		ns6slide()
	}
}

/**
 * displays the flash movie
 *
 **/
function displayMovie()
{
	var isIE = (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") >= 0));
	var MM_contentVersion = 4;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		    for (var i = 0; i < words.length; ++i)
		    {
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i]; 
		    }
		var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
	if ( MM_FlashCanPlay || isIE) {
			document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="lhg_intro" WIDTH="812px" HEIGHT="272px" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="lhg_intro.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noborder> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
		document.write(' <EMBED src="lhg_intro.swf" menu=false quality=high scale=noborder bgcolor=#FFFFFF  ');
		document.write(' swLiveConnect=FALSE WIDTH="812px" HEIGHT="272px" NAME="lhg_intro" ALIGN=""');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	}
	else
	{
		document.write('<table class="maxtable"><tr><td><table class="maintable">');
		document.write('<tr><td style="text-align: center; vertical-align: middle; height: 800px;"><img src="img/logos/lhg-logo_einstieg.gif" usemap="#lhg_intro" border="0"></td></tr>');
		document.write('</table></td></tr></table>');
	}
}

/**
 * search in dropdowns
 *
 **/
function searchValue(str, dropdown)
{
  if (str != "")
  {
    for(i=0; i<dropdown.length; i++)
    {
      if(dropdown.options[i].text.toLowerCase().indexOf(str.toLowerCase()) == 0)
      {
        dropdown.selectedIndex=i;
        break;
      }
    }
  }
  else
  {
    dropdown.selectedIndex=0;
  }
}