var selected; 
function init() {
var t = '/portfolio/thumbnails/'; var i;


i = jQuery("<div id='w_167' class='item_wrapper'><img class='item' src='"+t+"/./Mb_CBuilderThumb_112408.gif' title='Career Builder' /></div>").get(0);
jQuery.data(i,"key","online_football_game");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","15,18");	
jQuery.data(i,"cat","40,41,35,36,32,29,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_162' class='item_wrapper'><img class='item' src='"+t+"/./Mb_CDP1Thumb_103008.gif' title='Chicago Diabetes Project' /></div>").get(0);
jQuery.data(i,"key","cdp_web_site");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","21,9");	
jQuery.data(i,"cat","40,35,31,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_159' class='item_wrapper'><img class='item' src='"+t+"/./Mb_Woodia_111708.gif' title='Woodia la Piccolo' /></div>").get(0);
jQuery.data(i,"key","woodia_furniture_site");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","18,12");	
jQuery.data(i,"cat","40,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_147' class='item_wrapper'><img class='item' src='"+t+"/./Mb_ShossBlogThumb1_103108.gif' title='Shoss & Assoc.' /></div>").get(0);
jQuery.data(i,"key","intercultural_talk_blog");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","15,8");	
jQuery.data(i,"cat","40,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_163' class='item_wrapper'><img class='item' src='"+t+"/./Mb_ETA_111708.gif' title='Educational Theater Association' /></div>").get(0);
jQuery.data(i,"key","eta_video_shoot");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","65,8,9");	
jQuery.data(i,"cat","31");
$("#item_slider").append(i);
i = jQuery("<div id='w_142' class='item_wrapper'><img class='item' src='"+t+"/./Mb_SS2Thumb_103008.gif' title='Shakespeare Squared' /></div>").get(0);
jQuery.data(i,"key","shakespeare_squared_site");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","8,11");	
jQuery.data(i,"cat","40,35,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_141' class='item_wrapper'><img class='item' src='"+t+"/./Mb_CKT_111708.gif' title='Chicago Board of Tourism' /></div>").get(0);
jQuery.data(i,"key","chicago_kids_tour");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","18,13");	
jQuery.data(i,"cat","35,32,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_103' class='item_wrapper'><img class='item' src='"+t+"/./Mb_RMCUGuideThumb_103108.gif' title='Rand McNally' /></div>").get(0);
jQuery.data(i,"key","rand_mcnally_user_guide");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","55");	
jQuery.data(i,"ind","8,11");	
jQuery.data(i,"cat","40,35,32,29,30,31,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_158' class='item_wrapper'><img class='item' src='"+t+"/./Mb_PPACThumb2_111708.gif' title='Personal PAC' /></div>").get(0);
jQuery.data(i,"key","ppac_luncheon_videos");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","63");	
jQuery.data(i,"ind","21,9,24");	
jQuery.data(i,"cat","40,41,35,34,29,30,28,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_130' class='item_wrapper'><img class='item' src='"+t+"/./Mb_McDougIntThumb_103108.gif' title='Houghton Mifflin Harcourt' /></div>").get(0);
jQuery.data(i,"key","mcdougal");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","63,64,55");	
jQuery.data(i,"ind","8,11");	
jQuery.data(i,"cat","32,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_107' class='item_wrapper'><img class='item' src='"+t+"/./Mb_DCAThumb_103108.gif' title='DCA Theater' /></div>").get(0);
jQuery.data(i,"key","dca_theater");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","65,13,9");	
jQuery.data(i,"cat","40,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_125' class='item_wrapper'><img class='item' src='"+t+"/./Mb_RMCclassThumb_103108.gif' title='Rand McNally' /></div>").get(0);
jQuery.data(i,"key","classroom_demo_disc");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","8,11");	
jQuery.data(i,"cat","40,35,34,32,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_124' class='item_wrapper'><img class='item' src='"+t+"/./Mb_BookstreamMaryaThumb_103108.gif' title='Bookstream, Inc.' /></div>").get(0);
jQuery.data(i,"key","author_interview_marya_hornbacher");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","65,15,11");	
jQuery.data(i,"cat","41,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_126' class='item_wrapper'><img class='item' src='"+t+"/./Mb_MedelaFreestyleThumb_103108.gif' title='Medela' /></div>").get(0);
jQuery.data(i,"key","medela_freestyle");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","63,64,55,54");	
jQuery.data(i,"ind","18,21");	
jQuery.data(i,"cat","35,34,32,29,31,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_123' class='item_wrapper'><img class='item' src='"+t+"/./Mb_KinderThumbs_103108.gif' title='Kindermusik International' /></div>").get(0);
jQuery.data(i,"key","abc_music_me_dvd");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","8,13");	
jQuery.data(i,"cat","40,41,34,29,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_138' class='item_wrapper'><img class='item' src='"+t+"/./Mb_UpgradeEd_111708.gif' title='Upgrade Education' /></div>").get(0);
jQuery.data(i,"key","upgrade_education_podcasts");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","8,11");	
jQuery.data(i,"cat","40,35,30,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_131' class='item_wrapper'><img class='item' src='"+t+"/./Mb_McDougGlossThumb_103108.gif' title='Houghton Mifflin Harcourt' /></div>").get(0);
jQuery.data(i,"key","houghton_mifflin_harcourt_glossary");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","55");	
jQuery.data(i,"ind","8,11");	
jQuery.data(i,"cat","32,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_122' class='item_wrapper'><img class='item' src='"+t+"/./Mb_RMC_MapThumb_103108.gif' title='Rand McNally' /></div>").get(0);
jQuery.data(i,"key","interactive_history_maps");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","54");	
jQuery.data(i,"ind","8");	
jQuery.data(i,"cat","40,35,32,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_94' class='item_wrapper'><img class='item' src='"+t+"/./Mb_MarketStore_111708.gif' title='The Marketing Store' /></div>").get(0);
jQuery.data(i,"key","the_marketing_store_flash_game_prototypes");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","18,12");	
jQuery.data(i,"cat","36,32");
$("#item_slider").append(i);
i = jQuery("<div id='w_93' class='item_wrapper'><img class='item' src='"+t+"/./Mb_CBGthumb_111708.gif' title='Chicago Botanic Gardens' /></div>").get(0);
jQuery.data(i,"key","chicago_botanic_gardens_educational_dvd");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","55");	
jQuery.data(i,"ind","8,9,11");	
jQuery.data(i,"cat","40,35,34,29,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_92' class='item_wrapper'><img class='item' src='"+t+"/./Mb_NeoThumb_111708.gif' title='Neo-Futurists' /></div>").get(0);
jQuery.data(i,"key","neo_futurists_web_site");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","55");	
jQuery.data(i,"ind","65,13,9");	
jQuery.data(i,"cat","40,35,29,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_91' class='item_wrapper'><img class='item' src='"+t+"/./Mb_scholarThumb_111708.gif' title='Scholarship Chicago' /></div>").get(0);
jQuery.data(i,"key","scholarship_chicago_fundraiser_dvd");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","62");	
jQuery.data(i,"ind","9");	
jQuery.data(i,"cat","40,35,34,29,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_66' class='item_wrapper'><img class='item' src='"+t+"/./Mb_BLKipperThumb2_111708.gif' title='BLKipper Photography' /></div>").get(0);
jQuery.data(i,"key","blkipper_photography_web_site_and_identity");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","62");	
jQuery.data(i,"ind","65");	
jQuery.data(i,"cat","40,35,29,26,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_90' class='item_wrapper'><img class='item' src='"+t+"/./Mb_jlaThumb_111708.gif' title='Judi Lapinsohn' /></div>").get(0);
jQuery.data(i,"key","judi_lapinsohn_holiday_greetings");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","55");	
jQuery.data(i,"ind","15,10");	
jQuery.data(i,"cat","40,35,27,29,26,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_89' class='item_wrapper'><img class='item' src='"+t+"/./Mb_GrottoThumb_111708.gif' title='Grotto on State' /></div>").get(0);
jQuery.data(i,"key","grotto_on_state_web_site");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","55");	
jQuery.data(i,"ind","18,12");	
jQuery.data(i,"cat","40,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_88' class='item_wrapper'><img class='item' src='"+t+"/./Mb_Accenture_111708.gif' title='Accenture/Post Effects' /></div>").get(0);
jQuery.data(i,"key","accenture_post_effects_flash_video_application");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","15,8,10");	
jQuery.data(i,"cat","35,32,29,31,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_87' class='item_wrapper'><img class='item' src='"+t+"/./Mb_AbelsonThumb_111708.gif' title='Abelson Taylor/Alexion' /></div>").get(0);
jQuery.data(i,"key","abelson_taylor_alexion_multi_player_game");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","15,21");	
jQuery.data(i,"cat","36,32");
$("#item_slider").append(i);
i = jQuery("<div id='w_86' class='item_wrapper'><img class='item' src='"+t+"/./Mb_AdvocateThumb_111708.gif' title='Advocate Health Partners' /></div>").get(0);
jQuery.data(i,"key","advocate_health_partners_cbt_module");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","15,8,21");	
jQuery.data(i,"cat","36,32");
$("#item_slider").append(i);
i = jQuery("<div id='w_85' class='item_wrapper'><img class='item' src='"+t+"/./Mb_TrendsighThumb_111708.gif' title='Trendsight' /></div>").get(0);
jQuery.data(i,"key","trendsight_trendsightcom");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","15,11");	
jQuery.data(i,"cat","40,35,26,31,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_84' class='item_wrapper'><img class='item' src='"+t+"/./Mb_ScanlonXmasThumb_103008.gif' title='Scanlon Corporate Communications' /></div>").get(0);
jQuery.data(i,"key","scanlon_corporate_communications_animated_e_mail_announcements");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","15,10");	
jQuery.data(i,"cat","40,35,32,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_83' class='item_wrapper'><img class='item' src='"+t+"/./ppac_web_thumb.jpg' title='Personal PAC' /></div>").get(0);
jQuery.data(i,"key","personal_pac_personalpacorg");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","8,21,9,24");	
jQuery.data(i,"cat","40,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_82' class='item_wrapper'><img class='item' src='"+t+"/./Mb_GayGamesThumb_111708.gif' title='Gay Games Chicago' /></div>").get(0);
jQuery.data(i,"key","gay_games_chicago_opening_ceremonies_content");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","13,14");	
jQuery.data(i,"cat","35,29,28,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_81' class='item_wrapper'><img class='item' src='"+t+"/./Mb_JamProdThumb_111708.gif' title='Jam Productions/Dow Chemical' /></div>").get(0);
jQuery.data(i,"key","jam_productions_dow_chemical_cousteau_edit_and_animated_visuals");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","8,13");	
jQuery.data(i,"cat","35,29,28,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_80' class='item_wrapper'><img class='item' src='"+t+"/./Mb_MedelaThumb_111708.gif' title='Medela' /></div>").get(0);
jQuery.data(i,"key","medela_digital_prototypes_and_simulations");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","8,21");	
jQuery.data(i,"cat","40,32,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_79' class='item_wrapper'><img class='item' src='"+t+"/./Mb_DAKThumb_111708.gif' title='David A. Kipper, PhD, ABPP' /></div>").get(0);
jQuery.data(i,"key","david_a_kipper_phd_abpp_web_site");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","63");	
jQuery.data(i,"ind","8,21");	
jQuery.data(i,"cat","40,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_78' class='item_wrapper'><img class='item' src='"+t+"/./Mb_SEARSThumb_111708.gif' title='Sears' /></div>").get(0);
jQuery.data(i,"key","sears_how_to_measure_cd_rom");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","61");	
jQuery.data(i,"ind","8,12,10");	
jQuery.data(i,"cat","35,32,29,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_77' class='item_wrapper'><img class='item' src='"+t+"/./Mb_RigbyThumb_111708.gif' title='Rigby Education' /></div>").get(0);
jQuery.data(i,"key","rigby_education_educational_software_titles");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","60");	
jQuery.data(i,"ind","8,10");	
jQuery.data(i,"cat","35,36,32,29");
$("#item_slider").append(i);
i = jQuery("<div id='w_76' class='item_wrapper'><img class='item' src='"+t+"/./Mb_ChiFilmThumb_111708.gif' title='Chicago Filmmakers' /></div>").get(0);
jQuery.data(i,"key","chicago_filmmakers_film_festival_trailers");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","61");	
jQuery.data(i,"ind","65,13");	
jQuery.data(i,"cat","40,29,30,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_75' class='item_wrapper'><img class='item' src='"+t+"/./Mb_NewarkThumb1_111708.gif' title='Newark-in-One' /></div>").get(0);
jQuery.data(i,"key","newark_in_one_animated_web_tour");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","62");	
jQuery.data(i,"ind","15,10");	
jQuery.data(i,"cat","40,41,32,29");
$("#item_slider").append(i);
i = jQuery("<div id='w_74' class='item_wrapper'><img class='item' src='"+t+"/./Mb_NewarkThumb_111708.gif' title='Newark-in-One' /></div>").get(0);
jQuery.data(i,"key","newark_in_one_initiative_video");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","60");	
jQuery.data(i,"ind","15,10,16");	
jQuery.data(i,"cat","40,29,30,28,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_72' class='item_wrapper'><img class='item' src='"+t+"/./Mb_MROThumb_111708.gif' title='MRO Software' /></div>").get(0);
jQuery.data(i,"key","mro_software_sales_and_training_tool");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","57");	
jQuery.data(i,"ind","15,10");	
jQuery.data(i,"cat","40,32,29,28,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_71' class='item_wrapper'><img class='item' src='"+t+"/./Mb_Mxm2005Thumb_111708.gif' title='Montgomery Design' /></div>").get(0);
jQuery.data(i,"key","montgomery_design_dvd_authoring");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","61");	
jQuery.data(i,"ind","23,10");	
jQuery.data(i,"cat","34,28");
$("#item_slider").append(i);
i = jQuery("<div id='w_70' class='item_wrapper'><img class='item' src='"+t+"/./Mb_MbOldThumb_111708.gif' title='Mightybytes' /></div>").get(0);
jQuery.data(i,"key","mightybytes_promotional_trailer");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","59");	
jQuery.data(i,"ind","15");	
jQuery.data(i,"cat","40,27,29,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_69' class='item_wrapper'><img class='item' src='"+t+"/./Mb_McDougThumb_111708.gif' title='McDougal Littell' /></div>").get(0);
jQuery.data(i,"key","mcdougal_littell_interactive_product_development");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","63");	
jQuery.data(i,"ind","8,11,10");	
jQuery.data(i,"cat","41,32,29,30,28");
$("#item_slider").append(i);
i = jQuery("<div id='w_68' class='item_wrapper'><img class='item' src='"+t+"/./Mb_LifeFitThumb_111708.gif' title='Life Fitness' /></div>").get(0);
jQuery.data(i,"key","life_fitness_product_launch_promo");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","61");	
jQuery.data(i,"ind","18,21");	
jQuery.data(i,"cat","40,27,32,29,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_67' class='item_wrapper'><img class='item' src='"+t+"/./Mb_RobotixThumb_111708.gif' title='Learning Curve International' /></div>").get(0);
jQuery.data(i,"key","learning_curve_international_childrens_game");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","56");	
jQuery.data(i,"ind","18,13");	
jQuery.data(i,"cat","40,36,32,29,30");
$("#item_slider").append(i);
i = jQuery("<div id='w_65' class='item_wrapper'><img class='item' src='"+t+"/./Mb_JimBeamThumb_111708.gif' title='Jim Beam' /></div>").get(0);
jQuery.data(i,"key","jim_beam_online_games");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","58");	
jQuery.data(i,"ind","18,13");	
jQuery.data(i,"cat","35,36,32,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_64' class='item_wrapper'><img class='item' src='"+t+"/./Mb_GFXThumb_111708.gif' title='GFX International' /></div>").get(0);
jQuery.data(i,"key","gfx_international_sales_tool");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","61");	
jQuery.data(i,"ind","15,12,10");	
jQuery.data(i,"cat","40,35,32,29,28,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_73' class='item_wrapper'><img class='item' src='"+t+"/./Mb_NewarkThumbs3_111708.gif' title='Newark-in-One' /></div>").get(0);
jQuery.data(i,"key","newark_video_sample_software_demo");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","59");	
jQuery.data(i,"ind","15,10,16");	
jQuery.data(i,"cat","40,41,32,29,28,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_63' class='item_wrapper'><img class='item' src='"+t+"/./Mb_ExecPsychThumb_111708.gif' title='ExecPsych' /></div>").get(0);
jQuery.data(i,"key","execpsych_execpsychcom");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","64");	
jQuery.data(i,"ind","8,21");	
jQuery.data(i,"cat","40,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_62' class='item_wrapper'><img class='item' src='"+t+"/./Mb_GFXThumb2_111708.gif' title='GFX International' /></div>").get(0);
jQuery.data(i,"key","gfx_international_driver_video");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","61");	
jQuery.data(i,"ind","15,12,10,16");	
jQuery.data(i,"cat","40,35,29,30,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_60' class='item_wrapper'><img class='item' src='"+t+"/./Mb_ChelseaOThumb_111708.gif' title='Chelsea Olson' /></div>").get(0);
jQuery.data(i,"key","chelsea_olson_skateboarding_video");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","63");	
jQuery.data(i,"ind","13,14");	
jQuery.data(i,"cat","35,29,31");
$("#item_slider").append(i);
i = jQuery("<div id='w_59' class='item_wrapper'><img class='item' src='"+t+"/./Mb_BookStrmThumb_111708.gif' title='Bookstream, Inc.' /></div>").get(0);
jQuery.data(i,"key","bookstream_author_videos");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","60,61,62,63,64,55,54");	
jQuery.data(i,"ind","65,8,13,21,11,10");	
jQuery.data(i,"cat","31,33");
$("#item_slider").append(i);
i = jQuery("<div id='w_57' class='item_wrapper'><img class='item' src='"+t+"/./Mb_AMCThumb_103008.gif' title='AMC' /></div>").get(0);
jQuery.data(i,"key","amc_flashfest_identity");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","59");	
jQuery.data(i,"ind","15,18,9,10");	
jQuery.data(i,"cat","40,35,29,26");
$("#item_slider").append(i);
i = jQuery("<div id='w_4' class='item_wrapper'><img class='item' src='"+t+"/./Mb_IHSAAThumb_111708.gif' title='IHSAA' /></div>").get(0);
jQuery.data(i,"key","ihsaa_video_titles");
jQuery.data(i,"hit","0");
jQuery.data(i,"date","62");	
jQuery.data(i,"ind","8,21,14");	
jQuery.data(i,"cat","35,29,31");
$("#item_slider").append(i);
	selected = 55;}

