﻿repairBtn();
if ($('#OrderStep2_TD').length != 0) {
}
function repairBtn() {
  $(".OrderStep1_Next_TD .SubmitButton_Orderstep1_Position").before('<div class="decopayProcess"></div>').css("float", "right");
  $("#OrderStep2_TD input[name='Search']").before('<div class="decopayProcess"></div>').css("float", "right");
  $(".Heading_Orderstep2").parent().css('display', 'none');
  $(".Foto1_OrderStep2").css('padding-bottom', '10px');
}

function checkImagesOrderStep2() {
  if (document.getElementById('ShippingMethodsContainer')) {
    var images = document.getElementById('ShippingMethodsContainer').getElementsByTagName('IMG');
    if (images.length == 0) {
    }
  }
}

function fixOrderStep2() {
  if (document.getElementById('ShippingMethod_48')) {
    var cells = document.getElementById('ShippingMethod_48').getElementsByTagName('TD');
    for (var i = 0; i < cells.length; i++) {
      if (i % 3 == 2) {
        cells[i].innerHTML = "<img src='/images/design/source/post_dk.gif' />" + cells[i].innerHTML;
      }
    }
  }
  if (document.getElementById('ShippingMethod_53')) {
    var cells = document.getElementById('ShippingMethod_53').getElementsByTagName('TD');
    for (var i = 0; i < cells.length; i++) {
      if (i % 3 == 2) {
        cells[i].innerHTML = "<img src='/images/design/source/gls.gif' />" + cells[i].innerHTML;
      }
    }
  }
}

function subtoMC() {
$(document).ready(function() {
  var Cookie = $.cookie('mcEmail');
  if (Cookie != null) {
    $.post('/images/design/javascript/phraser.asp')
  }
});
}
function mailSave() {
  $('.SubmitButton_Orderstep1_Position').click(function () {
    if ($('input:checkbox').attr('checked') == true) {
      email = document.getElementById('email').value
      $.cookie('mcEmail', email, { path: '/'})
    }
  })
}
if (window.location.pathname == '/shop/order1.html') {
  mailSave();
}
if (document.getElementById('OrderStep3_TD')) {
  subtoMC();
}
