var share_cookie = ''; var arr,reg = new RegExp("(^| )"+cookie_name+"=([^;]*)(;|$)"); if(arr = document.cookie.match(reg)){_cookie = unescape(arr[2]); }