function pedia_common_ready()
{}
function pedia_music_index_ready()
{}
function pedia_music_artist_view_ready()
{comments_editor(".comments_input .user_message");if($("#sshow").length)
{var artist_id=$("#sshow").text();$("#sshow").empty().removeClass('hidden');so=new SWFObject("/swf/slideshow.swf","sshow_flash","100%","300","9","#ffffff");so.addParam("quality","high");so.addParam("wmode","transparent");so.addVariable("source",escape("/?mode=music&act=photo_xml&id="+artist_id));so.write("sshow");}}
function pedia_music_photo_view_ready()
{comments_editor(".comments_input .user_message");pedia_music_init_nav_buttons();$('.photo_curr img').load(pedia_music_init_nav_buttons);}
function pedia_music_init_nav_buttons()
{$('.photo_prev a, .photo_next a').css('line-height',$('.photo_curr').height()+'px');$('.neighbour_prev a, .neighbour_next a').css('line-height',$('.photo_neighbours .current').height()+'px');}
function pedia_music_photo_edit_ready()
{$('.photo_prev a, .photo_next a').css('line-height',$('.photo_curr').height()+'px');$('.photo_panel .photo_desc form textarea').eq(0).focus();$('.neighbour_prev a, .neighbour_next a').css('line-height',$('.photo_neighbours .current').height()+'px');}
function pedia_music_photo_upload_ready()
{$('.file_entry .file_btn').val('');$('.url_entry .url_btn').val('').focus();}
function pedia_photo_add_file_entry(el)
{if($('.file_entry').length>$('#max_upload_files').text())
return myalert('#max_upload_file_str');el=$(el);var file_name=$.trim(el.val());if(!file_name)
return;var parent=el.parents('.file_entry:first');var parclone=parent.clone();parclone.find('.file_btn').attr('name','name'+($('.file_entry').length+1)).val('');var img_name=$('<span></span>').addClass('file_name').text(file_name);parent.find('.file_btn').addClass('hidden').after(img_name);parent.find('.delete_btn').parent().removeClass('hidden');parent.after(parclone);$('.file_entry .file_btn').each(function(i){$(this).attr('name','name'+(i+1));});}
function pedia_photo_delete_file_entry(el)
{if($('.file_entry').length==1)
return;$(el).parents('.file_entry:first').remove();}
function pedia_photo_add_url_entry(el)
{if($('.url_entry').length>$('#max_upload_urls').text())
return myalert('#max_upload_url_str');el=$(el);var parent=el.parents('.url_entry:first');var url_name=$.trim(parent.find('.url_btn').val());if(!url_name||url_name=='http://')
return;var have_copy=false;var length=$('.url_entry .url_btn').length;$('.url_entry .url_btn').each(function(i){if($(this).val()==url_name&&length-1!=i)
have_copy=true;});if(have_copy)
{parent.find('.url_btn').val('');return false;}
var parclone=parent.clone();parclone.find('.url_btn').val('');var img_name=$('<a></a>').addClass('url_name').attr('href',url_name).attr('target','_blank').text(url_name);parent.find('.url_btn').addClass('hidden').after(img_name);parent.find('.delete_btn').parent().removeClass('hidden');parent.find('.add_btn').addClass('hidden');parent.after(parclone);parclone.find('.url_btn').focus();}
function pedia_photo_delete_url_entry(el)
{if($('.url_entry').length==1)
return;el=$(el);el.parents('.url_entry:first').remove();}
function pedia_music_photo_upload_submit()
{if($.browser.opera)
$('.file_entry:last').remove();$('.photo_upload form .status_info').removeClass('hidden');return true;}
function pedia_photo_description_toggle()
{$('._photo_desc').toggleClass('hidden');$('._photo_desc form textarea').eq(0).focus();}
function pedia_photo_desc_edit_submit()
{$('.photo_desc ._desc_saved').removeClass('hidden');$('.photo_desc .buttons .status_info').hide();}
function pedia_music_video_view_ready()
{comments_editor(".comments_input .user_message");$('.video_prev a, .video_next a').css('line-height',$('.video_curr').height()+'px');}
function pedia_music_video_edit_ready()
{$('.video_prev a, .video_next a').css('line-height',$('.video_curr').height()+'px');$('.video_panel .video_desc form textarea').eq(0).focus();}
function pedia_music_video_add_ready()
{setup_context_search($('.file_entry .embed_code').get(),'video',pedia_video_event_add_entry);}
function pedia_video_add_entry()
{var last_entry=$('.file_entry:last');var parclone=last_entry.clone();parclone.find('textarea, input').val('');var new_id=Math.random()+'';new_id='newid_'+new_id.substring(2,10);parclone.find('.embed_code').attr('id',new_id);last_entry.after(parclone);setup_context_search('#'+new_id,'video',pedia_video_event_add_entry);setTimeout(function(){parclone.find('.embed_code').focus();},100);}
function pedia_video_event_add_entry(event,item)
{var str=$.trim($(item[0]).find('.caption').text());var textarea=$(event.target||event.srcElement).parents('.file_entry:first').find('textarea');if(textarea.length&&!textarea.val()&&str)
textarea.val(str);}
function pedia_video_delete_entry(el)
{if($('.file_entry').length==1)
{$('.file_entry textarea, .file_entry input').val('');return;}
el=$(el);el.parents('.file_entry:first').remove();}
function pedia_video_description_toggle()
{$('._video_desc').toggleClass('hidden');$('._video_desc form textarea').eq(0).focus();}
function pedia_video_desc_edit_submit()
{$('.video_desc ._desc_saved').removeClass('hidden');$('.video_desc .buttons .status_info').hide();}
function pedia_music_album_view_ready()
{comments_editor(".comments_input .user_message");}
function pedia_music_editor_ready()
{comments_editor('.markit_area');}
function status_info_show(form)
{$(form).find('.buttons .status_info').fadeIn(100);}