// JavaScript Document
var isMac = (navigator.platform.indexOf("Mac") != -1) ? true : false;
var isIE = (navigator.appName.indexOf("Microsoft") == -1) ? false : true;
var isNetscape = (navigator.appName.indexOf("Netscape") == -1) ? false : true;
var mainStyle = "";
function setCSS(){
	if (isNetscape && isMac){
		mainStyle = "minStijl_1.0_net";
	}else if(isNetscape){
		mainStyle = "minStijl_1.0_net";
	}else{
		mainStyle = "minStijl_1.0";
	}
	document.write('<link href="'+toRootPath+'css/'+ mainStyle+'.css" rel="stylesheet" type="text/css" />');
}
setCSS();
//Basic Macromedica Funtions:
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 MM_swapImgRestore() { //v3.0
  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_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_swapImage() { //v3.0
  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];}
	//writeText('<font color="#FFFFFF">'+x.src + '</font>', 'logoDiv');
}

function MM_showHideLayers() {
	//v6.0
	var i, p, v, obj, args = MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i += 3) {
		if ((obj=MM_findObj(args[i])) != null) {
			v = args[i+2];
			if (obj.style) {
				obj = obj.style;
				v = (v == 'show') ? 'visible' : (v == 'hide') ? 'hidden' : v;
			}
			obj.visibility = v;
		}
	}
}
//
//
function swapClass(obj, cl) {
	var thisObj = MM_findObj(obj, '');
	thisObj.className = cl;
}
//

var MM_contentVersion = 6;
var MM_FlashCanPlay = false;
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]; 
	    }
		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');
}
function writeFlashMovie(vers, w, h, src, fvars, bg, wm){
	if(MM_FlashCanPlay){
		var textFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		textFlash += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=';
		textFlash += vers+',0,0,0" width="'+w+'" height="'+h+'">';
		textFlash += '<param name="movie" value="'+src+'" />';
		textFlash += '<param name="FlashVars" value="'+fvars+'" />';
		textFlash += '<param name="menu" value="false" />';
		textFlash += '<param name="quality" value="high" />';
		textFlash += '<param name="scale" value="noscale" />';
		textFlash += '<param name="wmode" value="'+wm+'" />';
		if(bg!=''){
			textFlash += '<param name="bgcolor" value="'+bg+'" />';
		}
		textFlash += '<embed src="'+src+'" type="application/x-shockwave-flash" ';
		textFlash += 'pluginspage="http://www.macromedia.com/go/getflashplayer" ';
		textFlash += 'flashvars="'+fvars+'" menu="false" quality="high" ';
		textFlash += 'wmode="'+wm+'" scale="noscale"';
		if(bg!=''){
			textFlash += ' bgcolor="'+bg+'"';
		}
		textFlash += ' width="'+w+'" height="'+h+'"></embed>';
		textFlash += '</object>';
		document.write(textFlash);
	}else{
		document.write('You need the Flash Player, please download it <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=English" target="_blank">here >>></a>');
	}
}
//end flash stuff
function showSubMenu(l){
	Effect.BlindDown(l, {from:.2});
}
function writeText(txt, div) {
	var Tekst = txt;
	var thisDiv = MM_findObj(div, '');
	if(thisDiv != "undefined" && thisDiv != null){
			thisDiv.innerHTML = '';
			thisDiv.innerHTML = Tekst;
	}
}

function saveText(div) {
	var thisDiv = MM_findObj(div, '');
	divText = thisDiv.innerHTML;
}
//Print version:
function printVersion(urll) {
	var druck=window.open(urll,"Print","toolbar=0,location=0,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=690,height=550,left=50,top=50");
	druck.focus;
}

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}

function checkSearchForm(field)
{
	if (field.value.length <3)
		{alert('Eingabe mindestens 3 Zeichen');
		field.focus();
		return false;
		}
	else
	{return true;}
}
