/*if(document.layers&&navigator.appVersion.substring(0,1) == "4")
{	document.writeln("<LINK REL=stylesheet TYPE=\"text/css\" HREF=\"../abo_ns.css\">");
}	else
{	document.writeln("<LINK REL=stylesheet TYPE=\"text/css\" HREF=\"../abo.css\">");
}*/

/*p0_norm = new Image(); p0_norm.src = "../gfx/p0.gif";
p0_aktiv = new Image(); p0_aktiv.src = "../gfx/p0a.gif";

mi_norm = new Image();	mi_norm.src = "../gfx/ad_mi.gif";
mi_aktiv = new Image();	mi_aktiv.src = "../gfx/ad_mi2.gif";*/

function wmpopup()
{	fenster=window.open("../webmiles/index.php?id=3","Webmiles","width=500,height=520,scrollbars=yes,resizable=no");
	fenster.focus();
	return false;
}


function ontop()
{	if(top==self)
	{	location.href="index.pl?$url"
	}
}

function openwindow(url)
{	fenster_n=window.open(url,"NewUser","width=565,height=600,resizable=no,scrollbars=yes");
	fenster_n.focus();
	return false;
}

function showcover(url)
{	fenster_c=window.open(url,"Titelseite","toolbar=no,menubar=no,location=no,scrollbar=no,height=560,width=420");
	fenster_c.focus();
	return false;
}

function popup(url)
{	fenster_h=window.open(url,"Hilfe","width=150,height=200,left=170,top=255;");
	fenster_h.focus();
	return false;
}

function empf_pop(url)
{	fenster_h=window.open(url,"Prämienempfehlung","width=400,height=320,left=170,top=255;");
	fenster_h.focus();
	return false;
}

/*function swap(pic)
{	if(document.images)
	{	window.document.images[pic].src = p0_aktiv.src;
	}
}

function swapback(pic)
{	if(document.images)
	{	window.document.images[pic].src = p0_norm.src;
	}
}*/

/*function swap2(pic)
{	if(document.images)
	{	window.document.images[pic].src = mi_aktiv.src;
	}
}

function swap2back(pic)
{	if(document.images)
	{	window.document.images[pic].src = mi_norm.src;
	}
}*/

function checkzahlung()
{	si = document.abfrage.zahlung.options.selectedIndex;
	zahlung = document.abfrage.zahlung.options[si].text;
 	if(zahlung.indexOf('Rechnung') > -1)
	{	
		tb_show('Hinweis', 'http://www.abo-direkt.de/abodir/hinweis_rechnung_ad.html?placeValuesBeforeTB_=savedValues&TB_iframe=true&height=220&width=150', false);
		/*fenster_h=window.open("http://www.abo-direkt.de/abodir/hinweis_rechnung_ad.html","Hinweis","width=160,height=186,left=170,top=255;");*/
	}
	return true;
}

function checkzahlung_6m()
{	si = document.abfrage.zahlung.options.selectedIndex;
	zahlung = document.abfrage.zahlung.options[si].text;
 	if(zahlung.indexOf('Rechnung') > -1)
	{	
		tb_show('Hinweis', 'http://www.abo-direkt.de/abodir/hinweis_rechnung_ad_6m.html?placeValuesBeforeTB_=savedValues&TB_iframe=true&height=220&width=150', false);
		/*fenster_h=window.open("http://www.abo-direkt.de/abodir/hinweis_rechnung_ad_6m.html","Hinweis","width=160,height=186,left=170,top=255;");*/
	}
	return true;
}

function checkzahlung_6m_webmiles(wm)
{	si = document.abfrage.zahlung.options.selectedIndex;
	zahlung = document.abfrage.zahlung.options[si].text;
 	if(zahlung.indexOf('Rechnung') > -1)
	{
		tb_show('Hinweis', 'http://www.abo-direkt.de/abodir/hinweis_rechnung_ad_6m_webmiles.pl?webmiles=' + wm + '&placeValuesBeforeTB_=savedValues&TB_iframe=true&height=175&width=150', false);
		/*fenster_h=window.open("http://www.abo-direkt.de/abodir/hinweis_rechnung_ad_6m_webmiles.pl?webmiles="+wm,"Hinweis","width=155,height=180,left=170,top=255;");*/
	}
	return true;
}

function checkzahlung_radio()
{
	fenster_h=window.open("http://www.abo-direkt.de/abodir/hinweis_rechnung_ad.html","Hinweis","width=160,height=186,left=170,top=255;");
	return true;
}

function be_gewinnspiel(opt)
{	if(document.abfrage.zahlung.options[opt].selected)
	{	fenster_h=window.open("http://www.abo-direkt.de/abodir/be_gewinnspiel.html","Hinweis","width=200,height=130,left=170,top=255;");
	}
	return true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	fenster=window.open(theURL,winName,features);
	fenster.focus();
	return false;
}

