
/*
==============
Anwendung: Abspann
-- by OLO 041217
==============
*/
function opEndWin()
	{
	window.open("http://www.motorradweb.de/content/end.html","endWindow","toolbar=0,hotkeys=0,location=0,menubar=0,resizable=no,scrollbars=no,status=no,titlebar=no,personalbar=no,width=1034,height=778,screenX=-10,screenY=-10");
	}

	
/*
==============
Anwendung: HUK24 PopUp
-- by OLO 050606
==============
*/
function openHUK()
	{
	return; // 11.06.05
	/*
	var intSW = screen.availWidth-320;
	strHUKOpen = window.open("/huk24.html","winHUK","width=220,height=350,screenX='+intSW+',screenY=10,scrollbars=no,location=no,menubar=no");  	
	strHUKOpen.moveTo(intSW,10);
	strHUKOpen.blur();
	*/
	}


/*
==============
Anwendung: Mail PopUp
-- by OLO 030410
==============
*/
function getSiteMail()
	{
	strUrl = "http://www.motorradweb.de/scripte/email_bm_mw_mc.asp?mail=mw";
	window.open(strUrl, "GetSiteMail","width=240,height=230" + ",resizable=no,scrollbars=no,toolbar=no,status=no,directories=no,menubar=no,location=no,screenX=400,screenY=250");
	}

/*
==============
Anwendung: Uhr
==============
Copyright (c) 1999 by Dietmar Rabich, Duelmen.
Alle Rechte vorbehalten.
Version:     1.1 Datum:       26.3.1999
Aenderungen: -
// === Parameter ===

*/

var	pfad	= "images/time/"	// Pfad als Ergaenzung der URL fuer die Bilder
var	format	= 4	// Formate: 1: HH:MM; 2: HH:MM:SS, 3: DD.MM.YYYY HH:MM, 4: DD.MM.YYYY HH:MM:SS, 5: DD.MM. HH:MM
var	nullen	= true	// true: fuehrende Nullen, false: fuehrende Leerzeichen

// === Interne Parameter ===
var	img_breite	= 8	// Breite der Ziffernbilder
var	img_hoehe	= 11	// Hoehe der Ziffernbilder

// === Variablen ===
var	zeichen	=
[
	".", ":", " ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
]
var	ziffer		= new Array()
var	ziffern		= 0
var	uhrzeit_curr	= ""

// === Funktionen ===

// Zeit darstellen
function zeit()
{
	// Zeit ermitteln
	var	now	= new Date()
	var	h	= now.getHours()
	var	m	= now.getMinutes()
	var	s	= now.getSeconds()
	var	d	= now.getDate()
	var	mo	= now.getMonth() + 1
	var	y	= 0
	if(now.getFullYear)
	{
		y	= now.getFullYear()
	}
	else
	{
		y	= now.getYear() + ((now.getYear() < 1900) ? 1900 : 0)
	}

	// Prefix festlegen
	var	prefix	= nullen ? "0" : " "

	// Komponenten aufbereiten
	h	= (h < 10) ? (prefix + String(h)) : String(h)
	m	= (m < 10) ? ("0" + String(m)) : String(m)
	s	= (s < 10) ? ("0" + String(s)) : String(s)
	d	= (d < 10) ? (prefix + String(d)) : String(d)
	mo	= (mo < 10) ? (prefix + String(mo)) : String(mo)
	y	= String(y)

	// Uhrzeit als Zeichenkette aufbauen
	var	uhrzeit	= ""
	switch(format)
	{
		case 2:
			uhrzeit	= h + ":" + m + ":" + s
			break
		case 3:
			uhrzeit	= d + "." + mo + "." + y + " " +
					h + (now.getSeconds() % 2 ? ":" : " ") + m
			break
		case 4:
			uhrzeit	= d + "." + mo + "." + y + " " +
					h + ":" + m + ":" + s
			break
		case 5:
			uhrzeit	= d + "." + mo + ". " +
					h + (now.getSeconds() % 2 ? ":" : " ") + m
			break
		default:
			uhrzeit	= h + (now.getSeconds() % 2 ? ":" : " ") + m
	}

	// Zeitanzeige anpassen
	if(uhrzeit != uhrzeit_curr)
	{
		var	i

		for(i = 0; i < ziffern; i++)
		{
			eval("document.ziffer" + String(i) + ".src = ziffer[uhrzeit.substring(" + String(i) + ", " + String(i) + " + 1)].src")
		}
		uhrzeit_curr	= uhrzeit
	}

	// Zeitfunktion erneut aufrufen
	setTimeout("zeit()", 50)
}

