if(top.location!=location){top.location.href=document.location.href}Ojay.HtmlBuilder.include({input:Ojay.HTML.input.wrap(function(){var B=Array.from(arguments),A=B.shift().apply(null,B);Ojay(A).addClass(A.type);return A})});Checkout={TITLE_FIELD:"Eothercommerce/ExpressBasket.billingAddress.title",FIRST_NAME_FIELD:"othercommerce/ExpressBasket.user.firstName",SURNAME_FIELD:"othercommerce/ExpressBasket.user.lastName",DELIVERY:"othercommerce/ExpressBasket.deliveryAddress.",BILLING:"othercommerce/ExpressBasket.billingAddress.",ADDRESS1_FIELD:"address1",ADDRESS2_FIELD:"address2",CITY_FIELD:"city",COUNTY_FIELD:"county",POSTCODE_FIELD:"postcode",COUNTRY_FIELD:"country",CARD_TYPE_FIELD:"Eothercommerce/ExpressBasket.payment.cardType",SECTION_CLASS:".section",FADE_OPACITY:0.5,FADE_TIME:0.4,getInputs:function(C,B){var A=C.descendants("input, textarea, select");if(B){A=A.filter(function(D){return D.node.name==B})}return A},highlightActiveSection:function(B){var E=B.descendants(this.SECTION_CLASS),A=this.getInputs(B),C=B.descendants(".invalid"),D=(C.node?C.ancestors(this.SECTION_CLASS):E).at(0);D.addClass("current-section");(C.node?this.getInputs(C):A).node.focus();A.on("focus",this.focus,this);E.on("click",this.swapSection,this);E.forEach(function(H,F){if(F==E.length-1){return }var G=Ojay.HTML.input({type:"submit",value:"Next section",className:"next-section"});Ojay(G).on("click",function(I,K){K.stopEvent();var J=E.at(F+1);this.swapSection(J);J.descendants("select, input, textarea").node.focus()},this);H.insert(G)},this);this._sections=E;this._activeSection=D},focus:function(A){A=Ojay(A);A.node.focus();var B=A.ancestors(this.SECTION_CLASS);this.swapSection(B)},swapSection:function(A){if(this._activeSection){if(Checkout.loginRequired&&this._activeSection.node==this._sections.at(0).node){return Checkout._accountLookup._checkAddress()}if(this._activeSection.node==A.node){return }this._activeSection.removeClass("current-section")}A.addClass("current-section");Ojay(document.documentElement).scroll([0,A.getRegion().top],1.5);this._activeSection=A},toggle:function(D,C){D=Ojay(D);var A=Ojay(C.using);function B(){var E=A.node.checked;if(C.invert){E=!E}D[E?"show":"hide"]()}A.on("click",B);B()},AccountLookup:new JS.Class({include:Ojay.Observable,extend:{CHECK_URL:"/shop/checkout/ajax/ajax-login.html",RESET_URL:"/shop/checkout/ajax/reset-password.html",DATA_URL:"/shop/addressBook/addresses.js",EMAIL_FIELD:"othercommerce/ExpressBasket.credentials.email",CONFIRM_FIELD:"othercommerce/ExpressBasket.confirmEmail",PASSWORD_FIELD:"othercommerce/ExpressBasket.credentials.password"},initialize:function(F,D){Checkout._accountLookup=this;this._form=Ojay(F);this._options=D||{};this._checkUrl=this._options.checkUrl||this.klass.CHECK_URL;this._resetUrl=this._options.resetUrl||this.klass.RESET_URL;this._dataUrl=this._options.dataUrl||this.klass.DATA_URL;var C=this._options.emailField||this.klass.EMAIL_FIELD;this._email=Checkout.getInputs(this._form,C);this._confirm=Checkout.getInputs(this._form,this.klass.CONFIRM_FIELD);this._password=Checkout.getInputs(this._form,this.klass.PASSWORD_FIELD);var G=Checkout.DELIVERY;this._titleField=Checkout.getInputs(this._form,Checkout.TITLE_FIELD);this._firstNameField=Checkout.getInputs(this._form,Checkout.FIRST_NAME_FIELD);this._lastNameField=Checkout.getInputs(this._form,Checkout.SURNAME_FIELD);this._address1Field=Checkout.getInputs(this._form,G+Checkout.ADDRESS1_FIELD);this._address2Field=Checkout.getInputs(this._form,G+Checkout.ADDRESS2_FIELD);this._cityField=Checkout.getInputs(this._form,G+Checkout.CITY_FIELD);this._countyField=Checkout.getInputs(this._form,G+Checkout.COUNTY_FIELD);this._postcodeField=Checkout.getInputs(this._form,G+Checkout.POSTCODE_FIELD);this._countryField=Checkout.getInputs(this._form,"P"+G+Checkout.COUNTRY_FIELD);var E,B,A=Ojay.HTML.span({className:"account-lookup"},function(H){E=Ojay(H.button({className:"account-lookup"},"Sign in"));B=Ojay(H.span({className:"login-status"}))});this._password.insert(A,"after");E.on("click",Ojay.stopDefault)._(this)._lookupData();this._statusDisplay=B;this._generateToggles();this.prefill()},_generateToggles:function(){var A=Ojay("input[name=customer-type]").map("node");if(!A[0]){return }A[0].checked=true;var B=function(){var C=A.filter("checked")[0];if(C===A[0]){this._confirm.ancestors(".opc-fields").show();this._password.ancestors(".opc-fields").hide()}else{this._confirm.ancestors(".opc-fields").hide();this._password.ancestors(".opc-fields").show()}}.bind(this);B();A.forEach(function(C){Ojay(C).on("click",B)})},_lookupData:function(A){this._statusDisplay.setContent("");var A=A||{email:this._email.node.value,password:this._password.node.value},B=A.email?"POST":"GET";Ojay.HTTP[B](this._dataUrl,A,{onSuccess:function(C){var D=C.parseJSON(),E=D.addresses;if(D.error){return this._statusDisplay.setContent(D.error)}Checkout.loginRequired=false;["title","firstName","lastName"].forEach(function(F){Ojay.Forms.setValue(this["_"+F+"Field"],E[0][F])},this);Checkout.Address.FIELDS.forEach(function(G){var F=this["_"+G+"Field"];if(!F){return }Ojay.Forms.setValue(F,E[0][G])},this);this.notifyObservers("populate",D)}.bind(this)})},prefill:function(){this._lookupData({})}}),AddressHelper:new JS.Class({extend:{SEARCH_URL:"/shop/checkout/ajax/addresses.xml"},initialize:function(B,A,C){this._form=Ojay(B);this._container=this._form.descendants(A);this._container.insert(this.getHTML());C=C||Checkout.DELIVERY;this._address1Field=Checkout.getInputs(this._form,C+Checkout.ADDRESS1_FIELD);this._address2Field=Checkout.getInputs(this._form,C+Checkout.ADDRESS2_FIELD);this._cityField=Checkout.getInputs(this._form,C+Checkout.CITY_FIELD);this._countyField=Checkout.getInputs(this._form,C+Checkout.COUNTY_FIELD);this._postcodeField=Checkout.getInputs(this._form,C+Checkout.POSTCODE_FIELD);this._countryField=Checkout.getInputs(this._form,"P"+C+Checkout.COUNTRY_FIELD)},getHTML:function(){if(this._html){return this._html}this._html=Ojay(Ojay.HTML.form(function(A){A.p("Enter a postcode and search:");this._postcode=A.input({type:"text"});this._button=A.input({type:"submit",value:"Search"});this._menu=Ojay(A.div(function(B){B.p({className:"choose-address"},"Choose your address from the list:");this._select=Ojay(B.select())}.bind(this)))}.bind(this)));this._html.on("submit",Ojay.stopDefault)._(this)._postcodeSearch();this._select.on("change")._(this)._selectAddress();this._menu.hide();return this._html},getMenu:function(){return this._menu},_postcodeSearch:function(){var A=this._postcode.value;this._button.value="Searching...";Ojay.HTTP.GET(this.klass.SEARCH_URL,{postcode:A},{onSuccess:function(B){var C=Checkout.Address.fromXML(B.responseXML);this.setAddresses(C);this._select.node.focus()}.bind(this),onComplete:function(){this._button.value="Search"}.bind(this)})},_selectAddress:function(B){B=(B===undefined)?Number(this._select.node.value):B;var A=this._addresses[B];if(!A){return }Checkout.Address.FIELDS.forEach(function(D){var C=this["_"+D+"Field"];if(!C){return }Ojay.Forms.setValue(C,A[D])},this)},setAddresses:function(C,D){this._addresses=C||[];var A;if(C.length===0){A="<option>No addresses found</option>"}else{A="<option>Please select an address</option>";C.forEach(function(E,F){A+='<option value="'+F+'">'+E.toShortAddress()+"</option>"})}this._select.setContent(A);this._select.node.options[0].selected=true;var B=(this._addresses.length>0);this._menu[B?"show":"hide"]();if(D){this._selectAddress(0)}}}),Address:new JS.Class({initialize:function(A){this.klass.FIELDS.forEach(function(B){this[B]=""},this);this.set(A)},set:function(A){JS.extend(this,A)},toString:function(){return this.klass.FIELDS.map(function(A){return this[A]},this).join(", ")},toShortAddress:function(){return this.address1+(this.address2?", "+this.address2:"")+", "+this.city},extend:{fromXML:function(B){var F=B.documentElement;var E=F.getElementsByTagName("address");var G=[],A,D;for(var C=0,H=E.length;C<H;C++){D=E.item(C).firstChild,A=new this;G.push(A);while(D){if(D.nodeType==Ojay.HTML.ELEMENT_NODE&&D.firstChild){A[D.nodeName]=D.firstChild.data}D=D.nextSibling}}return G},FIELDS:"addressName title firstName lastName address1 address2 address3 city county country postcode".split(" ")}}),AddressBook:new JS.Class({include:Ojay.Observable,extend:{INDEX_URL:"/shop/addressBook/addresses.js",CREATE_URL:"/shop/addressBook/editAddress.js",UPDATE_URL:"/shop/addressBook/editAddress.js",DELETE_URL:"/shop/addressBook/deleteAddress.js",COUNTRIES_URL:"/shop/addressBook/countries.js",TITLES_URL:"/shop/addressBook/titles.js",MASK_COLOR:"#FFFFFF",MASK_OPACITY:0.5,CONTAINER_CLASS:"address-book",getMetadata:function(){Ojay.HTTP.GET(this.COUNTRIES_URL,{},{onSuccess:function(A){this.COUNTRIES=A.parseJSON().countries;if(this.TITLES){this.notifyObservers("metadataready")}}.bind(this)});Ojay.HTTP.GET(this.TITLES_URL,{},{onSuccess:function(A){this.TITLES=A.parseJSON().titles;if(this.COUNTRIES){this.notifyObservers("metadataready")}}.bind(this)})},populateSelect:function(A,B){A.setContent(B.map(function(C){return'<option value="'+C.id+'">'+C.name+"</option>"}).join(""));A.node.options[0].selected=true},Address:new JS.Class({initialize:function(A,B){this._book=A;this._elements={};this.getHTML();this.set(new Checkout.Address(B))},getHTML:function(){var A=this,B=A._elements;if(B._li){return B._li}B._li=Ojay(Ojay.HTML.li(function(C){B._destroy=Ojay(C.span({className:"delete"},"Delete"));B._name=Ojay(C.span({className:"address-name"}))}));B._name.on("click")._(this._book).load(this);B._destroy.on("click")._(this._book).destroy(this);return B._li},load:function(){this._elements._li.addClass("selected")},unload:function(){this._elements._li.removeClass("selected")},set:function(A){if(this._address){this._id=this._address.id}if(!A.id){A.id=this._id}this._address=A;this._elements._name.setContent(A.addressName||A.address1);this._elements._destroy[A.defaultAddress?"hide":"show"]()},save:function(A,C,B){this.set(A);Ojay.HTTP.POST(this._book.klass.UPDATE_URL,this.getPostData(),{onComplete:C.bind(B||null),onSuccess:function(D){var E=D.parseJSON();if(!this._address.id&&E.id){this._id=this._address.id=E.id}}.bind(this)})},destroy:function(B,A){Ojay.HTTP.POST(this._book.klass.DELETE_URL,{id:this._address.id},{onComplete:B.bind(A||null)})},getPostData:function(){if(!this._address){return{}}var A={};Checkout.Address.FIELDS.forEach(function(B){A[B]=this._address[B]},this);if(this._address.id){A.id=this._address.id}return A}})},initialize:function(){this._mask=new Ojay.PageMask({color:this.klass.MASK_COLOR,opacity:this.klass.MASK_OPACITY});this._overlay=new Ojay.ContentOverlay({className:this.klass.CONTAINER_CLASS+"-overlay",width:728,height:520});this._mask.positionBehind(this._overlay);this._overlay.getContentElement().addClass("clear");var A=Ojay(Ojay.HTML.div({className:"close-button"},"Close"));A.on("click")._(this).hide();this._overlay.getContainer().insert(A,"top");this._elements={};this._overlay.setContent(this.getHTML())},getHTML:function(){var A=this,B=A._elements;if(B._container){return B._container}B._container=Ojay(Ojay.HTML.div({className:this.klass.CONTAINER_CLASS},function(C){C.h2("Your address book"),C.p({className:"address-msg"},"Choose an address from the list to edit it, or enter a new address and click 'Save' to add it to your address book.");C.div({className:"list"},B._list=Ojay(C.ul()),B._add=Ojay(C.button({className:"add-address"},"New address")));B._form=Ojay(C.form(function(D){D.div(function(E){E.label("Address Description");B._addressName=E.input({type:"text"})});D.div({className:"address-name"},function(E){E.label("Name");B._title=Ojay(E.select());B._firstName=E.input({type:"text"});B._lastName=E.input({type:"text"})});D.div(function(E){E.label("Address");B._address1=E.input({type:"text"})});D.div(function(E){B._address2=E.input({type:"text"})});D.div(function(E){E.label("Town or city");B._city=E.input({type:"text"})});D.div(function(E){E.label("Postcode");B._postcode=E.input({type:"text"})});D.div(function(E){E.label("County");B._county=E.input({type:"text"})});D.div(function(E){E.label("Country");B._country=Ojay(E.select())});D.div(function(E){B._save=Ojay(E.input({type:"submit",value:"Save"}))})}))}));this._populateSelects();B._add.on("click",Ojay.stopDefault)._(this).addAddress();B._form.on("submit",Ojay.stopDefault)._(this).save();return B._container},_populateSelects:function(){if(!this.klass.COUNTRIES||!this.klass.TITLES){return this.klass.on("metadataready")._(this)._populateSelects()}this.klass.populateSelect(this._elements._title,this.klass.TITLES);this.klass.populateSelect(this._elements._country,this.klass.COUNTRIES)},_updateAddresses:function(B,A){Ojay.HTTP.GET(this.klass.INDEX_URL,{},{onSuccess:function(C){var D=C.parseJSON(),E=D.addresses;if(D.error){return }this._elements._list.setContent("");this._addresses=E.map(function(G){var F=new this.klass.Address(this,G);this._elements._list.insert(F.getHTML());return F},this);if(this._addresses[0]){this.load(this._addresses[0])}B.call(A||null)}.bind(this)})},show:function(){this._updateAddresses(function(){this._mask.show("fade");this._overlay.center().show("fade")},this)},hide:function(){this._mask.hide("fade");this._overlay.hide("fade");this.notifyObservers("close")},addAddress:function(B){var A=new this.klass.Address(this,new Checkout.Address({addressName:"New address"}));this._addresses.push(A);this._elements._list.insert(A.getHTML());this.load(A,B)},getAddresses:function(){return this._addresses.map("_address")},load:function(A,B){if(this._activeAddress){this._activeAddress.unload()}this._activeAddress=A;A.load();if(B!==false){Checkout.Address.FIELDS.forEach(function(D){var C=this._elements["_"+D];if(!C){return }Ojay.Forms.setValue(C,A._address[D])},this)}this._elements._addressName.focus()},save:function(){if(!this._activeAddress){this.addAddress(false)}var B={};Checkout.Address.FIELDS.forEach(function(D){var C=this._elements["_"+D];if(!C){return }B[D]=(C.node||C).value},this);var A=new Checkout.Address(B);this._elements._save.node.value="Saving...";this._activeAddress.save(A,function(){this._elements._save.node.value="Save"},this)},destroy:function(A){A.destroy(function(){var B=this._addresses.indexOf(A);this._addresses.splice(B,1);A.getHTML().remove()},this)}}),CardHelper:new JS.Class({extend:{CONTAINER_CLASS:"card-helper",INNER_CLASS:"image",MAESTRO_ONLY:["othercommerce/ExpressBasket.payment.issueNumber","Dothercommerce/ExpressBasket.payment.startDate:MONTH","Dothercommerce/ExpressBasket.payment.startDate:YEAR"],FIELD_CONTAINER:".opc-fieldcol"},initialize:function(B,A){this._form=Ojay(B);this._container=Ojay(A);this._select=this._container.descendants("select");this._container.insert(this.getHTML());this._maestroFields=Ojay(this.klass.MAESTRO_ONLY.map(function(C){return Checkout.getInputs(this._form,C).node},this)).ancestors(this.klass.FIELD_CONTAINER);this._maestroFields.setStyle({overflow:"hidden"});this._width=this._maestroFields.getWidth();this._isMaestro=true;this._select.on("change")._(this).update();this.update()},getHTML:function(){if(this._html){return this._html}this._html=Ojay.HTML.div({className:this.klass.CONTAINER_CLASS},function(A){this._image=Ojay(A.div({className:this.klass.INNER_CLASS}))}.bind(this));return this._html},update:function(){var A=this._select.node.value;A=A.match(/[a-z]+/ig).pop().toLowerCase();this._image.setClass(this.klass.INNER_CLASS+" "+A);var B=(A=="switch");if(B!=this._isMaestro){this._maestroFields.animate({width:{to:B?this._width:0},opacity:{to:B?1:0}},0.4)._(function(){this[B?"show":"hide"]()})}this._isMaestro=B}})};$.onDOMReady(function(){Ojay("a").forEach(function(A){A.node.hideFocus=true;if(A.hasClass("new-window")){A.node.target="_blank";var B=A.node.title;A.node.title=B?B+" (Opens in a new window)":"This link opens in a new window"}})});function panel(B,D,C){var A=(typeof D=="function");C=C||Ojay.HTML;return C.div({className:"panel "+B},function(F){var E=F.div({className:"panel-c"},function(G){G.div({className:"panel-t"});if(A){D(G)}});if(!A){Ojay(E).insert(D,"bottom")}F.div({className:"panel-b"},function(G){G.div()})})}var Panel=new JS.Class({initialize:function(A,C,B){this._classes=A;this._block=C;this._HTML=B;this.getHTML()},getHTML:function(){if(this._html){return this._html}var B=this,C=B._classes,E=B._block,D=B._HTML;var A=(typeof E=="function");D=D||Ojay.HTML;this._html=Ojay(D.div({className:"panel"+(C?" "+C:"")},function(F){F.div({className:"panel-c"},function(G){G.div({className:"panel-t"});B._content=Ojay(G.div(function(H){if(A){E(H)}}))});if(!A){B._content.insert(E,"bottom")}F.div({className:"panel-b"},function(G){G.div()})}));return this.getHTML()},setContent:function(){this._content.setContent.apply(this._content,arguments);return this},insert:function(){this._content.insert.apply(this._content,arguments);return this}});var tabs=function(C){var D=Ojay(C),A,B=Ojay(Ojay.HTML.ul(function(E){A=D.map(function(H,G){var F=Ojay(E.li(H.children("h2").hide().node.innerHTML));F.on("click",function(){A.forEach({removeClass:"selected"});F.addClass("selected");D.hide().at(G).show()});return F})}));D.hide();A[0].addClass("selected");D.at(0).show().insert(B,"before")};Ojay.onDOMReady(function(){var D=new Ojay.ContentOverlay({width:800,height:280});var A=new Panel("drop-shadow-panel");D.insert(A.getHTML());var B=Ojay(Ojay.HTML.div({className:"close-button"},"Close"));B.on("click")._(D).hide("zoom");D.getContainer().insert(B,"top");Ojay(".share-this-page, .page-tools").on("click",function(E,F){F.stopDefault();Ojay.HTTP.GET(E.node.href).insertInto(A)._(D).center().show("zoom")});var C=new PanelOverlay({width:900});Ojay(".basket-form").on("submit",function(E,G){G.stopDefault();var F=Ojay.Forms.getData(E);Ojay.HTTP.POST(E.node.action,F).insertInto(C).evalScripts()._(C).fitToContent().center().show("fade")});Ojay(".related-images").forEach(ImageGallery.method("fromHTML"))});function addToBookmarks(B,A){if((navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)>=4)){window.external.AddFavorite(B,A)}else{if(navigator.appName=="Netscape"){window.sidebar.addPanel(A,B,"")}else{alert("To bookmark this page, press CTRL-D, if using Netscape, or CTRL-T ,if using Opera.")}}}Ojay.onDOMReady(function(){var C=new Ojay.ContentOverlay({width:700,height:420}),A=new Panel("drop-shadow-panel"),B=Ojay(Ojay.HTML.div({className:"close-button"},"Close"));C.insert(A.getHTML());B.on("click")._(C).hide("fade");C.getContainer().insert(B,"top");C.setContent(A.getHTML());Ojay("a.video").on("click",function(D,E){E.stopDefault();Ojay.HTTP.GET(D.node.href).insertInto(A).evalScripts()._(C).center().show("fade")})});PanelOverlay=new JS.Class(Ojay.ContentOverlay,{initialize:function(B){this._panel=new Panel("drop-shadow-panel");var A=Ojay(Ojay.HTML.div({className:"close-button"},"Close"));this.callSuper();this.getContainer().insert(A,"top");A.on("click")._(this).hide("fade");this.getContentElement().insert(this._panel.getHTML())},setContent:function(){this._panel.setContent.apply(this._panel,arguments);return this},insert:function(){this._panel.insert.apply(this._panel,arguments);return this}});SelectSpinner=new JS.Class({extend:{hideItem:function(B){var A=Ojay(Ojay.HTML.span());B.insert(A,"before");A.insert(B);A.setStyle({position:"relative"});B.setStyle({position:"absolute",left:"-5000px"})}},initialize:function(A){this._select=Ojay(A);this._elements={};this._values=this.getValues();this._pointer=0;this._select.insert(this.getHTML(),"after");this.klass.hideItem(this._select);this._updateDisplay()},getHTML:function(){var A=this,B=A._elements;if(B._container){return B._container}B._container=Ojay.HTML.span({className:"select-spinner"},function(C){B._down=Ojay(C.span({className:"down"},"Down"));B._display=Ojay(C.span({className:"display"}));B._up=Ojay(C.span({className:"up"},"Up"))});B._down.on("click")._(this).down();B._up.on("click")._(this).up();return this.getHTML()},getValues:function(){return this._select.children("option").map(function(A){return Number(A.node.value)||0})},down:function(){if(this._pointer>0){this._pointer-=1}this._updateDisplay()},up:function(){if(this._pointer<this._values.length-1){this._pointer+=1}this._updateDisplay()},_updateDisplay:function(){var A=this._values[this._pointer];this._elements._display.setContent(String(A));Ojay.Forms.setValue(this._select,A||"null")}});function wkCalcDayOfWeek(F){var E=F.name.substring(0,F.name.indexOf(":"));var D=F.form;var H=D.elements[E+":YEAR"];var A=D.elements[E+":MONTH"];var G=D.elements[E+":DAY"];var B=D.elements[E+":LOCAL_WEEKDAY"];var C=new Date(H.value,A.value-1,G.value).getDay();if(C==0){C=7}wkSetSelect(B,C)}function wkCalcDateOffset(G){var A=G.name.substring(0,G.name.indexOf(":"));var B=G.form;var F=B.elements[A+":YEAR"];var C=B.elements[A+":MONTH"];var E=B.elements[A+":DAY"];var J=B.elements[A+":LOCAL_WEEKDAY"];var D=new Date(F.value,C.value-1,E.value);var I=J.value-D.getDay();var H=new Date(D.getFullYear(),D.getMonth(),(D.getDate()+I));wkSetSelect(F,H.getFullYear());wkSetSelect(C,H.getMonth()+1);wkSetSelect(E,H.getDate())}function wkSetToToday(F){var E=F.name.substring(0,F.name.indexOf(":"));var D=F.form;var H=D.elements[E+":YEAR"];var A=D.elements[E+":MONTH"];var G=D.elements[E+":DAY"];var C=D.elements[E+":LOCAL_WEEKDAY"];var B=new Date();wkSetSelect(H,B.getFullYear());wkSetSelect(A,B.getMonth()+1);wkSetSelect(G,B.getDate());wkCalcDayOfWeek(H)}function wkClearDate(E){var D=E.name.substring(0,E.name.indexOf(":"));var C=E.form;var G=C.elements[D+":YEAR"];var A=C.elements[D+":MONTH"];var F=C.elements[D+":DAY"];var B=C.elements[D+":LOCAL_WEEKDAY"];wkSetSelect(G,"null");wkSetSelect(A,"null");wkSetSelect(F,"null");wkSetSelect(B,"-1")}function wkClearTimestamp(E){var D=E.name.substring(0,E.name.indexOf(":"));var C=E.form;var H=C.elements[D+":YEAR"];var A=C.elements[D+":MONTH"];var G=C.elements[D+":DAY"];var F=C.elements[D+":MINUTE"];var B=C.elements[D+":HOUR"];wkSetSelect(H,"null");wkSetSelect(A,"null");wkSetSelect(G,"null");wkSetSelect(F,"null");wkSetSelect(B,"null")}function wkSetTimestampToNow(K){var B=K.name.substring(0,K.name.indexOf(":"));var D=K.form;var J=D.elements[B+":YEAR"];var E=D.elements[B+":MONTH"];var I=D.elements[B+":DAY"];var F=D.elements[B+":MINUTE"];var G=D.elements[B+":HOUR"];var L=new Date();var M=L.getMinutes();var A=Math.round(M/5);var H=A*5;var C=M-H;M=M-C;wkSetSelect(J,L.getFullYear());wkSetSelect(E,L.getMonth()+1);wkSetSelect(I,L.getDate());wkSetSelect(F,M);wkSetSelect(G,L.getHours())}function wkSetSelect(A,C){for(var B=0;B<A.length;B++){A[B].value;if(A[B].value==C){A.selectedIndex=B;return }}}
