
function daytime()
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
if (new Date().getHours()<10) { document.write("Morning"); }
if (new Date().getHours()>9  && new Date().getHours()<18) { document.write("Day"); }
if (new Date().getHours()>17)  { document.write("Evening"); }
return null;
}

function daytimetxt()
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
if (new Date().getHours()<10) { return "Morning"; }
if (new Date().getHours()>9  && new Date().getHours()<18) { return "Day"; }
if (new Date().getHours()>17)  { return "Evening"; }
return "";
}

function sendpost(mailname,maildomain,mailtitle,mailclass,mailsubject,mailbody)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg - Info: %0A in mailbody = LF !
document.write('<a class=' + mailclass + ' title="' + mailtitle + '" ');
document.write('href="mailto:' + mailname + '@' + maildomain);
document.write('?bcc=r.a.koehler' + '@' + 'hamburg.de;');
document.write('&subject=' + mailsubject + '&body=' + mailbody + '">');
document.write('&nbsp;' + mailname + '@' + maildomain + '&nbsp;' + '</a>');
return null;
}

function click(evt)
{
if (navigator.appName.indexOf("Microsoft") != -1)
  {
  if (event.button==2)
    {
    alert('You clicked your right mouse button !');
    return false;
    }
  }
if (navigator.appName.indexOf("Netscape") != -1)
  {
  if (evt.which==3)
    {
    alert('You clicked your right mouse button !');
    return false;
    }
  }
if (navigator.appName.indexOf("Netscape") != -1)
  {
  document.captureEvents(Event.MOUSEDOWN);
  }
}

function fromwhere()
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
// if (! top.idxmf && ! window.location.protocol=="file:")
if (! top.idxmf)
  {
  window.location.href="http://www.pyratestyle.com";
  }
return null;
}

function waitsec(secrequest)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
var waitnow = new Date().getTime() + (secrequest*1000) ;
while(new Date().getTime()<waitnow)
  {
  // Info: ACHTUNG: Die geschweiften Klammern dürfen bei der while-Anweisung nicht fehlen !!!
  }
return null;
}

function duofra(tocall1,franum1,tocall2,franum2)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
parent.frames[franum1].location.href=tocall1;
parent.frames[franum2].location.href=tocall2;
parent.frames[franum2].focus();
return null;
}

function _checkBrowser()
{
setCookie(top.idxmf.cookname+"_BC","");
if (document.cookie)
  return true;
else
  return false;
}

function checkBrowser()
{
setCookie(top.idxmf.cookname+"_BC","");
return true;
}

function _setCookie(coknam,value,expires)
{
if ( !expires )
  {
  expires = new Date() ;
  expires.setTime( expires.getTime() + (1000 * 60 * 60 * 24 * 31) ) ;
  }
document.cookie = coknam + "=" + escape(value) + "; expires=" + expires.toGMTString() +  "; path=/" ;
return null;
}

function setCookie(coknam,value,expires)
{
if ( !expires )
  {
  expires = new Date() ;
  expires.setTime( expires.getTime() + (1000 * 60 * 60 * 24 * 31) ) ;
  }
if (coknam.indexOf("_BC") != -1)
  {
  top.idxmf.cd_BC = coknam + "=" + escape(value) + "; expires=" + expires.toGMTString() +  "; path=/" ;
  }
if (coknam.indexOf("_ORDER") != -1)
  {
  top.idxmf.cd_ORDER = coknam + "=" + escape(value) + "; expires=" + expires.toGMTString() +  "; path=/" ;
  }
if (coknam.indexOf("_VISITOR") != -1)
  {
  top.idxmf.cd_VISITOR = coknam + "=" + escape(value) + "; expires=" + expires.toGMTString() +  "; path=/" ;
  }
return null;
}

function _getCookie(coknam)
{
var doccok = document.cookie;
coknam = coknam + "=";
var coklen = doccok.length;
var cokbgn = 0;
while (cokbgn < coklen)
  {
  var varbgn = cokbgn + coknam.length;
  if (doccok.substring(cokbgn, varbgn) == coknam)
    {
	var varend = doccok.indexOf (";", varbgn);
	if (varend == -1)
	  varend = coklen;
      return unescape(doccok.substring(varbgn, varend));
	}
  cokbgn = doccok.indexOf(" ", cokbgn) + 1;
  if (cokbgn == 0)
    break;
  }
return "";
}

