function change_frames(frame_num) { appN=navigator.appName; appV=navigator.appVersion; img_name=""; if ((appN.indexOf("Microsoft") !=-1) && (appV.indexOf("Windows")!=-1)) msIE=true else msIE=false; //frame two is directors frame - need hotspots, must use html page extension=(frame_num==2)?".html":".gif"; path=(frame_num==2)?"frames/":"images/fireworks/"; prepath=(frame_num==2)?"":"../" //apparently IE needs different paths depending on wheher it's dealing w/ img or html files if(!msIE) img_name+= path + "frame_" + frame_num + extension + ""; else img_name = prepath + path + "frame_" + frame_num + extension + ""; (frame_num==2)?window.parent.frames['main_frame'].window.location=img_name: window.parent.frames['main_frame'].document.images[0].src=img_name; //loc="frames/frame_" + frame_num + ".html"; //window.parent.frames['main_frame'].location=loc; } function show_hide_class(klass) { d=document.getElementsByTagName('div'); for (i=0; i"; doc_code+="

" + caption_array[img_num] + "

"; doc_code+=""; //alert(img_array[img_num].src); //alert("w=" + width + " h=" + (height + 60)); window_str="width=" + width + ",height=" + (height + 100) + ",left=50,screenX=50,top=10,screenY=10,resizable=yes,directories=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no"; w=window.open("","img_viewer",window_str,"false"); w.document.clear(); w.resizeTo(width,(height + 100)); w.document.write(doc_code); w.document.close(); w.focus(); } //********************************form validation*********************************** invalid=new Boolean(false); err_msg="Please fill in the following fields: \n \n"; function is_null(value) { if(value==null || value=="" || value==" ") return true; else return false; } function add_to_err_msg(field) { if(field.indexOf("x_")!=-1) //field="x_Ship_To_Address field=field.substring(2,field.length); err_msg += field + "\n"; invalid=true; } function validate_form(form_name, required_fields) { var check_name; elements_array=required_fields.split(","); err_msg="Please fill in the following fields: \n \n"; //alert(elements_array.length); for(i=0; i<=elements_array.length-1; i++) { s="document.forms['" + form_name + "'].elements['" + elements_array[i] + "']"; type=eval(s + ".type"); name=eval(s + ".name"); //alert(name + " " + i); if (type=="text" || type=="textarea" || type=="password") { value=eval(s + ".value"); if(is_null(value)) add_to_err_msg(name) else if (!is_null(value) && (name=="cardnumber" || name=="cc_number")) { if (value.indexOf(" ") !=-1 || value.indexOf("-") !=-1) add_to_err_msg(name + " - without spaces or dashes " + "\n"); else { if(value.length==16) { cc_pattern=/\d{16}/; if(!cc_pattern.test(value)) { add_to_err_msg(name + " - not of the correct length or format (no spaces or dashes)" + "\n"); } } else if(value.length==15) { //amex cards are only 15 digits cc_pattern=/\d{15}/; if(!cc_pattern.test(value)) { add_to_err_msg(name + " - not of the correct length or format (no spaces or dashes)" + "\n"); } } else if (value.length !=16) { add_to_err_msg(name + " - not of the correct length or format (no spaces or dashes)" + "\n"); } } } else if(!is_null(value) && name=="zip") { for(j=0;j 1) //group of checkboxes in form { for (j=0; i40) { alert(err_msg); return false; } else return true; }