var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
//pfad = document.location.href;
//if (pfad.indexOf("index.html") >-1 || pfad.lastIndexOf("/") == pfad.length-1)
	flashUpDir = "";
//else
//	flashUpDir = "../";
//alert(pfad.lastIndexOf("/")+'<>'+pfad.length);
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');
}

function loadFlash(id) {
var called_onload = false;
var countMovies = 3;
if (!id)
  {
  called_onload = true;
  id = 0;
  }
while (id <= 0 || id > countMovies) {
    newRd=Math.random();
    id=Math.round(newRd*100);
}
if (id ==1) flashmovie = "profilkopf";
if (id ==2) flashmovie = "hakenriegel";
if (id ==3) flashmovie = "spezialteil";


flash_str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+
'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" '+
'width="230" height="255" hspace="0" vspace="0"><param name="movie" value="'+flashUpDir+'flash/'+flashmovie+'.swf">'+
'<param name="quality" value="high"><embed src="'+flashUpDir+'flash/'+flashmovie+'.swf" width="230" height="255" '+
'hspace="0" vspace="0" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" '+
'type="application/x-shockwave-flash"></embed></object>';

if ( MM_FlashCanPlay ) {
    DHTMLwriteInLayer('LayerFlash',flash_str);
    //document.write(flash_str);
}	

 else {
    document.write('<img src="'+flashUpDir+'images/spacer.gif" width="230" height="255" border="0">');
}
}

function DHTMLwriteInLayer(theName, theText) {
	var theObj = DHTMLgetRawObject(theName)
	if (theObj != null) {
		if (document.layers) {
			//alert(theObj.id);
			theObj.document.write(unescape(theText))
			theObj.document.close()
		} else {
			theObj.innerHTML = unescape(theText)
		}
	}
}

function DHTMLgetRawObject(theName) {
	var theObj
	if (document.all) {
		theObj = document.all(theName)
	} else if (document.getElementById) {
		theObj = document.getElementById(theName)
	} else if (document.layers) {
		theObj = document.layers[theName]
	} else {
		theObj = null
	}
	return theObj
}

function DHTMLgetObject(theObj) {
	// theObj can be an object or the name of an object
	if (document.all) {
	 	if (typeof theObj == "string") {
			return document.all(theObj).style
		} else { 
			return theObj.style
		}
	} else if (document.getElementById) {
		if (typeof theObj == "string") {
			return document.getElementById(theObj).style
		} else {
			return theObj.style
		}
	} else if (document.layers) {
		if (typeof theObj == "string") {
			return document.layers[theObj]
		} else {
			return theObj
		}
	}
	alert("No style object found.")
	return null
}


function DHTMLshow(theObj) {
	var theStyleObj = DHTMLgetObject(theObj)
	theStyleObj.visibility = "visible"	
}

function DHTMLhide(theObj) {
	var theStyleObj = DHTMLgetObject(theObj)
	theStyleObj.visibility = "hidden"	
}
