$(document).ready(function() {
    $("img[id*='change_tmb_']").click(function(event) {
        event.preventDefault();
        var click_id    = $(this).attr('id');
        var id_split    = click_id.split('_');
        var vkey        = id_split[2];
        var thumb       = id_split[3];
        for( var i=1; i<=20; i++ ) {
            if ( i == thumb ) {
                $(this).css('border-color', '#ff4800');
            } else {
                $("img[id='change_tmb_" + vkey + "_" + i + "']").css('border-color', '#ccc');
            }
        }
        $("input[id='" + vkey + "']").val(thumb);
    });
    
    $("input[id='edit_video_advanced'],input[id='edit_user_advanced'],input[id='edit_game_advanced']").click(function() {
        var val = $(this).val();
        if ( val == '-- Show Advanced --' ) {
            $('#advanced').fadeIn();
            $(this).val('-- Hide Advanced --');
        } else {
            $('#advanced').fadeOut();
            $(this).val('-- Show Advanced --');
        }
    });


  $(document).ready(function(){
    $('.splLink').click(function(){
      $(this).parent().children('div.splCont').toggle('normal');
      return false;
    });
  });

    
	$("a[id*='static_page_']").click(function(event) {
		event.preventDefault();
		var page_id  = $(this).attr('id');
		var id_split = page_id.split('_');
		var div_id   = id_split[2];
		var pages    = new Array('about', 'dev', 'help', 'terms', 'privacy');
		jQuery.each(pages, function() {
			if (this == div_id) {
				$('#' + this).show();
			} else {
				$('#' + this).hide();
			}
		});
	});
});



        $(document).ready(function() {
            $("#wideView").click(function() {
                $("#content").toggleClass("wide");
                $("#main1").toggleClass("wide");
                $(this).toggleClass("wide");
            });
        });

