/*-- //
 copyright 2010 www.yogajourney.com / written by kp Creation
// --*/

slide     = new Array(22);
href      = new Array(22);

// bw:
slide[0]  = 'slide_bw_meditation.png';      href[0]  = '#';
slide[1]  = 'slide_bw_trees.png';           href[1]  = '#';
slide[2]  = 'slide_bw_lookout.png';         href[2]  = '#';

// color:
slide[3]  = 'slide_beach_4.png';            href[3]  = '#';
slide[4]  = 'slide_beach_sunset.png';       href[4]  = '#';
slide[5]  = 'slide_buddha_1.png';           href[5]  = '#';
slide[6]  = 'slide_green_leaves.png';       href[6]  = '#';
slide[7]  = 'slide_hip_hop.png';            href[7]  = 'adventures.html';
slide[8]  = 'slide_humorous_1.png';         href[8]  = 'aboutYoga.html';
slide[9]  = 'slide_pool_1.png';             href[9]  = 'schedule_workshop.html';
slide[10] = 'slide_pose_1.png';             href[10] = '#';
slide[11] = 'slide_scenery_1.png';          href[11] = '#';
slide[12] = 'slide_scenery_2.png';          href[12] = '#';
slide[13] = 'slide_scenery_3.png';          href[13] = '#';
slide[14] = 'slide_student_1.png';          href[14] = 'testimonial.html';
slide[15] = 'slide_studio_2.png';           href[15] = '#';
slide[16] = 'slide_studio_outdoor.png';     href[16] = '#';
slide[17] = 'slide_tatami_room.png';        href[17] = '#';
slide[18] = 'slide_travel_1.png';           href[18] = 'adventures.html';
slide[19] = 'slide_yoga_on_the_beach.png';  href[19] = 'schedule_classes.html';
slide[20] = 'slide_zen_forest.png';         href[20] = '#';
slide[21] = 'slide_zen_garden.png';         href[21] = '#';

/*
    <li style="margin-left: -960px; float: left;"><a href="#">
        <img src="images/slideshow/slider_studio_2.png" alt="slide4">
    </a></li>
    <li style="float: left;"><a href="#">
        <img src="images/slideshow/slider_bw_trees.png" alt="slide2">
    </a></li>
    <li style="float: left;"><a href="#">
        <img src="images/slideshow/slider_bw_meditation.png" alt="slide2">
    </a></li>
    <li style="float: left;"><a href="#">
        <img src="images/SLIDER4.png" alt="slide3">
    </a></li>
 */
 
function randomslideshow(howmany) {
	var maximum = slide.length;
	var chosen  = '';						    // used to make sure that no duplicate slide
	var tmp     = '';
	for(var i=1; i<=howmany; i++) {
		index = Math.floor(Math.random() * maximum);
		index = index + '';					    // convert number to string
		while (chosen.indexOf(index) != -1)		// indexOf expects string as parameter, not number
		{
			index = Math.floor(Math.random() * maximum);
			//alert('index=' + index);
			index = index + '';
		}
        tmp += '<li style="float: left;">'
        //tmp += '    <a href="#">'
        tmp += '    <a href="' + href[index] + '">'
        tmp += '        <img src="images/slideshow/' + slide[index] + '" alt="slide' + index + '">';
        tmp += '    </a>';
        tmp += '</li>';

		if (chosen == '')
		{
			chosen = index;
		}
		else 
		{
			chosen = chosen + ',' + index;
		}
	
	}
    tmp += '<li style="float: left;"><a href="#"><img src="images/spacer.gif" alt="slideblank"></a></li>';
	document.write(tmp);
	//alert(tmp);
} 
 

