function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		// b_name_i_home_over = newImage("img3/b_name-i_home_over.jpg");
		preloadFlag = true;
	}
}

function noSpamMail(titel,pre,post,domain,subject,cssclass,cssfile) {
	wwidth = 300;
	wheight = 140;
	wleft = (screen.width / 2) - (wwidth / 2);
	wtop = (screen.height / 2) - (wheight / 2);
	NewWindow=window.open('','NoSpamMail','width=' + wwidth + ', height=' + wheight + ', menubar=no, toolbar=no, location=no, status=no, resizable=no, dependent=yes, left=' + wleft + ', top=' + wtop);
	NewWindow.document.write('<html>\n<head>\n');
	if (cssfile) NewWindow.document.write('<link rel="stylesheet" type="text/css" href="' + cssfile + '">\n');
	NewWindow.document.write('</head>\n<body>\n');
	NewWindow.document.write('<br><br>\n');
	if (titel) NewWindow.document.write('&nbsp;&nbsp;' + titel + '<br><br>\n');
	if (subject) subject = '?subject=' + subject; else subject = '';
	NewWindow.document.write('&nbsp;&nbsp;<a ');
	if (cssclass) NewWindow.document.write('class="' + cssclass + '" ');
	NewWindow.document.write('href="mailto:' + pre + '&#64;' + post + '.' + domain + subject + '">');
	NewWindow.document.write(pre + '&#64;' + post + '.' + domain);
	NewWindow.document.write('</a>\n');
	NewWindow.document.write('<br /><br /><br />\n');
	NewWindow.document.write('<div align="center"><a class="vklink" href="javascript: window.close();">[close]</a></div>\n');
	NewWindow.document.write('</body>\n</html>\n');
	NewWindow.document.close();
	NewWindow.focus();
}

function MM_controlSound(x, _sndObj, sndFile) { //v3.0
  var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  else window.location = sndFile;
}

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 showhide(action,id,a,linktext) {
	var displ,inner;
	if (action=="show") {
		displ = "block";
		inner = "<a href=\"javascript:showhide('hide','" + id + "','" + a + "','" + linktext + "')\" class=\"showhide-link\">hide " + linktext + "</a>";
	} else {
		displ = "none";
		inner = "<a href=\"javascript:showhide('show','" + id + "','" + a + "','" + linktext + "')\" class=\"showhide-link\">show " + linktext + "</a>";
	}
	document.getElementById(id).style.display = displ;
	document.getElementById(a).innerHTML = inner;
}

function openExternMusicPlayer ($playerSwfPath,$playerConfigPath) {
	if(windowOpenCloseReference) windowOpenCloseReference.close();
	OpenCloseExtWin('Musikplayer', '240', '80', 'no', 'no', 'no', 'no', 'no', 'no');
	windowOpenCloseReference.document.write('<html>\n<head>\n');
	windowOpenCloseReference.document.write('<title>Musicplayer</title>\n');
	windowOpenCloseReference.document.write('<link rel="stylesheet" href="css/main.css" type="text/css" />');
	windowOpenCloseReference.document.write('</head>\n<body>\n');
	windowOpenCloseReference.document.write('<div style="float: left; margin-bottom: 20px;">');
	windowOpenCloseReference.document.write('<object type="application/x-shockwave-flash" data="'+$playerSwfPath+'" width="220" height="60">');
	windowOpenCloseReference.document.write('<param name="movie" value="'+$playerSwfPath+'" />');
	windowOpenCloseReference.document.write('<param name="FlashVars" value="configxml='+$playerConfigPath+'" />');
	windowOpenCloseReference.document.write('<p>Flashplayer ist nicht installiert!</p>');
	windowOpenCloseReference.document.write('</object></div><br />');
	windowOpenCloseReference.document.write('<div align="center"><a href="javascript: window.close();">beenden / close</a></div>\n');
	windowOpenCloseReference.document.write('</body>\n</html>\n');
	windowOpenCloseReference.document.close();
	windowOpenCloseReference.focus();
}
