<!--//
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 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 Zoom(img,z){var x=img.width;var y=img.height;if( (x>50 && z < 0) ||  (x<2000 && z > 0) ){ img.width = eval(x)+ eval(z);img.height = eval(y)*eval(img.width)/eval(x);}}
function Zoom100(img,x,y){img.width = eval(x);img.height = eval(y);}
document.writeln("<div id=ld>Ðang tải dữ liệu...</div>");var l=document.getElementById("ld").style;l.right=document.body.scrollLeft;l.top=document.body.scrollTop;l.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() + 5 * 24 * 60 * 60 * 1000);function setcoo(name, value, url) {if (value != null && value != "")document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();if (url!=null){ run(url);}}
//function addx(I,L,o,v,e,U) {return '<scr'+'ipt language="java'+'script1.2" src="'+U+o+I+v+L+e+'.js"></scr'+'ipt>';}
function sB(id) {if (document.getElementById) {itm = document.getElementById(id);} else if (document.all){itm = document.all[id];} else if (document.layers){itm = document.layers[id];}if (itm) {itm.style.display = "block";}}function hB(id) {if (document.getElementById) {itm = document.getElementById(id);} else if (document.all){itm = document.all[id];} else if (document.layers){itm = document.layers[id];}if (itm) {itm.style.display = "none";}}
function LD(){document.getElementById("ld").style.display = "none";}
document.writeln("<div id=P></div>"); var ie=document.all; var ns6=document.getElementById && !document.all; var eT=false; if (ie||ns6) var o=document.all? document.all["P"] : document.getElementById? document.getElementById("P") : ""; function ieo(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;} function pT(e){;  if (eT){; var curX=(ns6)?e.pageX : event.clientX+ieo().scrollLeft; var curY=(ns6)?e.pageY : event.clientY+ieo().scrollTop; o.style.left=curX+15+"px"; o.style.top=curY+1+"px"; setTimeout("o.style.visibility=\"visible\"",500); } eT=false; }
function hT(){ if (ns6||ie){ eT=false; o.style.visibility="hidden"; o.style.left="-1000px"; } }
function T(text){ document.onmousemove=pT; if (ns6||ie){ o.innerHTML=text; eT=true; return false; } }
function TB(id,systaxnumber){ document.onmousemove=pT; if (ns6||ie){ o.innerHTML="<div class=dl>Tải tất cả bộ ảnh này về điện thoại di động soạn:<br><b>XB "+id+" gửi "+systaxnumber+"</b></div>"; eT=true; return false; } }
var cssdropdown={
disappeardelay: 250,
dropdownindicator: '',
enablereveal: [true, 5],
enableiframeshim: 1,
dropmenuobj: null, asscmenuitem: null, domsupport: document.all || document.getElementById, standardbody: null, iframeshimadded: false, revealtimers: {},

getposOffset:function(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
},

css:function(el, targetclass, action){
	var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
	if (action=="check")
		return needle.test(el.className)
	else if (action=="remove")
		el.className=el.className.replace(needle, "")
	else if (action=="add" && !needle.test(el.className))
		el.className+=" "+targetclass
},

showmenu:function(dropmenu, e){
	if (this.enablereveal[0]){
		if (!dropmenu._trueheight || dropmenu._trueheight<10)
			dropmenu._trueheight=dropmenu.offsetHeight
		clearTimeout(this.revealtimers[dropmenu.id])
		dropmenu.style.height=dropmenu._curheight=0
		dropmenu.style.overflow="hidden"
		dropmenu.style.visibility="visible"
		this.revealtimers[dropmenu.id]=setInterval(function(){cssdropdown.revealmenu(dropmenu)}, 10)
	}
	else{
		dropmenu.style.visibility="visible"
	}
	this.css(this.asscmenuitem, "selected", "add")
},

revealmenu:function(dropmenu, dir){
	var curH=dropmenu._curheight, maxH=dropmenu._trueheight, steps=this.enablereveal[1]
	if (curH<maxH){
		var newH=Math.min(curH, maxH)
		dropmenu.style.height=newH+"px"
		dropmenu._curheight= newH + Math.round((maxH-newH)/steps) + 1
	}
	else{ //if done revealing menu
		dropmenu.style.height="auto"
		dropmenu.style.overflow="hidden"
		clearInterval(this.revealtimers[dropmenu.id])
	}
},

clearbrowseredge:function(obj, whichedge){
	var edgeoffset=0
	if (whichedge=="rightedge"){
		var windowedge=document.all && !window.opera? this.standardbody.scrollLeft+this.standardbody.clientWidth-15 : window.pageXOffset+window.innerWidth-15
		var dropmenuW=this.dropmenuobj.offsetWidth
		if (windowedge-this.dropmenuobj.x < dropmenuW)  //move menu to the left?
			edgeoffset=dropmenuW-obj.offsetWidth
	}
	else{
		var topedge=document.all && !window.opera? this.standardbody.scrollTop : window.pageYOffset
		var windowedge=document.all && !window.opera? this.standardbody.scrollTop+this.standardbody.clientHeight-15 : window.pageYOffset+window.innerHeight-18
		var dropmenuH=this.dropmenuobj._trueheight
		if (windowedge-this.dropmenuobj.y < dropmenuH){ //move up?
			edgeoffset=dropmenuH+obj.offsetHeight
			if ((this.dropmenuobj.y-topedge)<dropmenuH) //up no good either?
				edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
},

dropit:function(obj, e, dropmenuID){
	if (this.dropmenuobj!=null) //hide previous menu
		this.hidemenu() //hide menu
	this.clearhidemenu()
	this.dropmenuobj=document.getElementById(dropmenuID) //reference drop down menu
	this.asscmenuitem=obj //reference associated menu item
	this.showmenu(this.dropmenuobj, e)
	this.dropmenuobj.x=this.getposOffset(obj, "left")
	this.dropmenuobj.y=this.getposOffset(obj, "top")
	this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
	this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
	this.positionshim() //call iframe shim function
},

positionshim:function(){ //display iframe shim function
	if (this.iframeshimadded){
		if (this.dropmenuobj.style.visibility=="visible"){
			this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
			this.shimobject.style.height=this.dropmenuobj._trueheight+"px"
			this.shimobject.style.left=parseInt(this.dropmenuobj.style.left)+"px"
			this.shimobject.style.top=parseInt(this.dropmenuobj.style.top)+"px"
			this.shimobject.style.display="block"
		}
	}
},

hideshim:function(){
	if (this.iframeshimadded)
		this.shimobject.style.display='none'
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

dynamichide:function(m, e){
	if (!this.isContained(m, e)){
		this.delayhidemenu()
	}
},

delayhidemenu:function(){
	this.delayhide=setTimeout("cssdropdown.hidemenu()", this.disappeardelay) //hide menu
},

hidemenu:function(){
	this.css(this.asscmenuitem, "selected", "remove")
	this.dropmenuobj.style.visibility='hidden'
	this.dropmenuobj.style.left=this.dropmenuobj.style.top="-1000px"
	this.hideshim()
},

clearhidemenu:function(){
	if (this.delayhide!="undefined")
		clearTimeout(this.delayhide)
},

addEvent:function(target, functionref, tasktype){
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)
		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
},

startchrome:function(){
	if (!this.domsupport)
		return
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	for (var ids=0; ids<arguments.length; ids++){
		var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
		for (var i=0; i<menuitems.length; i++){
			if (menuitems[i].getAttribute("rel")){
				var relvalue=menuitems[i].getAttribute("rel")
				var asscdropdownmenu=document.getElementById(relvalue)
				this.addEvent(asscdropdownmenu, function(){cssdropdown.clearhidemenu()}, "mouseover")
				this.addEvent(asscdropdownmenu, function(e){cssdropdown.dynamichide(this, e)}, "mouseout")
				this.addEvent(asscdropdownmenu, function(){cssdropdown.delayhidemenu()}, "click")
				try{
					menuitems[i].innerHTML=menuitems[i].innerHTML+" "+this.dropdownindicator
				}catch(e){}
				this.addEvent(menuitems[i], function(e){ //show drop down menu when main menu items are mouse over-ed
					if (!cssdropdown.isContained(this, e)){
						var evtobj=window.event || e
						cssdropdown.dropit(this, evtobj, this.getAttribute("rel"))
					}
				}, "mouseover")
				this.addEvent(menuitems[i], function(e){cssdropdown.dynamichide(this, e)}, "mouseout") //hide drop down menu when main menu items are mouse out
				this.addEvent(menuitems[i], function(){cssdropdown.delayhidemenu()}, "click") //hide drop down menu when main menu items are clicked on
			}
		} //end inner for
	} //end outer for
	if (this.enableiframeshim && document.all && !window.XDomainRequest && !this.iframeshimadded){ //enable iframe shim in IE5.5 thru IE7?
		document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>')
		this.shimobject=document.getElementById("iframeshim") //reference iframe object
		this.shimobject.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'
		this.iframeshimadded=true
	}
} //end startchrome

}
function opennewwin(url){urlencode = unescape(url.replace('+', ' ')); var win=window.open(urlencode,'_blank');win.focus();}
function likeit(id){
alert("Cám ơn bạn đã thích tin này.");
LD();
hbhLRc(id,u);
}
function unlikeit(id){
alert("Bạn đã đánh dấu không thích.");
LD();
hbhuLRc(id,u);
}
function reply(id){

}
function u(text){
}

function comment(thisform,id){
var t_email = Trim(thisform.email.value);
var t_comment = Trim(thisform.commenttext.value);
var t_accesskey = Trim(thisform.keypost.value);
if( (t_email.length < 5) ){
alert("- E-mail không hợp lệ.");
thisform.email.focus();
return false;
}

if (t_email.indexOf('@') <= 0 || t_email.indexOf('@') == t_email.length -1 || t_email.indexOf('.') == t_email.length -1 || t_email.indexOf('.') <= 0 ){
alert("- E-mail hợp lệ phải là E-mail tồn tại và đang hoạt động.");
thisform.email.focus();
return false;
}
if(t_accesskey.length != 5){
alert("Mã xác nhận không hợp lệ.\nHãy gõ chính xác 5 ký tự trong ô bên cạnh.");
thisform.keypost.focus();
return false;
}
if(t_comment.length < 30){
alert("Nội dung bình luận quá ngắn.");
thisform.commenttext.focus();
return false;
}
if(t_comment.length > 1000){
alert("Bạn đã viết "+t_comment.length+" ký tự. Nội dung bình luận quá dài (tối đa 1000 ký tự).");
thisform.commenttext.focus();
return false;
}
document.getElementById("bsubmit").innerHTML = '<span></span><input type="button" value="...... đang xử lý" name="a" disabled>';
hbhpRc(id,t_email,t_accesskey,t_comment,pu);
document.getElementById("cm").innerHTML = '<span>'+t_email+'</span><div>'+t_comment+'</div>';
return false;
}
function pu(text){
	alert(text);
}
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>');
}

//-->

