/************************************ Custom Alert Demonstration version 1.0 last revision: 02.02.2005 steve@slayeroffice.com Should you improve upon this source please let me know so that I can update the version hosted at slayeroffice. Please leave this notice in tact! ************************************/ var ALERT_TITLE = "Quick Note"; var ALERT_BUTTON_TEXT = "Ok"; var CONF_BUTTON_YES = "Continue to Cart"; var CONF_BUTTON_NO = "Do not add item to Cart"; if(document.getElementById) {      window.alert = function(txt)      {           createCustomAlert(txt);      }      window.confirm = function(txt,url)      {           return createCustomConfirm(txt,url);      } } function createCustomAlert(txt) {      var d = document;      if(d.getElementById("modalContainer")) return;      var mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));      mObj.id = "modalContainer";      mObj.style.height = d.documentElement.scrollHeight + "px";      var alertObj = mObj.appendChild(d.createElement("div"));      alertObj.id = "alertBox";      if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";      alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";      alertObj.style.visiblity="visible";      var h1 = alertObj.appendChild(d.createElement("h1"));      h1.appendChild(d.createTextNode(ALERT_TITLE));      var msg = alertObj.appendChild(d.createElement("p"));      msg.innerHTML=txt;      var btn = alertObj.appendChild(d.createElement("a"));      btn.id = "closeBtn";      btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));      btn.href = "#";      btn.onclick = function() { removeCustomAlert("modalContainer");return false; } } function createCustomConfirm(txt,url) {      var d = document;      if(d.getElementById("modalContainer")) return;      var mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));      mObj.id = "modalContainer";      mObj.style.height = d.documentElement.scrollHeight + "px";      var alertObj = mObj.appendChild(d.createElement("div"));      alertObj.id = "alertBox";      if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";      alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";      alertObj.style.visiblity="visible";      var h1 = alertObj.appendChild(d.createElement("h1"));      h1.appendChild(d.createTextNode(ALERT_TITLE));      var msg = alertObj.appendChild(d.createElement("p"));      msg.innerHTML=txt;      var btn = alertObj.appendChild(d.createElement("a"));      btn.id = "closeBtn";      btn.appendChild(d.createTextNode(CONF_BUTTON_YES));      btn.href = url;      btn.onclick = function()      {           //doSomething()           location=url;           removeCustomAlert("modalContainer");           return true;      }     // var btn2 = alertObj.appendChild(d.createElement("a"));      //btn2.id = "closeBtn";      //btn2.appendChild(d.createTextNode(CONF_BUTTON_NO));      //btn2.href = "#";     // btn2.onclick = function()      //{                   //   removeCustomAlert("modalContainer2");          // return false;     // }       } function removeCustomAlert(mId) { document.getElementsByTagName("body")[0].removeChild(document.getElementById(mId)); } function swar(url) { var agree=confirm("Add a design from our Charm Collection and we'll attach if for you.",url); } function joy(url) { var agree=confirm("Best with sterling or rhodium chain, or omega choker. Does not work with the rubber necklace.",url); }