function getCookie(coknam)
{
if (coknam.indexOf("_BC") != -1)
  {
  var doccok = top.idxmf.cd_BC ;
  }
if (coknam.indexOf("_ORDER") != -1)
  {
  var doccok = top.idxmf.cd_ORDER ;
  }
if (coknam.indexOf("_VISITOR") != -1)
  {
  var doccok = top.idxmf.cd_VISITOR ;
  }
coknam = coknam + "=";
var coklen = doccok.length;
var cokbgn = 0;
while (cokbgn < coklen)
  {
  var varbgn = cokbgn + coknam.length;
  if (doccok.substring(cokbgn, varbgn) == coknam)
    {
    var varend = doccok.indexOf (";", varbgn);
    if (varend == -1)
      varend = coklen;
      return unescape(doccok.substring(varbgn, varend));
    }
  cokbgn = doccok.indexOf(" ", cokbgn) + 1;
  if (cokbgn == 0)
    break;
  }
return "";
}

function _delCookie(coknam)
{
document.cookie = coknam + "=" + "; expires=Thu, 01-Jan-70 00:00:00 GMT" +  "; path=/";
return null;
}

function delCookie(coknam)
{
if (coknam.indexOf("_BC") != -1)
  {
  top.idxmf.cd_BC = coknam + "=" + "; expires=Thu, 01-Jan-70 00:00:00 GMT" +  "; path=/";
  }
if (coknam.indexOf("_ORDER") != -1)
  {
  top.idxmf.cd_ORDER = coknam + "=" + "; expires=Thu, 01-Jan-70 00:00:00 GMT" +  "; path=/";
  }
if (coknam.indexOf("_VISITOR") != -1)
  {
  top.idxmf.cd_VISITOR = coknam + "=" + "; expires=Thu, 01-Jan-70 00:00:00 GMT" +  "; path=/";
  }
return null;
}

function loadForm()
{
// Initialisiert das Formular
var elnam = new String();
var order = new String(getCookie(top.idxmf.cookname+"_ORDER"));
for (var i = 0; i < document.form.elements.length; i++)
  {
  elnam = document.form.elements[i].name;
  if (elnam.indexOf("BT_") != "0")
    {
    document.form.elements[i].value = getQty(order, document.form.elements[i].name);
    }
  }
return null;
}

function saveForm()
{
var order = new String(getCookie(top.idxmf.cookname+"_ORDER"));
var elnam = new String();
for (var i = 0; i < document.form.elements.length; i++)
  {
  elnam = document.form.elements[i].name;
  if (elnam.indexOf("BT_") != "0")
    {
    order = delItem(order, document.form.elements[i]);
    }
  }
for (var i = 0; i < document.form.elements.length; i++)
  {
  elnam = document.form.elements[i].name;
  if (elnam.indexOf("BT_") != "0")
    {
    order = addItem(order, document.form.elements[i]);
    }
  }
// Copyright © 2005 Ralf A. Köhler, Hamburg (Folgende if-Abfrage):
if (order.indexOf("X000") == -1)
  {
  order = "X000" + ":" + "1" + ";" + order;
  }
setCookie(top.idxmf.cookname+"_ORDER", order);
return null;
}

function addItem(str, item2add)
{
// Fügt der Zeichenkette str den Schlüssel item2add und den Wert zu
var ival = new String (cleanInput(item2add.value));
if (ival > 0)
  {
  str = str + item2add.name + ":" + ival + ";";
  }
return str;
}

function delItem(str, item2delete)
{
// Löscht aus der Zeichenkette str vom Schlüssel item2delete bis zum naechsten Semikolon
name2delete = item2delete.name + ":";
delbgn = str.indexOf(name2delete);
if (delbgn < 0)
  {
  return str;
  } // Schlüssel nicht gefunden
else
  {
  delend = str.indexOf(";", delbgn) + 1;
  return str.substring (0, delbgn) + str.substring (delend, str.length);
  }
}

function getQty(str, name2evaluate)
{
// Ermittelt aus der Zeichenkette str den Wert zwischen Schlüssel item2delete und dem naechsten Semikolon
var objnam = new String(name2evaluate + ":");
var delbgn = str.indexOf(objnam);
if (delbgn < 0)
  {
  return "0";
  }
else
  {
  var varbgn = delbgn + objnam.length;
  varend = str.indexOf(";", delbgn);
  return str.substring (varbgn, varend);
  }
}

