Javascript array HELP!!!!!

I am using FANCYBOX for a simple image galley.
I want to hold the images in an array

	albums = {
	  album1 : [ {href: '/assets/images/activity1.jpg#v2'}, {href: '/assets/images/activity1.jpg#v2'}],
	  album2 : [ {href: '/assets/images/activty1.jpg#v2'}, {href: '/assets/images/activity1.jpg#v2'}]

	othertest = [ {href : '/assets/images/activity1.jpg#v2'}, {href : '/assets/images/activity1.jpg#v2'} ]

	$('.album-link').bind('click', function(e){
		var name = $(this).attr('rel');
		$.fancybox(, {});

Open in new window

This code does nothing.

If I put:
            $.fancybox( albums.othertest, {});
it works!

WHY!!!! Must be simple??
Steve TinsleyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve TinsleyAuthor Commented:
forget to show the html

<a href="#" rel="album1" class='album-link'>Album1</a>
<a href="#" rel="album2" class='album-link'>Album2</a>

Open in new window

Robert SchuttSoftware EngineerCommented:
The posted code doesn't seem complete to me (albums.othertest is not defined) but you can try:
$.fancybox( albums[name], {});

Open in new window

This means that albums.album1 or albums.album2 will be passed to the function depending on the contents of variable name which seems to me is what you are trying to achieve.
Prakash SamariyaIT ProfessionalCommented:
Use like
$.fancybox( albums[name], {});

because name contains the value which is equal to album object's property!!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.