$(document).ready(function(){

   $("div.slideshow_holder").each( function(img){
	
	var id = $(this).attr( "id" );
	var id_e = id.split( "-" );
	var type  = id_e[0];
	var id = id_e[1];
	var width = 460;
	var height = 400;
	var slideshow = 'slideshow.swf';
     	if( type == 'gallery' ){
		slideshow = 'slideshow-gallery.swf';
	} 
		
      var swfObject  = '/_r/swf/'+slideshow;  // Default to small (one col). There's a different swf if it's the medium size (2 col)
      
      
   	var html = '<object width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" data="'+swfObject+'" style="visibility: visible;">';			
   	html += '      <param value="true" name="allowFullScreen">';
   	html += '      <param value="xmlfile=http://www.usu.co.nz/_ssp/images.php?'+type+'='+id+'&xmlfiletype=Director" name="flashvars">';
   	html += '   </object>';
   	
      $(this).html( html );
	});
});

