/*
// change input type to password
window.onload=function() {
    inp1=document.getElementById("passwd");
    inp1.className='hide';
    document.getElementById("pwtext").onfocus=function() {
    this.value='';
    this.className='hide';
    inp1.className='';
    inp1.focus();
    }
}
*/

function setEmptyField(field,ignorestring) {
    if (document.getElementById(field).value==ignorestring) {
    document.getElementById(field).value='';
    document.getElementById(field).focus();
    }
}


function setValueField() {
    if (document.getElementById('user').value=='') {
    document.getElementById('user').value='E-Mail';
    }
    if (document.getElementById('loginpasswd').value=='') {
    document.getElementById('loginpasswd').value='Passwort';
    }
}


// schreibt Flash in einem Layer dynamisch
function getAudioFlash(mp3file,startS) {
    var bgcolor='#fff';
    var menu=false;
    var quality="high";
    var closeTags = "</" + "embed></" + "object>";
    if (window.location.host == 'sz-audio.sueddeutsche.de') {
        var url = '/_common/files/audioplayer_g.swf?spath='+mp3file+'&startS='+startS;
    }
	else {
	    var url = '/_common/files/audioplayer_6.swf?spath='+mp3file+'&startS='+startS;
	}
    //alert(url);
	var flashwidth=240;
    var flashheight=32;
	var inhalt = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + flashwidth + '" height="' + flashheight + '" title="" id="audioplayer" /><param name="movie" value="' + url + '"><param name="quality" value="' + quality + '" /><param name="bgcolor" value="' + bgcolor + '" /><param name="menu" value="' + menu + '"><param name="play" value="true" /><embed src="' + url + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="' + bgcolor + '" width="' + flashwidth + '" height="' + flashheight + '" name="audioplayer" menu="' + menu + '" play="true" />'+closeTags;

    //inhalt += '<a href="/_ext/download.php?file='+mp3file+'" onClick="javascript:countGoogle(\'/download/'+mp3file+'\');"><img src="/_common/img/but/icon_download.gif" width="12" height="12" border="0" alt="" class="icon-download" /></a>';
    
    if (!flashplugin) {
    inhalt=('<div style="color:#c00;font-size:1.2em;">Um diesen interaktiven Inhalt angezeigt zu bekommen, ben&ouml;tigen Sie einen Flash Player. Dieser kann kostenlos <a href="http://www.adobe.com/" target="_blank" style="color:#c00;text-decoration:underline;">hier</a> heruntergeladen werden.</div>');
    }
    
    document.getElementById('contentflash').innerHTML = inhalt;
}

/*
var selectedDivForListen = false;
function selectContentForListen(contentID,mp3file,startS,toppic) {
	if(selectedDivForListen)
		document.getElementById(selectedDivForListen).className = document.getElementById(selectedDivForListen).className.replace(/ selected/,"");
	
    if(toppic == "1")
		document.getElementById("conten-border-top").style.backgroundImage = "url(/_common/img/cont-474-sh-top_selected.gif)";
	else
		document.getElementById("conten-border-top").style.backgroundImage = "url(/_common/img/cont-474-sh-top.gif)";
        
	document.getElementById(contentID).className += " selected"; 
	
	//selectedDivForListen = contentID;
	//var node = document.getElementById(contentID);	
	//var nodeFlashImage = document.getElementById('flash-image');
	//var nodeFlash = document.getElementById('flash-content');
	//nodeFlashImage.innerHTML = node.getElementsByTagName("div")[0].innerHTML;
	//nodeFlash.innerHTML = node.getElementsByTagName("div")[2].innerHTML;
    
    // Flashaufruf
	//getAudioFlash(mp3file,startS);
	// IVW
	//countIVW();
	// Google Analytics
	//countGoogle('/listen/'+mp3file);
}
*/

//ivw
function countIVW() {
    var get_rand = "d=" + (Math.random()*100000);
    var get_referer = "r=" + escape(document.referrer);
    //var countIVW = new Image();
    if (document.getElementById('countIVW')) {
        document.getElementById('countIVW').src = "http://sueddeut.ivwbox.de/cgi-bin/ivw/CP/N325UG0A0000?" + get_referer + "&" + get_rand;
    }
}
//google
function countGoogle(page) {
    if (typeof(pageTracker) != "undefined") {
       pageTracker._trackPageview(page);
    }
}


