pastebin

Paste Search Dynamic
Recent pastes
PCDetect
  1. var PCDetect = GetCookie('PCDetect');
  2.  
  3. function setDelivery(price, delivery_id) {
  4.     document.getElementById('delivery_price').innerHTML = price;
  5.     document.getElementById('d').value = delivery_id;
  6.     if (PCDetect == 1)
  7.         modal_off('#modalDelivery');
  8. }
  9.  
  10. function setPayment(name, payment_id) {
  11.     document.getElementById('payment_name').innerHTML = name;
  12.     document.getElementById('order_metod').value = payment_id;
  13.     if (PCDetect == 1)
  14.         modal_off('#modalPayment');
  15. }
  16.  
  17. function setOption(style) {
  18.     var ga = document.createElement('link');
  19.     ga.rel = 'stylesheet';
  20.     ga.async = true;
  21.     ga.href = '/phpshop/templates/mobile/ratchet/css/' + style;
  22.     var s = document.getElementsByTagName('script')[0];
  23.     s.parentNode.insertBefore(ga, s);
  24.  
  25.     setCookie('mobile_skin', style, 10);
  26. }
  27.  
  28. function go(page) {
  29.     return window.location.replace(page);
  30. }
  31.  
  32.  
  33. function modal_on(name) {
  34.     document.getElementById(name.replace("#", "")).className = 'modal.active';
  35. }
  36.  
  37. function modal_off(name) {
  38.     document.getElementById(name.replace("#", "")).className = 'modal';
  39. }
  40.  
  41. function setCookie(name, value, days) {
  42.     var today = new Date();
  43.     expires = new Date(today.getTime() + days * 24 * 60 * 60 * 1000);
  44.     document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
  45. }
  46.  
  47. function GetCookie(cookieName) {
  48.     var cookieValue = '';
  49.     var posName = document.cookie.indexOf(escape(cookieName) + '=');
  50.     if (posName != -1) {
  51.         var posValue = posName + (escape(cookieName) + '=').length;
  52.         var endPos = document.cookie.indexOf(';', posValue);
  53.         if (endPos != -1)
  54.             cookieValue = unescape(document.cookie.substring(posValue, endPos));
  55.         else
  56.             cookieValue = unescape(document.cookie.substring(posValue));
  57.     }
  58.     return cookieValue;
  59. }
  60.  
  61.  
  62. function tab_on(obj) {
  63.  
  64.     var content  = document.querySelectorAll('#segmented-content span');
  65.     for (i = content.length; i--; ) {
  66.         content[i].className = 'control-content';
  67.     }
  68.     document.getElementById(obj.hash.replace("#", "")).className = 'control-item active';
  69.  
  70.     var control = document.querySelectorAll('#segmented-control a');
  71.     for (i = control.length; i--; ) {
  72.         control[i].style.background = "#FFFFFF";
  73.     }
  74.     obj.style.background = "#CCCCCC";
  75. }
  76.  
  77. function addCartOption(xid) {
  78.     var name = "allOptionsSet" + xid;
  79.     if (document.getElementById(name)) {
  80.         addname = document.getElementById(name).value;
  81.     } else {
  82.         addname = "";
  83.     }
  84.     window.location.replace('/order/?from=html&id='+xid+'&addname=t'+addname);
  85. }
Parsed in 0.018 seconds