// Login Start
function logindropeffect() {
    if (document.getElementById('loginpopmenu').style.display == 'none') {
        document.getElementById('loginpopmenu').style.display = '';
    } else {
        document.getElementById('loginpopmenu').style.display = 'none'
    }
}
// Login Stop

// TeaserB3 start
function teaserb3change(id, status) {
	var iconteaserid = 'teaserb3icon-' + id;
	var iconcatchid = 'catchb3icon-' + id;
	
	var teaserdivid = 'teaserb3id' + id + '-';
	
	if (status == '1') {
		document.getElementById(iconteaserid).src = '/msuup/img/teaser/teaser_active.gif';
		document.getElementById(iconcatchid).src = '/msuup/img/teaser/catch_inactive.gif';
		
		document.getElementById(teaserdivid + status).style.display = '';
		document.getElementById(teaserdivid + '2').style.display = 'none';
	}
	
	if (status == '2') {
		document.getElementById(iconteaserid).src = '/msuup/img/teaser/teaser_inactive.gif';
		document.getElementById(iconcatchid).src = '/msuup/img/teaser/catch_active.gif';
		
		document.getElementById(teaserdivid + status).style.display = '';
		document.getElementById(teaserdivid + '1').style.display = 'none';
	}
} 
// TeaserB3 stop

// Schlagzeilenmodul start
function schlagzeilenAction(order) {
		var menuitem = 'schlagzeilenmodulmenu';
		var contentitem = 'schlagzeilenmodulcontent';
		
		document.getElementById(menuitem + order[0]).className = 'aktiv';
		document.getElementById(menuitem + order[1]).className = 'inaktiv';
		document.getElementById(menuitem + order[2]).className = 'inaktiv';
		
		document.getElementById(contentitem + order[0]).style.display = '';
		document.getElementById(contentitem + order[1]).style.display = 'none';
		document.getElementById(contentitem + order[2]).style.display = 'none';
}

function schlagzeilenChange(id) {
	switch (id) {
		case 1: 
			schlagzeilenAction([1,2,3]);
			break;
		case 2:
			schlagzeilenAction([2,1,3]);
			break;
		case 3:
			schlagzeilenAction([3,1,2]);
			break;
	}
}
// Schlagzeilenmodul ende

// Regionalmodul start
function regionalAction(order) {
		var menuitem = 'regionalmodulmenu';
		var contentitem = 'regionalmodulcontent';
		
		document.getElementById(menuitem + order[0]).className = 'aktiv';
		document.getElementById(menuitem + order[1]).className = 'inaktiv';
		
		document.getElementById(contentitem + order[0]).style.display = '';
		document.getElementById(contentitem + order[1]).style.display = 'none';
}

function regionalChange(id) {
	switch (id) {
		case 1: 
			regionalAction([1,2,3]);
			break;
		case 2:
			regionalAction([2,1,3]);
			break;
	}
}
// Regionalmodul ende

// Regionalmodul start
function sportAction(order) {
		var menuitem = 'sportmodulmenu';
		var contentitem = 'sportmodulcontent';
		
		document.getElementById(menuitem + order[0]).className = 'aktiv';
		document.getElementById(menuitem + order[1]).className = 'inaktiv';
		
		document.getElementById(contentitem + order[0]).style.display = '';
		document.getElementById(contentitem + order[1]).style.display = 'none';
}

function sportChange(id) {
	switch (id) {
		case 1: 
			sportAction([1,2,3]);
			break;
		case 2:
			sportAction([2,1,3]);
			break;
	}
}
// Regionalmodul ende

// Artikeldetail Toolbar
var fontsize = 11;
	
function changeTextSize(str) {
	var headsize = parseInt(fontsize)+4;
	var picfontsize = parseInt(fontsize)-1;
	var subheadsize = parseInt(fontsize)+1;
	
    if (str == '+') {
		fontsize++;
		headsize++;
		picfontsize++;
		subheadsize++;
    } else {
        fontsize--;
        headsize--;
        picfontsize--;    
        subheadsize--;    
    }
    
    fontsize = Math.max(8,Math.min(fontsize,18));
    headsize = Math.max(13,Math.min(headsize,22));
    picfontsize = Math.max(7,Math.min(picfontsize,16));
    subheadsize = Math.max(8,Math.min(subheadsize,20));
    
    if (document.getElementById("subheadline") != null) {
		if (document.getElementById("subheadline").style.fontSize != null) {
			document.getElementById("subheadline").style.fontSize = String(subheadsize)+"px";		
		}
    }
    
	if (document.getElementById("pictext") != null) {
		if (document.getElementById("pictext").style.fontSize != null) {
			document.getElementById("pictext").style.fontSize = String(picfontsize)+"px";
		}
	}

	document.getElementById("headline").style.fontSize = String(headsize)+"px";
	document.getElementById("shortline").style.fontSize = String(fontsize)+"px";
	document.getElementById("text").style.fontSize = String(fontsize)+"px";
}

