/*
*********************************************************************************
Javascript-Code to handle:
1. extended navigation in chapter 'careers'
2. layer control of the permanent running flash movie
3. client adapted control of flash/noflash versions
*********************************************************************************
Author: Norbert Annabring, Schindler, Parent & Cie, Meersburg, Germany, (nannabring@schindlerparent.de)
created: 2003, July, 9
*/

//Flash-Detection:
var requiredVersion = 6;
var useRedirect = true;
var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var flash8Installed = false;
var maxVersion = 8;
var actualVersion = 0;
var hasRightVersion = false;
var jsVersion = 1.0;

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function rd_people_startani_small_DoFSCommand(command, args) {
  var rd_people_startani_smallObj = InternetExplorer ? document.rd_people_startani_small : document.embeds[0];
  /*code*/  	
}
function rd_people_startani_DoFSCommand(command, args) {
  var rd_people_startaniObj = InternetExplorer ? document.rd_people_startani : document.embeds[0];
  /*code*/
}
function rdhr_map_DoFSCommand(command, args) {
  var rdhr_mapObj = InternetExplorer ? document.rdhr_map : document.embeds[1];
  if(command=="controlOther")
  {
  	controlHeadAni(args);
  	
  }  	
}
function rd_globe_DoFSCommand(command, args) {
  var rdhr_mapObj = InternetExplorer ? document.rd_globe : document.embeds[1];
  if(command=="controlOther")
  {
  	controlHeadAni(args);
  	
  }  	
}
// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub rd_people_startani_small_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call rd_people_startani_small_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('Sub rd_people_startani_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call rd_people_startani_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('Sub rdhr_map_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call rdhr_map_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('Sub rd_globe_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call rd_globe_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

