$(function(){
    var is_admin_login=getCookie('hcadmin');
    if(is_admin_login){
        $('.editposter').each(function(index,obj){
            var posterurl=$(obj).attr('href');
            $(obj).attr('href','javascript:;');$(obj).attr('target','_self');
            var posterid=posterurl.substring(posterurl.indexOf("id/")+3,posterurl.indexOf(".html"));
            $(obj).prepend("<span onclick='editposter("+posterid+")'>编辑</span><span onclick='window.open(\""+posterurl+"\")'>访问</span>");
        });
    }    
})
function editposter(id){
    alert(id);
    //var url=APP+'Home/Poster/edit/id/'+id;
}
function getCookie(name)
{
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
    if(arr=document.cookie.match(reg))
    return unescape(arr[2]);
    else
    return null;
}