
	 var mmOasShowPos = 0;
function mmShowOASPos(pos) {

	return false;
}
function OAS_RICH(pos) {
	mmShowOASPos(pos);
}

function mmGetHashParams() {
	var loc=(document.location.href+""); 
	var pos=loc.indexOf("#");
	if (pos == -1) 
		return [];
	var hashQs=loc.substring(pos+1, loc.length);
	return mmSplitParams(hashQs);
}
function mmSplitParams(params) {
	var result=[];
	var pairs=params.split("&");
	for (var i=0; i < pairs.length; i++) {
		var kv=pairs[i].split("=");
		if (kv.length == 2)
			result[kv[0]]=kv[1];
	}
	return result;
}
function getCookieContent (cookieName) {
	function getCookieValue (position) 	{
		var endpos = document.cookie.indexOf(";", position);
		if (endpos == -1)
			endpos = document.cookie.length;
		return unescape(document.cookie.substring(position, endpos));
	}
	var cookieString       = cookieName + "=";
	var cookieStringLength = cookieString.length;
	var allCookieLength    = document.cookie.length;
	var n = 0;
	while (n < allCookieLength) {
		var m = n + cookieStringLength;
		if (document.cookie.substring(n, m) == cookieString)
			return getCookieValue(m);
		n = document.cookie.indexOf(" ", n) + 1;
		if (n == 0) break;
	}
	return null;
}
function mmSearchImageWissen(){
	if (document.mmSearchWissen.suchbegriff) {
		var el = document.mmSearchWissen.suchbegriff;
		if (el.value == '' || el.value == undefined) {
			//el.style.backgroundImage="url('/static/te/backgrounds/bg_wissensearch.gif')";
			el.className = 'mmTextField mmWissenSearch';
		}
		else {
			//el.style.backgroundImage='';
			el.className = 'mmTextField mmWissenSearchWhite';
		}
	}
}
function mmSearchImageKurse(){
	if (document.mmSearchKurse.suchbegriff) {
		var el = document.mmSearchKurse.suchbegriff;
		if (el.value == '' || el.value == undefined) {
			//el.style.backgroundImage="url('/static/te/backgrounds/bg_aktiensearch.gif')";
			el.className = 'mmTextField mmShareSearch';
		}
		else {
			//el.style.backgroundImage='';
			el.className = 'mmTextField mmShareSearchWhite';
		}
	}
}
/******* Social Bookmarking functions ******/
/**
* toggles SocialBookmark-Box on and off
* @param mmDisplay - ture=on, false=off
*/
function mmSocialBookmarkSetDisplay(mmDisplay) {
mmSocialBookmarkElement = document.getElementById("mmSocialBookmark").style;
mmSocialBookmarkElement.visibility = (mmDisplay ? "visible" : "hidden");
mmSocialBookmarkState=mmDisplay;
}
/**
* toggle function called form Bookmark Link
* served mmSocialBookmarkSetDisplay() and starts EventHandler
*/
function mmSocialBookmarkToggle() {
if (!mmSocialBookmarkState) {
mmSocialBookmarkSetDisplay(true);
mmStartMouseEvent();
}
else 
mmSocialBookmarkSetDisplay(false);
}
/**
* Event handler function tests where the user clicked
* and acts	according to this (switch SocialBookmark-Box off 
* stops EventHandler)
*/
function mmSocialBookmarkToggleDisplay(e) {
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
if (targ.nodeType == 3) // defeat Safari bug
targ = targ.parentNode;
if (targ.id == "mmSocialBookmarkLink") {
mmStopMouseEvent();
return false;
}
var isInDiv = false;
while(targ != null) {
if (targ.id == "mmSocialBookmark") {
isInDiv=true;
break;
}
if (targ.id == "mmSocialBookmarkClose")
break;
targ = targ.parentNode;
}
if (!isInDiv) {
mmSocialBookmarkSetDisplay(false);
mmStopMouseEvent();
}
return false;
}
/**
* starts EventHandling
*/
function mmStartMouseEvent(){
if (document.addEventListener) { // DOM Level 2 Event Model
document.addEventListener("mouseup", mmSocialBookmarkToggleDisplay, true);
}
else if (document.attachEvent) { // IE 5+ Event Model
document.attachEvent("onmouseup", mmSocialBookmarkToggleDisplay);
}
else { // IE 4 Event Model
document.onmouseup=mmSocialBookmarkToggleDisplay;
}
}
/**
* stops EventHandling
* mmOldHandler is a hack for EI4 Event Model
*/
var mmOldHandler = document.onmouseup;	// Eventhandler for EI 4 StopEvent
function mmStopMouseEvent() {
// Unregister the capturing event handlers.
if (document.removeEventListener) { // DOM Event Model
document.removeEventListener("mouseup", mmSocialBookmarkToggleDisplay, true);
}
else if (document.detachEvent) { // IE 5+ Event Model
document.detachEvent("onmouseup", mmSocialBookmarkToggleDisplay);
}
else { // IE 4 Event Model
document.onmouseup = mmOldHandler;
}
}

	var mmoMobileClients=[
	      "midp",
	      "240x320",
	      "blackberry",
	      "netfront",
	      "nokia",
	      "panasonic",
	      "portalmmm",
	      "sharp",
	      "sie-",
	      "sonyericsson",
	      "symbian",
	      "windows ce",
	      "benq",
	      "mda",
	      "mot-",
	      "opera mini",
	      "philips",
	      "pocket pc",
	      "sagem",
	      "samsung",
	      "sda",
	      "sgh-",
	      "vodafone",
	      "xda"
	];
	
	
	function mmoIsMobileClient(userAgent) {
	      try {
	            userAgent=userAgent.toLowerCase();
	            for (var i=0; i < mmoMobileClients.length; i++)
	                  if (userAgent.indexOf(mmoMobileClients[i]) != -1)
	                        return true;
	      }
	      catch (e) { // pssst.
	      }
	      return false;
	}
	
	
	function mmoIsThisBrowserMobileClient() {
	      return mmoIsMobileClient(navigator.userAgent);
	}
	

	function mmoRedirectIfMobileClient() {
		try {
			if (mmoIsThisBrowserMobileClient()) {
				if (document.location.href.indexOf('#nomobile') != -1) {
					document.cookie='nomobile';
					return;
				}	

				if (document.cookie && document.cookie.indexOf('nomobile') != -1) 
					return;
					
				document.location.href="http://mobil.manager-magazin.de?redirect=1";
			}
		}
		catch (e) { 
		}
	}