function goSmall(){
	//document.all.flash.style.clip="rect(0,auto,48,0)";
}
function goItems(){
	//document.all.flash.style.clip="rect(0,auto,125,0)";
}
function scrollBack(){
	window.scrollBy(0,-130);
}
function openJob(name){
	url="/careers/jobs/profiles/function_profiles/popups/"+name.toLowerCase().split(" ").join("_")+".html";
	window.open(url,"functProf","width=440,height=450,scrollbars=auto,resizeable=no");
}
function openTestim(name,kennung){
	/*
	xname=name.replace(/,/,"");
	xname=xname.replace(/./,"");
	xname=xname.toLowerCase();
	*/
	xname=name.toLowerCase();
	//alert(xname);
	url="/careers/jobs/profiles/people/popups/"+kennung+"_"+xname.split(" ").join("_")+".html";
	window.open(url,"testim","width=440,height=450,scrollbars=auto,resizeable=no");
}
function openPress(kennung){
	url="/careers/what_we_offer/career_development/popups/"+kennung+"_frm.html";
	window.open(url,"press","width=440,height=450,scrollbars=auto,resizeable=no");
}
function controlHeadAni(sValue){
	if(ns4)
	{
		document.embeds[0].SetVariable("/:go",sValue);
	}
	else
	{
		if(document.location.href.indexOf("people.html")>-1)
		{
			document.rd_people_startani.SetVariable("/:go",sValue);
		}
		else
		{
			document.rd_people_startani_small.SetVariable("/:go",sValue);
		}
	}
}
function openPreview(url,location,typ){
	ctyp=(typ=="url")?"cpage":"id";
	window.open("http://jobadmin.rd-dev.de/job_preview.php4?"+ctyp+"="+escape(url)+"&location="+location,"preview","width=700,height=550,resizeable=yes,scrollbars=yes,50,50");
}
function writeHeader(head,subhead,plugin){
	if(plugin)
	{
		with(document)
		{
			write('<table border="0" cellpadding="0" cellspacing="0" width="100%">\n');
			write('	<tr>\n');
			write('		<td align="left" background="images/img_headbg.gif" width="100%">\n');
			write('			<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n');
			write(' 		 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"\n');
			write('			 WIDTH="615" HEIGHT="125" id="rd_people_startani_small" ALIGN="">\n');
			write('			 <PARAM NAME=movie VALUE="flash/rd_people_startani_small.swf">\n');
			write('			 <PARAM NAME=wmode VALUE=transparent>\n');
			write('			 <PARAM NAME=quality VALUE=high>\n');
			write('			 <PARAM NAME=bgcolor VALUE=#EAD0FD>\n');
			write('			 <PARAM NAME=FlashVars VALUE="head='+head+'&subhead='+subhead+'">\n');
			write('			 <EMBED src="flash/rd_people_startani_small.swf" wmode=transparent swLiveConnect=true quality=high \n');
			write('			  FlashVars="head='+head+'&subhead='+subhead+'"\n');
			write('			  bgcolor=#EAD0FD  WIDTH="615" HEIGHT="125" NAME="rd_people_startani_small" ALIGN=""\n');
			write('			  TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>\n');
			write('			</OBJECT>\n');
			write('		</td>\n');
			write('	</tr>\n');
			write('</table>\n');
		}
	}
	else
	{
		with(document)
		{
			write('<table border="0" cellpadding="0" cellspacing="0" width="100%">\n');
			write('	<tr>\n');
			write('		<td background="images/img_headbg.gif" width="100%">');
			write('<a href="http://www.macromedia.com/go/getflashplayer/" target="_blank">');
			write('<img src="images/noflash_title_content.gif" border="0">');
			write('</a>');
			write('		</td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td>&nbsp;</td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td nowrap>\n');
			write('		<H1><img src="/images/1pix_trans.gif" width="25" height="1" border="0" alt="">'+subhead.replace(/%2D/,"-")+'</H1></td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td>&nbsp;</td>\n');
			write('	</tr>\n');
			write('</table>\n');
		}
	}
}
function writeHeader2(head,subhead,plugin){
	if(plugin)
	{
		with(document)
		{
			write('<table border="0" cellpadding="0" cellspacing="0" width="100%">\n');
			write('	<tr>\n');
			write('		<td align="left" width="100%">\n');
			write('			<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n');
			write(' 		 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"\n');
			write('			 WIDTH="615" HEIGHT="125" id="rd_people_startani_small2" ALIGN="">\n');
			write('			 <PARAM NAME=movie VALUE="flash/rd_people_startani_small2.swf">\n');
			write('			 <PARAM NAME=wmode VALUE=transparent>\n');
			write('			 <PARAM NAME=quality VALUE=high>\n');
			write('			 <PARAM NAME=bgcolor VALUE=#ffffff>\n');
			write('			 <PARAM NAME=FlashVars VALUE="head='+head+'&subhead='+subhead+'">\n');
			write('			 <EMBED src="flash/rd_people_startani_small2.swf" wmode=transparent swLiveConnect=true quality=high \n');
			write('			  FlashVars="head='+head+'&subhead='+subhead+'"\n');
			write('			  bgcolor=#ffffff  WIDTH="615" HEIGHT="125" NAME="rd_people_startani_small2" ALIGN=""\n');
			write('			  TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>\n');
			write('			</OBJECT>\n');
			write('		</td>\n');
			write('	</tr>\n');
			write('</table>\n');
		}
	}
	else
	{
		with(document)
		{
			write('<table border="0" cellpadding="0" cellspacing="0" width="100%">\n');
			write('	<tr>\n');
			write('		<td background="images/img_headbg.gif" width="100%">');
			write('<a href="http://www.macromedia.com/go/getflashplayer/" target="_blank">');
			write('<img src="images/noflash_title_content.gif" border="0">');
			write('</a>');
			write('		</td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td>&nbsp;</td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td nowrap>\n');
			write('		<H1><img src="/images/1pix_trans.gif" width="25" height="1" border="0" alt="">'+subhead.replace(/%2D/,"-")+'</H1></td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td>&nbsp;</td>\n');
			write('	</tr>\n');
			write('</table>\n');
		}
	}
}


function writeGlobe(flashvars,plugin){
	if(plugin)
	{
		with(document)
		{
			
			write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n');
			write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/careers/flash/swflash.cab#version=6,0,0,0"\n');
			write(' WIDTH="310" HEIGHT="220" id="rd_globe" ALIGN="">\n');
			write(' <PARAM NAME="FlashVars" VALUE="'+flashvars+'">\n');
			write(' <PARAM NAME=movie VALUE="/careers/flash/rd_globe.swf">\n');
			write(' <PARAM NAME=quality VALUE=high>\n');
			write(' <PARAM NAME=bgcolor VALUE=#FFFFFF>\n');
			write(' <EMBED src="/careers/flash/rd_globe.swf" swLiveConnect=true  quality=high bgcolor=#FFFFFF \n');
			write('  FlashVars="'+flashvars+'"\n');
			write('  WIDTH="310" HEIGHT="220" NAME="rd_globe" ALIGN="" \n');
			write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>\n');
			write('</OBJECT>\n');
		}		
	}
	else
	{
		
		params=flashvars.split("&");
		values=new Array();
		for(f=0;f<params.length;f++)
		{
			thisVar=params[f].split("=");
			values[thisVar[0]]=thisVar[1];
		}
		urlx=values['urls'].split("|");
		with(document)
		{
			write('<table border="0" cellpadding="0" cellspacing="0">\n');
			write('	<tr>\n');
			write('		<td class="content" align="left">');
			write('			'+values['ftext'].replace(/%0D/g,"<br>"));
			write('		</td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td>&nbsp;<img src="images/1pix_trans.gif" width="310" height="1" alt="" border="0"></td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td class="content"><ul>\n');
			for(l=0;l<urlx.length;l++)
			{
				xlinks=urlx[l].split("$");
				write('		<li><a href="'+xlinks[1].replace(/%2F/g,"/")+'" target="'+xlinks[2]+'">'+xlinks[0]+'</li>\n');
			}
			write('		</ul></td>\n');
			write('	</tr>\n');
			write('	<tr>\n');
			write('		<td>&nbsp;</td>\n');
			write('	</tr>\n');
			write('</table>\n');
		}
	}
}