var targetleft = 0;

var jsReady = false;
function isReady() {
    return jsReady;
}

function hoogify(key) {
	$("#desc_"+key).find(".gohooge").each(function (e) {
		contents=escape($(this).html().replace(/&amp;/g,  "&").replace(/&gt;/g,  ">"));
	
		if ($(this).hasClass('white')) { color = 'ffffff'; }
		else { color = '000000'; }
		if ($(this).hasClass('small')) { size = 6; } 
		else { size = 12; }
	
		$(this).html("<img src='/includes/textreplace.php?size="+ size +"&fcolor="+color+"&text="+contents+"' />"); 
	});
}

function mouseX(evt) {
	if (evt.pageX) { return evt.pageX; }
	else if (evt.clientX) { return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); }
	else { return null; }
}

function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}
function formSend() {
	var text = document.htmlForm.sendField.value;  
    getFlashMovie("externalinterface").sendTextToFlash(text);
}
function getParam(str) {	
	thestart = str.indexOf("#") + 1;
	
	if ((thestart === 0) || (str.length == thestart)) {
		return "";
	} else {return str.substring(thestart);}
}
function getLoadKey() {
	var locate = window.location;
	document.form1.input1.value = locate;
	var text = document.form1.input1.value;
	return getParam(text);
}

function hideSendForm(){ $("#sendto_container").hide(); $("#sendto_center").hide(); }