/**
* spFontSizer increase/decrease font size inside "spEmStep"
*
* use: spFontSizer(1, false), spFontSizer(-1, false) or spFontSizer(0, true)
* @param spInc set to 1 or -1
* @param spReset set to true to get initial font size
*/
var mmEmStepWidth 	= 0.125;	// increase/decrease font every step by spEmStepWidth
var mmEmBasis 		= 1.125;		// font size of mmArticleBody at startup
var mmEmStep 		= -1;		// counter for current step (leave as 0)
var mmEmMaxSteps 	= 1;		// maximum steps alowed

function mmFontSizer(mmInc, mmReset) {
	// reset font size
	if (mmReset) 
		mmEmStep = -1;
	// inside allowed steps?
	if (Math.abs(mmEmStep + mmInc) <= mmEmMaxSteps) {
		// increase/decrease spEmStep
		mmEmStep += mmInc;
		// set new font size for every tag inside "spEmStep"
		mmEmFontSize = mmEmStep * mmEmStepWidth + mmEmBasis;
		//get spArticleBody
		mmEmBody = document.getElementById('mmMainContent');
		// set new fot size
		mmEmBody.style.fontSize = mmEmFontSize + "em";
	}

	if (mmReset) {
		document.getElementById("mmFontsizePlus").src = "/static/te/icons/ic_fontsize_plus.gif";
		document.getElementById("mmFontsizeMinus").src = "/static/te/icons/ic_fontsize_minus_lo.gif";
	}
	else {
		if (mmEmStep == -mmEmMaxSteps) {
			document.getElementById("mmFontsizeMinus").src = "/static/te/icons/ic_fontsize_minus_lo.gif";
		}
		else if (mmEmStep == mmEmMaxSteps) {
			document.getElementById("mmFontsizePlus").src = "/static/te/icons/ic_fontsize_plus_lo.gif";
		}
		else {
			document.getElementById("mmFontsizePlus").src = "/static/te/icons/ic_fontsize_plus.gif";
			document.getElementById("mmFontsizeMinus").src = "/static/te/icons/ic_fontsize_minus.gif";
		}
	}
}



