var tmr; var t; var obj; function sFa() { obj = gObj(); sLft(); shw(true); t = 0; sTmr(); overlay.init(); overlay.show(); } function hFa() { t = -100; sTmr(); return false; } function sTmr() { tmr = setInterval("fd()",20); } function fd() { var amt = Math.abs(t+=10); if(amt == 0 || amt == 100) clearInterval(tmr); amt = (amt == 100)?99.999:amt; obj.style.filter = "alpha(opacity:"+amt+")"; obj.style.KHTMLOpacity = amt/100; obj.style.MozOpacity = amt/100; obj.style.opacity = amt/100; //if(amt == 0) shw(false); } function sLft() { var w = 250; // set this to 1/2 the width of the fa div defined in the style sheet // there's not a reliable way to retrieve an element's width via javascript!! var l = (document.body.innerWidth)? document.body.innerWidth / 2:document.body.offsetWidth / 2; obj.style.left = (l - w)+"px"; } function gObj() { return document.getElementById("fa"); } function shw(b) { (b)? obj.className = 'show':obj.className = ''; } //==============================valid form============================= function isblank(fe){ // check that the value is not empty if (fe.value == "") { // its blank return true; } else { // it has data return false; } } function ischecked(fe){ // check that the value is not empty if (fe.checked) { // its blank return false; } else { // it has data return true; } } function checkvalue(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14) { // call the isblank() function with this form element //==================field 1 ========================== if (isblank(f1)){ f1.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f1.focus(); return; } else { f1.setAttribute("class", "field"); var blank=false; } //==================field 2 ========================== if (isblank(f2)) { f2.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f2.focus(); return; } else { f2.setAttribute("class", "field"); var blank=false; } //==================field 3 ========================== if (isblank(f3)) { f3.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f3.focus(); return; } else { f3.setAttribute("class", "field"); var blank=false; } //==================field 4 ========================== if (isblank(f4)) { f4.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f4.focus(); return; } else { f4.setAttribute("class", "field"); var blank=false; } //==================field 5 ========================== if (isblank(f5)) { f5.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f5.focus(); return; } else { f5.setAttribute("class", "field"); var blank=false; } //==================field 6 ========================== if (isblank(f6)) { f6.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f6.focus(); return; } else { f6.setAttribute("class", "field"); var blank=false; } //==================field 7 ========================== if (isblank(f7)) { f7.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f7.focus(); return; } else { f7.setAttribute("class", "field"); var blank=false; } //==================field 8 ========================== if (isblank(f8)) { f8.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f8.focus(); return; } else { f8.setAttribute("class", "field"); var blank=false; } //==================field 9 ========================== if (isblank(f9)) { f9.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f9.focus(); return; } else { f9.setAttribute("class", "field"); var blank=false; } //==================field 10 ========================== if (ischecked(f10)) { f10.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f10.focus(); return; } else { f10.setAttribute("class", "field"); var blank=false; } //==================field 11 ========================== if (ischecked(f11)) { f11.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f11.focus(); return; } else { f11.setAttribute("class", "field"); var blank=false; } //==================field 12 ========================== if (ischecked(f12)) { f12.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f12.focus(); return; } else { f12.setAttribute("class", "field"); var blank=false; } //==================field 13 ========================== if (isblank(f13)) { f13.setAttribute("class", ".field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f13.focus(); return; } else { f13.setAttribute("class", "field"); var blank=false; } //==================field 14 ========================== if (ischecked(f14)) { f14.setAttribute("class", "field_blank"); var blank=true; var hide='no'; displayerror(hide); location.href = "#error"; f14.focus(); return; } else { f14.setAttribute("class", "field"); var blank=false; } //==================field 14 ========================== if (blank==false) { sFa(); var hide='yes'; displayerror(hide); location.href = "#ship"; } return; } function displayerror(hide){ var row = document.getElementById("showerror"); if (hide=='no') { row.style.display = ''; } else { row.style.display = 'none'; } } //##############################overlay################################ var overlay = { click_on_overlay_hide: false, show_loading_image: false, loading_image: "https://www.parts-people.com/images/wait.gif", $: function(id){ return document.getElementById(id); }, init: function(){ var ol_div = document.createElement("div"); ol_div.id = "overlay"; ol_div.style.display = "none"; ol_div.onclick = (this.click_on_overlay_hide)? overlay.hide : null; if(this.show_loading_image){ var l_img = document.createElement("img"); l_img.src = this.loading_image; l_img.style.position = "absolute"; l_img.style.top = (((window.innerHeight)? window.innerHeight : document.body.clientHeight) / 2) + "px"; l_img.style.left = (((window.innerWidth)? window.innerWidth : document.body.clientWidth) / 2.5) + "px"; ol_div.appendChild(l_img); } document.body.appendChild(ol_div); }, show: function(){ if(this.$("overlay")){ this.$("overlay").style.display = ""; } }, hide: function(){ if(overlay.$("overlay")){ overlay.$("overlay").style.display = "none"; } } }