function cleanInput(input)
{
var str = new String(input);
if ( str.length < 1 )
  {
  str = "0";
  }
else
  {
  for (var index=0; index < str.length; index++)
    {
    if (str.charAt(index) < "0" || str.charAt(index) > "9")
      {
      alert ("While entering the amount, please use the digits 0 to 9 only  !");
      str = "0";
      }
    }
  str++; // befreit auf einfachste weise
  str--; // von führenden nullziffern
  }
return str;
}

function loadUserData(radiostat)
{
if (document.cookie)
  {
  var usrdat = new String (_getCookie(top.idxmf.cookname+"_VISITOR"));
  }
else
  {
  var usrdat = new String (getCookie(top.idxmf.cookname+"_VISITOR"));
  }
if (usrdat.length > 4)
  {

  var varbgn = 0;
  var varend = usrdat.indexOf (";");
  document.form.h_name.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_name1          = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_adr1.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_addr1          = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_adr2.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_addr2          = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_email.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_email           = usrdat.substring(varbgn, varend);

  //
  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_coucod.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_coucod           = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_crsize.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_crsize           = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_jvsize.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_jvsize           = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_ptsize.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_ptsize           = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_stsize.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_stsize           = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_btsize.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_btsize           = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_rgsize.value = usrdat.substring(varbgn, varend);
  top.idxmf.v_rgsize           = usrdat.substring(varbgn, varend);
  //

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_zahla.value = usrdat.substring(varbgn, varend);

  if (radiostat == 1)
    {
    if (document.form.h_zahla.value == "NN") { document.form.x_zahla[0].checked = true ; }
    if (document.form.h_zahla.value == "CC") { document.form.x_zahla[1].checked = true ; }
    if (document.form.h_zahla.value == "KK") { document.form.x_zahla[2].checked = true ; }
    }

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_ktobez.value = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_ktonum.value = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_ktoblz.value = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_kkart.value = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_kknum.value = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_kkcvc.value = usrdat.substring(varbgn, varend);

  varbgn = varend + 1;
  varend = usrdat.indexOf (";", varbgn);
  document.form.h_kkexp.value = usrdat.substring(varbgn, varend);

  }

else

  {

  if (radiostat == 1)
    {
    document.form.x_zahla[0].checked = true ;
    }

  }

return null;
}

function saveUserData()
{

if (document.form.x_zahla[0].checked == true) { document.form.h_zahla.value = "NN" ; }
if (document.form.x_zahla[1].checked == true) { document.form.h_zahla.value = "CC" ; }
if (document.form.x_zahla[2].checked == true) { document.form.h_zahla.value = "KK" ; }

var usrdat = new String( document.form.h_name.value + ";");
usrdat += document.form.h_adr1.value  + ";";
usrdat += document.form.h_adr2.value  + ";";
usrdat += document.form.h_email.value + ";";

//
usrdat += document.form.h_coucod.value + ";";
usrdat += document.form.h_crsize.value + ";";
usrdat += document.form.h_jvsize.value + ";";
usrdat += document.form.h_ptsize.value + ";";
usrdat += document.form.h_stsize.value + ";";
usrdat += document.form.h_btsize.value + ";";
usrdat += document.form.h_rgsize.value + ";";
//

usrdat += document.form.h_zahla.value  + ";";
usrdat += document.form.h_ktobez.value + ";";
usrdat += document.form.h_ktonum.value + ";";
usrdat += document.form.h_ktoblz.value + ";";

usrdat += document.form.h_kkart.value + ";";
usrdat += document.form.h_kknum.value + ";";
usrdat += document.form.h_kkcvc.value + ";";
usrdat += document.form.h_kkexp.value + ";";

setCookie(top.idxmf.cookname+"_VISITOR", usrdat);

_setCookie(top.idxmf.cookname+"_VISITOR", usrdat);

top.idxmf.v_name1 = document.form.h_name.value;
top.idxmf.v_addr1 = document.form.h_adr1.value;
top.idxmf.v_addr2 = document.form.h_adr2.value;
top.idxmf.v_email = document.form.h_email.value;

//
top.idxmf.v_coucod = document.form.h_coucod.value;
top.idxmf.v_crsize = document.form.h_crsize.value;
top.idxmf.v_jvsize = document.form.h_jvsize.value;
top.idxmf.v_ptsize = document.form.h_ptsize.value;
top.idxmf.v_stsize = document.form.h_stsize.value;
top.idxmf.v_btsize = document.form.h_btsize.value;
top.idxmf.v_rgsize = document.form.h_rgsize.value;
//

return null;
}