function showSendForm () {
	$("#sendto_center").show();
	$("#sendto_container").fadeIn("fast", bindFocus);
	$("#sendto_close").click(hideSendForm);
//	$("#sendto_center").click(hideSendForm);
	$("#sendto_container").unbind('click');
	$("#sendto_email").attr("value", "Enter an email address");
	$("#sendto_name").attr("value", "Enter your name");
	$("#sendto_message").attr("value", "Check out this piece of the Mightybytes portfolio!");
	$("#sendto_send_output").html("");

}



function bindFocus() {
	$("#sendto_email").bind('focus',  function () {
		$(this).attr("value", "");
	}).bind('blur', function () {
		if ($(this).attr("value") == "") {
			$(this).attr("value", "Enter an email address") ;
		}
	});

	$("#sendto_name").bind('focus',  function () {
		$(this).attr("value", "");
	}).bind('blur', function () {
		if ($(this).attr("value") == "") {
			$(this).attr("value", "Enter your name") ;
		}
	});
}

$(document).ready(function(){
	
	$("#sendto_send_container").click(function () {
		$("#sendto_send_output").html("Sending ...");
		$.post("/work/send_email/", { 
			name: $("#sendto_name").attr("value") , 
			email: $("#sendto_email").attr("value") , 
			message: $("#sendto_message").attr("value"), 
			link: location.href
		}, function(data){
			if (data == "1") {
				$("#sendto_send_output").html("Please fill in a name.");
			} else if (data == "2") {
				$("#sendto_send_output").html("Please fill in a valid email.");
			} else if (data == "0") {
				$("#sendto_send_output").html("Sent!");
				setTimeout ( resetForm, 1200 );
			}
		});
	});
	
	function resetForm () {
		$("#sendto_container").fadeOut("fast", function() {$("#sendto_center").hide();});
	}
	
	var loadKey = getLoadKey();
	jsReady = true;
	var flashvars = {}; 
	var params = {
		wmode: "opaque"
	};
	var attributes = {
		id: "mediaplayer",
		name: "mediaplayer"
	};
	
	swfobject.embedSWF("/images/work/mediaplayer.swf", "media_player", "400", "330", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

	init();

	if (loadKey !== '') {
		$(".text_holder").hide();
		$("#desc_"+ loadKey).show();
 		
 		hoogify(loadKey);	

	 	 $(".item_wrapper").each(function(e) {
			if (jQuery.data($(this).get(0), "key") == loadKey) { jQuery.data($(this).get(0), "hit", "1") ; }
		});	
       	         
	}

	Array.prototype.contains = function (element) {
		for (var i = 0; i < this.length; i++) {
			if (this[i] == element) {
				return true;
			}
		}
		return false;
	};	

	$("#tab_date").click(function(){
		$("#body_date").show(); 
		$("#body_category").hide(); 
		$("#body_industry").hide();
		$("#tab_industry").removeClass("tab_behind_hot"); 
		$("#tab_category").removeClass("tab_behind_hot"); 
		$("#tab_date").removeClass("tab_behind_hot");
		$("#tab_date").removeClass("tab_behind"); 
		$("#tab_category").addClass("tab_behind"); 
		$("#tab_industry").addClass("tab_behind");
	}).hover(function () {
		if ($(this).hasClass("tab_behind")) {
			$(this).addClass("tab_behind_hot");
		}
	}, function () {
		if ($(this).hasClass("tab_behind")) {
			$(this).removeClass("tab_behind_hot");
		}
	});
	
	$("#tab_category").click(function(){
		$("#body_date").hide(); 
		$("#body_category").show(); 
		$("#body_industry").hide();
		$("#tab_industry").removeClass("tab_behind_hot"); 
		$("#tab_category").removeClass("tab_behind_hot"); 
		$("#tab_date").removeClass("tab_behind_hot");
		$("#tab_category").removeClass("tab_behind"); 
		$("#tab_date").addClass("tab_behind"); 
		$("#tab_industry").addClass("tab_behind");
	}).hover(function () {
		if ($(this).hasClass("tab_behind")) {
			$(this).addClass("tab_behind_hot");
		}
	}, function () {
		if ($(this).hasClass("tab_behind")) {
			$(this).removeClass("tab_behind_hot");
		}
	});
	
	$("#tab_industry").click(function(){
		$("#body_date").hide();
		$("#body_category").hide();
		$("#body_industry").show();
		$("#tab_industry").removeClass("tab_behind_hot");
		$("#tab_category").removeClass("tab_behind_hot");
		$("#tab_date").removeClass("tab_behind_hot");
		$("#tab_industry").removeClass("tab_behind");
		$("#tab_category").addClass("tab_behind");
		$("#tab_date").addClass("tab_behind");
	}).hover(function () {
		if ($(this).hasClass("tab_behind")) {
			$(this).addClass("tab_behind_hot");
		}
	}, function () {
		if ($(this).hasClass("tab_behind")) {
			$(this).removeClass("tab_behind_hot");
		}
	});
	
	$("#tab_viewall").click(function(){
		sort_items(false, false ,true );
		$(".btn_holder_hit").removeClass("btn_holder_hit");
	}).hover(function () {
		$(this).addClass("tab_viewall_hot");
	}, function () {
		$(this).removeClass("tab_viewall_hot");
	});

	
	$(".btn_holder a").addClass("btn_holder_out");

	$(".btn_holder a").mouseover(function() {
		if (!$(this).hasClass("btn_holder_hit")) {
			$(this).removeClass("btn_holder_out");
			$(this).addClass("btn_holder_over");
		}
	}).mouseout(function() {
		$(this).removeClass("btn_holder_over");
		$(this).addClass("btn_holder_out");
	}).click(function() {
		sort_items($(this).attr("sortby"), $(this).attr("idnum"),false );
	});

	function sort_items(sortby, idnum,all){
		$(".btn_holder a").removeClass("btn_holder_hit");
		$(".btn_holder a").addClass("btn_holder_out");
		$(this).removeClass("btn_holder_over");
		$(this).removeClass("btn_holder_out");
		$(this).addClass("btn_holder_hit");
		update_items(sortby, idnum,all);
		$("#item_slider").animate({ left: "0px"}, 600, false, update_btns);	
		targetleft = 0;
	}
	
	function update_items(sortby, idnum,all){
		if (all) {
			$(".item_wrapper").animate({ width: "98px"}, 300);
		} else { 
			selected = 0;
			$(".item_wrapper").each(function(e) {
				var box = $(this);
				if (includes(sortby, idnum ,box)){
					selected++;
					box.animate({ width: "98px"}, 300);
				} else {
					box.animate({ width: "0px"}, 300 );
				}	
			});	
		}
	}

	function includes(sortby, needle, haystack) {
		arrayofhay = jQuery.data(haystack.get(0), sortby).split(',');
		return arrayofhay.contains(needle);
	}
	
	function update_btns(){
		if (can_go_right()) { $("#item_go_left").animate({ backgroundPosition: "0"}, 300); } 
		else { $("#item_go_left").animate({ backgroundPosition: "33px"}, 300); }
		
		if (can_go_left()) { $("#item_go_right").animate({ backgroundPosition: "0"}, 300); } 
		else { $("#item_go_right").animate({ backgroundPosition: "-33px"}, 300); }
	}
	

	
	function can_go_left() {
		targetleft = (targetleft === 0) ? 1 : targetleft;
		return ((targetleft / -784) < (Math.floor((selected - 1) / 8)-1));
	}
	
	function can_go_right() {
		return (targetleft<0);
	}
	
	$("#item_go_right").click(function(){
		if (can_go_left()) {		
			targetleft	-= 784;
			$("#item_slider").animate({ left: "-=784px"}, 1000, false, update_btns);	
		}
	});
		
	$("#item_go_left").click(function(){
		if (can_go_right()) {
			targetleft	+= 784;
			$("#item_slider").animate({ left: "+=784px"},  1000, false, update_btns);	
		}
		
	});
	
	 $(".item_wrapper").click(function() {
	 	//$(".item_wrapper").animate({ opacity: .5 }, 300);
	 	//$(this).animate({ opacity: 1 }, 300);
		var activate_key = jQuery.data($(this).get(0), "key");
		var hit = jQuery.data($(this).get(0), "hit");
		location.href='#'+activate_key;
		$(".text_holder").hide();
		$("#desc_"+activate_key).show();
		if (hit == "0") {
			jQuery.data($(this).get(0), "hit", "1");
			hoogify(activate_key);		
		}
		 getFlashMovie("mediaplayer").switchProject(activate_key);	
	});

	$(".media_selector_btn").mouseover(function() {
		if (!$(this).hasClass("media_selector_hit")) {
			$(this).removeClass("media_selector_out");
			$(this).addClass("media_selector_over");
		}
	}).mouseout(function() {
		$(this).removeClass("media_selector_over");
		$(this).addClass("media_selector_out");
	}).click(function() {
		$(".media_selector_btn").removeClass("media_selector_hit");
		$(".media_selector_btn").addClass("media_selector_out");
		$(this).removeClass("media_selector_over");
		$(this).removeClass("media_selector_out");
		$(this).addClass("media_selector_hit");
	});

	yOffset = 1;

	$(".item").mouseover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$('body').append("<div id='tooltip'><div class='tooltip_texty'>"+ this.t +"</div><div class='tooltip_slanty'></div></div>");
		var div_width = $("#tooltip").width();
		
		yOffset = -1 - Math.floor(div_width / 2) ; 
	
		$("#tooltip").css("left",(mouseX(e) + yOffset) + "px").animate( {opacity:".9"} , 300 );
		
	}).mousemove(function(e){
		$("#tooltip").css("left",(mouseX(e) + yOffset) + "px");
	}).mouseout(function(e) {
		this.title = this.t;		
		$("#tooltip").remove();
	});


	update_btns();

});

