/*********************************** * * Registerform_validation.js * **********************************/ function Form1_Validator2(Form1) { var submitcount=0; var alertsay = ""; var re10digit="0123456789"; //regular expression defining a 10 digit number if(Form1.userName) { if (Form1.userName.value == ""||Form1.userName.value.length <= 0) { alert("You must enter a \"User Name\"."); Form1.userName.focus(); return (false); } } if(Form1.password) { re = /^\w+$/; if ((Form1.password.value.length <=6)||(Form1.password.value=="")||(!re.test(Form1.password.value))) { alert("You must enter a \"Password\" 7 to 12 characters; letters and numbers only."); Form1.password.focus(); return (false); } } if(Form1.confirmpassword) { if (!((Form1.password.value)==(Form1.confirmpassword.value))) { alert("You must enter Password and Confirm Password be same."); Form1.confirmpassword.focus(); return (false); } } //check if email available, if so valid if(Form1.email1) { var at="@" var dot="." var lat=Form1.email1.value.indexOf(at) var lstr=Form1.email1.value.length var ldot=Form1.email1.value.indexOf(dot) if (Form1.email1.value.indexOf(at)==-1 || Form1.email1.value.indexOf(at)==0 || Form1.email1.value.indexOf(at)==lstr) { alert("Please enter a valid E-mail ID") Form1.email1.focus() return } if (Form1.email1.value.indexOf(dot)==-1 || Form1.email1.value.indexOf(dot)==0 || Form1.email1.value.indexOf(dot)==lstr){ alert("Please enter a valid E-mail ID") Form1.email1.focus() return (false); } if (Form1.email1.value.indexOf(at,(lat+1))!=-1){ alert("Please enter a valid E-mail ID") Form1.email1.focus() return (false); } if (Form1.email1.value.substring(lat+1,lat+2)==dot){ alert("Please enter a valid E-mail ID") Form1.email1.focus() return (false); } if (Form1.email1.value.indexOf(dot,(lat+2))==-1){ alert("Please enter a valid E-mail ID") Form1.email1.focus() return (false); } if (Form1.email1.value.indexOf(" ")!=-1){ alert("Please enter a valid E-mail ID") Form1.email1.focus() return (false); } } var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if(Form1.email2) { if (!((Form1.email1.value)==(Form1.email2.value))) { alert("You must enter Email and Re-Type Email be same."); Form1.email2.focus(); return (false); } } if(Form1.firstName) { if (Form1.firstName.value == "") { alert("You must enter a \"First Name\"."); Form1.firstName.focus(); return (false); } if (Form1.firstName.value.length > 16) { alert("\"First Name\" must not exceed 16 characters."); Form1.firstName.focus(); return (false); } } if(Form1.lastName) { if (Form1.lastName.value == "") { alert("You must enter a \"Last Name\"."); Form1.lastName.focus(); return (false); } if (Form1.lastName.value.length > 16) { alert("\"Last Name\" must not exceed 16 characters."); Form1.lastName.focus(); return (false); } } if (Form1.address1.value == "") { alert("You must enter an \"Address\"."); Form1.address1.focus(); return (false); } if (Form1.address1.value.length > 35) { alert("\"Address 1\" must not exceed 35 characters."); Form1.address1.focus(); return (false); } if (Form1.city.value == "") { alert("You must enter a \"City\"."); Form1.city.focus(); return (false); } if (Form1.city.value.length > 25) { alert("\"City \" must not exceed 25 characters."); Form1.city.focus(); return (false); } // check if no drop down or first drop down is selected, if so, invalid selection if (Form1.state.selectedIndex <= 0) { alert("You must select a \"State\"."); Form1.state.focus(); return (false); } if (Form1.zipcode.value == "") { alert("You must enter a \"Zip\"."); Form1.zipcode.focus(); return (false); } for(var i=0;i 0 || form1.workextension.value != '' ) { if(!extensionvalidation(form1.workextension.value)) { alert("\"Extention\" must be digits."); form1.workextension.focus(); } } } if (form1.email) { if(!emailvalidation(form1.email.value)) { msg+="Please enter Valid Email Address"; alert(msg); form1.email.focus(); return false; } } if (form1.shipto_firstname) {if (form1.shipto_firstname.value == '') { msg+="Ship-To First Name"; alert(msg); form1.shipto_firstname.focus(); return false; }} if (form1.shipto_lastname) {if (form1.shipto_lastname.value == '') { msg+="Ship-To Last Name"; alert(msg); form1.shipto_lastname.focus(); return false; }} if (form1.shipaddress1) {if (form1.shipaddress1.value == '') { msg+="Ship-To Street"; alert(msg); form1.shipaddress1.focus(); return false; }} if (form1.shipto_city) {if (form1.shipto_city.value == '') { msg+="Ship-To City"; alert(msg); form1.shipto_city.focus(); return false; }} if (form1.shipto_state) { if (form1.shipto_state.value == 'XX') { msg+="Ship-To State"; alert(msg); form1.shipto_state.focus(); return false; } else if (form1.shipto_state.value == '') { msg+="Ship-To State"; alert(msg); form1.shipto_state.focus(); return false; } } if (form1.shipto_postalcode) {if (form1.shipto_postalcode.value == '') { msg+="Ship-To Zip Code"; alert(msg); form1.shipto_postalcode.focus(); return false; }} return true; } function emailvalidation(email) { var validemail = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+[\.]{1}[a-zA-Z]{2,4}$/; if(email.search(validemail)==-1) { return false; } return true; } function areacodevalidation(areacode) { var re3digit=/^\d{3}$/; if(areacode.search(re3digit)==-1) { return false; } return true; } function phonenumbervalidation(phonenumber) { var re7digit=/^\d{7}$/; if(phonenumber.search(re7digit)==-1) { return false; } return true; } function extensionvalidation(extension) { var re10digit="0123456789"; for(var i=0;i'; $('.toggle_select_' + obj).html(newElement).show(); }else{ $('.toggle_select_' + obj).fadeOut(300, function(){ $('.toggle_select_' + obj).html(''); newElement = ''; $('.toggle_select_' + obj).html(newElement); $( "#" + bill_ship + "To_zipCodeButton" ).click(); }); $('.toggle_select_' + obj).delay(400).fadeIn(300); } }else{ $('#city_not_listed_' + obj).attr('checked', false); alert('Please enter a valid Zip Code'); }; } function citynotlisted2(obj){ if( $('#zip').val() != '' ){ var e = $('#city_not_listed_' + obj).attr('checked'); if( e == 'checked' ){ $('.toggle_select_' + obj).hide().html(''); newElement = ''; $('.toggle_select_' + obj).html(newElement).show(); }else{ $('.toggle_select_' + obj).fadeOut(300, function(){ $('.toggle_select_' + obj).html(''); newElement = ''; $('.toggle_select_' + obj).html(newElement); if( obj == 'register' ){ $("#zip").blur(); }else{ $( "#zip" ).change(); } }); $('.toggle_select_' + obj).delay(400).fadeIn(300); } }else{ $('#city_not_listed_' + obj).attr('checked', false); alert('Please enter a valid Zip Code'); }; } /*********************************** * * Style.js * **********************************/ // JavaScript Document // supporting code for style sheet var selectList=new Array(); function getSelectOptions() { var styleNo=document.getElementById('styleID').value; var optionData='?method=GetStyleSelectList&style='+styleNo; var Response = httpRequestGet("gaWeb.dll/Ajax"+optionData); if (Response=='') return false; if (Response.substring(0,5) == 'Error') { window.alert(Response); return; } else { selectList=Response.split(','); for (i=0;i 0) selectOpt.disabled="disabled"; selectOpt.options.add(optionNew); } getOptions('0'); } var isVisible=$("#optID_0:visible"); if (document.getElementById('optID_0').style.visibility=="visible") { getOptions(0); } document.getElementById('optCount').value=selectList.length.toString(); } function getOptions(obj) { if (obj=='0') optID=0 else { var parentSelect=obj; var optID=parseInt(parentSelect.id.split('_')[1])+1; } if (!document.getElementById('optID_'+optID) || document.getElementById('optID_'+optID).style.display=="none") return false; var styleNo=document.getElementById('styleID').value; var assortName=document.getElementById('assort').value; var bVal1=''; var bVal2=''; if (optID==1) { var bVal1=document.getElementById('optSelect_0').options[document.getElementById('optSelect_0').selectedIndex].value if (bVal1=="") return false; } else if (optID==2) { var bVal1=document.getElementById('optSelect_0').options[document.getElementById('optSelect_0').selectedIndex].value; var bVal2=document.getElementById('optSelect_1').options[document.getElementById('optSelect_1').selectedIndex].value; if (bVal2=="") return false; } var optionData='?method=GetStyleOptionsList&style='+styleNo+'&optID='+optID+'&bVal1='+bVal1+'&bVal2='+bVal2+'&assort='+assortName; var Response = httpRequestGet("gaWeb.dll/Ajax"+optionData); if (Response.substring(0,5) == 'ERROR') { window.alert(Response); return false; } else writeOptionData(optID,Response); /* if (document.getElementById('optSelect_'+optID).options.length==1) document.getElementById('optSelect_'+optID).onchange(document.getElementById('optSelect_'+optID)); */ } function writeOptionData(optID,Response) { var selectOpt = document.getElementById('optSelect_'+optID); selectOpt.options.length=0; var optValues=Response.split(',') //if (optValues.length>1) { var optionNew = document.createElement('option'); optionNew.text = 'Select '+getProperCase(selectList[optID]); optionNew.value = ''; //selectOpt.appendChild(optionNew); selectOpt.options.add(optionNew); //} for (i=0;i 0) selectOpt.disabled=""; } function getProperCase(inText) { var tempStr=inText.toLowerCase(); var tempChar=''; var outStr=''; var wordArray=tempStr.split(' '); for (x=0;x'); } else { $(this).next(".styledetail").slideUp('fast'); /*uncomment this line to have plain text plus sign instead of up arrow then comment out line below it*/ /*$(this).children('span').text('+');*/ $(this).children('span').html(''); } }); }); /*********************************** * * Main.js * **********************************/ $(document).ready(function() { function megaHoverOver() { $(this).find(".sub").stop().fadeTo('fast', 1).show(); $(this).find(".subright").stop().fadeTo('fast', 1).show(); //Calculate width of all ul's (function($) { jQuery.fn.calcSubWidth = function() { rowWidth = 0; //Calculate row $(this).find("ul").each(function() { rowWidth += $(this).width(); }); }; })(jQuery); //Calculate width of all ul's (function($) { jQuery.fn.calcSubWidth = function() { rowWidth = 0; //Calculate row $(this).find("ul").each(function() { rowWidth += $(this).width(); }); }; })(jQuery); if ($(this).find(".row").length > 0) { //If row exists... var biggestRow = 0; //Calculate each row $(this).find(".row").each(function() { $(this).calcSubWidth(); //Find biggest row if (rowWidth > biggestRow) { biggestRow = rowWidth; } }); //Set width $(this).find(".sub").css({ 'width' : biggestRow }); $(this).find(".subright").css({ 'width' : biggestRow }); $(this).find(".row:last").css({ 'margin' : '0' }); } else { //If row does not exist... $(this).calcSubWidth(); //Set Width $(this).find(".sub").css({ 'width' : rowWidth }); $(this).find(".subright").css({ 'width' : rowWidth }); } } function megaHoverOut() { $(this).find(".sub").stop().fadeTo('fast', 0, function() { $(this).hide(); }); $(this).find(".subright").stop().fadeTo('fast', 0, function() { $(this).hide(); }); } var config = { sensitivity : 1, // number = sensitivity threshold (must be 1 or higher) interval : 40, // number = milliseconds for onMouseOver polling interval over : megaHoverOver, // function = onMouseOver callback (REQUIRED) timeout : 1, // number = milliseconds delay before onMouseOut out : megaHoverOut // function = onMouseOut callback (REQUIRED) }; $("ul#navMenu li .sub").css({ 'opacity' : '0' }); $("ul#navMenu li .subright").css({ 'opacity' : '0' }); $("ul#navMenu li").hoverIntent(config); }); function passwordStrength(password) { var desc = new Array(); desc[0] = "Very Weak"; desc[1] = "Weak"; desc[2] = "Better"; desc[3] = "Medium"; desc[4] = "Strong"; desc[5] = "Strongest"; var score = 0; //if password bigger than 6 give 1 point if (password.length > 6) score++; //if password has both lower and uppercase characters give 1 point if ((password.match(/[a-z]/)) && (password.match(/[A-Z]/))) score++; //if password has at least one number give 1 point if (password.match(/\d+/)) score++; //if password has at least one special character give 1 point if (password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) score++; //if password bigger than 12 give another 1 point if (password.length > 12) score++; document.getElementById("passwordDescription").innerHTML = desc[score]; document.getElementById("passwordStrength").className = "strength" + score; } /*********************************** * * colorboxCall.js * **********************************/ $(document).ready(function(){ var sourceHeight = $("#source").height(); var signupHeight = $("#signup").height(); var departmentHeight = $("#department").height(); var unsubHeight = $("#signup-unsub").height(); $(".signup").colorbox({innerWidth:"370px", innerHeight: signupHeight + "px", inline:true, href:"#signup"}); $(".department").colorbox({innerWidth:"375px", innerheight: departmentHeight + "px", inline:true, href:"#department"}); $(".signup-unsub").colorbox({innerWidth:"420px", innerHeight: unsubHeight + "px", inline:true, href:"#signup-unsub"}); $(".signup-ack").colorbox({innerWidth:"360px", innerHeight:"370px", inline:true, href:"#signup-ack", open:true}); $(".signup-optout").colorbox({innerWidth:"400px", innerHeight:"420px", inline:true, href:"#signup-optout", open:true}); $(".need-help").colorbox({innerWidth:"400px", innerHeight:"420px", inline:true, href:"#need-help"}); $(".department-ack").colorbox({innerWidth:"400px", height:"300px", inline:true, href:"#department-ack", open:true}); $(".department-nak").colorbox({innerWidth:"400px", height:"400px", inline:true, href:"#department-nak", open:true}); $(".thanksdept-ack").colorbox({innerWidth:"400px", innerHeight:"400px", inline:true, href:"#thanksdept-ack", open:true}); $(".pop").colorbox({innerwidth:"407px", innerHeight:"241px", inline:true, href:"#inline_cart", open:true}); $(".stock").colorbox({width:"100%", height:"100%", rectangle:true}); $(".logopop").colorbox({width:"950px", height:"480px", rectangle:true}); $(".source").colorbox({innerWidth:"380px", innerHeight: sourceHeight + "px", inline:true, href:"#source"}); $(".silverpop-signup").colorbox({innerWidth:"740px", innerHeight: signupHeight + "px", inline:true, href:"#silverpop_signup", open:true}); }); /*********************************** * * StayOnPage.js * **********************************/ function stayOnPage(){ var txt = 'You are navigating
away from
shoparamark.com!


Be sure to finish making your purchase as items in your cart will not be saved.'; $.prompt(txt,{ buttons:[{title: 'FINISH SHOPPING AT SHOPARAMARK.COM', value:false}, {title: 'GO TO ARAMARK RENTAL', value:true}], prefix:'cleanred', callback: function(v,m,f){ if(v){ window.location = "/aurental/";} } }); } //for special offers homepage //for redirect warning function flatrate(){ var txt = 'Thank You!
You have selected flat rate shipping.
Start shopping now.

'; $.prompt(txt,{ buttons:[{title: 'CLICK HERE TO APPLY YOUR PROMOTION', value:true}], prefix:'cleanred', callback: function(v,m,f){ if(v==true){ window.location = "home?sourcecode=106520&promo=YES"; } } }); } function freejacket(){ var txt = 'Thank You!
You have selected the free jacket with orders over $200.
Start shopping now.

'; $.prompt(txt,{ buttons:[{title: 'CLICK HERE TO APPLY YOUR PROMOTION', value:true}], prefix:'cleanred', callback: function(v,m,f){ if(v==true){ window.location = "home?sourcecode=106521&promo=YES"; } } }); } function entireorder(){ var txt = 'Thank You!
You have selected 15% off your entire order.
Start shopping now.

'; $.prompt(txt,{ buttons:[{title: 'CLICK HERE TO APPLY YOUR PROMOTION', value:true}], prefix:'cleanred', callback: function(v,m,f){ if(v==true){ window.location = "home?sourcecode=106522&promo=YES"; } } }); } /*********************************** * * feedbackFormNov07.js * **********************************/ function feedbackForm() { var theURL = document.URL; var wgwebCancel = ""; var wgwebIndex = document.URL.indexOf('wgweb.dll'); try{ if (wgwebIndex != -1){ theURL = theURL.substring(0,wgwebIndex); wgwebCancel += document.stylesearch.html.value; if (document.stylesearch.html.value == "style.html"){ wgwebCancel += "?style=" + document.forms[1].styleid.value + "&assort=" + document.forms[1].assort.value; } } } catch(e){} var newWindow = window.open("feedback-form-07nov.html?" + document.URL + wgwebCancel, "FeedbackForm", "width=605,height=505"); newWindow.focus(); } /*********************************** * * expandableDivs.js * **********************************/ $(document).ready(function() { $(".openNav").click(function () { if ($(this).next(".expandedNav").is(":hidden")) { $(this).next(".expandedNav").slideDown('fast'); /* uncomment this line to have plain text minus sign instead of down arrow then comment out line below it*/ $(this).children('span').text('+'); } else { $(this).next(".expandedNav").slideUp('fast'); /*uncomment this line to have plain text plus sign instead of up arrow then comment out line below it*/ $(this).children('span').text('-'); } }); }); $(document).ready(function() { $(".vasholder1").hide(); $(".openvas").click(function () { if ($(this).next(".vasholder1").is(":hidden")) { $(this).next(".vasholder1").slideDown('fast'); } else { $(this).next(".vasholder1").slideUp('fast'); } }); }); /*********************************** * * Search.js * **********************************/ function cleartext() { document.stylesearch.question.value = ""; } function toggleLists(initialListID, fullListID) { try { var initialList = document.getElementById(initialListID); var fullList = document.getElementById(fullListID); if (initialList) { if (initialList.style.display == "none") { initialList.style.display = ""; fullList.style.display = "none"; } else { initialList.style.display = "none"; fullList.style.display = ""; } } } catch (e) { } } function verify_search() { if (document.stylesearch.question.value == "") { alert("Please enter a keyword or a style number to search."); document.stylesearch.question.focus(); return false; } } function gotoSelectedURL(selector) { url = selector.options[selector.selectedIndex].value; if (url != "") { document.location.href = url; } } /*********************************** * * StaticPage.js * **********************************/ //contact, returns and shipping, size charts, faq, privacy // javascript to expand and collapse panels $(document).ready(function() { $(".question").click(function () { if ($(this).next(".answer").is(":hidden")) { $(this).next(".answer").slideDown('fast'); /* uncomment this line to have plain text minus sign instead of down arrow then comment out line below it*/ /*$(this).children('span').text('-');*/ $(this).children('span').html(''); } else { $(this).next(".answer").slideUp('fast'); /*uncomment this line to have plain text plus sign instead of up arrow then comment out line below it*/ /*$(this).children('span').text('+');*/ $(this).children('span').html(''); } }); }); /*********************************** * * subcategory search pagejs * **********************************/ //contact, returns and shipping, size charts, faq, privacy // javascript to expand and collapse panels $(document).ready(function() { $(".searchproperty").click(function () { if ($(this).next(".searchdetail").is(":hidden")) { $(this).next(".searchdetail").slideDown('fast'); /* uncomment this line to have plain text minus sign instead of down arrow then comment out line below it*/ /*$(this).children('span').text('-');*/ $(this).children('span').html(''); } else { $(this).next(".searchdetail").slideUp('fast'); /*uncomment this line to have plain text plus sign instead of up arrow then comment out line below it*/ /*$(this).children('span').text('+');*/ $(this).children('span').html(''); } }); }); //feedback form function validateForm() { swapFormName(); return checkContact(); } function checkContact() { if (document.feedback07nov.checkbox.checked == true && document.feedback07nov.email.value == "" && document.feedback07nov.phone.value == ""){ alert("Please enter your Email or Phone."); document.feedback07nov.checkbox.focus(); return false; } else {return true;} } function swapFormName() { if (document.feedback07nov.checkbox.checked == true){ document.feedback07nov.formid.value = "feedback07novContact"; } } $(document).ready(function(){ var currentPosition = 0; var slideWidth = 758; var slides = $('.slide'); var numberOfSlides = slides.length; // Remove scrollbar in JS $('#slidesContainer').css('overflow', 'hidden'); // Wrap all .slides with #slideInner div slides .wrapAll('
') // Float left to display horizontally, readjust .slides width .css({ 'float' : 'left', 'width' : slideWidth }); // Set #slideInner width equal to total width of all slides $('#slideInner').css('width', slideWidth * numberOfSlides); // Insert controls in the DOM $('#slideshow') .prepend('Clicking moves left') .append('Clicking moves right'); // Hide left arrow control on first load manageControls(currentPosition); // Create event listeners for .controls clicks $('.control') .bind('click', function(){ // Determine new position currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1; // Hide / show controls manageControls(currentPosition); // Move slideInner using margin-left $('#slideInner').animate({ 'marginLeft' : slideWidth*(-currentPosition) }); }); $('.control2') .bind('click', function(){ // Determine new position currentPosition = ($(this).attr('id')=='forward_box') ? currentPosition+1 : currentPosition-1; // Hide / show controls manageControls(currentPosition); // Move slideInner using margin-left $('#slideInner').animate({ 'marginLeft' : slideWidth*(-currentPosition) }); }); // manageControls: Hides and Shows controls depending on currentPosition function manageControls(position){ // Hide left arrow if position is first slide if(position==0){ $('#leftControl').hide();$('#back_box').hide() } else{ $('#leftControl').show(); $('#back_box').show() } // Hide right arrow if position is last slide if(position==numberOfSlides-1){ $('#rightControl').hide(); $('#forward_box').hide() } else{ $('#rightControl').show(); $('#forward_box').show() } } }); /*********************************** * * Checkout_address.jsp * - checkout_address.js * **********************************/ $(document).ready(function(){ //Zip-verification :: BEGIN //BillTo-Zipcode::: $("#zipcodeBillTo").blur(function(){ $("#billTo_zipCodeButton").click(); }); $("#billTo_zipCodeButton").click(function(){ if($("#zipcodeBillTo").val().length >= 5) { $.ajax({ url: "addresscorrection", type: "POST", datatype: "json", async: false, data: { zipcode: $("#zipcodeBillTo").val(), formname: "zipcode", type: "BILL-TO" }, success:function zipcodeData(data, status){ var jsonobject = data; var state=jsonobject.States; var city=jsonobject.Cities; var error=jsonobject.Error; if(document.getElementById("billto_city")!=null){ var current_city=document.getElementById("billto_city").value; document.getElementById("billto_state").value="XX"; var x=document.getElementById("billto_city"); }else{ var current_city=document.getElementById("city").value; document.getElementById("billto_state").value="XX"; var x=document.getElementById("city"); } var i; for(i = x.length-1;i>=0;i--) { x.remove(i); } if(error=="false") { for (var i = 0;i <= city.length - 1; i++) { if(document.getElementById("billto_city")!=null){ var x=document.getElementById("billto_city"); }else{ var x=document.getElementById("city"); } var option=document.createElement("option"); if(i==0) { AddSelectOption(x, city[i], city[i], true); }else if(current_city==city[i]) { AddSelectOption(x, city[i], city[i], true); }else{ AddSelectOption(x, city[i], city[i], false); } } document.getElementById("billto_state").value=state; } else { alert("Error -No data found for ZipCode "+error); //errorDisplay(); } }, error:function err() {alert("Error -No data found for ZipCode");} }); } else { alert("Error -No data found for ZipCode "+$("#zipcodeBillTo").val()); //errorDisplay(); } }); //ShipTo-Zipcode::: $("#shipto_postalcode").blur(function(){ $("#shipTo_zipCodeButton").click(); }); $("#shipTo_zipCodeButton").click(function(){ if($("#shipto_postalcode").val().length >= 5) { $.ajax({ url: "addresscorrection", type: "POST", datatype: "json", data: { zipcode: $("#shipto_postalcode").val(), formname: "zipcode", type: "SHIP-TO" }, success:function zipcodeData(data, status){ var jsonobject = data; var state=jsonobject.States; var city=jsonobject.Cities; var error=jsonobject.Error; var current_city=document.getElementById("shipto_city").value; var zipCode=jsonobject.zipCode; document.getElementById("shipto_state").value="XX"; var x=document.getElementById("shipto_city"); var i; for(i = x.length-1;i>=0;i--) { x.remove(i); } if(error=="false") { for (var i = 0;i <= city.length - 1; i++) { var x=document.getElementById("shipto_city"); var option=document.createElement("option"); if(i==0) { AddSelectOption(x, city[i], city[i], true); }else if(current_city==city[i]) { AddSelectOption(x, city[i], city[i], true); }else{ AddSelectOption(x, city[i], city[i], false); } } document.getElementById("shipto_state").value=state; } else { alert("Error -No data found for ZipCode "+error); } }, error:function err() { alert("Error -No data found for ZipCode"); } }); } else { alert("Error -No data found for ZipCode "+$("#shipto_postalcode").val()); } }); //Zip-verification :: END //Submit Address with out Address correction ::BEGIN $("#bill_shop_Info").click(function(){ if(CheckAddressInfo(document.redeemcoupon)){ $("#bill_shop_Info").val("PROCESSING...").attr("disabled", "disabled"); $('#processImg').html(''); submitCount_calcu++; if(submitCount_calcu==1){ document.getElementById("redeemcoupon").submit(); }else if(submitCount_calcu==2){ document.getElementById("redeemcoupon").submit(); } } }); //Submit Address with out Address correction :: END //ADDRESS CORRECTION :: BEGIN $("#bill_shop_Info_addrck").click(function(){ if(CheckAddressInfo(document.redeemcoupon)){ $("#bill_shop_Info_addrck").val("PROCESSING...").attr("disabled", "disabled"); $('#processImg').html(''); if(submitFlag_AddrCorrection){ submitFlag_AddrCorrection = false; submitCount_calcu++; $.ajax({//send Bill-To address for verification url: 'addresscorrection?formname=addrsCorrectionInfo', type: "POST", datatype: "json", data: { address1: $("#address1").val(), address2: $("#address2").val(), type: $("#billToAddrType").val(), city: $("#city").val(), state: $("#billto_state").val(), "zipcode": $("#zipcodeBillTo").val() }, success: correctedAddress2, error: err }); $.ajax({//send Ship-To address for verification url: 'addresscorrection?formname=addrsCorrectionInfo', type: "POST", datatype: "json", data: { address1: $("#shipaddress1").val(), address2: $("#shipaddress2").val(), type: $("#shipToAddrType").val(), city: $("#shipto_city").val(), state: $("#shipto_state").val(), "zipcode": $("#shipto_postalcode").val() }, success: correctedAddress2, error: err }); }else if(submitCount_calcu==1){ submitCount_calcu++; if(submitFlag_BillToErrorPOPUP){ submitFlag_BillToErrorPOPUP = false; submitFlag_BillTo=true; document.getElementById( "invalidStreet_dev" ).style.display = "block"; document.getElementById("addressMgs").innerHTML = 'We are unable to verify this BILL-TO address.'; }else if(submitFlag_ShipToErrorPOPUP){ submitFlag_ShipToErrorPOPUP = false submitFlag_ShipTo=true; document.getElementById( "invalidStreet_dev" ).style.display = "block"; document.getElementById("addressMgs").innerHTML = 'We are unable to verify this SHIP-TO address.'; }else{ $("#bill_shop_Info_addrck").val("PROCESSING...").attr("disabled", "disabled"); $('#processImg').html(''); document.getElementById("redeemcoupon").submit(); } }else if(submitCount_calcu==2){ $("#bill_shop_Info_addrck").val("PROCESSING...").attr("disabled", "disabled"); $('#processImg').html(''); document.getElementById("redeemcoupon").submit(); } } //end of the validation condition }); //ADDRESS CORRECTION :: END }); function errorDisplay() { ////document.getElementById( "invalidZipCode_dev" ).style.display = "block"; ////document.getElementById("State1").innerHTML = state; ////document.getElementById("Zipcode1").innerHTML = zipCode; } function AddSelectOption(selectObj, text, value, isSelected) { if (selectObj != null && selectObj.options != null) { selectObj.options[selectObj.options.length] = new Option(text, value, false, isSelected); } } function err(xhr, reason, ex){ $("#output").text(reason); } function resetSubmitCount() { submitcount = 0; } var submitcount = 0; var clickCount = 0; var statusRegAddr=0; var statusShipAddr=0; var tempsubmitcount = 0;//Temp //For new logic var submitCount_calcu = 0; var submitFlag_BillTo = false; var submitFlag_ShipTo = false; var submitFlag_AddrCorrection = true; var submitFlag_BillToErrorPOPUP = false; var submitFlag_ShipToErrorPOPUP = false; var popupStatus = 0; var url = window.location; function correctedAddress2(data) { var jo = data;//Create a JSON object // var jo = data; var address1 = jo.address1; var address2 = jo.address2; var type1 = jo.type; var city = jo.city; var state = jo.state; if (jo.zip4 == null ) { var zipcode = jo.zipcode; } else { var zipcode = jo.zipcode +"-"+jo.zip4; } var residental = jo.residential var status = jo.status; var errmsg = jo.errmsg; if (type1.match("shipToAddrType")) { if (status == true) { $("#shipaddress1").val(address1); $("#shipaddress2").val(address2); $("#shipto_city").val(city); $("#shipto_state").val(state); $("#shipto_postalcode").val(zipcode); $("#shipto_residential").val(residental); submitFlag_ShipToErrorPOPUP = false; submitFlag_ShipTo = true; } else { submitFlag_ShipToErrorPOPUP = true; } }//end of the 1st else if loop if (type1.match("billToAddrType")) { if (status == true) { $("#address1").val(address1); $("#address2").val(address2); $("#city").val(city); $("#billto_state").val(state); $("#zipcodeBillTo").val(zipcode); submitFlag_BillToErrorPOPUP = false; submitFlag_BillTo = true } else { submitFlag_BillToErrorPOPUP = true; } } if (popupStatus == 0) { popupStatus++; if (submitFlag_BillToErrorPOPUP) { submitFlag_BillToErrorPOPUP = false; submitFlag_BillTo = true; document.getElementById("invalidStreet_dev").style.display = "block"; document.getElementById("addressMgs").innerHTML = 'We are unable to verify this BILL-TO address.'; } else if (submitFlag_ShipToErrorPOPUP) { submitFlag_ShipToErrorPOPUP = false; submitFlag_ShipTo = true; document.getElementById("invalidStreet_dev").style.display = "block"; document.getElementById("addressMgs").innerHTML = 'We are unable to verify this SHIP-TO address.'; } else { setTimeout("submitForm2()", 7000); } } } function submitForm2() { document.getElementById("invalidStreet_dev").style.display = "none"; /*if (submitFlag_ShipToErrorPOPUP == true && submitFlag_BillToErrorPOPUP == false) { closeWindowStreet(); } else if (submitFlag_ShipToErrorPOPUP == false && submitFlag_BillToErrorPOPUP == true) { closeWindowStreet(); } else*/ if (submitFlag_ShipToErrorPOPUP == false && submitFlag_BillToErrorPOPUP == false) { document.getElementById("redeemcoupon").submit(); } if ((submitFlag_ShipToErrorPOPUP == true || submitFlag_BillToErrorPOPUP == true) && (submitFlag_ShipToErrorPOPUP == true || submitFlag_BillToErrorPOPUP == true)) { if (submitFlag_BillTo == true && submitFlag_ShipTo == true) { document.getElementById("redeemcoupon").submit(); } else if (submitFlag_ShipToErrorPOPUP == false && submitFlag_BillToErrorPOPUP == false) { document.getElementById("redeemcoupon").submit(); } else if (submitFlag_BillTo == true && submitFlag_ShipTo == false) { submitFlag_ShipToErrorPOPUP = false; submitFlag_ShipTo = true; document.getElementById("invalidStreet_dev").style.display = "block"; document.getElementById("addressMgs").innerHTML = 'We are unable to verify this SHIP-TO address.'; } else if (submitFlag_BillTo == false && submitFlag_ShipTo == true) { submitFlag_BillToErrorPOPUP = false; submitFlag_BillTo = true; document.getElementById("invalidStreet_dev").style.display = "block"; document.getElementById("addressMgs").innerHTML = 'We are unable to verify this BILL-TO address.'; } else if (submitFlag_ShipToErrorPOPUP == false && submitFlag_BillToErrorPOPUP == true) { submitFlag_BillToErrorPOPUP = false; submitFlag_BillTo = true; document.getElementById("invalidStreet_dev").style.display = "block"; document.getElementById("addressMgs").innerHTML = 'We are unable to verify this BILL-TO address.'; } else if (submitFlag_ShipToErrorPOPUP == true && submitFlag_BillToErrorPOPUP == false) { submitFlag_ShipToErrorPOPUP = false; submitFlag_ShipTo = true; document.getElementById("invalidStreet_dev").style.display = "block"; document.getElementById("addressMgs").innerHTML = 'We are unable to verify this SHIP-TO address.'; } } } function closeWindowStreet() { //document.getElementById("invalidStreet_dev").style.display = "none"; $("#bill_shop_Info").removeAttr("disabled"); location.reload(); } function formSubmit() { document.getElementById("redeemcoupon").submit(); } function onLoadCall(callFrom){ // var billZip = document.getElementById("zipcodeBillTo").value; var shipZip = document.getElementById("shipto_postalcode").value; if(callFrom==2){ if(shipZip!='')$("#shipTo_zipCodeButton").click(); }else{ if(billZip!='')$("#billTo_zipCodeButton").click(); for(var k=0; k<=10; k++){ var h=k; } if(shipZip!='')$("#shipTo_zipCodeButton").click(); } } /*********************************** * * Checkout_payment.jsp * - checkout_payment.js * **********************************/ var submitCount = 0; $(document).ready(function(){ $("#submitButton").click(function(){ if(submitCount<1){ submitCount++; if (document.getElementById("hpfcc_paymethod") != null ) { if (document.getElementById("hpfcc_paymethod").checked == true){ if (document.getElementById("reponse_hostpayment").value == "true"){ document.getElementById("paymentform").submit(); } } } if (document.getElementById("cc_paymethod") != null) { if (document.getElementById("cc_paymethod").checked == true) { var accountnumber=document.getElementById('accountno'); if (accountnumber != null) if (accountnumber.value=='') { submitCount = 0; window.alert('You must provide a card number when using a credit card.'); document.getElementById('accountno').focus(); return false; } if (isValidInteger(accountnumber.value) == false) //if match failed { submitCount = 0; alert("\"Card Number\" must be digits."); document.getElementById('accountno').focus(); return (false); } var expirationdatemonth=document.getElementById('expmmdate'); if (expirationdatemonth != null) { if (expirationdatemonth.value=='') { submitCount = 0; window.alert('You must provide an expiration month when using a credit card.'); document.getElementById('expmmdate').focus(); return false; } else { if (isValidInteger(expirationdatemonth.value) == false) //if match failed { submitCount = 0; alert("You must provide a valid expiration month when using a credit card."); return false; } else { if (expirationdatemonth.value > 12 || expirationdatemonth.value <=0) { submitCount = 0; alert("You must provide a valid expiration month when using a credit card."); return false; } } } } var expirationdateyear=document.getElementById('expyydate'); if (expirationdateyear != null) { if (expirationdateyear.value==''||expirationdateyear.value.length<=0) { submitCount = 0; window.alert('You must provide an expiration year when using a credit card.'); document.getElementById('expyydate').focus(); return false; } else { if (isValidInteger(expirationdateyear.value) == false) //if match failed { submitCount = 0; alert("You must provide a valid expiration year when using a credit card."); return false; } } } var cvnNum = document.getElementById('cvn'); var cvnLen = cvnNum.value.length; if (cvnNum != null) { if (!isValidInteger(cvnNum.value)) { submitCount = 0; alert("You can't use ALPHA letters in the Security Code."); document.getElementById('cvn').focus(); return false; } if (cvnLen < 3) { submitCount = 0; alert("You must provide 3 to 4 digits for the Security Code."); document.getElementById('cvn').focus(); return false; } } $.ajax({ url: "Checkout", type: "POST", datatype: "json", data: { accountno: $("#accountno").val(), expmmdate: $("#expmmdate").val(), expyydate: $("#expyydate").val(), creditcarttype: $("#creditcardname").val(), formname: "checkCreditCard" }, success:checkCCValidity }); } } if (document.getElementById("ba_paymethod").checked == true) { //if (document.paymentform.accountno.value.length > 1) { // alert('You have entered credit card information and have chosen ARAMARK Business Account. If you would like to pay by credit //card then click on the Credit Card button. If paying by WearGuard Business Account then erase the credit card information.') // submitCount = 0; // } //else { document.getElementById("paymentform").submit(); //} } if ( (document.getElementById("ba_paymethod").checked == false) && (document.getElementById("hpfcc_paymethod").checked == false)) { submitCount = 0; alert('Please select a method of payment'); } } else{ alert("Please wait. Your request is processing..."); return false; } }); }); function checkCCValidity(data) { var data = data; existMsg1 = data.existMsg1; existMsg2 = data.existMsg2; existStatus = data.existStatus; if(existStatus==0) { document.getElementById("errorMessageExist1").innerHTML = ''; document.getElementById("errorMessageExist2").innerHTML = ''; document.getElementById("errorTable").style.display = "none"; document.getElementById("paymentform").submit(); } else { document.getElementById("errorMessageExist1").innerHTML = existMsg1; document.getElementById("errorMessageExist2").innerHTML = existMsg2; document.getElementById("errorTable").style.display = "block"; submitCount = 0; return false; } } function isValidInteger (s) { var i; if (s == null || s=="") return false; var strValidChars = "1234567890"; for (i = 0; i < s.length; i++) { var c = s.charAt(i); if (strValidChars.indexOf(c) == -1) { return false; } } if (s <= 0) { return false; } return true; } function checkForNaN(fieldVal) { var checkFlag=true; var strString = fieldVal; var strValidChars = "1234567890"; var strChar; // test strString consists of valid characters listed above for (var i = 0; i < strString.length; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1) { checkFlag = false; } } if(!checkFlag){ alert("Please enter a numeric value in the Gift Card Number field"); } return checkFlag; } function setRefresh() { document.getElementById('creditcardname').selectedIndex = ""; } $(document).ready(function(){ //$("#useGiftCard").attr('checked', true); //$('#giftcardno').attr("disabled",true); }); //function setGiftCard() { //document.getElementById("giftcardno").enabled=(document.getElementById("useGiftCard").checked==true); //if (document.getElementById("useGiftCard").checked==true) //{ //document.getElementById("giftcardno").focus(); //document.getElementById("giftcardno").enabled=true; //document.getElementById('giftcardno').disabled =false; //} //else { // document.getElementById('giftcardno').disabled =true; // } //} function validateGiftCard() { var fieldVal = document.getElementById('giftcardno').value; if(fieldVal.length>0){ if(checkForNaN(fieldVal)){ var existMsg= ""; existStatus=""; $.ajax({ url: "Checkout", type: "POST", datatype: "json", data: { giftcardno: $("#giftcardno").val(), formname: "giftCardCheck" }, success:checkForExists }); } } else{ alert("Please enter a numeric value in the Gift Card Number field."); } } function checkForExists(data) { var data = data; //var data = data; existMsg1 = data.existMsg1; existMsg2 = data.existMsg2; existStatus = data.existStatus; var giftVal = data.giftValue; //var giftVal = giftValRaw.toFixed(2); //var giftVal; //if(giftValRaw > 0) { // var giftVal = -giftValRaw; //} else { // giftVal = giftValRaw; //} //if(giftVal > 0) { // alert(giftVal); // giftVal=giftVal*-1; // alert(giftVal); //} var ordTotalValue = document.getElementById("orderTotal").value; var totalFinalRaw = ordTotalValue - giftVal; var totalFinal = totalFinalRaw.toFixed(2); //totalFinal.numberFormat("$0.00"); if(existStatus==0){ //if(giftVal > 0) { var negGiftVal = giftVal * -1.00; var nGVF = negGiftVal.toFixed(2); document.getElementById("giftValDisplay").innerHTML = nGVF; document.getElementById("giftValDisplayBottom").innerHTML = nGVF; //} else { // var initialGiftVal = "0.00"; // document.getElementById("giftValDisplay").innerHTML = initialGiftVal; // document.getElementById("giftValDisplayBottom").innerHTML = initialGiftVal; //} // change order total amount on hpf var iframeurl = document.getElementById("hpf").src; var stroldamount = "amount="+document.getElementById("orderTotal").value; var strnewamount = "amount="+totalFinal; iframeurl = iframeurl.replace(stroldamount, strnewamount ); document.getElementById("hpf").src = iframeurl; document.getElementById("ordTotal").innerHTML = totalFinal; document.getElementById("ordTotalBottom").innerHTML = totalFinal; document.getElementById("giftCardValue").value = giftVal; document.getElementById("errorMessageExist1").innerHTML = ''; document.getElementById("errorMessageExist2").innerHTML = ''; document.getElementById("errorTable").style.display = "none"; } else{ //document.getElementById("ordTotal").innerHTML = ordTotalValue; //document.getElementById("giftCardValue").value = initialGiftVal; document.getElementById("errorMessageExist1").innerHTML = existMsg1; document.getElementById("errorMessageExist2").innerHTML = existMsg2; var initialGiftVal = "0.00"; document.getElementById("giftValDisplay").innerHTML = initialGiftVal; document.getElementById("giftValDisplayBottom").innerHTML = initialGiftVal; document.getElementById("giftCardValue").value = initialGiftVal; document.getElementById("ordTotal").innerHTML = totalFinal; document.getElementById("ordTotalBottom").innerHTML = totalFinal; document.getElementById("errorTable").style.display = "block"; } } //document.updategiftcard.giftcardno.value=document.getElementById('giftcardno').value; //document.updategiftcard.validate_creditcardselindex.value=document.getElementById('creditcardname').selectedIndex; //document.updategiftcard.validate_accountno.value=document.getElementById('accountno').value; //document.updategiftcard.validate_expmmdate.value=document.getElementById('expmmdate').value; //document.updategiftcard.validate_expyydate.value=document.getElementById('expyydate').value; //document.updategiftcard.validate_cc_paymethod.value=document.getElementById('cc_paymethod').checked; //document.updategiftcard.validate_ba_paymethod.value=document.getElementById('ba_paymethod').checked; //document.updategiftcard.validate_territorycode.value=document.getElementById('territorycode').value; //document.updategiftcard.validate_routedriver.value=document.getElementById('routedriver').value; //document.updategiftcard.validate_ponumber.value=document.getElementById('ponumber').value; //document.updategiftcard.submit(); /*********************************** * * Vas_ire.js * **********************************/ function updateProfile(newViewType) { var defaultStyleMainHeight = 450; var viewTypeParam="FRONT"; var currURL = document.getElementById("IRE1").getAttribute("src"); var queryVars = currURL.split("&"); for (var i=0;i 0 && embName != 'undefined') { if (checkEmployeeSelected() == false) { alert("You must complete Option 3: Add Embroidered Name if you would like to add an embroidered name to this garment."); return false; } } var qty = $("#qty").val(); if (!isValidInteger(qty)) { alert("Please specify the quantity."); return false; } if (fieldValidation()) { //------------Display Style---------------- var styleDiv = $("#styleDiv"); var elementTolable = document.createElement('lable'); elementTolable.id="chooseStyleLabel_"+rowNumber; elementTolable.innerHTML = style; var elementToList = document.createElement('input'); elementToList.id="chooseStyle_"+rowNumber; elementToList.value=style; elementToList.type="hidden"; elementToList.name="chooseStyle_"+rowNumber; var ba1 = document.createElement('br'); ba1.id="chooseBa_"+rowNumber; styleDiv.append(elementTolable); styleDiv.append(elementToList); styleDiv.append(ba1); //-------------Display Color---------------- var colorDiv = $("#colorDiv"); var elementTolable = document.createElement('lable'); elementTolable.id="chooseColorLabel_"+rowNumber; elementTolable.innerHTML = color; var elementToList = document.createElement('input'); elementToList.id="chooseColor_"+rowNumber; elementToList.value=color; elementToList.type="hidden"; elementToList.name="chooseColor_"+rowNumber; var ba1 = document.createElement('br'); ba1.id="chooseBb_"+rowNumber; colorDiv.append(elementTolable); colorDiv.append(elementToList); colorDiv.append(ba1); //------------Display Size-------------------- var sizeDiv = $("#sizeDiv"); var elementTolable = document.createElement('lable'); elementTolable.id="chooseSizeLabel_"+rowNumber; elementTolable.innerHTML = size; var elementToList = document.createElement('input'); elementToList.id="chooseSize_"+rowNumber; elementToList.value=size; elementToList.type="hidden"; elementToList.name="chooseSize_"+rowNumber; var ba1 = document.createElement('br'); ba1.id="chooseBc_"+rowNumber; sizeDiv.append(elementTolable); sizeDiv.append(elementToList); sizeDiv.append(ba1); //------------Display Name-------------------- var nameDiv = $("#nameDiv"); var elementTolable = document.createElement('lable'); elementTolable.style.width = "200px"; elementTolable.id="chooseNameLabel_"+rowNumber; elementTolable.innerHTML = embName; var elementToList = document.createElement('input'); elementToList.id="chooseName_"+rowNumber; elementToList.value=embName; elementToList.type="hidden"; elementToList.name="chooseName_"+rowNumber; var ba1 = document.createElement('br'); ba1.id="chooseBd_"+rowNumber; nameDiv.append(ba1); nameDiv.append(elementTolable); nameDiv.append(elementToList); nameDiv.append(ba1); //------------Display Qty-------------------- var qtyDiv = $("#qtyDiv"); var elementTolable = document.createElement('lable'); elementTolable.id="chooseQtyLabel_"+rowNumber; elementTolable.innerHTML = qty; var elementToList = document.createElement('input'); elementToList.id="chooseQty_"+rowNumber; elementToList.value=qty; elementToList.type="hidden"; elementToList.name="chooseQty_"+rowNumber; var ba1 = document.createElement('br'); ba1.id="chooseBe_"+rowNumber; qtyDiv.append(ba1); qtyDiv.append(elementTolable); qtyDiv.append(elementToList); qtyDiv.append(ba1); //Remove Order var removeOrderDiv = $("#removeDiv"); var elementToRemoveOrder = document.createElement('a'); elementToRemoveOrder.href="javascript:removeCurrentOrder("+rowNumber+")"; elementToRemoveOrder.id="removeOdr_"+rowNumber; elementToRemoveOrder.innerHTML="REMOVE"; var ba1 = document.createElement('br'); ba1.id="chooseBf_"+rowNumber; removeOrderDiv.append(ba1); removeOrderDiv.append(elementToRemoveOrder); removeOrderDiv.append(ba1); itemCounter = itemCounter+1; $("#itemCount").val(itemCounter); //orderRowCount Hidden value var orderRowCountDiv = $("#hiddenDiv"); var elementToOrderRowCount = document.createElement('input'); elementToOrderRowCount.id="hiddenVal_"+rowNumber; elementToOrderRowCount.value="1"; elementToOrderRowCount.name="hiddenVal_"+rowNumber; elementToOrderRowCount.type="hidden"; var ba1 = document.createElement('br'); ba1.id="chooseBg_"+rowNumber; orderRowCountDiv.append(ba1); orderRowCountDiv.append(elementToOrderRowCount); orderRowCountDiv.append(ba1); var rowNumber = $("#rowNum").val(); rowNumber++; $("#rowNum").val(rowNumber); } $("#embName").val(''); $("#qty").val(''); } // Remove Button function removeCurrentOrder(currentOrder){ var removeColorLabel = 'chooseColorLabel_'+currentOrder; var removeColor = 'chooseColor_'+currentOrder; var removeQtyLabel = 'chooseQtyLabel_'+currentOrder; var removeQty = 'chooseQty_'+currentOrder; var removeNameLabel = 'chooseNameLabel_'+currentOrder; var removeName = 'chooseName_'+currentOrder; var removeSizeLabel = 'chooseSizeLabel_'+currentOrder; var removeSize = 'chooseSize_'+currentOrder; var removeStyleLabel = 'chooseStyleLabel_'+currentOrder; var removeStyle = 'chooseStyle_'+currentOrder; var removeOdr= 'removeOdr_'+currentOrder; var hiddenVal= 'hiddenVal_'+currentOrder; var removeBa = 'chooseBa_'+currentOrder; var removeBb = 'chooseBb_'+currentOrder; var removeBc = 'chooseBc_'+currentOrder; var removeBd = 'chooseBd_'+currentOrder; var removeBe = 'chooseBe_'+currentOrder; var removeBf = 'chooseBf_'+currentOrder; var removeBg = 'chooseBg_'+currentOrder; document.getElementById(removeColorLabel).style.display = "none"; document.getElementById(removeColor).style.display = "none"; document.getElementById(removeQtyLabel).style.display = "none"; document.getElementById(removeQty).style.display = "none"; document.getElementById(removeNameLabel).style.display = "none"; document.getElementById(removeName).style.display = "none"; document.getElementById(removeSizeLabel).style.display = "none"; document.getElementById(removeSize).style.display = "none"; document.getElementById(removeStyleLabel).style.display = "none"; document.getElementById(removeStyle).style.display = "none"; document.getElementById(removeOdr).style.display = "none"; document.getElementById(hiddenVal).value = 0; document.getElementById(removeBa).style.display = "none"; document.getElementById(removeBb).style.display = "none"; document.getElementById(removeBc).style.display = "none"; document.getElementById(removeBd).style.display = "none"; document.getElementById(removeBe).style.display = "none"; document.getElementById(removeBf).style.display = "none"; document.getElementById(removeBg).style.display = "none"; } //------------------------End Changes---------------------------------- function submitForm(vasFormParam) { var PN_CHK = false; var PN_LET = ""; var PN_THR = ""; var CF_CHK = false; var CF_LET = ""; var CF_THR = ""; var PERS = $("#Pers_Type").val(); var HAT = $("#Is_Hat").val(); try{ PN_CHK = document.getElementById("chk_opt3").checked; PN_LET = document.getElementById("opt3Font").value; PN_THR = document.getElementById("opt3ThColor").value; } catch(e){} try{ CF_CHK = document.getElementById("chk_opt2").checked; CF_LET = document.getElementById("opt2Font").value; CF_THR = document.getElementById("opt2ThColor").value; } catch(e){} var promptOkCancel; if(PERS=="CUS_EMBR"){ var warnings = ""; var lines = ""; if(HAT=="NOTHAT") { lines = document.getElementById("opt2Line1").value + " " + document.getElementById("opt2Line2").value + " " + document.getElementById("opt2Line3").value; } else { lines = document.getElementById("opt2Line1").value + " " + document.getElementById("opt2Line2").value; } if(CF_CHK == true && PN_CHK == true){ //Check Lettering Style if (CF_LET != "select" && PN_LET != "select"){ if (CF_LET != PN_LET){ warnings = warnings + "-Company Name and Personal Name lettering styles do not match." + '\n'; } } //Check Thread Color if (CF_THR != "select" && PN_THR != "select"){ if (CF_THR != PN_THR){ warnings = warnings + "-Company Name and Personal Name thread colors do not match." + '\n'; } } } //Check for all upper or all lowercase for Upper/Lower if(CF_CHK == true && CF_LET == "Upper/Lower"){ for(i=0,upper=0,lower=0;i < lines.length;i++){ if(lines.charAt(i) != ' '){ if(lines.charAt(i).toLowerCase() == lines.charAt(i)){ lower++; } if(lines.charAt(i).toUpperCase() == lines.charAt(i)){ upper++; } } if(i+1 == lines.length){ if(upper == 0 || lower == 0){ warnings = warnings + "-You selected Upper and lowercase lettering style but when you keyed in your Company Name you used only one case. This is how we will embroider your garment." + '\n'; } } } } //Check for all upper or all lowercase for Script if(CF_CHK == true && CF_LET == "Script"){ for(i=0,upper=0,lower=0;i < lines.length;i++){ if(lines.charAt(i) != ' '){ if(lines.charAt(i).toLowerCase() == lines.charAt(i)){ lower++; } if(lines.charAt(i).toUpperCase() == lines.charAt(i)){ upper++; } } if(i+1 == lines.length){ if(upper == 0 || lower == 0){ warnings = warnings + "-You selected Script lettering style but when you keyed in your Company Name you used only one case. This is how we will embroider your garment." + '\n'; } } } } //Check Words for proper case if(CF_CHK == true && CF_LET != "BLOCK"){ for(i=0,firstLetter=true;i < lines.length;i++){ if(firstLetter && lines.charAt(i) != ' '){ if(lines.charAt(i).toLowerCase() == lines.charAt(i)){ warnings = warnings + "-One or more words may not be capitalized in your Company Name." + '\n'; break; } firstLetter = false; } if(lines.charAt(i) == ' '){ firstLetter = true; } } } //Check for uppercase lower case mixed lettering for BLOCK if(CF_CHK == true && CF_LET == "BLOCK"){ for(i=0,upper=0,lower=0;i < lines.length;i++){ if(lines.charAt(i) != ' '){ if(lines.charAt(i).toLowerCase() == lines.charAt(i)){ lower++; } if(lines.charAt(i).toUpperCase() == lines.charAt(i)){ upper++; } } if(i+1 == lines.length){ if(upper != 0 && lower != 0){ warnings = warnings + "-You selected BLOCK lettering style for your Company Name. All letters will be capitalized. If you want upper and lower case letters you need to select Upper Lower lettering style." + '\n'; } } } } //Tone on Tone Warning if(CF_CHK == true || PN_CHK == true){ warnings = warnings + "-Please ensure you're happy with how your thread color choices appear on your garment." + '\n'; } //Output warnings if(warnings != ""){ promptOkCancel = confirm("Please carefully review the following:" + '\n' + '\n' + warnings + '\n' + "Click OK to accept your design choices and add your 'Item List' to your shopping cart." + '\n' + "Click CANCEL to make additional changes."); if (!promptOkCancel){return false;} } } //-*end*-//-SF //document.getElementById("submit").disabled = true; // In case the visitor never did REFRESH DRAWING - we rely on it to calc pers stuff /* if (! ShowIt("TRUE")) { document.getElementById("submit").disabled = false; return false; } */ var rows = itemCounter; if (rows <= 0) { alert("You must add at least 1 item to your 'Item List'. Please click 'Prepare Order' to select size and quantity. For more details, see 'Need Help?' at bottom of page."); //document.getElementById("submit").disabled = false; return false; } // Submit form vasFormParam.submit(); } $(document).ready(function(){ $('#opt2Line2').attr("disabled",true); $('#opt2Line3').attr("disabled",true); $("#opt2Line1").blur(function(){ validateField(this.id); }); $("#opt2Line2").blur(function(){ validateField(this.id); }); //------------- Option 1 ----------------- $("#opt1Loc").change(function(){ if(document.getElementById('chk_opt1').checked == true) { if((document.getElementById('chk_opt2').checked == true) && (document.getElementById('chk_opt3').checked == true)) { if ($("#opt1Loc").val() == $("#opt2Loc").val() || ( $("#opt1Loc").val() == $("#opt3Loc").val() ) ) { alert("You have selected multiple items for the same location. Please uncheck or change the location. "); return false; } } else if((document.getElementById('chk_opt2').checked == true) || (document.getElementById('chk_opt3').checked == true)) { if (($("#opt1Loc").val() == $("#opt2Loc").val() && document.getElementById('chk_opt2').checked == true) || ( $("#opt1Loc").val() == $("#opt3Loc").val() && document.getElementById('chk_opt3').checked == true ) ) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } else { doAjaxCall('option1'); } } else { document.getElementById('chk_opt1').checked = true; if((document.getElementById('chk_opt2').checked == true) && (document.getElementById('chk_opt3').checked == true)) { if ($("#opt1Loc").val() == $("#opt2Loc").val() || ( $("#opt1Loc").val() == $("#opt3Loc").val() ) ) { alert("You have selected multiple items for the same location. Please uncheck or change the location. "); return false; } } else if((document.getElementById('chk_opt2').checked == true) || (document.getElementById('chk_opt3').checked == true)) { if (($("#opt1Loc").val() == $("#opt2Loc").val() && document.getElementById('chk_opt2').checked == true) || ( $("#opt1Loc").val() == $("#opt3Loc").val() && document.getElementById('chk_opt3').checked == true ) ) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } else { doAjaxCall('option1'); } } }); $("#chk_opt1").change(function(){ if((document.getElementById('chk_opt1').checked == false)) { $("#opt1Loc").val(''); doAjaxCall('all'); } }); //------------ Option 2------------------- $("#chk_opt3").click(function(){ if(document.getElementById('chk_opt3').checked == true) { if(document.getElementById('chk_opt2').checked == true) { doAjaxCall('both'); } else { doAjaxCall('option3'); } } else { if(document.getElementById('chk_opt2').checked == true) { doAjaxCall('option2'); } else{ var defaultURL = document.getElementById('ireBaseUrl').value; document.getElementById("IRE1").setAttribute("src", defaultURL); } } }); $("#opt2Line1").change(function(){ if((document.getElementById('chk_opt2').checked == true)) { doAjaxCall('option2'); } }); $("#opt2Line2").change(function(){ if((document.getElementById('chk_opt2').checked == true)) { doAjaxCall('option2'); } }); $("#opt2Line3").change(function(){ if((document.getElementById('chk_opt2').checked == true)) { doAjaxCall('option2'); } }); $("#opt2Loc").change(function(){ if((document.getElementById('chk_opt2').checked == true)) { if(document.getElementById('chk_opt1')) { if((document.getElementById('chk_opt1').checked == true) && (document.getElementById('chk_opt3').checked == true)) { if ($("#opt2Loc").val() == $("#opt1Loc").val() || ( $("#opt2Loc").val() == $("#opt3Loc").val() ) ) { alert("You have selected multiple items for the same location. Please uncheck or change the location. "); return false; } } else if((document.getElementById('chk_opt1').checked == true) || (document.getElementById('chk_opt3').checked == true)) { if (($("#opt2Loc").val() == $("#opt1Loc").val() && document.getElementById('chk_opt1').checked == true)|| ( $("#opt2Loc").val() == $("#opt3Loc").val() && document.getElementById('chk_opt3').checked == true)) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } } else if (document.getElementById('chk_opt3').checked == true) { if ($("#opt2Loc").val() == $("#opt3Loc").val()) { alert("You have selected multiple items for the same location. Please uncheck or change the location. "); return false; } } else { doAjaxCall('option2'); } } else { document.getElementById('chk_opt2').checked = true; if(document.getElementById('chk_opt1')) { if((document.getElementById('chk_opt1').checked == true) && (document.getElementById('chk_opt3').checked == true)) { if ($("#opt2Loc").val() == $("#opt1Loc").val() || ( $("#opt2Loc").val() == $("#opt3Loc").val() ) ) { alert("You have selected multiple items for the same location. Please uncheck or change the location. "); return false; } } else if((document.getElementById('chk_opt1').checked == true) || (document.getElementById('chk_opt3').checked == true)) { if (($("#opt2Loc").val() == $("#opt1Loc").val() && document.getElementById('chk_opt1').checked == true)|| ( $("#opt2Loc").val() == $("#opt3Loc").val() && document.getElementById('chk_opt3').checked == true)) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } else { doAjaxCall('option2'); } } else { if(document.getElementById('chk_opt3').checked == true) { if ($("#opt2Loc").val() == $("#opt3Loc").val()) { alert("You have selected multiple items for the same location. Please uncheck or change the location. "); return false; } else { doAjaxCall('option2'); } } } } }); $("#opt2ThColor").change(function(){ if((document.getElementById('chk_opt2').checked == true)) { doAjaxCall('option2'); } }); $("#opt2Font").change(function(){ if((document.getElementById('chk_opt2').checked == true)) { doAjaxCall('option2'); } }); $("#chk_opt2").change(function(){ if((document.getElementById('chk_opt2').checked == false)) { $("#opt2Loc").val(''); $("#opt2ThColor").val(''); $("#opt2Font").val(''); $("#opt2Line1").val(''); loc2: $("#opt2Line2").val(''); loc3: $("#opt2Line3").val(''); doAjaxCall('all'); } }); //---------------------- End Option2 -------------- // ---------------- Option 3 ------------------ $("#opt3Loc").change(function(){ if((document.getElementById('chk_opt3').checked == true)) { if((document.getElementById('chk_opt1').checked == true) && (document.getElementById('chk_opt2').checked == true)) { if ($("#opt3Loc").val() == $("#opt1Loc").val() || ( $("#opt3Loc").val() == $("#opt2Loc").val() ) ) { alert("You have selected multiple items for the same location. Please uncheck or change the location. "); return false; } } else if((document.getElementById('chk_opt1').checked == true) || (document.getElementById('chk_opt2').checked == true)) { if (($("#opt3Loc").val() == $("#opt1Loc").val() && document.getElementById('chk_opt1').checked == true)|| ( $("#opt3Loc").val() == $("#opt2Loc").val() && document.getElementById('chk_opt2').checked == true)) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } else { doAjaxCall('option3'); } } else { document.getElementById('chk_opt3').checked = true; if((document.getElementById('chk_opt1').checked == true) && (document.getElementById('chk_opt2').checked == true)) { if ($("#opt3Loc").val() == $("#opt1Loc").val() && ( $("#opt3Loc").val() == $("#opt2Loc").val() ) ) { alert("You have selected multiple items for the same location. Please uncheck or change the location of two of them. "); return false; } } else if((document.getElementById('chk_opt1').checked == true) || (document.getElementById('chk_opt2').checked == true)) { if (($("#opt3Loc").val() == $("#opt1Loc").val() && document.getElementById('chk_opt1').checked == true)|| ( $("#opt3Loc").val() == $("#opt2Loc").val() && document.getElementById('chk_opt2').checked == true)) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } else { doAjaxCall('option3'); } } }); $("#opt3ThColor").change(function(){ $("#enThreadColorName").val($("#opt3ThColor :selected").text()); if((document.getElementById('chk_opt3').checked == true)) { doAjaxCall('option3'); } }); $("#opt3Font").change(function(){ if((document.getElementById('chk_opt3').checked == true)) { doAjaxCall('option3'); } }); $("#chk_opt3").change(function(){ if((document.getElementById('chk_opt2').checked == false)) { $("#opt3Loc").val(''); $("#opt3ThColor").val(''); $("#opt3Font").val(''); doAjaxCall('all'); } }); //--------------- End Option3 ------------------ $("#previewbutton").click(function(){ doAjaxCall('all'); }); $("#removelogolink").click(function(){ document.getElementById("logoId").value=""; document.getElementById("logoFromLibrary").value=""; document.getElementById("logoSelectedImg").setAttribute("src", ""); document.getElementById('chk_opt1').checked = false; document.getElementById('opt1Loc').value = ''; doAjaxCall('all'); }); function doAjaxCall(doFlag){ if(doFlag=='all'){ $.ajax({ url: "Vasvisualization", type: "POST", datatype: "json", data: { opt1place: $("#opt1Loc").val(), logoFromLibrary: $("#logoFromLibrary").val(), logoId: $("#logoId").val(), opt2place: $("#opt2Loc").val(), fontstyle: $("#opt2Font").val(), threadcolor: $("#opt2ThColor").val(), loc1: $("#opt2Line1").val(), loc2: $("#opt2Line2").val(), loc3: $("#opt2Line3").val(), opt3place: $("#opt3Loc").val(), opt3fontstyle: $("#opt3Font").val(), opt3threadcolor: $("#opt3ThColor").val(), formname: "opt2Ajax", style: $("#style").val(), ireBaseUrl:$("#ireBaseUrl").val() }, success:getImageUrlOpt2 }); } if(doFlag=='option1'){ if(document.getElementById('chk_opt1').checked == true) { $.ajax({ url: "Vasvisualization", type: "POST", datatype: "json", data: { opt1place: $("#opt1Loc").val(), logoFromLibrary: $("#logoFromLibrary").val(), logoId: $("#logoId").val(), opt2place: $("#opt2Loc").val(), fontstyle: $("#opt2Font").val(), threadcolor: $("#opt2ThColor").val(), loc1: $("#opt2Line1").val(), loc2: $("#opt2Line2").val(), loc3: $("#opt2Line3").val(), opt3place: $("#opt3Loc").val(), opt3fontstyle: $("#opt3Font").val(), opt3threadcolor: $("#opt3ThColor").val(), formname: "opt2Ajax", style: $("#style").val(), ireBaseUrl:$("#ireBaseUrl").val() }, success:getImageUrlOpt2 }); } } if(doFlag=='option2'){ if(document.getElementById('chk_opt2').checked == true) { if(document.getElementById('chk_opt3').checked == true) { doAjaxCall('both'); } else { $.ajax({ url: "Vasvisualization", type: "POST", datatype: "json", data: { opt1place: $("#opt1Loc").val(), logoFromLibrary: $("#logoFromLibrary").val(), logoId: $("#logoId").val(), opt2place: $("#opt2Loc").val(), fontstyle: $("#opt2Font").val(), threadcolor: $("#opt2ThColor").val(), loc1: $("#opt2Line1").val(), loc2: $("#opt2Line2").val(), loc3: $("#opt2Line3").val(), opt3place: $("#opt3Loc").val(), opt3fontstyle: $("#opt3Font").val(), opt3threadcolor: $("#opt3ThColor").val(), formname: "opt2Ajax", style: $("#style").val(), ireBaseUrl:$("#ireBaseUrl").val() }, success:getImageUrlOpt2 }); } } } else if(doFlag=='option3') { if(document.getElementById('chk_opt3').checked == true) { if(document.getElementById('chk_opt2').checked == true) { doAjaxCall('both'); } else { $.ajax({ url: "Vasvisualization", type: "POST", datatype: "json", data: { opt1place: $("#opt1Loc").val(), logoFromLibrary: $("#logoFromLibrary").val(), logoId: $("#logoId").val(), opt2place: $("#opt2Loc").val(), fontstyle: $("#opt2Font").val(), threadcolor: $("#opt2ThColor").val(), loc1: $("#opt2Line1").val(), loc2: $("#opt2Line2").val(), loc3: $("#opt2Line3").val(), opt3place: $("#opt3Loc").val(), opt3fontstyle: $("#opt3Font").val(), opt3threadcolor: $("#opt3ThColor").val(), formname: "opt2Ajax", style: $("#style").val(), ireBaseUrl:$("#ireBaseUrl").val() }, success:getImageUrlOpt2 }); } } } else if(doFlag=='both') { //if((document.getElementById('chk_opt3').checked == true)&&(document.getElementById('chk_opt2').checked == true)) //{ $.ajax({ url: "Vasvisualization", type: "POST", datatype: "json", data: { opt1place: $("#opt1Loc").val(), logoFromLibrary: $("#logoFromLibrary").val(), logoId: $("#logoId").val(), opt2place: $("#opt2Loc").val(), fontstyle: $("#opt2Font").val(), threadcolor: $("#opt2ThColor").val(), loc1: $("#opt2Line1").val(), loc2: $("#opt2Line2").val(), loc3: $("#opt2Line3").val(), opt3place: $("#opt3Loc").val(), opt3fontstyle: $("#opt3Font").val(), opt3threadcolor: $("#opt3ThColor").val(), formname: "opt2Ajax", style: $("#style").val(), ireBaseUrl:$("#ireBaseUrl").val() }, success:getImageUrlOpt2 }); //} //} } function getImageUrlOpt2(data) { var data = data; //var data = data; opt2Url = data.imageURL; document.getElementById("IRE1").setAttribute("src", opt2Url); } } }); function removeLogo() { document.getElementById("logoId").value=""; document.getElementById("logoFromLibrary").value=""; document.getElementById("logoSelectedImg").setAttribute("src", ""); document.getElementById('chk_opt1').checked = false; document.getElementById('opt1Loc').value = ''; //doAjaxCall('option1'); } function fieldValidation(){ var flag=true; if((document.getElementById('chk_opt1').checked == true) || (document.getElementById('chk_opt2').checked == true)||(document.getElementById('chk_opt3').checked == true)) { if(document.getElementById('chk_opt1').checked == true) { if((document.getElementById('chk_opt2').checked == true) && (document.getElementById('chk_opt3').checked == true)) { if ($("#opt1Loc").val() == $("#opt2Loc").val() && ( $("#opt1Loc").val() == $("#opt3Loc").val() ) ) { alert("You have selected three items for the same location. Please uncheck or change the location of two of them. "); return false; } } if((document.getElementById('chk_opt2').checked == true) || (document.getElementById('chk_opt3').checked == true)) { if ($("#opt1Loc").val() == $("#opt2Loc").val() || ( $("#opt1Loc").val() == $("#opt3Loc").val() ) ) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } var line1 = document.getElementById("opt1Loc").value; if(line1==""){ alert("Please select a location for your Logo."); return false; } } if(document.getElementById('chk_opt2').checked == true) { if((document.getElementById('chk_opt1').checked == true) && (document.getElementById('chk_opt3').checked == true)) { if ($("#opt2Loc").val() == $("#opt1Loc").val() && ( $("#opt2Loc").val() == $("#opt3Loc").val() ) ) { alert("You have selected three items for the same location. Please uncheck or change the location of two of them. "); return false; } } if((document.getElementById('chk_opt1').checked == true) || (document.getElementById('chk_opt3').checked == true)) { if ($("#opt2Loc").val() == $("#opt1Loc").val() || ( $("#opt2Loc").val() == $("#opt3Loc").val() ) ) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } flag = selectfieldCheck(); } if(flag) { if(document.getElementById('chk_opt3').checked == true) { if((document.getElementById('chk_opt1').checked == true) && (document.getElementById('chk_opt2').checked == true)) { if ($("#opt3Loc").val() == $("#opt1Loc").val() && ( $("#opt3Loc").val() == $("#opt2Loc").val() ) ) { alert("You have selected three items for the same location. Please uncheck or change the location of two of them. "); return false; } } if((document.getElementById('chk_opt1').checked == true) || (document.getElementById('chk_opt2').checked == true)) { if ($("#opt3Loc").val() == $("#opt1Loc").val() || ( $("#opt3Loc").val() == $("#opt2Loc").val() ) ) { alert("You have selected two items for the same location. Please uncheck or change the location of one of them. "); return false; } } flag = selectfield2Check(); } } } return flag; } function selectfield2Check(){ var line1 = document.getElementById("opt3Loc").value; var line2 = document.getElementById("opt3ThColor").value; var line3 = document.getElementById("opt3Font").value; if(line1==""){ alert("Please select a location for your employee name."); return false; }else if(line2==""){ alert("Please select the thread color for your Employee Name."); return false; }else if(line3==""){ alert("Please select the lettering style for your Employee Name."); return false; } else{ return true; } } function selectfieldCheck(){ var line1 = document.getElementById("opt2Loc").value; var line2 = document.getElementById("opt2ThColor").value; var line3 = document.getElementById("opt2Font").value; if(line1==""){ alert("Please select a location for your company name."); return false; }else if(line2==""){ alert("Please select the thread color for your Company Name."); return false; }else if(line3==""){ alert("Please select the lettering style for your Company Name."); return false; } else{ return true; } } function disable(){ if(document.getElementById('vasHolderOpt1').style.display == "none"){ document.getElementById('vasHolderOpt1').style.display ="block"; } else { document.getElementById('vasHolderOpt1').style.display ="none"; } } function validateField(now){ var HAT = $("#Is_Hat").val(); var str = document.getElementById(now).value; if(now=='opt2Line1') { if(str=="") { if(HAT=="NOTHAT") { document.getElementById('opt2Line3').disabled =true; } document.getElementById('opt2Line2').disabled =true; return false; } else { document.getElementById('opt2Line2').disabled =false; } } else if(now == 'opt2Line2'){ if(str=="") { if(HAT=="NOTHAT") { document.getElementById('opt2Line3').disabled =true; } return false; } else { if(HAT=="NOTHAT") { document.getElementById('opt2Line3').disabled =false; } } } } /*********************************** * * adsweb_thread_select.js * **********************************/ var entity; function thread(rgb, code, name, type, index){ this.rgb = rgb; this.code = code; this.name = name; this.type = type; this.index = index; } function sortthreads(a, b) { if (a.index < b.index) return -1; else if (a.index > b.index) return 1; else if (a.name < b.name) return -1; else if (a.name > b.name) return 1; else return 0; } function but(_entity) { //alert('invoked PFO_thread_selector, but function'); //'entity' is used to tell wether 'company front' or 'personal name' is calling the color panel. entity=_entity; //Hide Dropdowns (IE 6.0 Bug Fix) -SF dropdowns = document.getElementsByTagName('select') ; for (var i=0;i'; thrtabs += '' + logo + '' + s + ''; } if (LOGOTHREADS[0] != null){ thrtabs += ''; } //alert('Done with logo thread color, starting to create table for standard colors'); s = makeThreadTable('Standard'); thrtabs += '' + s + ''; thrtabs += ''; e = document.getElementById('selector'); e.innerHTML = thrtabs; //alert('returning from adsweb_thread_selector'); //Opacity try{ e.style.display = "block"; document.getElementById('black').style.visibility = "visible"; opacity('black', 1, 50, 1000); } catch(e){} //e.style.display = 'block'; //e.style.left = "50%"; //e.style.top = "50%"; //var bblaleft = e.offsetLeft; //e.style.left = bblaleft - e.offsetWidth/2; //var bblatop = e.offsetTop; //e.style.top = bblatop - e.offsetHeight/2; } function makeThreadTable(key) { // Construct an offering for each custom logo, and then for standard thread colors //alert('makeThreadTable invoked'); if (key == 'Standard') { var s = ''; s += ''; var tcnt = 0; for (var ix in STDTHREADS) { if (STDTHREADS[ix].type != key) { continue; } if ( ( tcnt % 6) == 0) { if (tcnt != 0) { s += ''; } s += ''; } var txtcol = (checkForLightColors(STDTHREADS[ix].rgb.toUpperCase()))?' class="tpatch"':' class="tpatchWhite"'; var evnt = ' onclick="clicky(this)"'; s += ''; tcnt += 1; } if ( ( tcnt % 6) != 0) { s += ''; } s += '
Standard Thread Colors:
' + STDTHREADS[ix].name + '
'; return s; } // Here, we're making the section for a custom logo var s = ''; // s += ''; var tcnt = 0; for (var ix in LOGOTHREADS) { if (LOGOTHREADS[ix].type != key) { continue; } if ( ( tcnt % 5) == 0) { if (tcnt != 0) { s += ''; } s += ''; } var txtcol = (checkForLightColors(LOGOTHREADS[ix].rgb.toUpperCase()))?' class="tpatch"':' class="tpatchWhite"'; var evnt = ' onclick="clicky(this)"'; s += ''; tcnt += 1; } if ( ( tcnt % 5) != 0) { s += ''; } s += '
Threads from your logo:
' + LOGOTHREADS[ix].name + '
'; //alert('return data from makeThreadTable: ' + s); return s; } function clicky(e) { //alert(unescape(e.getAttribute('tname')) + ' (' + e.getAttribute('rgb') + ')'); //For Add Company Name -SF if(entity == "acn"){ var colorChooserCode = e.getAttribute('code'); colorChooserName = unescape(e.getAttribute('tname')); $.ajax({ type: "GET", url: "vasvisualization?formname=chkSimilarColorAjax", async: false, dataType: "json", data: "colorChooserCode="+colorChooserCode+"&garmentColorCode="+GARMENT_Color_Code, success: function(rtn) { var vasObject = rtn; if (vasObject.similarMatch == "Y") { alert("IMPORTANT! " + '\n' + 'Embroidery Thread colors : ' + colorChooserName + ' may conflict with Garment color: ' + GARMENT_Color_Name + '\n' + "Please review prior to submitting order."); } } }); //colorChooserName = unescape(e.getAttribute('tname')); document.getElementById('colorChooserBoxTextAcn').childNodes[0].replaceData(0,30, colorChooserName); document.getElementById('colorChooserBoxTextAcn').style.background = "#" + e.getAttribute('rgb'); document.getElementById('colorChooserBoxButtonAcn').style.background = "#" + e.getAttribute('rgb'); document.getElementById('colorChooserBoxButtonAcn').getElementsByTagName('img')[0].src = "/widgets/au2007/config/colorchoosert.gif"; if(checkForLightColors(e.getAttribute('rgb'))) {document.getElementById('colorChooserBoxTextAcn').style.color = "#000000";} else{document.getElementById('colorChooserBoxTextAcn').style.color = "#ffffff";} document.getElementById('opt2ThColor').setAttribute("value", e.getAttribute('rgb') + "|" + e.getAttribute('code')); //alert('opt2ThColor: ' + e.getAttribute('rgb')); document.getElementById('selector').style.display='none'; document.getElementById('black').style.display='none'; //recalccCompanyName(); } //For Add Employee Name -SF if(entity == "aen"){ //colorChooserName = unescape(e.getAttribute('tname')); var colorChooserCode = e.getAttribute('code'); colorChooserName = unescape(e.getAttribute('tname')); $.ajax({ type: "GET", url: "vasvisualization?formname=chkSimilarColorAjax", async: false, dataType: "json", data: "colorChooserCode="+colorChooserCode+"&garmentColorCode="+GARMENT_Color_Code, success: function(rtn) { var vasObject = rtn; if (vasObject.similarMatch == "Y") { alert("IMPORTANT! " + '\n' + 'Embroidery Thread colors : ' + colorChooserName + ' may conflict with Garment color: ' + GARMENT_Color_Name + '\n' + "Please review prior to submitting order."); } } }); document.getElementById('colorChooserBoxTextAen').childNodes[0].replaceData(0,30, colorChooserName); document.getElementById('colorChooserBoxTextAen').style.background = "#" + e.getAttribute('rgb'); document.getElementById('colorChooserBoxButtonAen').style.background = "#" + e.getAttribute('rgb'); document.getElementById('colorChooserBoxButtonAen').getElementsByTagName('img')[0].src = "/widgets/au2007/config/colorchoosert.gif"; if(checkForLightColors(e.getAttribute('rgb'))) {document.getElementById('colorChooserBoxTextAen').style.color = "#000000";} else{document.getElementById('colorChooserBoxTextAen').style.color = "#ffffff";} document.getElementById('opt3ThColor').setAttribute("value", e.getAttribute('rgb') + "|" + e.getAttribute('code')); document.getElementById('enThreadColorName').setAttribute("value", e.getAttribute('tname')); //alert('enThreadColorName: ' + e.getAttribute('tname')); document.getElementById('selector').style.display='none'; document.getElementById('black').style.display='none'; //recalccEmpName(); } //Unhide Dropdowns (IE 6.0 Bug Fix) -SF dropdowns = document.getElementsByTagName('select') ; for (var i=0;iRetrieving delivery date...'); $.ajax({ type: "GET", url: "checkout?formname=getWillHaveBy", dataType: "json", data: { shipmethod: a }, success: getdelivercallback, error: err }); } function getdelivercallback(data){ var Status = data.Status; var DeliverBy = data.DeliverBy; if (Status){ var delivery_msg = "Estimated Delivery Date: "+ DeliverBy; $('#delivery_msg').html(delivery_msg); } else { //var delivery_msg = "Delivery Date is not available at this time"; var delivery_msg = "Estimated delivery date unavailable due to backorder-Call 800-785-2299 for assistance" $('#delivery_msg').html(delivery_msg); } return true; } function err(xhr, reason, ex){ alert(reason); return false; } $(document).ready(function() { $('#payOptions div:nth-child(5)').addClass('gift-cc-box'); var ccbox = $('#payOptions .gift-cc-box'); ccbox.css({ 'display':'block', 'padding':'15px 0px' }); }); //this script add a link to the site header and makes the wrapping div wider to accomodate the link when the page header is rendered for a user who is logged in SK 1/18/23 $(document).ready(function() { $(".head_links").append( 'TRACK MY ORDER'); $(".head_links").css("width", "550px") }); //$(document).ready(function() { // var mTitle = '
Page under maintenance
'; // var mBody = '
Please email us at feedback2-aus@aramark.com or call 1800-888-2900 if you have any questions.
'; // var cContain = $('#oinq_orderdetailload_jsp #contenContainer'); // cContain.html(""); // cContain.append(mTitle); // cContain.append(mBody); // var content = cContain; // $('#oinq_orderdetailload_jsp #contentRight').html(content); //});