function dyna_x()
{
// Copyright © 2005 Ralf A. Köhler, Hamburg - Info: Diese Funktion OHNE return-Wert !!!
helptext(0);
top.idxmf.dyna00.location.href=top.idxmf.cont_x+".htm";
top.idxmf.dyna00.focus();
}

function catalog_x()
{
// Copyright © 2005 Ralf A. Köhler, Hamburg - Info: Diese Funktion OHNE return-Wert !!!
var xshort = new String(top.idxmf.cont_x) ;
helptext(0);
if (xshort=="00" || xshort=="01")
  {
  top.idxmf.dyna00.location.href="catalog_"+top.idxmf.cont_x+".htm" ;
  }
if (xshort=="oc")
  {
  if (top.idxmf.vc_name != 0 || top.idxmf.vc_adr1 != 0 || top.idxmf.vc_adr2 != 0 || top.idxmf.vc_email != 0 || top.idxmf.vc_zahla != 0)
    {
    top.idxmf.os_menu              = "08" ;
    top.idxmf.menu00.location.href = "menu_os.htm" ;
    top.idxmf.dyna00.location.href = "visitor.htm" ;
    }
  else
    {
    top.idxmf.dyna00.location="order.htm";
    }
  }
if (xshort=="pd")
  {
  top.idxmf.dyna00.location.href="visitor.htm";
  }
if (xshort=="sc")
  {
  top.idxmf.dyna00.location="shopcart.htm";
  }
top.idxmf.dyna00.focus();
}

function medyca00(menuid,cataid,prodid,filoc)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg - Info: Diese Funktion bis auf "oc" OHNE return-Wert !!!

var v_menuid = new String(menuid) ;
var v_cataid = new String(cataid) ;
var v_prodid = prodid             ;
var v_filoc  = new String()       ;
if (filoc=="shop/" || filoc=="../")
  {
  v_filoc=filoc;
  }

var menulist0 = new String("00|01|02|03|04|05|14|15");
var menulist1 = new String("06|-6|07|08|09|10");

top.idxmf.cont_x=v_cataid;
top.idxmf.cont_y=v_prodid;
top.idxmf.cont_z=v_filoc;

top.idxmf.dy_menu=v_menuid;
top.idxmf.os_menu=v_menuid;

if ( (v_menuid == "00") || (v_menuid == "06" && v_cataid == "00") || (v_menuid == "07" && v_cataid == "sc") )
  {
  top.idxmf.dy_cate = 0 ;
  top.idxmf.dy_cata = 0 ;
  top.idxmf.dy_stop = 0 ;
  }

if (v_menuid == "06" && v_cataid == "01" && top.idxmf.dy_cate != 0)
  {
  // Diese VOR der mit == 0 !!!
  var v_look = top.idxmf.dy_cata ;
  var v_stop = 0 ;
  if (top.idxmf.dy_stop == 2)
    {
    top.idxmf.dy_stop = 0 ;
    }
  while ( v_stop == 0 )
    {
    if ( top.idxmf.ProdCat[v_look] == top.idxmf.dy_cate )
      {
      if ( top.idxmf.dy_cata != v_look )
        {
        top.idxmf.dy_cata = v_look ;
        v_stop = 1 ;
        }
      }
    v_look++ ;
    if ( v_look > top.idxmf.PX )
      {
      top.idxmf.dy_stop = 1 ;
      v_stop = 1 ;
      }
    }
  }

if (v_menuid == "-6" && v_cataid == "01" && top.idxmf.dy_cate != 0)
  {
  // Diese VOR der mit == 0 !!!
  var v_look = top.idxmf.dy_cata ;
  var v_stop = 0 ;
  if (top.idxmf.dy_stop == 1)
    {
    top.idxmf.dy_stop = 0 ;
    }
  while ( v_stop == 0 )
    {
    if ( top.idxmf.ProdCat[v_look] == top.idxmf.dy_cate )
      {
      if ( top.idxmf.dy_cata != v_look )
        {
        top.idxmf.dy_cata = v_look ;
        v_stop = 1 ;
        }
      }
    v_look-- ;
    if ( v_look < 1 )
      {
      top.idxmf.dy_stop = 2 ;
      v_stop = 1 ;
      }
    }
  }

