OK..
Creating a Ken Burns effect slideshow using Tobia Conforto's CrossSlide (can be found here: http://www.gruppo4.com/~tobia/cross-slide.shtml) EXCELLENT script!

Using it on a page in a database display where each record can have up to 30 images. The script runs perfectly when the record displayed has ALL 30 images loaded.. However, if the record has less than all 30 loaded the script breaks. The "if" statement leaves behind an end curly brace where no image is loaded..

I've tried several ways around it.. and have gotten nowhere. HELP!

The "$data[data.mainpic]" statements are actually calling the image from the database. I show the script before and after it's ran...

before:
Code:
<script type='text/javascript' id='source-test3'>//<![CDATA[
$(function() {
$('#test3').crossSlide({
  fade: 1
}, [
  $if ($data[data.mainpic]) {
  {
    src:  '$data[data.mainpic]', 
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  } }
  $if ($data[data.pic2]) {, {
    src:  '$data[data.pic2]',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }  }
  $if ($data[data.pic3]) {, {
    src:  '$data[data.pic3]',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }}
  $if ($data[data.pic4]) {, {
    src:  '$data[data.pic4]',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }}
  $if ($data[data.pic5]) {, {
    src:  '$data[data.pic5]',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }}
  $if ($data[data.pic6]) {, {
    src:  '$data[data.pic6]',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }}
  $if ($data[data.pic7]) {, {
    src:  '$data[data.pic7]',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }}
  $if ($data[data.pic8]) {, {
    src:  '$data[data.pic8]',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }}
  $if ($data[data.pic9]) {, {
    src:  '$data[data.pic9]',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }}
  $if ($data[data.pic10]) {, {
    src:  '$data[data.pic10]',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }}
  $if ($data[data.pic11]) {, {
    src:  '$data[data.pic11]',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }}
  $if ($data[data.pic12]) {, {
    src:  '$data[data.pic12]',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }}
  $if ($data[data.pic13]) {, {
    src:  '$data[data.pic13]',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }}
  $if ($data[data.pic14]) {, {
    src:  '$data[data.pic14]',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }}
  $if ($data[data.pic15]) {, {
    src:  '$data[data.pic15]',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }}
  $if ($data[data.pic16]) {, {
    src:  '$data[data.pic16]',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }}
  $if ($data[data.pic17]) {, {
    src:  '$data[data.pic17]',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }}
  $if ($data[data.pic18]) {, {
    src:  '$data[data.pic18]',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }}
  $if ($data[data.pic19]) {, {
    src:  '$data[data.pic19]',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }}
  $if ($data[data.pic20]) {, {
    src:  '$data[data.pic20]',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }}
  $if ($data[data.pic21]) {, {
    src:  '$data[data.pic21]',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }}
  $if ($data[data.pic22]) {, {
    src:  '$data[data.pic22]',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }}
  $if ($data[data.pic23]) {, {
    src:  '$data[data.pic23]',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }}
  $if ($data[data.pic24]) {, {
    src:  '$data[data.pic24]',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }}
  $if ($data[data.pic25]) {, {
    src:  '$data[data.pic25]',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }}
  $if ($data[data.pic26]) {, {
    src:  '$data[data.pic26]',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }}
  $if ($data[data.pic27]) {, {
    src:  '$data[data.pic27]',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }}
  $if ($data[data.pic28]) {, {
    src:  '$data[data.pic28]',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }}
  $if ($data[data.pic29]) {, {
    src:  '$data[data.pic29]',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }}
  $if ($data[data.pic30]) {, {
    src:  '$data[data.pic30]',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }}
]);
});
//]]></script>
After:
Code:
<script type='text/javascript' id='source-test3'>//<![CDATA[
$(function() {
$('#test3').crossSlide({
  fade: 1
}, [
  
  {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/mainpic/FrontPassengerSide1044x783.jpg', 
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic2/FrontDriverSide1044x783.jpg',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic3/FrontGrill1044x783.jpg',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic4/Rear1044x783.jpg',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic5/RearDriverSide1044x783.jpg',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic6/RearPassengerSide1044x783.jpg',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic7/DriveSideExterior1044x783.jpg',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic8/PassengerSide1044x783.jpg',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic9/FrontSeats1044x783.jpg',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic10/BackSeats1044x783.jpg',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic11/Dashoverview1044x783.jpg',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic12/2keysandkeyfobs1044x783.jpg',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic13/driversidedoor21044x783.jpg',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic14/passengersidedoor1044x783.jpg',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic15/VIN1044x783.jpg',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic16/ownersmanuals1044x783.jpg',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic17/trunk11044x783.jpg',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic18/trunk21044x783.jpg',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic19/wheel11044x783.jpg',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic20/wheel21044x783.jpg',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic21/wheel31044x783.jpg',  
    from: '100% 80% 1x',
    to:   '100% 0% 1.7x',
    time: 3
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic22/wheel41044x783.jpg',  
    from: 'top left',
    to:   'bottom right 1.5x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic23/calibrepaperwork1044x783.jpg',  
    from: '100% 80% 1.5x',
    to:   '80% 0% 1.1x',
    time: 2
  }
  , {
    src:  'http://www.websitesfordealers.com/uploads/data/246629/pic24/exterior1044x783.jpg',  
    from: '100% 50%',
    to:   '30% 50% 1.5x',
    time: 2
  }
   }
  }
      }
      }
      }
    }
  
]);
});
//]]></script>