jQuery.fn.center = function (b) { var a = { vertical: true, horizontal: true }; op = jQuery.extend(a, b); return this.each(function () { var a = jQuery(this), d = a.width(), c = a.height(), k = isNaN(parseInt(a.css("padding-top"))) ? 0 : parseInt(a.css("padding-top")), e = isNaN(parseInt(a.css("padding-bottom"))) ? 0 : parseInt(a.css("padding-bottom")), l = isNaN(parseInt(a.css("border-top-width"))) ? 0 : parseInt(a.css("border-top-width")), f = isNaN(parseInt(a.css("border-bottom-width"))) ? 0 : parseInt(a.css("border-bottom-width")), i = (l + f) / 2, g = (k + e) / 2, h = a.parent().css("position"), m = d / 2 * -1, j = c / 2 * -1 - g - i, b = { position: "absolute" }; if (op.vertical) { b.height = c; b.top = "50%"; b.marginTop = j } if (op.horizontal) { b.width = d; b.left = "50%"; b.marginLeft = m } h == "static" && a.parent().css("position", "relative"); a.css(b) }) }
jQuery.fn.imageLoader = function (j, e) { var a = $.extend({}, $.fn.imageLoader.defaults, j), c = 1, d = this, f = [], g = typeof a.images[0] == "object" ? true : false; h(); for (var b = 0; b < a.images.length; b++) { f["img" + b] = new Image; $(d).append(function () { var c = $(f["img" + b]).load(function () { i() }); a.hideImages && $(c).hide(); c.attr(g ? a.images[b] : { src: a.images[b] }); return c }) } return $(this); function i() { c++; if (a.images.length + 1 == c) { a.endableSplashScreen && $("#imageLoaderSplashArea").remove(); typeof e == "function" && e.call() } else a.endableSplashScreen && a.enableSplashScreenText && $("#imageLoaderSplashArea p.loadingText").html("Loading " + c + " of " + a.images.length) } function h() { if (a.endableSplashScreen) { var b = '<div id="imageLoaderSplashArea">' + (a.enableSplashScreenImage ? '<img src="' + a.splashScreenImage + '" class="splashScreenImage" />' : "") + (a.enableSplashScreenText ? '<p class="loadingText">Loading ' + c + " of " + a.images.length + "</p>" : "") + "</div>"; $(d).append(b) } } }; jQuery.fn.imageLoader.defaults = { images: [], splashScreenImage: "images/splashScreenImage.gif", enableSplashScreenImage: 1, enableSplashScreenText: 1, endableSplashScreen: 1, hideImages: 1 }
$(function(){$("#l,#vl, #vd").center();$("body").append('<div id="vl_overlay"></div>');$("#l").css("display","inline");$(document).keydown(function(a){if(a.keyCode==27&&$("#vl").is(":hidden")==false){hide_topmost()}});$.history.init(function(a){if(g_loaded==false){if(a!=""){init()}}else{load_state(a)}},{unescape:",/"})});function init(){var a=[];for(var b in characters){a.push("/resources/images/character_selection/disabled/"+b+".gif");a.push("/resources/images/character_selection/p1/"+b+".gif");a.push("/resources/images/character_selection/p2/"+b+".gif")}$("#l").html("").imageLoader({images:a,splashScreenImage:"/resources/images/loading.gif"},init_complete)}function init_complete(){$("#l").hide();$("#c").css("opacity","1");for(var a in characters){$("#cs").append('<area shape="circle" coords="'+characters[a].e+'" href="#" title="'+characters[a].n+'" char="'+a+'" />');$("#c").prepend('<img class="p p2" id="p2_'+a+'" src="/resources/images/character_selection/p2/'+a+'.gif" style="padding-left: '+characters[a].d+'px;" />');$("#c").prepend('<img class="p p1" id="p1_'+a+'" src="/resources/images/character_selection/p1/'+a+'.gif" />');$("#c").prepend('<img class="d" id="d_'+a+'" src="/resources/images/character_selection/disabled/'+a+'.gif" style="margin: '+characters[a].c+';" />')}$("#cs").append('<area shape="circle" title="Random" coords="544,334,19" href="#" onclick="alert(\'Not yet implemented.\\n\\nJust spazz out on your mouse and click randomly if you want random select.\'); return false;" />');$("#cs").append('<area shape="rect" title="Help" coords="341,30,364,48" href="#" onclick="alert(\'Not yet implemented.\\n\\nAnyway, you should be helping us!  We have a lot of videos that need indexing.  Contact us if you can help!\'); return false;" />');$("map area").mouseover(show_character_avatar).mouseout(hide_character_avatar).click(clicked);g_loaded=true;if(location.hash.substring(1)!=""){load_state(location.hash.substring(1))}}var g_loaded=false;var g_x=0;var g_y=0;var g_player=1;var g_character1="";var g_character2="";var g_video_type="all";function show_character_avatar(){var a=$(this).attr("char");if($("#d_"+a).is(":hidden")==true){if($("#p"+g_player+"_"+a).is(":hidden")==true){update_character_info(a,g_character1)}$(".p"+g_player).hide();$(".p"+g_player+"b").show();$("#p"+g_player+"_"+a).show()}}function hide_character_avatar(){var a=$(this).attr("char");if($("#d_"+a).is(":hidden")==true){$(".p"+g_player+"b").hide();$("#p"+g_player+"_"+a).hide()}}function clicked(){var a=$(this).attr("char");if($("#d_"+a).is(":hidden")==false){return}if(g_player==1){g_character1=a;location.hash=a}else{g_character2=a;location.hash=g_character1+"/vs/"+a}return false}function get_character_from_index(b){var a=0;for(var d in characters){if(a++==b){return d}}}function update_character_info(g,b){var f="";if(g_player==1){f+="<h5>"+characters[g].n+"</h5>";f+="<h6>";f+='	<div style="margin: 0;"><b>'+characters[g].vm+"</b> match videos against <b>"+Math.round(characters[g].ms._count/39*100)+"%</b> of the cast</div>";f+='	<div style="margin: 7px 0 0 0;"><b>'+characters[g].vn+"</b> non-match videos</div>";f+='	<div style="margin: 7px 0 0 0;">Latest video dated '+characters[g].l+"</div>";f+="</h6>"}else{var e="";if(typeof(characters[g].ms[lookup[b]].t)!="undefined"){if(characters[g].ms[lookup[b]].t==5){e="<b>5:5</b> even match-up"}else{var a=characters[g].n;if(characters[g].ms[lookup[b]].t<5){a=characters[b].n}var c=characters[g].ms[lookup[b]].t;var d=10-c;e="<b>"+d+":"+c+"</b> in favor of "+a}}f+="<h5>"+characters[g].n+"</h5>";f+="<h6>";f+='	<div style="margin: 0;"><b>'+characters[g].ms[lookup[b]].c+"</b> available matches with "+characters[b].n+"</div>";f+='	<div style="margin: 7px 0 0 0;">'+e+"<br /></div>";f+='	<div style="margin: 7px 0 0 0;">Latest match dated '+characters[g].ms[lookup[b]].d+"</div>";f+="</h6>"}$(".p"+g_player+"b:eq(1) div").html(f)}function show_videos(a){if(typeof(a)=="undefined"){a="all"}g_player=-1;if($("#vl").is(":visible")===false){$("#vl").show("scale",{percent:100},250)}setTimeout(function(){show_videos_callback(a,1,$("#vl2").is(":visible"))},251);return false}function show_videos_callback(b,c,a){g_video_type=b;if(a==true){$("#vl_videos").html('<img src="/resources/images/loading2.gif" style="padding-left: 204px; padding-top: 140px; border: none; width: 54px; height: 55px;" />')}else{$("#vl2").show().html('<div style="text-align: center; margin-top: 259px;"><img src="/resources/images/loading2.gif" /></div>')}$("#vl2").load("/video_listing/"+g_character1+"/"+g_character2,{view:b,page:c},function(){$("#vl img").css("width","").css("height","")});return false}function change_page(a){show_videos_callback(g_video_type,a,true);return false}function hide_videos(){g_player=1;g_character1="";g_character2="";$("#vl2").html("");$(".p1,.p1b,.p2,.p2b,#vl2,.d").hide();$("#vl").hide("scale",{percent:0},250)}function hide_video(){$("#vd").hide();if($("#vl_overlay").is(":hidden")===false){$("#vl_overlay").fadeOut()}}function choose_second_player(){g_player=2;$("#vl,#vl2,.p2,.p2b").hide();for(var a in characters[g_character1].ms){if(characters[g_character1].ms[a].c==0){var b=get_character_from_index(a);$("#d_"+b).show()}}return false}function display_video(a,b){$("#vl_overlay").css({width:$(document).width(),height:$(document).height()}).fadeIn(function(){display_video_callback(a,b)})}function display_video_callback(a,b){var c="";c+='<div style="text-align: center;">';c+='<img style="float: right; padding-right: 10px; position: relative; top: -3px; cursor: pointer;" onclick="hide_video();" src="/resources/js/fancybox/fancy_close.png"/>';c+='<div style="font-family: arial; font-size: 18px; font-weight: bold; padding-bottom: 10px; color: white; margin-top: 10px;">';c+=a;c+="</div>";c+='<object width="656" height="394">';c+='<param name="movie" value="'+b+'"></param>';c+='<param name="allowfullscreen" value="true" /></param>';c+='<param name="allowscriptaccess" value="always" /></param>';c+='<embed type="application/x-shockwave-flash" src="'+b+'" allowscriptaccess="always" allowfullscreen="true" width="656" height="394" />';c+="</object>";c+="</div>";$("#vd").html(c);$("#vd").show()}function hide_topmost(){if($("#vl_overlay").is(":visible")===true){hide_video()}else{hide_videos()}}function load_state(b){if(b==""){hide_video();hide_videos();$(".p"+g_player).hide()}else{var a=b.split("/");if(typeof(lookup[a[0]])!="undefined"){$(".p1").hide();g_character1=a[0];$(".p1b").show();$("#p1_"+g_character1).show();if(typeof(lookup[a[2]])!="undefined"){g_character2=a[2];$(".p2b").show();$("#p2_"+g_character2).show()}else{g_character2="";g_player=1;update_character_info(g_character1)}if(typeof(a[1])!="undefined"){switch(a[1]){case"w":show_videos("winning");break;case"l":show_videos("losing");break;case"n":show_videos("non-match");break;case"vs":if(g_character2==""){choose_second_player()}else{if(typeof(a[3])!="undefined"&&typeof(lookup[a[3]])!="undefined"){show_videos(a[3])}else{show_videos()}}break}}else{show_videos()}}else{load_state("")}}};
