
var flashversionMin = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (plugin) {
	for (f = 0; f < 20; f++) {
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		if (plugin.description.indexOf(f+".")>=0){
			flashversion = f;
			
			if (flashversion >= flashversionMin){
				plugin = true;
				break;
			}
		}
	}
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+flashversionMin+'")))\n');
	document.write('</SCRIPT\> \n');
}

function playSWF(file,id,vars,width,height,wmode,bgcolor,baseurl,wLName) {
	fsource='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	fsource+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ';
	fsource+=' ID='+id+' WIDTH="'+width+'"; HEIGHT="'+height+'">';
	fsource+=' <PARAM NAME="allowScriptAccess" VALUE="sameDomain" /> <PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=FlashVars VALUE="page_vars='+vars+'"> <PARAM NAME=menu VALUE=false>  <PARAM NAME="BASE" VALUE='+baseurl+'> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode value='+wmode+'> <PARAM NAME=bgcolor VALUE='+bgcolor+'>';
		if(navigator.userAgent.indexOf("Opera")==-1) {
			fsource+=' <EMBED src="'+file+'" FlashVars="page_vars='+vars+'" wmode='+wmode+' menu=false quality=high bgcolor='+bgcolor+'';
			fsource+=' swLiveConnect=FALSE allowScriptAccess="sameDomain" NAME='+id+' WIDTH="'+width+'" HEIGHT="'+height+'"';
			fsource+=' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" BASE='+baseurl+'>';
			fsource+=' </EMBED>';
		}
		else	{
			fsource+=' <EMBED src="'+file+'" FlashVars="page_vars='+vars+'" wmode='+wmode+' menu=false quality=high bgcolor='+bgcolor+'';
			fsource+=' swLiveConnect=FALSE allowScriptAccess="sameDomain" ID='+id+' WIDTH="'+width+'" HEIGHT="'+height+'"';
			fsource+=' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" BASE='+baseurl+'>';
			fsource+=' </EMBED>';
		}
	fsource+=' </OBJECT>';

	if (document.getElementById){
		document.getElementById(wLName).innerHTML=fsource;
	}

}

newsOld="";
function getNews(newsID){
	if (newsOld != ""){
		document.getElementById(newsOld).className="start_zuklapptext";	
	}
	document.getElementById(newsID).className="start_aufklapptext";
	newsOld = newsID;
}

var job_oldID = new Array();

jobOld="";
function getJob(newsID){
	if (jobOld!= ""){
		document.getElementById(jobOld).className="start_zuklapptext";	
	}
	else {
		document.getElementById(job_oldID[0]).className="start_zuklapptext";
	}
	document.getElementById(newsID).className="start_aufklapptext";
	jobOld= newsID;
}

function showSitemap(){
	if(!document.getElementById("schnellzugriff").style.display || document.getElementById("schnellzugriff").style.display == "none"){
	document.getElementById("schnellzugriff").style.display = "block";
	document.getElementById("schnellzugriff_btn").getElementsByTagName("a")[0].style.background="url(fileadmin/template/main/image/azubiportal/btn_schnellzugriff_pfeil_unten.png)";
	}
	else{
	document.getElementById("schnellzugriff").style.display = "none";
	document.getElementById("schnellzugriff_btn").getElementsByTagName("a")[0].style.background="url(fileadmin/template/main/image/azubiportal/btn_schnellzugriff.png)";
	}
}



	
/**TOGGLE CASE START
 * Object class attribute may consist of a space separated list of class names.
 * This function iterates thorugh an objects <obj> class list and checks for a match of <match>.
 */
function hasClassName(obj, match) {
    var retVal = false;
    var list = obj.className.split(" ");
    for (var i=0; i<list.length; i++) {
        if (list[i]==match) {
            retVal = true;
            break;
        }
    }
    return retVal;
}

/**
 * Object class attribute may consist of a space separated list of class names.
 * This function adds <name> to an objects <obj> class list and optionally replaces class <remove> with the given class name.
 */
function setClassName(obj, name, remove) {
    var list = obj.className.split(" ");
    if (remove) {
        for (var i=0; i<list.length; i++) {
            if (list[i]==remove) {
                list[i] = name;
                name = "";
                break;
            }
        }
    }
    if (name) list[list.length] = name;
    obj.className = list.join(" ");
}

function togglepnTabs(obj) {
    var boxObj;
    if (obj) {
        if (boxObj = obj.parentNode.parentNode) {
            if (hasClassName(boxObj, "pnTabsShow")) setClassName(boxObj, "pnTabsHide", "pnTabsShow");
            else                                       setClassName(boxObj, "pnTabsShow", "pnTabsHide");
        }
    }
}

///Function//////////

function setElement(eID,ifStyle,funct,wert){
	if (document.getElementById){
		if (ifStyle == 1){
			var newElement = document.getElementById(eID).style;
		}
		else {
			var newElement = document.getElementById(eID);
		}
		newElement[funct] = wert;
	}
}

function nxSend () {
  document.location="index.php?id=5390&url="+escape(document.location);
  return false;
}

function getQueryVariable(variable) {
	  var query = window.location.search.substring(1);
	  var vars = query.split("&");
	  for (var i=0;i<vars.length;i++) {
	    var pair = vars[i].split("=");
	    if (pair[0] == variable) {
	      return pair[1];
	    }
	} 
}

function getobject(id) {
	var elmID;

	if(document.getElementById) {elmID = document.getElementById(id);}
    else if(document.all) {elmID = document.all[id];}
    else if(document.layers) {elmID = this._getLayer(id);}
    else if(document.forms) {
        if(document.forms[id]) {elmID = document.forms[id];}
        else {
            for(var i=0; i<document.forms.length; i++) {
                if(document.forms[i][id]) {
                    elmID = document.forms[i][id];
                    break;
                }
            }
        }
    }
    else {elmID = null;}

    return elmID;
}
//-->