if (v_menuid == "06" && v_cataid == "01" && top.idxmf.dy_cate == 0)
  {
  // Diese NACH der mit != 0 !!!
  top.idxmf.dy_cate = v_prodid ;
  var v_look = 1 ;
  var v_stop = 0 ;
  while ( v_stop == 0 )
    {
    if ( top.idxmf.ProdCat[v_look] == v_prodid )
      {
      top.idxmf.dy_cata = v_look ;
      v_stop = 1 ;
      }
    else
      {
      v_look++ ;
      if ( v_look > top.idxmf.PX )
        {
        v_stop = 2 ;
        }
      }
    }
  }

if (v_menuid != "")
  {
  if (menulist1.indexOf(v_menuid) == -1)
    {
    if (menulist0.indexOf(v_menuid) == -1)
      {
      top.idxmf.menu00.location.href=v_filoc+"menu_"+v_menuid+".htm";
      }
    else
      {
      top.idxmf.menu00.location.href=v_filoc+"menu_dy.htm";
      }
    }
  else
    {
    top.idxmf.menu00.location.href=v_filoc+"menu_os.htm";
    }
  }

if (v_cataid.indexOf("dyna_") != -1)
  {
  top.idxmf.dyna00.location.href=v_filoc+"dyna_x.htm";
  }
else
  {
  if (v_cataid=="shop/ordok" || v_cataid=="kfok" || v_cataid=="nfok")
    {
    if (v_cataid=="kfok" || v_cataid=="nfok")
      {
      top.idxmf.cont_x="dyna_"+v_cataid;
      }
    top.idxmf.dyna00.form.submit();
    }
  else
    {
    top.idxmf.dyna00.location.href=v_filoc+"catalog_x.htm";
    }
  }

top.idxmf.dyna00.focus();
}

function helptext(htxtnr)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
if (htxtnr==0)
  {
  document.write('<div align="center"><font class="txt12red"><br><br><br><b>Please wait ...</b></font></div>');
  }
if (htxtnr==1)
  {
  // document.write('<font class="txt08red">Please enter an amount for each wanted item and click on <nobr>&quot;<b>SHOPPING CART</b>&quot;,</nobr> to proceed with your order.<br>All prices quoted in our <nobr>Online-SHOP</nobr> include VAT.</font>');
  return ('<font class="txt08red">Please enter an amount, if you want to buy this item.<br>Click on &quot;<b>next</b>&quot; or &quot;<b>Catalog</b>&quot; for other products.<br>Click on <nobr>&quot;<b>SHOPPING CART</b>&quot;,</nobr> to proceed with your order.<br>All prices quoted in our <nobr>Online-SHOP</nobr> include VAT.</font>');
  }
}

function fix2decs(tofixnr)
{
// Info: u.a. wegen Order_Row-Preis
// document.write(parseInt(tofixnr)+'.'+String(Math.abs(Math.round(tofixnr*100))%100+100).substr(1,2));
return (parseInt(tofixnr)+'.'+String(Math.abs(Math.round(tofixnr*100))%100+100).substr(1,2));
}

function todayinfo(tdval)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
var todayall = new Date();
var todayarr = new Array("Sunday","Monday","Thuesday","Wednesday","Thursday","Friday","Saturday");
var tdda     = todayall.getDate();
var tdmo     = todayall.getMonth() + 1;
var tdye     = todayall.getYear();
if (tdye<100)
  {
  tdye+=2000;
  }
if (tdye>99 && tdye<1000)
  {
  tdye+=1900;
  }
var tdho     = todayall.getHours();
var tdxxm    = ((tdho < 12) ? " AM" : " PM");
if (tdho > 12)
  {
  tdho = (tdho-12);
  }
var tdmi     = todayall.getMinutes();
var tdse     = todayall.getSeconds();
var tdwd     = todayall.getDay();
var tdxda    = ((tdda < 10) ? "0" : "");
var tdxmo    = ((tdmo < 10) ? "0" : "");
var tdxho    = ((tdho < 10) ? "0" : "");
var tdxmi    = ((tdmi < 10) ? "0" : "");
var tdxse    = ((tdse < 10) ? "0" : "");
var todaydat = tdmo + "/" + tdda + "/" + tdye + " (MEZ)";
var todaytim = tdho + ":" + tdxmi + tdmi + ":" + tdxse + tdse + tdxxm;
var todaynam = todayarr[tdwd];
if (tdval==1)
  {
  // document.write(todaynam+', den '+todaydat);
  return (todaynam+', '+todaydat);
  }
}

