function dynmicSlider(){
    document.write('<ul id="mycarousel" class="jcarousel jcarousel-skin-tango">');
    var title = '';
    if (!(galleryarray.length)) {
        slider();
    }
    for(i=0;i<galleryarray.length;i++){
        title =  galleryarray[i];
        url   =  galleryarray[i];

        url =  url.replace(/.jpg/gi,"");
        url =  url.replace(/.png/gi,"");
        url =  url.replace(/.gif/gi,"");
        url =  url.replace(/.jpeg/gi,"");

        
        title =  title.replace(/-/gi," ");
        title =  title.replace(/.jpg/gi,"");
        title =  title.replace(/.png/gi,"");
        title =  title.replace(/.gif/gi,"");
        title =  title.replace(/.jpeg/gi,"");
        title =  title.toUpperCase();
        //alert(title);
        document.write('    <li><a HREF="'+subdir+url+'.html">');
        document.write('       <img src="http://www.6london.com/'+imgpath+'/'+galleryarray[i]+'" width="150" height="101" border="0" alt="'+title+'" />');
        document.write('       </a><br /><a HREF="'+subdir+url+'.html" class="slider-link">'+title+'</a>');
        document.write('    </li>');
    }
    document.write('</ul>');
}

function slider()
{  
    document.write('<ul id="mycarousel" class="jcarousel jcarousel-skin-tango">');
    document.write('    <li><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/caesars-palace.html">');
    document.write('       <img src="http://www.flightshotelstours.com/images/slider/ceasers-palace.JPG" width="150" height="101" border="0" alt="Ceasers Palace" />');
    document.write('       </A><BR><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/caesars-palace.html" class="slider-link">Ceasers Palace</A></li>');
    
	document.write('<li><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/bellagio.html">');
    document.write('<img src="http://www.flightshotelstours.com/images/slider/bellagio.JPG" width="150" height="101" border="0" alt="Bellagio" /></A>');
    document.write('<BR><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/bellagio.html" class="slider-link">Bellagio</A>');
    
	document.write('</li><li><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/mgm-grand-hotel-and-casino.html">');
    document.write('<img src="http://www.flightshotelstours.com/images/slider/mgm-hotel.JPG" width="150" height="101" border="0" alt="MGM Grand Hotel and Casino" /></A>');
    document.write('<BR><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/mgm-grand-hotel-and-casino.html" class="slider-link">MGM Grand Hotel and Casino</A>');
    
	document.write('</li><li><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/paris-las-vegas.html">');
    document.write('<img src="http://www.flightshotelstours.com/images/slider/paris-las-vegas.JPG" width="150" height="101" border="0" alt="Paris Las Vegas" /></A>');
    document.write('<BR><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/paris-las-vegas.html" class="slider-link">Paris Las Vegas</A>');

	document.write('</li><li><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/mandalay-bay.html">');
    document.write('<img src="http://www.flightshotelstours.com/images/slider/mandalay-bay.JPG" width="150" height="101" border="0" alt="Mandalay Bay" /></A>');
    document.write('<BR><A HREF="http://www.flightshotelstours.com/las-vegas/las-vegas-hotels/mandalay-bay.html" class="slider-link">Mandalay Bay</A>');
   
    
}

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        vertical: true,
        scroll: 2,
        start:3,
        wrap: 'last'
    });
});
