// rev=200612080001 //
SpOnENV_SERVER_IMG = 'http://www.spiegel.de';
SpOnENV_SERVER = 'http://www.spiegel.de';
SpOnENV_VideoPopupParams  = 'width=630,height=490,scrollbars=auto,resizable=yes,screenX=150,screenY=100';
SpOnENV_FlashvideoPopupParams  = 'width=690,height=434,scrollbars=no,resizable=no,screenX=150,screenY=100';
SpOnENV_FlashPopupParams  = 'scrollbars=no,screenX=150,screenY=100';
SpOnENV_PdfPopupParams    = 'width=600,height=550,scrollbars=no,screenX=150,screenY=100,resizable';
SpOnENV_PopTopPopupParams = 'width=500,height=310,resizable,screenX=150,screenY=100,status=no';
SpOnENV_BigaPopupParams_0   = 'width=625,height=545,scrollbars=auto,resizable,screenX=150,screenY=10';
SpOnENV_BigaPopupParams_1   = 'width=625,height=650,scrollbars=auto,resizable,screenX=150,screenY=10';
SpOnENV_BigaPopupParams_2   = 'width=780,height=650,scrollbars=auto,resizable,screenX=10,screenY=10';
SpOnENV_BigaPopupParams_3   = '';
SpOnENV_BigaPopupParams   = 'width=625,height=545,scrollbars=auto,resizable,screenX=150,screenY=10';
var spVideoCpServerName = 'http://www.spiegel.de';  
function goURL(frmlrname){
adresse = document.forms[frmlrname].to.options[document.forms[frmlrname].to.selectedIndex].value;
if(adresse=="") adresse = "javascript:void(0)";
if(adresse.substr(0,1) == '/') adresse = SpOnENV_SERVER + adresse;
window.location = adresse;
}
function RandomImg (Pfad,aBilder,Ext){
if (typeof(Ext)=='undefined')Ext = "";
if (Pfad =="img"){
Pfad = SpOnENV_SERVER_IMG + "/img/0,1020,";
if(Ext!="") Ext = ",00" + Ext;
} else {
Pfad = SpOnENV_SERVER_IMG + "/static/img/" + Pfad;
}
return Pfad + aBilder[Math.round(Math.random()*(aBilder.length-1))] + Ext;
}
function spon_popup(seite,breite,hoehe,scroll,rsize) {
sbars = (scroll==1)? "yes" : "no";
rsize = (rsize==1)? "yes" : "no";
if(seite.substr(0,1) == '/') seite = SpOnENV_SERVER + seite;
var win_name = breite+hoehe;
var win_attr = "menubar=no,location=no,directories=no,toolbar=no,screenX=0,screenY=0";
win_attr += ",width=" + breite + ",height=" + hoehe + ",scrollbars=" + sbars + ",resizable=" + rsize;
sponWin = open(seite,win_name,win_attr);
sponWin.focus();
}	
function bilderladen(pfad,bildIds,ext) {
if(document.images) {
if(pfad.indexOf("img")==1) {
pfad = pfad + '0,1020,';
ext = ',00' + ext;
}
if(pfad.substr(0,1) == '/') pfad = SpOnENV_SERVER_IMG + pfad;
var bilder = new Array();
for(i=0;i < bildIds.length;i++) {
bilder[i] = pfad + bildIds[i] + ext;
}
chgImg = new Array();
for(i=0;i < bilder.length;i++) {
chgImg[i] = new Image();
chgImg[i].src = bilder[i];
}
}
}
function bildtausch(imgname,imgnr) {
if(document.images) {
if(imgnr < (chgImg.length)) imgname.src = chgImg[imgnr].src;
}
}
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 = '#f0f0f0';
}
}
}
}
function SPONDetectFlashVerInit(){
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 SPONGetSwfVer(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('SPONGetSwfVer = 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 SPONGetSwfVer(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 SPONDetectFlashVer(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 = SPONGetSwfVer(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 SPONLoadFlash(videoid, flashvars){
if(document.getElementById){
if ( SPONDetectFlashVer(7,0,14) ) {
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="http://www.spiegel.de/static/flash/flashvideo-180.swf" />\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="http://www.spiegel.de/static/flash/flashvideo-180.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+'"><\/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 7 wurde nicht gefunden.<br />\nMögliche Ursachen:<br /><br />\nJavaScript erkennt den Player nicht korrekt.<br />\n		<a href="http://www.spiegel.de/videoplayer/0,6298,'+videoid+',00.html" title="Video abspielen..." target="SPONflashvideo" onClick="window.open(\'http://www.spiegel.de/videoplayer/0,6298,'+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>';
SPONShowFlashDiv(videoid);
document.getElementById('flashvideocredit'+videoid).style.display = 'none';
}
}
}
function SPONShowFlashDiv(videoid){
//		alert('Zeige Videofenster '+videoid);
document.getElementById('flashvideoswf'+videoid).style.zIndex=3;
document.getElementById('flashfotocredit'+videoid).style.display = 'none';
document.getElementById('flashvideocredit'+videoid).style.display = 'block';
}
function SPONVideoPopup(videoid){
window.open('http://www.spiegel.de/videoplayer/0,6298,'+videoid+',00.html', 'SPONflashvideo', SpOnENV_FlashvideoPopupParams).focus();
}
function SPONgetCookie (name) 
{
function SPONgetCookieVal (offset) 
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return SPONgetCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
var spMobileClients=[
"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 spIsMobileClient(userAgent) {
try {
userAgent=userAgent.toLowerCase();
for (var i=0; i < spMobileClients.length; i++)
if (userAgent.indexOf(spMobileClients[i]) != -1)
return true;
}
catch (e) { // pssst.
}
return false;
}
function spIsThisBrowserMobileClient() {
return spIsMobileClient(navigator.userAgent);
}
function spRedirectIfMobileClient() {
try {
if (spIsThisBrowserMobileClient()) {
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.spiegel.de?redirect=1";
}
}
catch (e) { 
}
}
// neues Javascript für V8 //
function spStartseitenlink() {
var ausgabe = '';
if (navigator.userAgent.indexOf("Opera") == -1) {
if (navigator.appName.indexOf("Explorer") != -1){
ausgabe = '<a id="spStartseite" href="http://www.spiegel.de/static/startseite/als_startseite_redirect.html" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.spiegel.de\');" id="spFfsidebar">Startseite<\/a>';
} else if (navigator.userAgent.indexOf("compatible") == -1) {
ausgabe = '<a id="spStartseite" href="javascript:window.open(\'http://www.spiegel.de/static/startseite/anleitung.html\',\'SponStart\',\'width=526,height=660,resizable,screenX=10,screenY=10\').focus();" id="spFfsidebar">Startseite<\/a>';
}
document.write( ausgabe );
}
}
function spToggleTickerBox2(spElement, spArticleId) {
// set rootElement
spRootElement = spElement.parentNode.parentNode;
// capture coresponding DIV element of clicked h3
thisElement = spElement.parentNode;
while (thisElement.nodeName != "DIV") {
thisElement = thisElement.nextSibling;
}
if (thisElement.style.display == "block") {
// do nothing, if thisElement is active
return false;
} else {
// loop over all childs of rootElement and switch all divs off
for (key=0;key < spRootElement.childNodes.length;key++) {
if (spRootElement.childNodes[key].nodeName == "DIV")
spRootElement.childNodes[key].style.display = "none";
if (spRootElement.childNodes[key].nodeName == "H3")
spRootElement.childNodes[key].className = "spTickerBox";
} 
// finaly switch current div on
thisElement.style.display = "block";
spElement.parentNode.className = "spTickerBox spTickerBoxActive";
spon_vdz_countframe.location.href = SpOnENV_SERVER + '/count/artikel/0,,' + spArticleId + ',00.html';
}
}
function spBoersenbilderPreload( breite ){
if(document.images){
var aXName = new Array('dax','tecdax','dow','nasdaq');
aTabImg = new Array();
aChart	= new Array();
for(i=0; i < 4; i++){
aTabImg[i] = new Image(breite,20);
aTabImg[i].src = SpOnENV_SERVER + "/static/sys/boerse/boersenreiter-"+breite+"-"+aXName[i]+".gif";
aChart[i] = new Image (196,91);
aChart[i].src = SpOnENV_SERVER + "/static/sys/boerse/spiegeltrans_"+aXName[i]+".gif";
}
}
}
function spBoerseShowChart(index) {
if(document.images){
document.boerseTab.src = aTabImg[index].src;
document.boerseChart.src = aChart[index].src;
}
}
function spHighlightMultipartTab(cid,nr) {
for (i=1;i<=10;i++) {
var mytab = document.getElementById('spMultipartTab-'+cid+'-'+i);
if (mytab) {
if (nr == i) {
mytab.className = 'spMultipartTabAktiv';
} else {
mytab.className = '';
}
} else {
break;
}
}
}
var spEmStepWidth 	= 0.125;	// increase/decrease font every step by spEmStepWidth
var spEmBasis 		= 0.875;		// font size of spArticleBody at startup
//var spEmBasis 		= 1;		// font size of spArticleBody at startup
var spEmStep 		= -1;		// counter for current step (leave as 0)
var spEmMaxSteps 	= 1;		// maximum steps alowed
/**
* 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
*/
function spFontSizer(spInc, spReset) {
// reset font size
if (spReset)
spEmStep = -1;
// inside allowed steps?
if (Math.abs(spEmStep + spInc) <= spEmMaxSteps) {
// increase/decrease spEmStep
spEmStep += spInc;
// set new font size for every tag inside "spEmStep"
spEmFontSize = spEmStep * spEmStepWidth + spEmBasis;
//get spArticleBody
spEmBody = document.getElementById('spMainContent');
//		spEmBody = document.getElementsByTagName('body')[0];
// set new fot size
spEmBody.style.fontSize = spEmFontSize + "em";
}
if (spEmStep == -spEmMaxSteps) {
document.getElementById("spFontsizeMinus").src = "/static/sys/v8/icons/spFontsizeMinus_lo.jpg";
}
else if (spEmStep == spEmMaxSteps) {
document.getElementById("spFontsizePlus").src = "/static/sys/v8/icons/spFontsizePlus_lo.jpg";
}
else {
document.getElementById("spFontsizePlus").src = "/static/sys/v8/icons/spFontsizePlus.jpg";
document.getElementById("spFontsizeMinus").src = "/static/sys/v8/icons/spFontsizeMinus.jpg";
}
} 
var spPaginatorClassesLoaded = Array();
function spPaginatorHandleEvent(spElement) {
spClassName = spElement.parentNode.parentNode.parentNode.id;
spLoadedClass = false;
// check id class is already loaded
for (var key in spPaginatorClassesLoaded) {
if (key == spClassName) {
spLoadedClass = key;
break;
}
}
// if class not loaded create new instance
if (!spLoadedClass) {
spPaginatorClassesLoaded[spClassName] = new spPaginator(spClassName,1);
spLoadedClass = spClassName;
}
// handle click event
if (spElement.className == "spNext")
spPaginatorClassesLoaded[spLoadedClass].showNext(spElement);
else
spPaginatorClassesLoaded[spLoadedClass].showPrev(spElement);
}
var spPaginator = function(paginator_id, index) {
// get container
var container = document.getElementById(paginator_id);
// get pages in the current paginator
var pagesTmp = container.getElementsByTagName('DIV');
this.pages = [];
// get pages and hide them all
for (key=0;key<pagesTmp.length;key++) {
if (pagesTmp[key].className == 'spPage') {
var page = pagesTmp[key];
this.pages.push(page);
page.style.display = 'none';
}
}
this.next = true;
this.prev = false;
// make sure default tab-id is valid
this.index = index;
this.index--;
if (this.index < 0 || this.index >= this.pages.length)
this.index = 0;
// show default tab
this.currentPage = this.pages[this.index];
this.currentPage.style.display = 'block';
}
spPaginator.prototype = {
showNext: function(element) {
// remember old index and calculate the new one
if (this.index <= this.pages.length - 1) {
var oldIndex = this.index++;
if (this.index >= this.pages.length)
this.index = 0;
// get new page
var newPage = this.pages[this.index];
// hide old page
this.currentPage.style.display = 'none';
// show new page
this.currentPage = newPage;
this.currentPage.style.display = 'block';
// disable/enable next/prev button
/* 
if (this.prev == false) {
element.parentNode.parentNode.childNodes[0].childNodes[0].childNodes[0].style.display = "block";
this.prev = true;
}
if (this.index == this.pages.length -1) {
element.childNodes[0].style.display = "none";
this.next = false;
}
*/
}
},
showPrev: function(element) {
// remember old index and calculate the new one
if (this.index > 0) {
var oldIndex = this.index--;
if (this.index < 0)
this.index = this.pages.length - 1;
// get new page
var newPage = this.pages[this.index];
// hide old page
this.currentPage.style.display = 'none';
// show new page
this.currentPage = newPage;
this.currentPage.style.display = 'block';
// disable/enable next/prev button
if (this.next == false) {
element.parentNode.parentNode.childNodes[2].childNodes[0].childNodes[0].style.display = "block";
this.next = true;
}
if (this.index == 0) {
element.childNodes[0].style.display = "none";
this.prev = false;
}
}
}
}
function spMainNaviInit() {
if (document.all && document.getElementById) {
var spNavContainer = document.getElementById("spNaviChannel");
var spNavis = spNavContainer.getElementsByTagName('ul');
for (var i in spNavis) {
var ul = spNavis[i];
// wenn 2. Ebene, ...
if (ul.nodeName == 'UL' && ul.className == 'spNaviLevel1') {
var spNavItems = spNavContainer.getElementsByTagName('li');
for (var j in spNavItems) {
var li = spNavItems[j];
//...dann 3. Ebene einblenden, falls vorhanden
if (li.nodeName == 'LI' && li.className.indexOf('spNaviSubNavigation') > -1) {
li.onmouseover = function() {
// lazy initialization
if (! this.spSubNav) {
var spSubNavTmp = this.getElementsByTagName('ul')[0];
if (spSubNavTmp && spSubNavTmp.nodeName == 'UL' && spSubNavTmp.className == 'spNaviLevel2')
this.spSubNav = spSubNavTmp;
}
if (this.spSubNav) {
this.spSubNav.style.display = "block";
}
}
li.onmouseout = function() {
// lazy initialization
if (! this.spSubNav) {
var spSubNavTmp = this.getElementsByTagName('ul')[0];
if (spSubNavTmp && spSubNavTmp.nodeName == 'UL' && spSubNavTmp.className == 'spNaviLevel2')
this.spSubNav = spSubNavTmp;
}
if (this.spSubNav)
this.spSubNav.style.display = "none";
}
}
}
}
}
}
}