$.fn.centerInClient = function(options) {
    /// <summary>Centers the selected items in the browser window. Takes into account scroll position.
    /// Ideally the selected set should only match a single element.
    /// </summary>    
    /// <param name="fn" type="Function">Optional function called when centering is complete. Passed DOM element as parameter</param>    
    /// <param name="forceAbsolute" type="Boolean">if true forces the element to be removed from the document flow 
    ///  and attached to the body element to ensure proper absolute positioning. 
    /// Be aware that this may cause ID hierachy for CSS styles to be affected.
    /// </param>
    /// <returns type="jQuery" />
    var opt = { forceAbsolute: false,
                container: window,    // selector of element to center in
                completeHandler: null
              };
    $.extend(opt, options);
   
    return this.each(function(i) {
        var el = $(this);
        var jWin = $(opt.container);
        var isWin = opt.container == window;

        // force to the top of document to ENSURE that 
        // document absolute positioning is available
        if (opt.forceAbsolute) {
            if (isWin)
                el.remove().appendTo("body");
            else
                el.remove().appendTo(jWin.get(0));
        }

        // have to make absolute
        el.css("position", "absolute");

        // height is off a bit so fudge it
        var heightFudge = isWin ? 2.0 : 1.8;

        var x = (isWin ? jWin.width() : jWin.outerWidth()) / 2 - el.outerWidth() / 2;
        var y = (isWin ? jWin.height() : jWin.outerHeight()) / heightFudge - el.outerHeight() / 2;

        el.animate({ "left": x + jWin.scrollLeft()+"px" },300);
        el.animate({ "top": y + jWin.scrollTop()+"px" },300);

        // if specified make callback and pass element
        if (opt.completeHandler)
            opt.completeHandler(this);
    });
}

