$(document).ready(function() { $('#content .learn-more a').click(function() { window.firstLoad = false; getAndOpenSwf($(this)); return false; }); }); function getFlexApp(appName) { if (navigator.appName.indexOf ('Microsoft') !=-1) { return window[appName]; } else { return document[appName]; } } function flashSeasonPageReady() { getFlexApp('ImgVidTxt').loadFirstImage(); } function alertThis(something) { alert(something); } function getAndOpenSwf($clicked) { var $openSwf = $('#content .swf-show').eq(0); var openSwfId = $openSwf.attr('id'); var clickedDivID = $clicked.parent().parent().parent().attr('id'); var newSwfId = clickedDivID + '-swf'; if (openSwfId == newSwfId) { $openSwf.slideToggle('fast'); return false; } var xmlID = $clicked.attr('rel'); if (xmlID == '') {xmlID = 1;} var $show = $('#'+clickedDivID); $openSwf.slideUp('fast', function() { var thisHTML = callSWF('getShow',xmlID,0); $openSwf.html(thisHTML); $openSwf.clone() .appendTo($show) .attr('id',newSwfId) .attr('rel',clickedDivID) .css({'border':'1px solid #032E59','height':'0px'}) .animate({height: '255px'}, 400); $('#'+openSwfId).remove(); }); }