function changeborderToolbarMouseIn(elem) {
	elem.style.borderTopColor = "#3a8cc0";
	elem.style.borderLeftColor = "#3a8cc0";
	elem.style.borderRightColor = "#ffffff";
	elem.style.borderBottomColor = "#ffffff";
}

function changeborderToolbarMouseOut(elem) {
	elem.style.borderTopColor = "#ffffff";
	elem.style.borderLeftColor = "#ffffff";
	elem.style.borderRightColor = "#3a8cc0";
	elem.style.borderBottomColor = "#3a8cc0";
}

function showSocialBookmarks() {
	var elem = document.getElementById("articletoolbarbookmarks");
	
	if (elem.style.display == "block") {
		elem.style.display = "none";
	} else {
		elem.style.display = "block";
	}
}

function bookmarkUs() {
	var title = encodeURIComponent(document.title);
	var url = encodeURIComponent(location.href);
	
	 // firefox 
	if (window.sidebar) {
		window.sidebar.addPanel(title, url, "");
	// opera
	} else if(window.opera && window.print) {
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	// ie 
	} else if(document.all) {
		window.external.AddFavorite(url, title);
	}
}

function socialBookmark(kind) {
	var locUrl = encodeURIComponent(location.href);
	var title = encodeURIComponent(document.title);
	var serviceUrl = '';
	var serviceName = '';
	
	if (kind == 'deli') {
		serviceName = 'delicious';
		serviceUrl = 'http://del.icio.us/post?v=4&noui&jump=close&url='+locUrl+'&title='+title;
	} else if (kind == 'wong') {
		serviceName = 'Mister Wong';
		serviceUrl = 'http://www.mister-wong.de/add_url/?action=addurl&bm_url='+locUrl+'&bm_description='+title;
	} else if (kind == 'digg') {
		serviceName = 'Digg';
		serviceUrl = 'http://digg.com/submit?url='+locUrl+'&title='+title;
	} else if (kind == 'facebook') {
		serviceName = 'Facebook';
		serviceUrl = 'http://www.facebook.com/share.php?u='+locUrl;
	} else if (kind == 'webnews') {
		serviceName = 'Webnews';
		serviceUrl = 'http://www.webnews.de/einstellen?url='+locUrl+'&title='+title;
	} else if (kind == 'google') {
		serviceName = 'Googletoolbar';
		serviceUrl = 'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='+locUrl+"&title="+title;
	} else if (kind == 'yigg') {
		serviceName = 'Yigg';
		serviceUrl = 'http://yigg.de/neu?exturl='+locUrl+'&exttitle='+title;
	}
	
	window.open(serviceUrl, serviceName,'toolbar=no,width=700,height=400');
}

// RMC Rightbar
function rmcchange(count, change, max) {
	if (change == "+" && count < max-1) {
		document.getElementById("rmcrb" + count).style.display = 'none'
		document.getElementById("rmcrb" + (count+1)).style.display = 'block'
	} else if (change == "-" && count > 0) {
		document.getElementById("rmcrb"+count).style.display = 'none'
		document.getElementById("rmcrb"+(count-1)).style.display = 'block'
	}
}
// RMC Rightbar

//####################################################################################
//E-Paper (Begin)
//####################################################################################
function registerEPaper () {
  location.href = "/service/abonnement/epaper/";
}
 
function starteEPaper (Adresse) {
  ePaperWindow = window.open(Adresse, "ePaper", "width=1000,height=720,left=20,top=20,resizable=yes,scrollbars=yes");
  ePaperWindow.focus();
}
 
function startDemoEPaper() {
  ePaperWindow = window.open("http://epaper.main-echo.de/edition-me/index2.jsp?abo=demo&user=&pass=fe01ce2a7fbac8fafaed7c982a04e229", "ePaper", "width=1000,height=720,left=20,top=20,resizable=yes,scrollbars=yes");
  ePaperWindow.focus();
}
//####################################################################################
//E-Paper (End)
//####################################################################################


//####################################################################################
//Mobilportal (Begin)
//####################################################################################
function starteHandySimulator() {
  $url = "http://www.main-netz.de/specials/mobil/index.php";
  ePaperWindow = window.open($url, "Main-Netz.mobi", "width=500,height=650,left=20,top=20,resizable=yes,scrollbars=yes");
  ePaperWindow.focus();
}
//####################################################################################
//Mobilportal (End)
//####################################################################################


//####################################################################################
//WM2010-Ticker (Begin)
//####################################################################################
function starteWMTicker() {
  $url = "http://admin.main-netz.de/nachrichten/sport/wm2010/my_fb_mwm/html_php/index.html";
  fbwmWindow = window.open($url, "WM2010", "width=850,height=720,left=0,top=0,resizable=yes,scrollbars=auto");
  fbwmWindow.focus();
}
//####################################################################################
//WM2010-Ticker (End)
//####################################################################################


//####################################################################################
//Verlag (Begin)
//####################################################################################
function starteZeitreise () {
  $address = "/verlag/museum/museum_rundum.html";
  MeinFenster = window.open($address, "Zeitreise", "width=804,height=486,left=50,top=50,scrollbars=no,status=no");
  MeinFenster.focus();
}

