var isc=0;var isb=0;var HOOG;var CUR=b('p');
if (CUR==''||isNaN(CUR)){CUR=1;}
var AR=new Array();
function PR(vI){
var cP=new Number(CUR);if (cP==0){cP=1;}
var totp=Math.ceil(vI/50);
var uit='<div class="cpag">';
var diT=document.getElementById('b_tit').href;
if (diT.indexOf('?')==-1){diT=diT+'?p=';}else {diT=diT+'&p=';}
//var diT=document.URL;
if (totp>1){

var i=0;var bol='';for (i=1;i<=totp;i++){
if (i==cP){bol=' style="color:#fff;background-color:#0066FF;"';}else {bol='';}
uit=uit+'<a href="'+diT+i+'"'+bol+'>'+i+'</a>';}
}
return uit+'</div>';
}

function F(II,MM,DD,MS){
var ED='';if (MM.toLowerCase()==mem.toLowerCase()){ED='<a href="javascript:void(0)" onclick="EDT('+II+');return false;">EDIT</a>';}
AR.push('<div class="bcmi"><a href="http://asiantown.net/'+MM+'" class="bca" style="background-image:url(http://a.asntown.net/a/'+MM+'.jpg)">&nbsp;</a><h5><span>'+ED+' <a href="javascript:void(0)" onclick="QUO(\''+MM+'\','+II+');return false">QUOTE</a></span><a href="http://asiantown.net/'+MM+'"><b>'+MM+'</b></a>  '+tm(DD)+'</h5><div class="bcm" id="mz'+II+'">'+MS+'</div><hr /></div>');
}

function GG(rR){
if (AR.length==0){document.getElementById("rz").innerHTML='No Comments Found.';}
else{
var PGR=PR(rR);
AR.push('<p>'+PGR+'</p>');
document.getElementById("rz").innerHTML=PGR+''+AR.join('')+'<div><a href="http://blog.asiantown.net/addcomments.aspx?id='+BID+'" class="abu"><b>+</b> Add Comments</a></div>';
}
AR=null;
}

	
var tzz=9;
	
function TOGM(diz){
var Tod=$('#b_txt');
if (tzz==0){
diz.innerHTML='<span><b style="color:red">X</b> Hide Mature Content</span>';
Tod.css('visibility','visible');tzz=1;
}else {
diz.innerHTML='<p>Show Mature Content</p>';
Tod.css('visibility','hidden');
tzz=0;
}
}

function wrcom(Tog){
if (Tog==1){
var Tod=$('#b_txt');
Tod.css({'visibility':'hidden'});
Tod.before('<div id="togm" onclick="TOGM(this)"><p>Show Mature Content</p></div>');tzz=0;
}
var BT=document.getElementById("b_tit");
var BTL=escape(BT.href);
var BTT=encodeURIComponent(BT.innerHTML);	
var targ='class="b_sha" target="_blank" ';
document.write('<div id="b_sha"><ul class="naf"><li style="width:363px"><a name="fb_share" type="button_count" share_url="'+BT.href+'" href="http://www.facebook.com/sharer.php?u='+BTL+'&title='+BTT+'">Share</a></li><li><a href="#" class="abu"><b style="color:green">+</b> Share This</a><ul><li><a href="http://blog.asiantown.net/email.aspx?id='+BID+'" '+targ+' style="background-position:0 -29px">Email This</a></li><li><a href="http://www.facebook.com/sharer.php?u='+BTL+'&title='+BTT+'" '+targ+' style="background-position:0 -285px">Facebook</a></li><li><a href="http://digg.com/submit?phase=2&url='+BTL+'&title='+BTT+'" '+targ+' style="background-position:0 -132px">Digg</a></li><li><a href="http://www.google.com/bookmarks/mark?op=edit&bkmk='+BTL+'&title='+BTT+'" '+targ+' style="background-position:0 -246px">Google Bookmarks</a></li><li><a href="http://twitter.com/home?status='+BTT+'%20http%3A%2F%2Fblog.asiantown.net%2Fblog.aspx%3Fi%3D'+BID+'" '+targ+' style="background-position:0 -363px">Twitter</a></li><li><a href="http://www.stumbleupon.com/submit?url='+BTL+'&title='+BTT+'" '+targ+' style="background-position:0 -205px">StumbleUpon</a></li></ul></li><li><a href="/addcomments.aspx?id='+BID+'" class="abu"><b>+</b> Add Comments</a></li></ul></div>');

//<iframe src="http://www.facebook.com/plugins/like.php?href='+BTL+'&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" height="35" width="450"></iframe>

HOOG=$("#b_txt").height();
 
$('#b_txt a.vw').each(function(){
var cls=this.className.split(' ');
this.onclick=function (){var iw=parseInt(cls[1]);var ih=parseInt(cls[2]);var ir=this.href;
var background = $('<div/>');$(background).attr('id', 'overlay').css({'opacity':'.9','filter':'alpha(opacity=85)','height':$(document).height()
}).bind('click',function (){$(this).remove();$('#bigpic').remove();});
var newImage=$('<img/>');
var topi=Math.round((($(window).height()-ih)/2)+$(window).scrollTop());
if (topi<0){topi=0;}
var lefi=Math.round((($(window).width()-iw)/2)+$(window).scrollLeft());
if (lefi<0){lefi=0;}
$(newImage).attr({'src':ir,'id':'bigpic'}).bind('click',function (){$('div#overlay').remove();$(this).remove(); }).css({'cursor':'pointer','position':'absolute','z-index':'999','top':topi+'px','left':lefi+'px'});
$('body').append(newImage).append(background);
return false;
};
});

}