// Zeitdarstellung aktivieren
function uhr(alignment)
{
	var	i

	// Bilder laden
	for(i = 0; i < zeichen.length; i++)
	{
		ziffer[zeichen[i]]	= new Image()
		switch(zeichen[i])
		{
			case ".":
				ziffer[zeichen[i]].src	= pfad + "punkt.gif"
				break

			case ":":
				ziffer[zeichen[i]].src	= pfad + "doppelpunkt.gif"
				break

			case " ":
				ziffer[zeichen[i]].src	= pfad + "leer.gif"
				break

			default:
				ziffer[zeichen[i]].src	= pfad + zeichen[i] + ".gif"
		}
	}

	// Feldlaenge merken
	switch(format)
	{
		case 2:
			ziffern	= 8
			break

		case 3:
			ziffern	= 16
			break

		case 4:
			ziffern	= 19
			break

		case 5:
			ziffern	= 12
			break

		default:
			ziffern	= 5
	}

	// Uhrzeitfeld ausgeben
	with(document)
	{
		open("text/html")
		writeln("<TABLE " + (alignment ? (alignment + " ") : "") + "BORDER=0 CELLSPACING=1 CELLPADDING=5 WIDTH=" + String(img_breite + 12) + " HEIGHT=" + String(img_hoehe + 12) + ">")
		writeln("<TR ALIGN=CENTER VALIGN=MIDDLE>")
		write("<TD NOWRAP>")
		for(i = 0; i < ziffern; i++)
			write("<IMG SRC=\"leer.gif\" NAME=\"ziffer" + String(i) + "\" HEIGHT=" + img_hoehe + " WIDTH=" + img_breite + " BORDER=0 ALT=\"\">")
		writeln("</TD>")
		writeln("</TR>")
		writeln("</TABLE>")
		close()
	}

	// Anzeige starten
	zeit()
}


/*
Weitere JS Functionen, hier her verschoben am 12.12.01 OLO
*/

function StartGebraucht()
	{
	NavDat = window.open("http://www.motorradweb.de/info/info_dat_frame.asp?site=mw","dat","width=1024,location=yes,menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes");
	NavDat.focus();
	}

function StartUmfrage()
	{
	Navigation = window.open("http://www.motorradundmehr.de/poll/poll.php3","Window","height=280,width=135");
	Navigation.focus();
	}
  
function StartNewsletter()
		{
  strNL= window.open("newsletter.asp","nl","height=380,width=500");
 	strNL.focus();
		}

function openCC()
	{
	winCC = window.open("http://www.carcredit.de/StartCalculationFromStandard.do?partner=w039dkn8","winCC","width=800,height=600,screenX=0,screenY=0");  	
	}

function openDom()
	{
	winDom = window.open("../content/domains.html","winDom","width=250,height=600,screenX=0,screenY=0");  	
	winDom.moveTo(1,1);
	winDom.focus();
	}
	
// Funktionen für Bild-Wechsel vom 160302
	
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

function CheckMail(strMail)
	{
	//strEmail ist nicht leer, prüfe Email-Adressen auf @ u.Pkt!
	var strEMail = strMail;
	var bolMail=true;
	var intATPos = strEMail.indexOf('@');
	var intLen = strEMail.length;
	
	if (intATPos>0)
		var intPktPos = strEMail.indexOf('.');
	else
		var intPktPos=0;
	
	if (intATPos == -1)
		bolMail = false;
	
	if (intPktPos <= 0) 
		bolMail = false;
		
	if (intLen == intPktPos)
		bolMail = false;
	
	return bolMail;
	}