function starteFirmengeschichte () {
  $address = "/verlag/historie/lexikon.html";
  MeinFenster = window.open($address, "Historie", "width=804,height=486,left=50,top=50,scrollbars=no,status=no");
  MeinFenster.focus();
}
 //####################################################################################
//Verlag (End)
//####################################################################################


//####################################################################################
//Tickt-Online (Begin)
//####################################################################################
function showEventByRegion($region) {
  $url = "http://www.ticketonline.de/trans/prlist?LI=TO90&SO=DATE&LG=DE&MENU=NO&RG=" + $region;
  showTicketOnlinePopUp($url);
}

function showEventByCategory($category) {
  $url = "http://www.ticketonline.de/trans/prlist?LI=TO90&SO=DATE&LG=DE&MENU=NO&CAT=" + $category;
  showTicketOnlinePopUp($url);
}

function searchByZipCode() {
  $region = document.getElementById('ticketOnlineZipcode').value;
  $url = "http://www.ticketonline.de/trans/prlist?LI=TO90&SO=DATE&LG=DE&MENU=NO&RG=" + $region;
  showTicketOnlinePopUp($url);
}

function searchByZipString() {
  $string = document.getElementById('ticketOnlineSearchString').value;
  $url = "http://www.ticketonline.de/trans/prlist?LI=TO90&SO=DATE&LG=DE&MENU=NO&SB=" + $string;
  showTicketOnlinePopUp($url);
}

function showExtendedSearch() {
  $url = "http://www.ticketonline.de/trans/menu?SO=DATE&LI=TO90&MENU=NO&AD=evsearch.html";
  showTicketOnlinePopUp($url);
}

function showTicketOnlinePopUp($toUrl) {
  $url = "/service/ticketservice/index.php?toURL=" + escape(encodeURIComponent($toUrl));
  MeinFenster = window.open($url, "Ticketservice", "width=650,height=700,left=50,top=50,scrollbars=yes,status=no");
  MeinFenster.focus();
}
//####################################################################################
//Ticket-Online (End)
//####################################################################################

//####################################################################################
//Onlinewerbung (Begin)
//####################################################################################
function showDigitaleAnzeige($adId) {
  $url = "/msuup/digitale-anzeige/index.html?adId=" + $adId;
  MeinFenster = window.open($url, "Anzeige", "width=550,height=670,left=50,top=50,scrollbars=no,status=no");
  MeinFenster.focus();
}
//####################################################################################
//Onlinewerbung (End)
//####################################################################################

//####################################################################################
//Live-Ticker (Start)
//####################################################################################
 function popup_liveticker(){
   popup = window.open("http://www.main-netz.de/nachrichten/sport/liveticker/", "Ticker", "width=550,height=500,status=yes,scrollbars=yes,resizable=yes");
   popup.focus();
 }
//####################################################################################
//Live-Ticker (END)
//####################################################################################

//####################################################################################
//Multimediamodul
//####################################################################################
function multimediamodulAction(order) {
		var menuitem = 'multimediamodulmenu';
		var contentitem = 'multimediamodulcontent';
		
		if ( document.getElementById(menuitem + order[0]) != null ) document.getElementById(menuitem + order[0]).className = 'aktiv';
		if ( document.getElementById(menuitem + order[1]) != null ) document.getElementById(menuitem + order[1]).className = 'inaktiv';
		if ( document.getElementById(menuitem + order[2]) != null ) document.getElementById(menuitem + order[2]).className = 'inaktiv';
		
		if ( document.getElementById(menuitem + order[0]) != null ) document.getElementById(contentitem + order[0]).style.display = '';
		if ( document.getElementById(menuitem + order[1]) != null ) document.getElementById(contentitem + order[1]).style.display = 'none';
		if ( document.getElementById(menuitem + order[2]) != null ) document.getElementById(contentitem + order[2]).style.display = 'none';
}

function multimediaChange(id) {
	switch (id) {
		case 1: 
			multimediamodulAction([1,2,3]);
			break;
		case 2:
			multimediamodulAction([2,1,3]);
			break;
	  case 3:
			multimediamodulAction([3,1,2]);
			break;
	}
}
//####################################################################################
//Multimediamodul (END)
//####################################################################################
//####################################################################################
//Olympia Popup (Start)
//####################################################################################
 function popup_olympiaticker(start){
   popup = window.open("/nachrichten/sport/olympia/ticker/popup.php?start="+start, "Ticker", "width=800,height=700,status=yes,scrollbars=yes,resizable=yes");
   popup.focus();
 }
 //####################################################################################
//Olympia Popup (END)
//####################################################################################
//####################################################################################
//Olympia Popup (Start)
//####################################################################################
 function popup_landtagswahlen08(){
   popup = window.open("/nachrichten/politik/landtagswahl08/my_lw_by/html_php/index_mainnetz.html", "Landtagswahlen", "width=770,height=620,status=yes,scrollbars=yes,resizable=yes");
   popup.focus();
 }
 //####################################################################################
//Olympia Popup (END)
//####################################################################################