function mmOAS_reminder(html) { 
	if( html == null || html == "null" ) {
		html = '';
	}
	document.getElementById('mmOASreminder').innerHTML = html;
}
function showReiter (name, id) 
{
	for (i=1;i<=10;i++){
		var name2 = name + i ;
		if (document.getElementById(name2)){
			if (id == i){
				document.getElementById(name2).style.background = '#ffffff';
			}
			else {
				document.getElementById(name2).style.background = '#f4f4f4';			
			}	
		}
	} 
}
 
function mmMainNaviInit(mmNavUlName) {
	if (document.all && document.getElementById) {
		var ul = document.getElementById(mmNavUlName);
		if (ul.nodeName == 'UL') {
			var mmNavItems = ul.getElementsByTagName('li');
			for (var j in mmNavItems) {
				var li = mmNavItems[j];
				if (li.nodeName == 'LI' && li.className != 'mmNoHover') {
				
					li.onmouseover = function() {
						// lazy initialization

						if (!this.cssClass) {
							if (this.className != '')
								this.classBackup=this.className;
							this.cssClass = this.className + ' mmMainNavLiHover';
						}
						
						this.className = this.cssClass;
						if (! this.mmSubNav) {
							var mmSubNavTmp = this.getElementsByTagName('ul')[0];
							if (mmSubNavTmp && mmSubNavTmp.nodeName == 'UL' && mmSubNavTmp.className == 'mmSubNav')
								this.mmSubNav = mmSubNavTmp;
						}
						
						if (this.mmSubNav) {
							this.mmSubNav.style.display = "block";
								
							this.subLis=this.mmSubNav.getElementsByTagName('li');
							for (var k in this.subLis) {
								
								var subLi = this.subLis[k];
								if (subLi.nodeName == 'LI') {
									subLi.onmouseover = function() {
										this.className = "mmSubNavLiHover";
									}

									subLi.onmouseout = function() {
										this.className = "";
									}
								}
							}
						}
					}
					li.onmouseout = function() {
						// lazy initialization
						if (this.classBackup)
							this.className = this.classBackup;
						else
							this.className = '';
						if (! this.mmSubNav) {
							var mmSubNavTmp = this.getElementsByTagName('ul')[0];
							if (mmSubNavTmp && mmSubNavTmp.nodeName == 'UL' && mmSubNavTmp.className == 'mmSubNav')
								this.mmSubNav = mmSubNavTmp;
						}
						if (this.mmSubNav)
							this.mmSubNav.style.display = "none";
					}
				}

			}
		}
	}
}
Mm_FlashvideoPopupParams = 'width=769,height=489,scrollbars=no,resizable=no,screenX=150,screenY=100';

	
			function mmDetectFlashVerInit(){
				if(!document.getElementById('swfversionscript')){
					var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
					var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
					var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
					
					if(isIE && isWin && !isOpera){
						document.write('<scr'+'ipt id="swfversionscript" type="text/vbscript">\n');
document.write('Function mmGetSwfVer(i)\n');
document.write('on error resume next\n');
document.write('Dim swControl, swVersion\n');
document.write('swVersion = 0\n');
document.write('set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))\n');
document.write('if (IsObject(swControl)) then\n');
document.write('swVersion = swControl.GetVariable("$version")\n');
document.write('end if\n');
document.write('mmGetSwfVer = swVersion\n');
document.write('End Function\n');
document.write('<\/scr'+'ipt>\n');
document.write('\n');

					} else {
						document.write('<scr'+'ipt id="swfversionscript" type="text/javascript">\n');
document.write('function mmGetSwfVer(i)\n');
document.write('{\n');
document.write('if (navigator.plugins != null && navigator.plugins.length > 0) {\n');
document.write('if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {\n');
document.write('var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";\n');
document.write('var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;\n');
document.write('descArray = flashDescription.split(" ");\n');
document.write('tempArrayMajor = descArray[2].split(".");\n');
document.write('versionMajor = tempArrayMajor[0];\n');
document.write('versionMinor = tempArrayMajor[1];\n');
document.write('if ( descArray[3] != "" ) {tempArrayMinor = descArray[3].split("r");} else {tempArrayMinor = descArray[4].split("r");}\n');
document.write('versionRevision=tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;\n');
document.write('// variable flashVer zusammensetzen -> analog zu ie\n');
document.write('flashVer="x " + versionMajor + "," + versionMinor + "," + versionRevision;\n');
document.write('}else{flashVer=-1;}\n');
document.write('}\n');
document.write('// MSN/WebTV 2.6 supports Flash 4\n');
document.write('else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;\n');
document.write('// WebTV 2.5 supports Flash 3\n');
document.write('else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;\n');
document.write('// older WebTV supports Flash 2\n');
document.write('else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;\n');
document.write('// Can\'t detect in all other cases\n');
document.write('else {flashVer = -1;}\n');
document.write('return flashVer;\n');
document.write('}\n');
document.write('<\/scr'+'ipt>\n');
document.write('\n');

					}
				}
			} 
		function mmDetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
		{
			var reqVer = parseFloat(reqMajorVer + "." + reqRevision);
			// loop backwards through the versions until we find the newest version	
			for (var i=25;i>0;i--) {
				versionStr = mmGetSwfVer(i);
				if (versionStr == -1 ) { 
					return false;
				} else if (versionStr != 0) {
					var versionArray = new Array();
					var tempArray   = versionStr.split(" ");
					var tempString  = tempArray[1];
					versionArray    = tempString .split(",");
					var versionMajor    = versionArray[0];
					var versionMinor    = versionArray[1];
					var versionRevision = versionArray[2];
					var versionString   = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
					var versionNum      = parseFloat(versionString);
					// is the major.revision >= requested major.revision AND the minor version >= requested minor
					if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
						return true;
					} else {
						return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
					}
				}
			}
		}
	function mmLoadFlash(videoid, flashvars){
	if(document.getElementById){
		if ( mmDetectFlashVer(8,0,0) ) {
			document.getElementById('flashvideoswf'+videoid).innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+videoid+'" width="180" height="155">\n<param name="movie" value="/static/flash/flashvideo/180-all-004.swf" />\n<param name="allowFullScreen" value="true" />\n<param name="quality" value="high" />\n<param name="bgcolor" value="#f2f2f2" />\n<param name="menu" value="false" />\n<param name="wmode" value="opaque" />\n<param name="allowScriptAccess" value="sameDomain" />\n<param name="FlashVars" value="'+flashvars+'" />\n<embed src="/static/flash/flashvideo/180-all-004.swf" name="'+videoid+'" type="application/x-shockwave-flash" width="180" height="155" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" bgcolor="#f2f2f2" menu="false" wmode="opaque" allowScriptAccess="sameDomain" FlashVars="'+flashvars+'" allowFullScreen="true"><\/embed>\n<\/object>\n'; 
						 } else {  
			document.getElementById('flashvideoswf'+videoid).innerHTML = '<div style="width:100%;height:155px;padding:3px;background-color:#f0f0f0">\n<font face="verdana" size="-2">\nDer benötigte Flash Player 8 wurde nicht gefunden.<br />\nMögliche Ursachen:<br /><br />\nJavaScript erkennt den Player nicht korrekt.<br />\n<a href="http://www.manager-magazin.de/videoplayer/0,6521,'+videoid+',00.html" title="Video abspielen..." target="SPONflashvideo" onClick="window.open(\'http://www.manager-magazin.de/videoplayer/0,6521,'+videoid+',00.html\',\'SPONflashvideo\',SpOnENV_FlashvideoPopupParams).focus();return false;">Große Version ohne Abfrage starten (Flash Player 8 erforderlich)<\/a><br /><br />\nDer Player ist nicht vorhanden.<br />\n<a href="http://www.macromedia.com/go/getflash/" target="_blank">Jetzt installieren<\/a>\n<\/font>\n<\/div>';
						 mmShowFlashDiv(videoid);
			document.getElementById('flashvideocredit'+videoid).style.display = 'none';
		}
	}
}

