// Build 20090624163704@JAMES-NB  Copyright(c) 2006-2008, Walkr.CN http://www.walkr.cn

function insert_out_url(){var img_url=$('out_url').value;if((img_url!='http://')&&(img_url!='')){var out_text=$('out_text').value;out_text=out_text.replace(',',' ');insert_img(img_url,out_text,'');$('out_url').value='';$('out_text').value='';window.album_api.hide();}
else{alert('图片地址为空！');}}
function all_list_click_do(){window.photo_tab_type='all';if(get_photo_context_page_obj().get_photo_page(1).photos.length<1){get_photo_context_page_obj().get_photos_from_ajax();}
photo_context_page_refresh();}
function get_albums(){if(window.album_api)
window.album_api.get_albums(window.user_id);}
function change_view(obj){unfocus_view_all();if(!hasClass(obj,'photo_list_curr'))
addClass(obj,'photo_list_curr');var id=obj.id;var arr=id.split('_list_');var plus=arr[1];hide_div_view_all();if(window.photo_tab_type=='all')
if(obj.id.indexOf('_byall')>1)
return;$('all_photos_container').style.display='none';$('page_div').style.display='none';$('tips_div').style.display='none';$('head_photos_container').style.display='none';document.getElementById('div_'+plus).style.display='';}
function unfocus_view_all(){if(hasClass(document.getElementById('photo_list_byall'),'photo_list_curr'))
removeClass(document.getElementById('photo_list_byall'),'photo_list_curr');if(hasClass(document.getElementById('photo_list_byalbum'),'photo_list_curr'))
removeClass(document.getElementById('photo_list_byalbum'),'photo_list_curr');if(hasClass(document.getElementById('photo_list_bytag'),'photo_list_curr'))
removeClass(document.getElementById('photo_list_bytag'),'photo_list_curr');if(hasClass(document.getElementById('photo_list_bydest'),'photo_list_curr'))
removeClass(document.getElementById('photo_list_bydest'),'photo_list_curr');}
function hide_div_view_all(){document.getElementById('div_byall').style.display='none';document.getElementById('div_bytag').style.display='none';document.getElementById('div_bydest').style.display='none';document.getElementById('div_byalbum').style.display='none';}
function get_photo_context_page_obj(){var obj_photo_context_page=null;if(window.photo_tab_type=='all'){obj_photo_context_page=window.all_photo_context_page;}
if(window.photo_tab_type=='album'){obj_photo_context_page=window.album_photo_context_page;}
if(window.photo_tab_type=='tag'){obj_photo_context_page=window.tag_photo_context_page;}
if(window.photo_tab_type=='map'){obj_photo_context_page=window.map_photo_context_page;}
return obj_photo_context_page;}
function photo_context_page_refresh(){var obj_photo_context_page=get_photo_context_page_obj();if(obj_photo_context_page)
obj_photo_context_page.refresh_container(obj_photo_context_page.page);}
function removePhotoFromContainerById(photo_id){if(window.photo_tab_type=='all')
return;var obj_photo_context_page=get_photo_context_page_obj();if(obj_photo_context_page)
obj_photo_context_page.removePhotoById(photo_id);}
function addPhotoToContainerById(photo_id){if(window.photo_tab_type=='all')
return;var obj_photo_context_page=get_photo_context_page_obj();if(obj_photo_context_page)
obj_photo_context_page.addPhotoById(photo_id);}
function search_photo_byalbum(album_id,album_title){if(album_id){if(window.album_photo_context_page){$('head_photos_container').innerHTML='按相册检索：'+album_title;$('head_photos_container').style.display='block';window.photo_tab_type='album';window.album_photo_context_page.keywords=album_id;window.album_photo_context_page.refresh();}}
else{alert('参数错误，请重试！');}}
function search_tag(){return search_bytag($('search_keywords').value);}
function search_bytag(tag){if(tag){if(window.tag_photo_context_page){$('head_photos_container').innerHTML='按标签搜索：'+tag;$('head_photos_container').style.display='block';window.photo_tab_type='tag';window.tag_photo_context_page.keywords=tag;window.tag_photo_context_page.refresh();}}
else{alert('未选中任何标签，请重新选择！');}}
function photo_map_search(dest_id,dest_name){if(dest_id){window.photo_tab_type='map';var obj_photo_context_page=get_photo_context_page_obj();if(obj_photo_context_page){$('head_photos_container').innerHTML='拍摄于'+dest_name+'的照片：';$('head_photos_container').style.display='block';obj_photo_context_page.keywords_pre=obj_photo_context_page.keywords;obj_photo_context_page.keywords=dest_id;obj_photo_context_page.refresh();}}
else{alert('目的地未选择，请重试！');}}