function chkval(valpro,valent)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg - Info: Diese Funktion OHNE return-Wert !!!
var valstr = new String(valent);
var valerr = 0;
if ( valstr.length < 1 )
  {
  alert("An empty amount field is not allowed !");
  valstr = "0";
  valerr = 1;
  }
else
  {
  for (var validx=0; validx < valstr.length; validx++)
    {
    if (valstr.charAt(validx) < "0" || valstr.charAt(validx) > "9")
      {
      alert("While entering the amount, please use the digits 0 to 9 only  !");
      valerr = 1;
      break;
      }
    }
  }
if (valerr==1)
  {
  // valpro.value=valstr; --> kein confirm bei Netscape (bei 3 zeichen automatisch blur und somit loop !!! --> ERROR)
  valpro.value="0";
  valpro.focus();
  valpro.select();
  }
}

function setKoFo()
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
document.form.recipient.value = "PYRATESTYLE_CF@network-models.de";
document.form.print_blank_fields.value = "1";
document.form.realname.value = document.form.k_name.value;
document.form.email.value = document.form.k_email.value;
document.form.subject.value = "Contact Form PYRATE STYLE";
document.form.print_config.value = "subject";
document.form.sort.value = "order:k_name,k_tel,k_email,k_text";
document.form.redirect.value = "http://www.network-models.de/pyratestyle/dyna_x.htm";

// document.form.required.value = "k_email,email";
return null;
}

function setNeFo()
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
document.form.recipient.value = "PYRATESTYLE_NF@network-models.de";
document.form.print_blank_fields.value = "1";
document.form.realname.value = document.form.n_name.value;
document.form.email.value = document.form.n_email.value;
document.form.subject.value = "Newsletter Form PYRATE STYLE";
document.form.print_config.value = "subject";
document.form.sort.value = "order:n_name,n_email,n_text";
document.form.redirect.value = "http://www.network-models.de/pyratestyle/dyna_x.htm";

// document.form.required.value = "n_email,email";
return null;
}

function wavplay(wavfile)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
var wavbase = new Array();
wavbase[0]  = new String("images/telring1.wav");
wavbase[1]  = new String("images/telring2.wav");
if (top.idxmf)
  {
  top.idxmf.dyna00.ancwav.src=wavbase[wavfile];
  }
else
  {
  document.all.ancwav.src=wavbase[wavfile];
  }
return null;
}

function imgx(imgnum,imgfile)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
if (top.idxmf)
  {
  if (imgfile < 2)
    {
    top.idxmf.top00.document.images[imgnum].src = top.idxmf.imgbase[imgfile].src;
    }
  else
    {
    top.idxmf.dyna00.document.images[imgnum].src = top.idxmf.imgbase[imgfile].src;
    }
  }
else
  {
  document.all.images[imgnum].src = imgbase[imgfile].src;
  }
return null;
}

function playsound(sbnum,loopmode)
{
// Copyright © 2005 Ralf A. Köhler, Hamburg
var v_sbnum    = sbnum ;
var v_loopmode = loopmode ;

if (v_sbnum != 0)
  {
  top.idxmf.dy_actsb = v_sbnum ;
  top.idxmf.dy_actlm = v_loopmode ;
  }

if (top.idxmf.dy_sound == 0)
  {
  v_sbnum = 1 ;    // ergibt SoundBase[1] und das ist off.wav !
  v_loopmode = 1 ; // ergibt "nur einmal abspielen" !
  }

if (top.idxmf)
  {
  if (v_loopmode == 0)
    {
    top.idxmf.ancsound_1.src = top.idxmf.SoundBase[1] ;
    top.idxmf.ancsound_0.src = top.idxmf.SoundBase[v_sbnum] ;
    }
  else
    {
    top.idxmf.ancsound_0.src = top.idxmf.SoundBase[1] ;
    top.idxmf.ancsound_1.src = top.idxmf.SoundBase[v_sbnum] ;
    }
  }

return null ;
}

function togglesound()
{
// Copyright © 2005 Ralf A. Köhler, Hamburg

if (top.idxmf.dy_sound == 1)
  {
  top.idxmf.dy_sound = 0 ;
  top.idxmf.fina00.location.href = "fina_00.htm" ;
  playsound(0,1) ;
  }
else
  {
  top.idxmf.dy_sound = 1 ;
  top.idxmf.fina00.location.href = "fina_00.htm" ;
  playsound(top.idxmf.dy_actsb,top.idxmf.dy_actlm) ;
  }

return null;
}

document.onmousedown = click;

