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