function pop(first,url){
  if("true"==first){
     window.open(url,'','resizable=1,menubar=1,status=1,toolbar=1,location=1,directories=1,fullscreen=0,width=800,height=600,top=100,left=100');
     return;
   }
}

function show_recomments(ev) {
	ev = ev || window.event;
	var rdiv = document.getElementById('recomments');
	rdiv.top = ev.pageX || ev.x;
	rdiv.left = ev.pageY || ev.y;
	rdiv.onmouseover = function() {bOnWin = 1;};
	rdiv.onmouseout = function() {bOnWin = null};
	rdiv.style.display = 'block';
}

function NewWin(newURL,wth,hgh) {
	if (wth == null){
       wth = 500;
    }
    if (hgh == null){
      hgh = 300;
    }
	window.open(newURL,'','width='+wth+',height='+hgh+',left=70,top=130,scrollbars=yes');
}

function gotoPage(url,totalpage){
  	var pageno = Number(document.getElementById('pageno').value);
	totalpage = Number(totalpage);
  	if(/^\d+/.test(pageno)==false||pageno==""||pageno <= 0||pageno > totalpage){
  	  return false;
	  }
	if(pageno.toString().length < 2)
	 	pageno = "0"+pageno;
 	
	document.location.href=url.replace('{pageNum}',pageno);
}

function genArticleURL(s){
	 var exp=/(\w+):\/\/([\w.]+)\/(\w+)\/(\w+)\/(\w+)\/01\//;
	 while (s.search(exp)>-1){
		 var result = s.match(exp);
		 var artId = result[5]; 
		  s=s.replace(exp,"$1:\/\/$2\/$3\/$4\/$5\/"+hex_md5(artId).substring(0,8)+"01/");
	 }
	 return s;
}
