
function iA(numberOfImage) {
  document["basketImg_" + numberOfImage].src = "images/ka.gif";
}

function iD(numberOfImage) {
  document["basketImg_" + numberOfImage].src = "images/ki.gif";
}

function showNewsInfo(userid) {
  window.status = '';
  var myWin = window.open("webshop.epl?exec=News&userid=" + userid, "beck_kanal_NewsInformation", "width=630,height=370,resizable=yes,alwaysRaised,scrollbars=yes");
  myWin.focus();
}

function showFeedbackInfo(userid) {
  window.status = '';
  var myWin = window.open("webshop.epl?exec=Feedback&userid=" + userid, "beck_kanal_FeedbackInformation", "width=740,height=530,resizable=no,alwaysRaised,scrollbars=no");
  myWin.focus();
}

function showAGBInfo(userid) {
  window.status = '';
  var myWin = window.open("webshop.epl?exec=AGB&userid=" + userid, "beck_kanal_AGBInformation", "width=770,height=600,resizable=no,alwaysRaised,scrollbars=yes");
  myWin.focus();
}

function showBestellInfo(userid) {
  window.status = '';
  var myWin = window.open("webshop.epl?exec=BestellInfo&userid=" + userid, "beck_kanal_BestellInformation", "width=770,height=600,resizable=no,alwaysRaised,scrollbars=yes");
  myWin.focus();
}

function showImpressumInfo(userid) {
  window.status = '';
  var myWin = window.open("webshop.epl?exec=Impressum&userid=" + userid, "beck_kanal_ImpressumInformation", "width=600,height=580,resizable=no,alwaysRaised");
  myWin.focus();
}

function showAnmeldungInfo(userid, email, callbackflag) {
  window.status = '';
  document.location.href = "https://www.e-webshopping.de/beck-kanal.de/webshop.epl?exec=Login&userid=" + userid + "&email=" + escape(email) + "&cbflag=" + callbackflag;
}

function showDatenschutzInfo(userid) {
  window.status = '';
  var myWin = window.open("webshop.epl?exec=Datenschutz&userid=" + userid, "beck_kanal_DatenschutzInformation", "width=470,height=350,resizable=no,alwaysRaised");
  myWin.focus();
}

function showSicherheitInfo(userid) {
  window.status = '';
  var myWin = window.open("webshop.epl?exec=Sicherheit&userid=" + userid, "beck_kanal_SicherheitInformation", "width=600,height=400,resizable=no,alwaysRaised");
  myWin.focus();
}

function showPasswortVergessenInfo(userid, email) {
  window.status = '';
  var myWin = window.open("", "beck_kanal_PasswortVergessenInformation", "width=400,height=340,resizable=no,alwaysRaised");
  myWin.document.location.href = "webshop.epl?exec=PasswortVergessen&userid=" + userid + "&email=" + escape(email);
  myWin.focus();
}

function showVerlosungInfo(userid) {
  window.status = '';
  var myWin = window.open("webshop.epl?exec=Verlosung&userid=" + userid, "beck_kanal_VerlosungInformation", "width=410,height=360,resizable=no,alwaysRaised");
  myWin.focus();
}

function katalogseiteAnzeigen(userid, katid, katnr, ogr, block, page, filterselector, filterchar) {
  window.status = '';
  document.location.href = "http://www.e-webshopping.de/beck-kanal.de/webshop.epl?exec=Seite&userid=" + userid + "&katid=" + katid + "&katnr=" + katnr + "&ogr=" + ogr + "&block=" + block + "&page=" + page + "&filterselector=" + filterselector + "&filterchar=" + escape(filterchar);
}

function orderFct(userid, katid, katnr, ogr, ugr, artNr, artfieldId) {
  var fieldId, anzahl;
  fieldId = "Art_" + artfieldId;
  anzahl = document.layout[fieldId].value;

  if (isInt(anzahl) && anzahl > 0) {
    var eplCmd = "http://www.e-webshopping.de/beck-kanal.de/webshop.epl?exec=Danke";
    eplCmd = eplCmd + "&userid=" + userid;
    eplCmd = eplCmd + "&katid=" + katid;
    eplCmd = eplCmd + "&katnr=" + katnr;
    eplCmd = eplCmd + "&ogr=" + ogr;
    eplCmd = eplCmd + "&ugr=" + ugr;
    eplCmd = eplCmd + "&artanz=" + anzahl;
    eplCmd = eplCmd + "&artnr=" + escape(artNr);

    var myWin = window.open("", "beck_kanal_BestellWindow", "width=400,height=270,resizable=no,alwaysRaised");
    myWin.document.location.href = eplCmd;
    myWin.focus();
  }
}

function isInt(anzahl) {
  var index;
  var aChar;

  for (index = 0; index < anzahl.length; index++) {
    aChar = anzahl.substring (index, index + 1);

    if ((aChar < "0") || (aChar > "9")) {
      return false;
    }
  }

return true;
}

function showBigPic(userid, name) {
  window.status = '';

  var widthheight_pos = name.lastIndexOf("_");
  var picWidth  = 600;
  var picHeight = 480;

  if (widthheight_pos != -1) {
    var sizepart = name.slice(widthheight_pos + 1, name.lastIndexOf("."));
    var widthheight = sizepart.split("x");
    picWidth  = Number(widthheight[0]) + 20;
    picHeight = Number(widthheight[1]) + 30;
  }

  var namepart = "beck_kanal_BildInformation_" + name.slice(name.lastIndexOf("/") + 1, name.lastIndexOf("."));
  namepart = namepart.replace(/\W/g, "_");

  var openproperties = "resizable=yes,alwaysRaised,location=no,scrollbars=no,width=" + picWidth + ",height=" + picHeight;

  var myWin = window.open("", namepart, openproperties);
  myWin.document.location.href = "http://www.e-webshopping.de/beck-kanal.de/webshop.epl?exec=Bild&userid=" + userid + "&img=" + name;
  myWin.focus();
}

