<!--
document.writeln("<div id=ld>Đang tải dữ liệu...</div>");
function Fetch_object(idname){if (document.getElementById){return document.getElementById(idname);}else if (document.all){return document.all[idname];}else if (document.layers){return document.layers[idname];}else{return null;}}
function LTrim(str){var whitespace = new String(" \t\n\r");var s = new String(str);if (whitespace.indexOf(s.charAt(0)) != -1){ var j=0, i = s.length; while (j < i && whitespace.indexOf(s.charAt(j)) != -1) j++; s = s.substring(j, i); } return s;}
function RTrim(str){var whitespace = new String(" \t\n\r"); var s = new String(str); if (whitespace.indexOf(s.charAt(s.length-1)) != -1) { var i = s.length - 1; while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) i--; s = s.substring(0, i+1);} return s;}
function Trim(str){ return RTrim(LTrim(str));}
function Ld(){var l=Fetch_object("ld").style;l.right=document.body.scrollLeft;l.top=document.body.scrollTop;l.display = "block";}Ld();
function Ldend(){document.getElementById("ld").style.display = "none"; if(Fetch_object("thd")) Fetch_object("thd").style.display = "block";}
function Hs(){window.status = document.readyState!="complete" ? "Loading..." : window.defaultStatus;}document.onreadystatechange = Hs;
function run(url){top.location.replace(url);}var today = new Date();var expiry = new Date(today.getTime() + 7 * 24 * 3600 * 1000);
function setcoo(name, value, url) {if (value != null && value != "")document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();if (url!=null){ run(url);}}
function sB(id){itm =Fetch_object(id);if(itm){itm.style.display = "block";}}
function hB(id){itm =Fetch_object(id);if (itm){itm.style.display = "none";}}
function tBox(exempt){ var infoBox = exempt; if (Fetch_object(infoBox).style.display == 'block'){hB(infoBox);} else{sB(infoBox);}}function C18(url){ if(confirm("Có phải bạn dưới 18 tuổi ?")){} else{location.href=url;}}
function Favorites(url){titleFav = "Cuoi.Net - Giai Tri - Nghe Nhac - Xem phim - "+url;if (window.sidebar){window.sidebar.addPanel(titleFav, url,"");}else if( window.external ){window.external.AddFavorite( url, titleFav);}else if(window.opera && window.print){return true;}}
function Shand(){for(i=1;i<7;i++){Fetch_object("S"+i).className = "hand";}}
function Search(mod,key){Fetch_object("search").innerHTML = '<form name=search action="/search/" method=get><table cellpadding=0 cellspacing=2 width=460 height=80 border=0 valign=top align=right id=searchtable><tr><td><table border=0  cellpadding=2 cellspacing=5 ><tr><td><span id=S1 onclick=tSearch("1");><b>Truyện</b></span> | <span id=S2 onclick=tSearch("2");><b>Tranh vui</b></span> | <span id=S3 onclick=tSearch("3");><b>Phim</b></span> | <span id=S4 onclick=tSearch("4");><b>Nhạc</b></span> | <span id=S5 onclick=tSearch("5");><b>Game</b></span> | <span id=S6 onclick=tSearch("6");><b>Clip vui</b></span></td></tr><tr><td id=key><input name="keys" type="text" value="'+key+'" maxlength=80 size=60></td><td><input type="submit" value="Tìm kiếm"><span id=shiden></span></td></tr></table></td></tr></table></form>';Shand();document.getElementById("S"+mod).className = "S"+mod;document.getElementById("key").className = "T"+mod;document.getElementById("shiden").innerHTML = "<input name=\"action\" type=\"hidden\" value=\""+mod+"\">";}
function tSearch(mod){Shand();document.getElementById("key").className = "T"+mod;document.getElementById("S"+mod).className = "S"+mod;document.getElementById("shiden").innerHTML = '<input name="action" type="hidden" value="'+mod+'">';};
function urlencode(text){text = escape(text.toString()).replace(/\+/g, "%2B");var matches = text.match(/(%([0-9A-F]{2}))/gi);if (matches){for (var matchid = 0; matchid < matches.length; matchid++){var code = matches[matchid].substring(1,3);if (parseInt(code, 16) >= 128){text = text.replace(matches[matchid], '%u00' + code);}}}text = text.replace('%25', '%u0025');return text;}
function opennewwin(url){urlencode = unescape(url.replace('+', ' ')); var win=window.open(urlencode,'_blank');win.focus();}

