function PopWindow(my_url) { var NewWindow; NewWindow=window.open(my_url,"","width=800,height=600,top=0,left=0,location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=yes"); NewWindow.focus(); } function InvoiceWindow(my_url) { var NewWindow; NewWindow=window.open(my_url,"","width=800,height=600,top=0,left=0,location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=no"); NewWindow.focus(); } function CommonUnselect(my_id) { my_object=document.getElementById(my_id) my_length=my_object.options.length for (i=0;i=0) myvalue=formname.elements[i].selectedIndex+1; mytype=mytype+"--"+myvalue; current_value=current_value+myname+"="+mytype+";"; break; break; case 'radio': mytype=mytype+"--"+formname.elements[i].checked; current_value=current_value+myname+"="+mytype+";"; break; */ } } for (j = 1; j < arguments.length; j++) { id_name=arguments[j]; my_field=document.getElementById(id_name); my_field.value=''; } } function check_date_time(a) { a=trim_string(a); var err=0 if (a.length <10) err=1 if (err==0) { d = a.substring(0, 2) // day e = a.substring(2, 3) // '/' b = a.substring(3, 5) // month c = a.substring(5, 6) // '/' f = a.substring(6, 10) // year l = a.length //basic error checking if (b<1 || b>12) err = 2 if (c != '/') err = 3 if (d<1 || d>31) err = 4 if (e != '/') err = 5 if (f<1996 || f>2015) err = 6 //if (l!=19) err=7 //advanced error checking // months with 30 days if (b==4 || b==6 || b==9 || b==11) { if (d==31) err=8 } // february, leap year if (b==2) { // feb var g=parseInt(f/4) if (isNaN(g)) { err=9 } if (d>29) err=10 if (d==29 && ((f/4)!=parseInt(f/4))) err=11 } } if (err>0) { alert('Invalid date input!(dd/mm/yyyy)(1996-2015) Error: '+err); return 0; } else { return 1; } } // End of check_data_time(); function mousedown_handler(mouse_event) { // This is the message that will appear var no_right_click = "Sorry, right-clicking is not allowed!" if (document.all) { //Probably Internet Explorer 4 and later if (event.button == 2 || event.button == 3) { alert(no_right_click) return false } } else if (document.getElementById) { // Probably Netscape 6 and later if (mouse_event.which == 3) { alert(no_right_click) return false } } else if (document.layers) { // Probably Netscape 4 if (mouse_event.which == 3) { alert(no_right_click) return false } } }//End of mousedown_handler(mouse_event) /* if (document.all) { } else if (document.getElementById) { document.captureEvents(Event.MOUSEDOWN) } else if (document.layers) { document.captureEvents(Event.MOUSEDOWN) } document.onmousedown = mousedown_handler */ function GlobalScrollTo(my_id) { my_object=document.getElementById(my_id) my_length=my_object.options.length for (i=0;i function KeepShopping() { var url=""; url="category.php?category_ID="+document.shopping_cart.category_ID.value; location.href=url; } function POPSmallWindow(my_url,width,height) { var NewWindow; my_left=(screen.availWidth-width)/2; my_top=(screen.availHeight-height)/2; NewWindow=window.open(my_url,"","width="+width+",height="+height+",top="+my_top+",left="+my_left+",location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=yes"); NewWindow.focus(); } function popup(url,width,height) { var popup = window.open(url, '_blank', 'width='+width+',height='+height+',scrollbars=1,resizable=1,status=1'); if (!popup.opener) popup.opener = self; popup.focus(); } function setCheckboxesRange(the_form, do_check, basename, min, max) { for (var i = min; i < max; i++) { if (typeof(document.forms[the_form].elements[basename + i]) != 'undefined') { document.forms[the_form].elements[basename + i].checked = do_check; } if (typeof(document.forms[the_form].elements[basename + i + 'r']) != 'undefined') { document.forms[the_form].elements[basename + i + 'r'].checked = do_check; } } return true; } var newwindow_packman = ''; function PopUpPackman(url) { if (!newwindow_packman.closed && newwindow_packman.location) { newwindow_packman.location.href = url; } else { newwindow_packman=window.open(url,'name','height=700,width=900,menubar=1,scrollbars=yes,resizable=yes,status=yes'); if (!newwindow_packman.opener) newwindow_packman.opener = self; } if (window.focus) {newwindow_packman.focus()} return false; } function DisplayDiv(my_id) { //Display first div my_div=document.getElementById(my_id); if (my_div) { my_div.style.display='block'; } //Hide other divs for (j = 1; j < arguments.length; j++) { HideDiv(arguments[j]); } } function ToggleDiv(my_id,link_id) { my_div=document.getElementById(my_id); my_link=document.getElementById(link_id); //alert(my_link.onmouseover); if (my_div.style.display=='none') { my_div.style.display='block'; } else { my_div.style.display='none'; } } function HideDiv(my_id) { my_div=document.getElementById(my_id); if (my_div) my_div.style.display='none'; } function SetClass(my_id,class_name) { my_div=document.getElementById(my_id); if (my_div) { my_div.className=class_name; } } function Tab(tab_index,number_tabs,tab_header_prefix,tab_prefix) { var my_string=''; for (i=0;i<=number_tabs;i++) { if (i==tab_index) SetClass('tab_header_'+i,'tab_active'); else SetClass('tab_header_'+i,'tab_inactive'); } if (tab_index==0) { for(i=1;i<=number_tabs;i++) DisplayDiv(tab_prefix+i); //display all tabs } else { for(i=1;i<=number_tabs;i++) { if (i==tab_index) DisplayDiv(tab_prefix+i); else HideDiv(tab_prefix+i); } } } function AddOption(control_name,my_text,my_value) { eval('new_index=document.'+control_name+'.options.length'); eval('document.'+control_name+'.options[new_index]=new Option("'+my_text+'","'+my_value+'",true,true)'); } function RadioButtonToggleTextFields(my_value,id_1,id_2) { for (j = 1; j < arguments.length; j++) { id_name=arguments[j]; my_field=document.getElementById(id_name); if (my_value==1) { my_field.readOnly=false; my_field.className='text-input'; } else { my_field.readOnly=true; my_field.className='text-input-readonly'; } } } function CheckboxToggleDivs(my_value,checkbox_id) { check=document.getElementById(checkbox_id); for (j = 2; j < arguments.length; j++) { id_name=arguments[j]; my_div=document.getElementById(id_name); if (check.checked==my_value) { my_div.style.display='block'; } else { my_div.style.display='none'; } } } function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function SetOptions(source_object,do_check) { var selectCount = source_object.length; for (var i = 0; i < selectCount; i++) { source_object.options[i].selected =do_check ; } } function SelectCopy(div_id) { if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion >= "4.0") { //alert(document.all.length); /* for (i=0; i