function writeGlobe2(flashvars,plugin){
	if(plugin)
	{
		with(document)
		{
			write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n');
			write(' 	codebase="http://download.macromedia.com/pub/shockwave/cabs/careers/flash/swflash.cab#version=6,0,0,0"\n');
			write('		WIDTH="310" HEIGHT="220" id="rd_globe2" ALIGN="">\n');
	        write('    <PARAM NAME="FlashVars" VALUE="'+flashvars+'">\n');
	        write('    <PARAM NAME=movie VALUE="/careers/flash/rd_globe2.swf">\n');
	        write('    <PARAM NAME=quality VALUE=high>\n');
	        write('    <PARAM NAME=bgcolor VALUE=#FFFFFF>\n');
	        write('    <EMBED src="/careers/flash/rd_globe2.swf" swLiveConnect=true  quality=high bgcolor=#FFFFFF \n');
			write(' 	 FlashVars="'+flashvars+'"\n');
			write(' 	 WIDTH="310" HEIGHT="220" ALIGN="" \n');
			write(' 	TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> \n');
			write('</OBJECT>\n');
		}		
	}
	else
	{
		//urls, getimages
		params=flashvars.split("&");
		values=new Array();
		for(f=0;f<params.length;f++)
		{
			thisVar=params[f].split("=");
			values[thisVar[0]]=thisVar[1];
		}
		urlx=values['urls'].split("|");
		imgs=values['getimages'].split("|");
		imgText=values['imgtext'].split("|");
		with(document)
		{
			write('<table border="0" cellpadding="0" cellspacing="0" width="310">');
			if(values['showtext']!=null)
			{
				write('<tr>');
				write('<td class="content" align="left">');
				write(values['ftext'].replace(/%0D/g,"<br>"));
				write('</td>');
				write('</tr>');
			}
			write('<tr>');
			write('<td>&nbsp;<img src="/images/1pix_trans.gif" width="310" height="1" alt="" border="0"></td>');
			write('</tr>');
			write('<tr>');
			write('<td class="content">');
			write('<table border="0" cellpadding="0" cellspacing="0">');
			for(u=0;u<urlx.length;u++)
			{
				write('<tr>');
				write('<td align="left">');
				write('<a href="'+urlx[u]+'" target="_blank">');
				write('<img src="'+imgs[u]+'" border="0">');
				write('</a>');
				write('</td>');
				write('<td><img src="/images/1pix_trans.gif" width="20" height="1" alt="" border="0"></td>');
				write('<td align="left" valign="top" class="content">');
				write(imgText[u]);
				write('</td>');
				write('<tr>');
				write('<tr>');
				write('<td colspan="3">&nbsp;</td>');
				write('</tr>');
			}
			write('</table>');
			write('</td>');
			write('</tr>');
			write('<tr>');
			write('<td>&nbsp;</td>');
			write('</tr>');
			write('</table>');
		}
	}
}
function openNews(){
	url="/careers/newsPopup.html";
	//window.open(url,"news","width=440,height=350,scrollbars=auto,resizeable=no");
	window.open(url,"news","width=195,height=200,scrollbars=no,resizeable=no,status=no,menubar=no,left="+(screen.width-230)+",top=261");
}

function eOrientation(){
	//window.open("/careers/flash/eorientation/index.htm","eorientation","width="+(screen.width-10)+",height="+(screen.height-100)+",left=0,top=0,scrollbars=no");	
	window.open("/careers/flash/eorientation/index.htm","eorientation","width=750,height=500,left=0,top=0,scrollbars=no");	
}