What I want is a loop that will call the same function until it reaches a certain number (let's say 10). Then I want the function to take the parameter passed (the number) and use it in the function where ever you see a 1 below. Basically I want it to run on each element of the pub_name array and from the info gathered define a variable based on the number (example: display_pub_name_*). I have run some tests, but I'm a little rusty and I must have the systax messed up. Any help is appreciated.

-Michael

check_name_length();

function check_name_length ()
{
if (pub_name[1].length > 30)
{display_pub_name_1 = pub_name[1].substring(0,27) + "<b>...</b>";}
else
{display_pub_name_1 = pub_name[1];}
}