2 function setupPoints(numberformat, wrongFormat) {
3 decpoint = numberformat.substring((numberformat.substring(1, 2).match(/.|,/) ? 5 : 4), (numberformat.substring(1, 2).match(/.|,/) ? 6 : 5));
4 if (numberformat.substring(1, 2).match(/.|,/)) {
5 thpoint = numberformat.substring(1, 2);
10 wrongformat = wrongFormat;
13 function centerParms(width,height,extra) {
14 xPos = (screen.width - width) / 2;
15 yPos = (screen.height - height) / 2;
17 string = "left=" + xPos + ",top=" + yPos;
20 string += "width=" + width + ",height=" + height;
25 function set_longdescription_window(input_name) {
26 var parm = centerParms(600,500) + ",width=600,height=500,status=yes,scrollbars=yes";
27 var name = document.getElementsByName(input_name)[0].value;
29 "action=set_longdescription&" +
30 "login=" + encodeURIComponent(document.getElementsByName("login")[0].value)+ "&"+
31 "password=" + encodeURIComponent(document.getElementsByName("password")[0].value) + "&" +
32 "path=" + encodeURIComponent(document.getElementsByName("path")[0].value) + "&" +
33 "longdescription=" + escape(document.getElementsByName(input_name)[0].value) + "&" +
34 "input_name=" + escape(input_name) + "&"
35 window.open(url, "_new_generic", parm);
38 function check_right_date_format(input_name) {
39 var decnumbers = input_name.value.split(decpoint);
41 var thnumbers = input_name.value.split(thpoint);
42 if(thnumbers[thnumbers.length-1].match(/.+decpoint$/g)) {
43 thnumbers[thnumbers.length-1] = thnumbers[thnumbers.length-1].substring(thnumbers[thnumbers.length-1].length-1);
45 if(thnumbers[thnumbers.length-1].match(/.+decpoint\d$/g)) {
46 thnumbers[thnumbers.length-1] = thnumbers[thnumbers.length-1].substring(thnumbers[thnumbers.length-1].length-2);
48 if(thnumbers[thnumbers.length-1].match(/.+decpoint\d\d$/g)) {
49 thnumbers[thnumbers.length-1] = thnumbers[thnumbers.length-1].substring(thnumbers[thnumbers.length-1].length-3);
51 for(var i = 1; i < thnumbers.length; i++) {
52 if(!thnumbers[i].match(/\d\d\d/g)) {
53 return show_alert_and_focus(input_name);
55 if(thnumbers[i].match(/.*decpoint.*|.*thpoint.*/g)) {
56 return show_alert_and_focus(input_name);
59 if(decnumbers.length > 2 || (decnumbers.length > 1 ? (decnumbers[1].length > 2) : false)) {
60 return show_alert_and_focus(input_name);
64 if(decnumbers.length > 1 || decnumbers[0].length > 2) {
65 return show_alert_and_focus(input_name);
70 function show_alert_and_focus(input_name) {
72 alert(wrongformat + "\n\r\n\r--> " + input_name.value);