function kontaktpopup()
{
	fenster=window.open("http://www.abo-direkt.de/abodir/popup_danke.html","Kontakt","width=200,height=130,left=170,top=255;");
	fenster.focus();
	return false;
}

function cutText(len, divid)
{
	var p = document.getElementById(divid);
	if (p)
	{
		var trunc = p.innerHTML;
		if (trunc.length > len)
		{
			/* Truncate the content of the P, then go back to the end of the
			   previous word to ensure that we don't truncate in the middle of
			   a word */
			trunc = trunc.substring(0, len);
			trunc = trunc.replace(/\w+$/, '');

			/* Add an ellipses to the end and make it a link that expands
			   the paragraph back to its original size */
			trunc += '<a href="#" ' +
				'onclick="this.parentNode.innerHTML=' +
				'unescape(\''+escape(p.innerHTML)+'\');return false;">' +
				'<strong>&gt;&gt; mehr Infos<\/strong><\/a>';
			p.innerHTML = trunc;
		}
	}
}



function showMagPreview(vkz, titel, erscheinung, screenX, screenY, screenX2, screenY2)
{
	//alert (vkz + ' ' + titel + ' ' + erscheinung + ' ' + screenX + ' ' + screenY + ' ' + screenX2 + ' ' + screenY2);
	var inner;
	var ew;

	if ( vkz == '0' )
		document.getElementById('magPreview').style.display = 'none';
	else
	{
		if ( screenX > 0 )	// Alle guten Browser
		{
			screenX += 80;
			screenY -= 150;
		}
		else	// Internet Explorer
		{
			screenX = screenX2 + 80;
			screenY = screenY2 - 150;
		}

		inner  = '<dl>' + "\n";
		inner += '<dt><img src="http://www.intan.net/abo-direkt/cover/' + vkz + 'g.jpg" width="80" height="116" alt="' + titel + '" /></dt>' + "\n";
		inner += '<dd><span align="center"><strong>' + titel + '</strong><br />' + "\n";
		inner += 'Erscheinung: ' + erscheinung + '<br />' + "\n";
		inner += '</dd>' + "\n";
		inner += '</dl>' + "\n";

		document.getElementById('magPreview').innerHTML = inner;
		document.getElementById('magPreview').style.display = 'block';
		document.getElementById('magPreview').style.left = screenX+'px';
		document.getElementById('magPreview').style.top = screenY+'px';
	}
}

function iload(who) {
	window.scrollTo(0,0);
}

function showPramDetail(element)
{
	thisElement=document.getElementById(element);
	if(thisElement.getAttributeNode("class").nodeValue == "productDetailHidden")
	{
		newClass = document.createAttribute("class");
		newClass.nodeValue = "productDetailVisible";
		thisElement.setAttributeNode(newClass);
	} else
	{
		newClass = document.createAttribute("class");
		newClass.nodeValue = "productDetailHidden";
		thisElement.setAttributeNode(newClass);
	}
}

function changeContact(){
	if( window.document.Abfrage.thema[window.document.Abfrage.thema.selectedIndex].value=="urlaub" ){
		window.location.href = document.URL + '&aktion=urlaub';
	}else if( window.document.Abfrage.thema[window.document.Abfrage.thema.selectedIndex].value=="umzug" ){
		window.location.href = document.URL + '&aktion=adresse';
	}else if( window.document.Abfrage.thema[window.document.Abfrage.thema.selectedIndex].value=="bank" ){
		window.location.href = document.URL + '&aktion=bank';
	}else if( window.document.Abfrage.thema[window.document.Abfrage.thema.selectedIndex].value=="titelwechsel" ){
		window.location.href = document.URL + '&aktion=titel';
	}
}

/*Funktion für buch-de zum öffnen der buchde-Seite im Parent-Fenster
  momentan jedoch inaktiv
*/
function FensterOeffnen (Adresse) {
	var fenster;
	if(window.opener && window.opener != null){
		window.fenster=opener;
	}
	
	if (!(fenster) || fenster.closed){
		window.fenster = window.open(Adresse,'buchde');	
		self.name="abodirekt";
		
		if (window.fenster.opener == null){
			window.fenster.opener = self;
		}
	}else{
		window.fenster.location=Adresse;	
	}
	window.fenster.focus();
}
function checkStatus(){
	value = window.document.getElementById("zahlung")[window.document.getElementById("zahlung").selectedIndex].value;
	if(value=="jährlicher Rechnung"){
		tb_show('Hinweis', 'tpl/neckermann/hinweis_rechnung.html?placeValuesBeforeTB_=savedValues&TB_iframe=true&height=220&width=150', false);
	}
}