function LC(){if (document.getElementById('bron')){
var BRN=document.getElementById('bron').innerHTML;
var bdag=tm(document.getElementById("b_date").innerHTML);
if (BRN.length>9){BRN=' - <a href="'+BRN+'" onclick="window.open(\''+BRN+'\');return false;">Source</a> <img src="http://axaru.com/i/wb/n.gif" alt="open new window" width="20" height="20" />';document.getElementById('bron').innerHTML=BRN;}
document.getElementById('b_date').innerHTML=bdag;
if(HOOG<800){
$.getScript('http://blog.asiantown.net/c.ashx?i='+BID+'&p='+CUR);isc=1;
}
else {isb=1;}
}else {isc=-1;}
}

function BX(){
	//if (isc!=-1){
$(document).ready(function() {
HOOG=$("#b_txt").height();
if (tzz==0){HOOG=HOOG+50;}
document.getElementById('acenter').style.top=(HOOG+350)+'px';
});
document.write('<form id="ac" style="padding:0;margin:0;" name="ac" method="post" action="/addcomments.aspx?id='+BID+'"><input type="hidden" name="mo" value="" /><input type="hidden" name="bi" value="'+BID+'" /></form><sc'+'ript src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></sc'+'ript>');

	//}
}

$(window).scroll(function () { 
if (isc==0){
isc=1;
if (isb==1){
$.getScript('http://blog.asiantown.net/c.ashx?i='+BID+'&p='+CUR);
}
}
}
);


function VW(ir,iw,ih){var background = $('<div/>');$(background).attr('id', 'overlay').css({'opacity':'.8','filter':'alpha(opacity=80)','width' : '100%','height' : $(document).height(),'padding-top':'300px'
}).bind('click',function (){$(this).remove();$('#bigpic').remove(); });
var newImage = $('<img/>');
var width = $('body').width();
var iru=$(ir);
var topi=(($(window).height()-ih)/2)+$(window).scrollTop();
var lefi=(($(window).width()-iw)/2)+$(window).scrollLeft();
$(newImage).attr({'src':iru.attr('href'),'id':'bigpic'}).bind('click',function (){$('div#overlay').remove();$(this).remove(); }).css({'cursor':'pointer','position':'absolute','z-index':'999','top':topi+'px','left':lefi+'px'});
$('body').append(newImage).append(background);
}
function EDT(KI){
var HH=document.forms['ac'];HH.action='http://blog.asiantown.net/addcomments.aspx?mode=edit&id='+BID+'&j='+KI;var MZ="mz"+KI;HH.mo.value=document.getElementById(MZ).innerHTML;HH.submit();
}

function QUO(MB,MI){
var HH=document.forms['ac'];
HH.action='http://blog.asiantown.net/addcomments.aspx?id='+BID+'&mode=add';
var MZ="mz"+MI;
HH.mo.value='<div class="qq"><b>'+MB+' wrote:</b><br />'+document.getElementById(MZ).innerHTML+'</div><br />';
HH.submit();
}