function CMail(thisform){

if(Trim(thisform.toname.value).length < 3)  {
    alert("Thiếu tên người nhận\n(Tên của người bạn mà bạn muốn gởi)");
    thisform.toname.focus();
    return false;
}
  var toemail=Trim(thisform.tomail.value);
  if (toemail == ''){
          alert("Thiếu địa chỉ Email người nhận\n(Email của người bạn mà bạn muốn gởi)");
          thisform.tomail.focus();
          return false;
  }
  if (toemail.indexOf('@') <= 0 || toemail.indexOf('@') == toemail.length -1 || toemail.indexOf('.') == toemail.length -1 || toemail.indexOf('.') <= 0 ){
          alert("Email người nhận không chính xác");
          thisform.tomail.focus();
          return false;
  }
  var fromemail=Trim(thisform.frommail.value);
  if (fromemail == ''){
          alert("Thiếu địa chỉ Email của bạn\nĐịa chỉ Email của bạn giúp bạn của bạn nhận ra bạn");
          thisform.frommail.focus();
          return false;
  }
  if (fromemail.indexOf('@') <= 0 || fromemail.indexOf('@') == fromemail.length -1 || fromemail.indexOf('.') == fromemail.length -1 || fromemail.indexOf('.') <= 0){
          alert("Địa chỉ Email của bạn không chính xác\n(Thiếu Email người gởi)");
          thisform.frommail.focus();
          return false;
  }
document.getElementById("bsubmit").innerHTML = '<input type="button" class=botton value="...... đang xử lý" name="a">';
return true;
}
function share_article(who,title,url){
if(url==''){
var url = document.location.href;
}
switch (who) {
  case 'yahoo':
    run('ymsgr:im?msg='+title+': '+url);
    break;
  case 'twitter':
    opennewwin('http://twitter.com/home?status='+title+': '+url);
    break;
  case 'facebook':
    opennewwin('http://www.facebook.com/sharer.php?u='+url+'&t='+title);
    break;
  case 'myspace':
    opennewwin('http://www.myspace.com/Modules/PostTo/Pages/?l=3&u='+url+'&t='+title+'&c=%3Cp%3EPowered+by+%3Ca+href%3D%22http%3A%2F%2Fcuoi.net/%22%3ECuoi.net%3C%2Fa%3E%3C%2Fp%3E');
    break;
  case 'google':
    opennewwin('http://www.google.com/bookmarks/mark?op=edit&bkmk='+url+'&title='+title);
    break;
  case 'url':
    var answer = prompt ("Hãy copy và gửi địa chỉ bên dưới để chia sẻ với bạn bè nhé bạn",url);
    break;
}
}
function share_articles(title,url){
document.writeln('<span class="share_icons sharesyahoo" onclick="share_article(\'yahoo\',\''+title+'\',\''+url+'\');"></span>');
document.writeln('<span class="share_icons sharestwitter" onclick="share_article(\'twitter\',\''+title+'\',\''+url+'\');" ></span>');
document.writeln('<span class="share_icons sharefacebook" onclick="share_article(\'facebook\',\''+title+'\',\''+url+'\');"></span>');
document.writeln('<span class="share_icons sharemyspace" onclick="share_article(\'myspace\',\''+title+'\',\''+url+'\');"></span>');
document.writeln('<span class="share_icons sharegoogle" onclick="share_article(\'google\',\''+title+'\',\''+url+'\');"></span>');
}
//-->

