/* Given two linked comma-separated strings containing parameter |
names and values for an applet, return the corresponding HTML */ |
function commaseparated(appletpname,appletpvalue) { |
var stop = appletpname.lastIndexOf(','); // last comma |
if( appletpname.length <= 0 ) |
stop = -2; // length is property of String object |
index = -1; |
var ct = 0; // this is a precaution |
var jndex1 = 0; |
var jndex = -1; |
while( index <= stop) { // scan through commas |
index1 = appletpname.indexOf(',', index+1); // next comma |
if (index1 < 0 ) index1 = appletpname.length; // no more commas |
++ct; |
if ( ct > 20 ) break; |
jndex1 = appletpvalue.indexOf(',', jndex+1); |
if ( jndex1 < 0 ) jndex1 = appletpvalue.length; |
// Extract the stuff between commas |
var grab1 = appletpname.substring(index+1, index1); |
var grab2 = appletpvalue.substring(jndex+1, jndex1); |
var tag = '<param name=' + grab1 + ' value="' + grab2 + '">'; |
top.document.writeln(tag); |
index = index1; |
jndex = jndex1; |
} |
} |