function mmShowFlashDiv(videoid) { 
	document.getElementById('flashvideoswf'+videoid).style.zIndex=3;
	document.getElementById('flashfotocredit'+videoid).style.display = 'none';
	document.getElementById('flashvideocredit'+videoid).style.display = 'block';
}

function mmVideoPopup(videoid){ 
	window.open('/videoplayer/0,6521,'+videoid+',00.html', 'MmFlashvideo', Mm_FlashvideoPopupParams).focus();
}

function mmOAS_reminder(html) { 
 	if( html == null || html == "null" ) {
 		html = '';
 	}
 	document.getElementById('mmOASreminder').innerHTML = html;
}


	var mmTmpImgSetToLoad;
	// Muss ausserhalb des spEnhPaginators stehen, da per timeout aufgerufen...
	function mmLoadDeferImgSet(prefix) {
	        for (var i=0; i < mmTmpImgSetToLoad.length; i++) {
	                var imgElement=document.getElementById(prefix + i);
	                if (imgElement != null)
	                        imgElement.src = mmTmpImgSetToLoad[i];
	        }
	}


	var mmEnhPaginator = function(paginatorId, imageSets) {
		this.pages=[];
		this.imageSets=imageSets;
		this.completedImageSets=(imageSets != null) ? new Array(imageSets.length) : null;
		this.index=0;
		this.paginatorId=paginatorId;
		this.imageSetToLoad=null;
		this.currentPage=null;
		this.initDone=false;
		this.onChangePage=null;
	}

	mmEnhPaginator.prototype = {
		checkInit: function() {
			if (!this.initDone) {
				
				var container=document.getElementById(this.paginatorId);
				var pagesTmp=container.getElementsByTagName('DIV');
				for (key=0; key < pagesTmp.length; key++)
					if (pagesTmp[key].className == 'mmPaginatorPage') {
						this.pages.push(pagesTmp[key]);
					}
	
				this.currentPage=this.pages[this.index];
				this.initDone=true;
			}
		},
		showNext: function(element) {
			this.checkInit();
			var oldIndex = this.index++;
			if (this.index >= this.pages.length)
				this.index = 0;
	
			if (this.onChangePage != null)
				this.onChangePage(this.pages[oldIndex]);
			this.switchToNewIndex();
		},
		showPrev: function(element) {
			this.checkInit();
			var oldIndex = this.index--;
			if (this.index < 0)
				this.index = this.pages.length - 1;
	
			if (this.onChangePage != null)
				this.onChangePage(this.pages[oldIndex]);
	
			this.switchToNewIndex();
		},
		showNum: function(element) {
			this.checkInit();
			var oldIndex = this.index;
			this.index = arguments[0];
			if (this.index < 0)
				this.index = this.pages.length - 1;
			if (this.onChangePage != null)
				this.onChangePage(this.pages[oldIndex]);
			this.switchToNewIndex();
		},		
		switchToNewIndex: function(newPage) {
			this.currentPage.style.display='none';
			this.currentPage=this.pages[this.index];
			this.currentPage.style.display='block';
			this.checkLoadImages();
		},
		checkLoadImages: function() {
			if (this.imageSets != null) {
				var imageSetIndex=this.index-1;
				if (this.imageSets[imageSetIndex] != null && !this.completedImageSets[imageSetIndex]) {
					mmTmpImgSetToLoad=this.imageSets[imageSetIndex];
					window.setTimeout("mmLoadDeferImgSet('" + this.paginatorId + imageSetIndex + "')", 20);
					this.completedImageSets[imageSetIndex]=true;
				}
			}
		}
	}
	

function mmoInArray(haystack, needle) {
	for (var i in haystack) {
		if (haystack[i] == needle)
			return true;
	}
	return false;
}

