/* ausgelagerte Javascript-Funktionen */


/* *** aus header.php *** */


function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
}

/* Aufruf aus checkout-Adressverifizierung */
function check_form_optional(form_name) {
  var form = form_name;

  var firstname = form.elements['firstname'].value;
  var lastname = form.elements['lastname'].value;
  var street_address = form.elements['street_address'].value;

  if (firstname == '' && lastname == '' && street_address == '') {
    return true;
  } else {
    return check_form(form_name);
  }
}


/* *** aus general.js.php *** */



/* Passendes Passepartout aussuchen auf Klick zum Rahmen */
function gotoPP() {

        w = '';
        h = '';
  hersteller = '';
        if ((document.getElementById('prod_w')) && (document.getElementById('prod_h') && document.getElementById('hersteller'))) {
			
                w = document.getElementById('prod_w').firstChild.nodeValue;
                h = document.getElementById('prod_h').firstChild.nodeValue;
    hersteller = document.getElementById('hersteller').firstChild.nodeValue;

        } else {
                if (document.forms['cart_quantity'].elements['id[-2]'])
                        w = document.forms['cart_quantity'].elements['id[-2]'].value;
                if (document.forms['cart_quantity'].elements['id[-3]'])
                        h = document.forms['cart_quantity'].elements['id[-3]'].value;
        }

        s = '';
        if (w != '') s += '{-2}' + w;
        if (h != '') s += '{-3}' + h;

//        window.location.href = 'product_info.php?info=p86{2}-2' + s + '_KeineMarken-Museumsqualit-t-Passepartout-Sonderformate.html';

   switch(hersteller) {

     case 'Roggenkamp':  // Sonderformat
       window.location.href = 'product_info.php?info=p281{2}-2' + s + '_Roggenkamp-Museumsqualit-t-Passepartout-Sonderformate.html';
       break;

     case 'Werkladen': // mehrere Sonderformate, also Auswahl
       window.location.href = '/bilderrahmen/werkladen-passepartout.html';
       break;

     case 'Nielsen': // mehrere Sonderformate, also Auswahl
       window.location.href = 'index.php?cat=c16_Nielsen.html';
       break;

     case 'Hama': // keine Sonderformate, also wohin?
       window.location.href = '/bilderrahmen/hama-passepartout.html';
       break;

     case 'DEHA': // Sonderformate
       window.location.href = 'product_info.php?info=p277{2}-2' + s + '_Deha-Museumsqualit-t-Passepartout-Sonderformate.html';
       break;

     case 'HALBE': // Sonderformate
       window.location.href = 'product_info.php?info=p280{2}-2' + s + '_Halbe-Museumsqualit-t-Passepartout.html';
        break;

     case 'Spagl': // Sonderformate
       window.location.href = 'product_info.php?info=p282{2}-2' + s + '_Spagl-Museumsqualit-t-Passepartout.html';
       break;

     case 'Bonn Bilderrahmen': // Sonderformate
       window.location.href = 'product_info.php?info=p283{2}-2' + s + '_Bonn-Bilderrahmen-Museumsqualit-t-Passepartout.html';
       break;

    case 'KeineMarken': // mehrere Sonderformate, also Auswahl
       window.location.href = '/bilderrahmen/keinemarken-passepartout.html';
       break;

     default:
        window.location.href = '/bilderrahmen/passepartout.html';
        break;

   }

}
