function submit_action(action) { document.jsform1.action.value=action; document.jsform1.submit(); } function reset() { document.jsform1.reset(); } function submit_action2(action) { document.jsform2.action.value=action; document.jsform2.submit(); } function reset2() { document.jsform2.reset(); } function submit_window_action(action) { document.jsform1.action.value=action; document.jsform1.submit(); window.close(); } function submit_sub_action2(sub_action) { document.jsform1.sub_action.value=sub_action; document.jsform1.submit(); } function submit_sub_action3(action, sub_action) { document.jsform1.action.value=action; document.jsform1.sub_action.value=sub_action; document.jsform1.submit(); } function submit_sub_action(obj,subaction,key,value) { document.jsform1.object.value=obj; document.jsform1.sub_action.value=subaction; document.jsform1.key.value=key; document.jsform1.value.value=value; document.jsform1.submit(); } function submit_serv_sub_action(obj,action,subaction,key,value) { document.jsform1.object.value=obj; document.jsform1.action.value=action; document.jsform1.sub_action.value=subaction; document.jsform1.key.value=key; document.jsform1.value.value=value; document.jsform1.submit(); } /** * The below functions are tailor-made for customized contact us form submission. Two extra arrays are added for special feature management * * 1.exfields is a 2D array used to house additional field references to customized * contact us info. Upon submission, such additional fields will be concat to MSG textarea element * Each array element stores the name and the caption of one extra field * For each extra field, * Element 0 - Fieldname * Element 1 - Caption of the field * 2.nnfields is also a 2D array used to house the mandatory fields for which the visitor has to be filled before submission * Upon submission, the program will first to check whether all the stated mandatory fields are filled or not. * if not so, an alert dialog will display to remind the visitor. * Each array element stores the name and the caption of one mandatory field * For each mandatory field, * Element 0 - Fieldname * Element 1 - Caption of the field */ var exfields=new Array(); var nnfields=new Array(); function addExtraField(name,caption) { exfields[exfields.length]=[name,caption]; } function addMandatoryField(name,caption) { nnfields[nnfields.length]=[name,caption]; } function submit_contactus(obj,action,key,value) { var err=''; for (var i=0;imax) err+=(cnt++)+'. '+ilist[j].product_name+' - Available qty is '+max+'\n'; break; } } } return err; } function custom_odrform_step1(){ var of=document.orderform; if(of.exec.value!='step2')return; /* dedicated for shop_id=35067 to hide expected delivery date input */ if(of.shop_id.value==35067){ var o=of.delivery_date; if(!o)return; while((o=o.parentNode)!=null) if(o.tagName.toUpperCase()=='TR')break; o.style.display='none'; } } function custom_odrform_step2(){ var of=document.orderform; if(of.exec.value!='step3')return; /* dedicated for shop_id=35067 to default at minimal charge option */ if(of.shop_id.value==35067){ if(dcharge.length==0)return; var ptr=0,chg=999999; for(var i=0;i