
var agt_=navigator.userAgent.toLowerCase();var is_major=parseInt(navigator.appVersion);var isIE=((agt_.indexOf("msie")!=-1)&&(agt_.indexOf("opera")==-1));var m_isIE6=(isIE&&(is_major==4)&&(agt_.indexOf("msie 6.")!=-1));var sAscii=" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`"
sAscii=sAscii+"abcdefghijklmnopqrstuvwxyz{|}~";var sHex="0123456789abcdef";function hex(i){h="";for(j=0;j<=3;j++){h+=sHex.charAt((i>>(j*8+4))&0x0F)+sHex.charAt((i>>(j*8))&0x0F);}
return h;};function add(x,y){return((x&0x7FFFFFFF)+(y&0x7FFFFFFF))^(x&0x80000000)^(y&0x80000000);};function R1(A,B,C,D,X,S,T){q=add(add(A,(B&C)|((~B)&D)),add(X,T));return add((q<<S)|((q>>(32-S))&(Math.pow(2,S)-1)),B);};function R2(A,B,C,D,X,S,T){q=add(add(A,(B&D)|(C&(~D))),add(X,T));return add((q<<S)|((q>>(32-S))&(Math.pow(2,S)-1)),B);};function R3(A,B,C,D,X,S,T){q=add(add(A,B^C^D),add(X,T));return add((q<<S)|((q>>(32-S))&(Math.pow(2,S)-1)),B);};function R4(A,B,C,D,X,S,T){q=add(add(A,C^(B|(~D))),add(X,T));return add((q<<S)|((q>>(32-S))&(Math.pow(2,S)-1)),B);};function oSecu(sInp){wLen=(((sInp.length+8)>>6)+1)<<4;var X=new Array(wLen);j=4;for(i=0;(i*4)<sInp.length;i++){X[i]=0;for(j=0;j<4&&(i*4+j)<sInp.length;j++){X[i]+=(sAscii.indexOf(sInp.charAt((i*4)+j))+32)<<(j*8);}}
if(j==4){X[i++]=0x80;}
else{X[i-1]+=0x80<<(j*8);}
while(i<wLen){X[i]=0;i++;}
X[wLen-2]=sInp.length<<3;a=0x67452301;b=0xefcdab89;c=0x98badcfe;d=0x10325476;for(i=0;i<wLen;i+=16){aO=a;bO=b;cO=c;dO=d;a=R1(a,b,c,d,X[i+0],7,0xd76aa478);d=R1(d,a,b,c,X[i+1],12,0xe8c7b756);c=R1(c,d,a,b,X[i+2],17,0x242070db);b=R1(b,c,d,a,X[i+3],22,0xc1bdceee);a=R1(a,b,c,d,X[i+4],7,0xf57c0faf);d=R1(d,a,b,c,X[i+5],12,0x4787c62a);c=R1(c,d,a,b,X[i+6],17,0xa8304613);b=R1(b,c,d,a,X[i+7],22,0xfd469501);a=R1(a,b,c,d,X[i+8],7,0x698098d8);d=R1(d,a,b,c,X[i+9],12,0x8b44f7af);c=R1(c,d,a,b,X[i+10],17,0xffff5bb1);b=R1(b,c,d,a,X[i+11],22,0x895cd7be);a=R1(a,b,c,d,X[i+12],7,0x6b901122);d=R1(d,a,b,c,X[i+13],12,0xfd987193);c=R1(c,d,a,b,X[i+14],17,0xa679438e);b=R1(b,c,d,a,X[i+15],22,0x49b40821);a=R2(a,b,c,d,X[i+1],5,0xf61e2562);d=R2(d,a,b,c,X[i+6],9,0xc040b340);c=R2(c,d,a,b,X[i+11],14,0x265e5a51);b=R2(b,c,d,a,X[i+0],20,0xe9b6c7aa);a=R2(a,b,c,d,X[i+5],5,0xd62f105d);d=R2(d,a,b,c,X[i+10],9,0x2441453);c=R2(c,d,a,b,X[i+15],14,0xd8a1e681);b=R2(b,c,d,a,X[i+4],20,0xe7d3fbc8);a=R2(a,b,c,d,X[i+9],5,0x21e1cde6);d=R2(d,a,b,c,X[i+14],9,0xc33707d6);c=R2(c,d,a,b,X[i+3],14,0xf4d50d87);b=R2(b,c,d,a,X[i+8],20,0x455a14ed);a=R2(a,b,c,d,X[i+13],5,0xa9e3e905);d=R2(d,a,b,c,X[i+2],9,0xfcefa3f8);c=R2(c,d,a,b,X[i+7],14,0x676f02d9);b=R2(b,c,d,a,X[i+12],20,0x8d2a4c8a);a=R3(a,b,c,d,X[i+5],4,0xfffa3942);d=R3(d,a,b,c,X[i+8],11,0x8771f681);c=R3(c,d,a,b,X[i+11],16,0x6d9d6122);b=R3(b,c,d,a,X[i+14],23,0xfde5380c);a=R3(a,b,c,d,X[i+1],4,0xa4beea44);d=R3(d,a,b,c,X[i+4],11,0x4bdecfa9);c=R3(c,d,a,b,X[i+7],16,0xf6bb4b60);b=R3(b,c,d,a,X[i+10],23,0xbebfbc70);a=R3(a,b,c,d,X[i+13],4,0x289b7ec6);d=R3(d,a,b,c,X[i+0],11,0xeaa127fa);c=R3(c,d,a,b,X[i+3],16,0xd4ef3085);b=R3(b,c,d,a,X[i+6],23,0x4881d05);a=R3(a,b,c,d,X[i+9],4,0xd9d4d039);d=R3(d,a,b,c,X[i+12],11,0xe6db99e5);c=R3(c,d,a,b,X[i+15],16,0x1fa27cf8);b=R3(b,c,d,a,X[i+2],23,0xc4ac5665);a=R4(a,b,c,d,X[i+0],6,0xf4292244);d=R4(d,a,b,c,X[i+7],10,0x432aff97);c=R4(c,d,a,b,X[i+14],15,0xab9423a7);b=R4(b,c,d,a,X[i+5],21,0xfc93a039);a=R4(a,b,c,d,X[i+12],6,0x655b59c3);d=R4(d,a,b,c,X[i+3],10,0x8f0ccc92);c=R4(c,d,a,b,X[i+10],15,0xffeff47d);b=R4(b,c,d,a,X[i+1],21,0x85845dd1);a=R4(a,b,c,d,X[i+8],6,0x6fa87e4f);d=R4(d,a,b,c,X[i+15],10,0xfe2ce6e0);c=R4(c,d,a,b,X[i+6],15,0xa3014314);b=R4(b,c,d,a,X[i+13],21,0x4e0811a1);a=R4(a,b,c,d,X[i+4],6,0xf7537e82);d=R4(d,a,b,c,X[i+11],10,0xbd3af235);c=R4(c,d,a,b,X[i+2],15,0x2ad7d2bb);b=R4(b,c,d,a,X[i+9],21,0xeb86d391);a=add(a,aO);b=add(b,bO);c=add(c,cO);d=add(d,dO);}
return hex(a)+hex(b)+hex(c)+hex(d);};function popUnder(urls){var url=urls[Math.floor(Math.random()*urls.length)];var params='width='+screen.width;params+=', height='+screen.height;params+=', top=0, left=0,scrollbars=yes';params+=', toolbar=yes,location=yes,status=yes,menubar=yes,resizable=yes';params+=', fullscreen=yes';pop=window.open(url,'window',params).blur();window.focus();return false;}
function popupAClick(urls){var cookiename="popunder1K2";if(getCookie(cookiename))
return false;jh("a").click(function(){popUnder(urls);});setCookie(cookiename,cookiename+" popupAClick","1","/","","");return false;}
function popupPageLoad(urls){var cookiename="popunder1K3";if(getCookie(cookiename))
return false;popUnder(urls);setCookie(cookiename,cookiename+" popupPageLoad","1","/","","");return false;}
function gotoTop(){var hr=window.location.href;hr=hr.replace(/#top$/ig,'');window.location.href=hr+'#top';}
function openWindow(src,title,width,height){var leftPos=(screen.availWidth-width)/2;var topPos=(screen.availHeight-height)/2;if(isIE){window.open(src,title,'toolbar=no'+',location=no'+',status=yes'+',menubar=no'+',scrollbars=yes'+',resizable=yes'+',width='+width+',height='+height+',top='+topPos+',left='+leftPos);return false;}
else{window.open(src,title,'height='+height+', width='+width+', left='+leftPos+', top='+topPos+', resizable=yes, scrollbars=yes, toolbar=no, status=yes');return false;}};function onLinkClick(link){window.open(link.href,link.innerHTML,'toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600,top=0,left=0');return false;};function voidnull(para){};function setHomePage(domain){if(document.all){var homepage=document.getElementById('o_homepage');if(!homepage)
return;homepage.style.behavior='url(#default#homepage)';homepage.setHomePage(domain);}
else
alert('Chọn Tools > Option > Main > Use Current Page (Alt+C) để đặt trang chủ!');};function addFavorite(domain,title){if(document.all)
window.external.AddFavorite(domain,title);else if(window.sidebar)
window.sidebar.addPanel(title,domain,"")};function lTrim(value){if(!value||value=='')
return'';var re=/\s*((\S+\s*)*)/;return value.replace(re,"$1");};function rTrim(value){if(!value||value=='')
return'';var re=/((\s*\S+)*)\s*/;return value.replace(re,"$1");};function Trim(value){return lTrim(rTrim(value));};function wordCount(strHtml){strHtml=strHtml.replace(/<[^>]+>/ig,'');strHtml=strHtml.replace(/[^A-Za-z0-9\u00c0-\u01b0\u1ea0-\u1ef9]+/g,"+");var words=strHtml.split("+");var length=words.length;if(words[length-1]=="")
length--;if(words[0]=="")
length--;return(length<0?0:length);};function cuttingWord(text,wordcount){text=Trim(text);var words=text.split(" ");if(wordcount>=words.length)
return text;var str='';for(var i=0;i<wordcount;i++)
str+=words[i]+' ';return Trim(str)+'..';}
function cuttingChar(text,wordcount){text=Trim(text);if(wordcount<=0)return text;if(wordcount>=text.Length)
return text;return text.substring(0,wordcount)+"..";}
function checkEmail(strValue){var emailRegExp=/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})$/;return emailRegExp.test(strValue);};function setCookie(name,value,expires){var today=new Date();today.setTime(today.getTime());if(expires)
expires=expires*1000*60*60*24;var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+';expires='+expires_date.toGMTString()+';path=/;';};function getCookie(name){var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
return null;if(start==-1)
return null;var end=document.cookie.indexOf(";",len);if(end==-1)
end=document.cookie.length;return unescape(document.cookie.substring(len,end));};function postFormJson(objID,onSucess){var url=document.getElementById(objID).action;jh.post(url,jh("#"+objID).serialize(),function(data){onSucess(data);},"json");};function oEncrypt(str){var out='';for(var n=0;n<str.length;n++){var si=str.charCodeAt(n);var ki=(si>=33&&si<=79)?1:(si>=80&&si<=126)?-1:0;out+=String.fromCharCode(si+47*ki);;}
return out;};var hideLeftPanel=false;var hideRightPanel=false;function hideLeftColumn(){var ckcenter=document.getElementById('ckcenter');var ckleft=document.getElementById('ckleft');if(ckcenter&&ckleft){var width=ckcenter.offsetWidth+ckleft.offsetWidth-10;ckcenter.style.width=width+'px';ckleft.style.display='none';}};function hideRightColumn(){var ckcenter=document.getElementById('ckcenter');var ckright=document.getElementById('ckright');if(ckcenter&&ckright){var width=ckcenter.offsetWidth+ckright.offsetWidth-10;ckcenter.style.width=width+'px';ckright.style.display='none';}};function createFlashControl(src_,width,height){var HTML='<object align="baseline" border="0" classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" ';if(width!=0)
HTML+=' width="'+width+'"';else
HTML+=' width="200"';if(height!=0)
HTML+=' height="'+height+'"';else
HTML+=' height="150"';HTML+=' >';HTML+='<param name="_cx" value="5292" />';HTML+='<param name="_cy" value="3969" />';HTML+='<param name="FlashVars" value="5292" />';HTML+='<param name="Movie" value="'+src_+'" />';HTML+='<param name="Src" value="'+src_+'" />';HTML+='<param name="WMode" value="Transparent" />';HTML+='<param name="Play" value="-1" />';HTML+='<param name="Loop" value="-1" />';HTML+='<param name="Quality" value="High" />';HTML+='<param name="SAlign" value="" />';HTML+='<param name="Menu" value="-1" />';HTML+='<param name="Base" value="" />';HTML+='<param name="AllowScriptAccess" value="always" />';HTML+='<param name="Scale" value="ShowAll" />';HTML+='<param name="DeviceFont" value="0" />';HTML+='<param name="EmbedMovie" value="0" />';HTML+='<param name="BGColor" value="#000000" />';HTML+='<param name="SWRemote" value="" />';HTML+='<embed src="'+src_+'"';HTML+=' wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer"';HTML+=' type="application/x-shockwave-flash"';HTML+=' allowscriptaccess="always"';HTML+=' bgcolor="#000000"';HTML+=' name="AdObj1" quality="High"';if(width!=0)
HTML+=' width="'+width+'"';else
HTML+=' width="200"';if(height!=0)
HTML+=' height="'+height+'"';else
HTML+=' height="150"';HTML+=' >';HTML+='</object>';return HTML;};function writeSlideShow(objID,xmlurl,width,height,bgcolor){var oswf=oDnnUrl+'Flash/Slide/s'+width+'x'+height+'.swf';if(xmlurl!='')
xmlurl='?xmlfile='+xmlurl;var htmlSWF='<object id="'+objID+'" align="middle" border="0" ';htmlSWF+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';htmlSWF+='codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';htmlSWF+='width="'+(width&&width>0?width:200)+'" ';htmlSWF+='height="'+(height&&height>0?height:150)+'" ';htmlSWF+='>';htmlSWF+='<param name="allowScriptAccess" value="sameDomain" /> ';htmlSWF+='<param name="WMode" value="Transparent" />';htmlSWF+='<param name="movie" value="'+oswf+xmlurl+'" /> ';htmlSWF+='<param name="quality" value="high" /> ';htmlSWF+='<param name="bgcolor" value="'+bgcolor+'" /> ';htmlSWF+='<embed src="'+oswf+xmlurl+'" quality="high" ';htmlSWF+='bgcolor="'+bgcolor+'" ';htmlSWF+='width="'+(width&&width>0?width:200)+'" ';htmlSWF+='height="'+(height&&height>0?height:150)+'" ';htmlSWF+='name="'+objID+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" ';htmlSWF+='wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" />';htmlSWF+='</object>';return htmlSWF;};function showWindow(url,isStatus,isResizeable,isScrollbars,isToolbar,isLocation,isFullscreen,isTitlebar,isCentered,width,height,top,left){if(isCentered){top=(screen.height-height)/2;left=(screen.width-width)/2;}
window.open(url,'_blank','status='+(isStatus?'yes':'no')+','
+'resizable='+(isResizeable?'yes':'no')+','
+'scrollbars='+(isScrollbars?'yes':'no')+','
+'toolbar='+(isToolbar?'yes':'no')+','
+'location='+(isLocation?'yes':'no')+','
+'fullscreen='+(isFullscreen?'yes':'no')+','
+'titlebar='+(isTitlebar?'yes':'no')+','
+'height='+height+','+'width='+width+','
+'top='+top+','+'left='+left);};function createFlvPlayer(src,file,image,width,height){if(image=='')
image=oDnnUrl+'Content'+oTemplateApp+'/images/vdt'+width+'x'+height+'.jpg';var htmlSWF='<embed height="'+height+'" width="'+width+'" src="'+src+'" allowfullscreen="true" ';htmlSWF+='allownetworking="all" allowscriptaccess="always" name="mediaplayer" menu="true" ';htmlSWF+='flashvars="file='+file+'&amp;image='+image+'" ';htmlSWF+='wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';htmlSWF+='type="application/x-shockwave-flash" play="true" loop="true"></embed>';return htmlSWF;};function createMediaPlayer(file,width,height){var htmlSWF='<embed align="middle" height="'+height+'" width="'+width+'" src="'+file+'" ';htmlSWF+='showdisplay="0" showstatusbar="1" showcontrols="1" autostart="0" ';htmlSWF+='wmode="transparent" scale="aspect" kioskmode="False" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" ';htmlSWF+='type="application/x-mplayer2"></embed>';return htmlSWF;};function playVideoWH(title,location,imagesrc,contenttype,objContainer,width,height){if(!objContainer)
return;if(contenttype=='application/octet-stream'||contenttype=='video/x-flv'||contenttype=='flv-application/octet-stream')
objContainer.innerHTML=createFlvPlayer(oDnnUrl+'Flash/osflvplayer.swf',location,imagesrc,width,height);else
objContainer.innerHTML=createMediaPlayer(location,width,height);var vietitle=document.getElementById('vietitle');if(vietitle)
vietitle.innerHTML=title;};function playVideo0(objContainer){if(objContainer){var lis=objContainer.childNodes;for(var t=0;t<lis.length;t++){var tagName=lis[t].nodeName.toLowerCase();if(tagName=='li'){eval(lis[t].getAttribute('onclick'));return;}}}};function oPageView(pv){var spPageView=document.getElementById('spPageView');if(spPageView){spPageView.innerHTML=pv;}}
function execJs(strCont){var regScript1=new RegExp('<script.*?src="([^"]+)".*?>\s*</script>');if(regScript1.test(strCont)){var scr=document.createElement('script');scr.setAttribute("type","text/javascript");scr.setAttribute("src",regScript1.exec(strCont)[1]);document.getElementsByTagName("head").item(0).appendChild(scr);}
var regScript=new RegExp('<script.*?>([^\x3C]+)</script>');if(regScript.test(strCont))
eval(regScript.exec(strCont)[1]);}
function countItem(containerID,itemTag){var it=0;var contr=document.getElementById(containerID);if(!contr)
return 0;contr=contr.childNodes;for(var t=0;t<contr.length;t++){var tagName=contr[t].nodeName.toLowerCase();if(tagName==itemTag)
it++;}
return it;}
function getDivsByClassName(obj,classname){obj=obj.getElementsByTagName('div');var divs=[];for(var i=0;i<obj.length;i++){if(obj[i].className==classname)
divs.push(obj[i]);}
return divs;};function fixHeightNewsBox(){var col0=document.getElementById('OsCol0');var boxNews0s=getDivsByClassName(col0,'boxNews');var col1=document.getElementById('OsCol1');var boxNews1s=getDivsByClassName(col1,'boxNews');var maxlength=boxNews0s.length>boxNews1s.length?boxNews0s.length:boxNews1s.length;for(var i=0;i<maxlength;i++){if(i>=boxNews0s.length||i>=boxNews1s.length)
break;var d0=boxNews0s[i];var d1=boxNews1s[i];if(d0.offsetHeight>d1.offsetHeight)
d1.style.height=d0.offsetHeight+'px';else
d0.style.height=d1.offsetHeight+'px';}};function containerPage(funcHref,pageIndex,pageSize,totalItem,pageLength){var divContainer=document.createElement('div');var begin=Math.floor((pageIndex-1)/pageLength)*pageLength+1;var sp=Math.floor(totalItem/pageSize);if(sp*pageSize<totalItem)
sp++;var ti=0;var firsta=null;var itemA=0;for(ti=begin;ti<pageLength+begin&&ti<sp+1;ti++){var a_=document.createElement('a');a_.href="#";a_.setAttribute('pi',ti);a_.onclick=function(){return funcHref(this);}
if(ti==pageIndex){a_.className='Psed';a_.innerHTML='['+ti+']';}
else
a_.innerHTML=ti;if(firsta==null)
firsta=a_;divContainer.appendChild(a_);var spa=document.createElement('span');spa.innerHTML='&nbsp;|&nbsp;';divContainer.appendChild(spa);itemA++;}
var imgPath=oDnnUrl+'content/'+oTemplateApp+'/images/';if(sp>=ti){var an_=document.createElement('a');an_.href='#';an_.onclick=function(){return funcHref(this);}
an_.setAttribute('pi',ti);an_.innerHTML='<img alt=\"next\" src=\"'+imgPath+'arrow_right.png\" />';divContainer.appendChild(an_);}
if(begin>pageLength){var ap_=document.createElement('a');ap_.href='#';ap_.onclick=function(){return funcHref(this);}
ap_.setAttribute('pi',begin-1);ap_.innerHTML='<img alt=\"previous\" src=\"'+imgPath+'arrow_left.png\" />';divContainer.insertBefore(ap_,firsta);}
if(itemA<=1)
return document.createElement('div');return divContainer;};var myIpAddress='';function refrCaptcha(width,height){var imgCaptcha=document.getElementById('imgCaptcha');var hdcaptcha=document.getElementById('hdcaptcha');if(imgCaptcha&&hdcaptcha){var rand=Math.floor(Math.random()*999+1);var captchartoken=myIpAddress+'.'+rand;hdcaptcha.value=captchartoken;if(!width)
width=180;if(!height)
height=50;var img=document.createElement('IMG');img.style.width=width+'px';img.style.height=height+'px';capcharURL=oVirtualDir+'m/utility/captcha';img.src=capcharURL+'?t='+captchartoken+'&w='+width+'&h='+height+'&r='+(Math.random()*999999999);imgCaptcha.innerHTML='';imgCaptcha.appendChild(img);}};function copyClipboard(html){if(window.clipboardData)
window.clipboardData.setData('text',html);else{var flashcopier='flashcopier';var dvFlashcopier=document.getElementById(flashcopier);if(!dvFlashcopier){dvFlashcopier=document.createElement('div');dvFlashcopier.id=flashcopier;document.body.appendChild(dvFlashcopier);}
dvFlashcopier.innerHTML='';var html=encodeURIComponent(html);var divinfo='<embed wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" ';divinfo+='type="application/x-shockwave-flash" allowscriptaccess="always" quality="High" ';divinfo+='src="'+oDnnUrl+'Flash/_clipboard.swf" FlashVars="clipboard='+html+'" width="1px" height="1px"></embed>';dvFlashcopier.innerHTML=divinfo;}};oProcess={loadingID:'f_loading_message',objLoadingContainer:null,loading:function(showLoading){if(typeof(showLoading)=='undefined')
showLoading=true;if(showLoading){this.objLoadingContainer=document.getElementById(this.loadingID);this.objLoadingContainer.style.display='block';}},hide:function(){if(this.objLoadingContainer!=null){this.objLoadingContainer.style.display='none';}}};var oTitleText={url:'',data:[],callback:null,callfirst:null,init:function(_url,_data,_callback,_callfirst){oTitleText.data=_data;oTitleText.url=_url;if(_callback)
oTitleText.callback=_callback;if(_callfirst)
oTitleText.callfirst=_callfirst;jh(".stitle").each(function(idx){var value=jh(this).html();var sp=oTitleText.createTitle(this,value);this.innerHTML="";this.appendChild(sp);this.id='otitle_'+idx;});},setObjEvent:function(obj_){if(!obj_.onclick)
obj_.onclick=function(){var value=jh('#'+this.id+' span:first').html();oTitleText.showInputTitle(this,oTitleText.strValue(value));}
if(!obj_.onmousemove)
obj_.onmousemove=function(){jh('#'+this.id+' span:first').attr('class','hor');if(this.className.indexOf("phor")==-1){jh(this).addClass("phor");jh(this).removeClass("pnor");}}},createTitle:function(obj_,value_){oTitleText.setObjEvent(obj_);if(!obj_.onmouseout)
obj_.onmouseout=function(){if(this.className.indexOf("pnor")==-1){jh(this).addClass("pnor");jh(this).removeClass("phor");}
jh('#'+this.id+' span:first').attr('class','nor');var inp=jh('#'+this.id+' input:first');if(inp){var value=inp.val();if(value){var sp2=document.createElement('SPAN');sp2.innerHTML=oTitleText.strValue(value);obj_.innerHTML='';obj_.appendChild(sp2);oTitleText.setObjEvent(obj_);}}}
var sp=document.createElement('SPAN');sp.innerHTML=oTitleText.strValue(value_);return sp;},strValue:function(value_){var value=value_.replace(/^\s+/,'').replace(/\s+$/,'');return value;},changeTitle:function(evt,inputID_,obj_){var key;if(typeof(evt)=='string')
key=evt.charCodeAt(0);else
key=document.all?event.keyCode:(evt&&evt.which)?evt.which:0;if(key==27||key==13){var value=jh(inputID_).val();oTitleText.setTitle(value,obj_,key==13);}
return false;},setTitle:function(value,obj_,update){var sp=oTitleText.createTitle(obj_,value);obj_.innerHTML='';obj_.appendChild(sp);if(update){var oldv=jh(obj_).attr("old");var newv=oTitleText.strValue(value);if(oldv!=newv){oTitleText.data.value=newv;jh.ajax({type:'POST',url:oTitleText.url,data:oTitleText.data,dataType:'json',success:function(res){if(res.err==0){if(oTitleText.callback!=null)
oTitleText.callback(res.data[0]);}},error:function(res){},beforeSend:function(res){}});}}},showInputTitle:function(obj_,value){var inp=document.createElement('input');inp.type='text';inp.maxlength='255';value=oTitleText.strValue(value);inp.value=value;if(oTitleText.callfirst)
oTitleText.callfirst(inp);jh(obj_).attr("old",value);inp.onkeyup=function(event){return oTitleText.changeTitle(event,this,obj_);}
obj_.innerHTML='';obj_.appendChild(inp);var comm=document.createElement('input');comm.value='OK';comm.type='button';comm.onclick=function(event){if(event)
event.stopPropagation();var value=jh(inp).val();return oTitleText.setTitle(value,obj_,true);}
obj_.appendChild(comm);if(obj_.className.indexOf("stitle")==-1)
jh(obj_).addClass("stitle");obj_.onmousemove=null;obj_.onmouseout=null;obj_.onclick=null;}};function getLastName(fullname){fullname=Trim(fullname);var li=fullname.lastIndexOf(' ');if(li==-1)
return fullname;var ll=fullname.length;return fullname.substring(li+1,ll);}
function cloneObj(obj){var clone={};clone.prototype=obj.prototype;for(var p in obj)
clone[p]=obj[p];return clone;};function dialogDragDrop(dialogDivID){jh('#'+dialogDivID).bind('dragstart',function(event){return jh(event.target).is('.dgCline');}).bind('drag',function(event){jh(this).css({top:event.offsetY,left:event.offsetX});});};oDialog={iindex:0,showDivIDdef:'mainAlert',dialogDivID:'dgDialogMain',timeoutId:null,ifrNameIdx:0,_borderWidth:35,_borderHeight:35,addButtons:[],close:function(idx){if(typeof(idx)=='undefined')
idx=oDialog.iindex;var dialogDiv=window.document.getElementById(oDialog.dialogDivID+idx);if(dialogDiv){if(dialogDiv.getAttribute('modal')){var modalDialog=document.getElementById(oDialog.dialogDivID+'MODAL');if(modalDialog)
document.body.removeChild(modalDialog);}
document.body.removeChild(dialogDiv);oDialog.iindex--;if(oDialog.timeoutId)
clearTimeout(oDialog.timeoutId);}},btnPanel:function(type,setup,dialogFrame){var dgBtns=document.createElement('DIV');dgBtns.className='dgBtns';for(var i=0;i<this.addButtons.length;i++){var abi=this.addButtons[i];if(typeof(abi.command)=='function'){var botn2=document.createElement('INPUT');botn2.type='button';botn2.value=abi.title
botn2.onclick=function(event){if(event)
event.stopPropagation();abi.command();}
dgBtns.appendChild(botn2);}
else if(typeof(dialogFrame[abi.command])=='function'){var botn1=document.createElement('INPUT');botn1.type='button';botn1.value=abi.title
botn1.onclick=function(event){if(event)
event.stopPropagation();dialogFrame[abi.command]();}
dgBtns.appendChild(botn1);}}
this.addButtons=[];if(setup!=null){if(setup.onOKclick){var ok=document.createElement('INPUT');ok.type='button';if(type=='iframe')
ok.value='Cập nhật';else if(type=='ynquestion')
ok.value='Có';else
ok.value='Đồng ý';ok.onclick=function(event){if(event)
event.stopPropagation();setup.onOKclick();}
dgBtns.appendChild(ok);}
if(setup.onNOclick){var no=document.createElement('INPUT');no.type='button';no.value='Không';no.onclick=function(event){if(event)
event.stopPropagation();setup.onNOclick();}
dgBtns.appendChild(no);}
var close=document.createElement('INPUT');close.type='button';close.setAttribute('idx',setup.idx);close.value='Đóng';close.onclick=function(event){if(event)
event.stopPropagation();if(setup.onUnLoad)
setup.onUnLoad();oDialog.close(this.getAttribute('idx'));}
dgBtns.appendChild(close);}
return dgBtns;},frameOnload:function(idx){var dialogFrame=window.frames["dialogFrame"+oDialog.ifrNameIdx];if(dialogFrame){var setup=null;if(typeof(dialogFrame.onSubmit)=='function'){setup={onOKclick:function(){dialogFrame.onSubmit();}}}
setup.idx=idx;var dgBtns=oDialog.btnPanel('iframe',setup,dialogFrame);var dgDivBox=window.document.getElementById('btn'+this.dialogDivID+idx);dgDivBox.parentNode.appendChild(dgBtns);}},getzindexMax:function(){var zindexMax=10000;jh(".generic_dialog").each(function(){var zindex=parseInt(jh(this).css("z-index"));if(zindex>zindexMax)
zindexMax=zindex;});return zindexMax;},getindexMax:function(){var indexMax=0;jh(".generic_dialog").each(function(){var index=parseInt(jh(this).attr("idx"));if(index>indexMax)
indexMax=index;});return indexMax;},setPriority:function(obj){if(typeof(obj)=='number')
obj=jh("#"+oDialog.dialogDivID+obj);else
obj=jh(obj);obj.css("z-index",oDialog.getzindexMax()+1);},openDialog:function(type,setup,callback){var index=oDialog.getindexMax();index++;oDialog.iindex++;var winPar=window;var d=winPar.document.documentElement,b=winPar.document.body,w=winPar;var left,top;if(setup.left>0&&setup.top>0){left=setup.left;top=setup.top;}
else if(jh.browser.msie){left=b.scrollLeft||d.scrollLeft;top=b.scrollTop||d.scrollTop;}
else{left=w.pageXOffset;top=w.pageYOffset;}
var width=setup.width;if(!width)
width=0;var height=setup.height;if(!height)
height=0;var modal=setup.modal;if(!modal)
modal=false;var autoClose=setup.autoClose;if(!autoClose)
autoClose=0;var dgBoxcontin=document.createElement('DIV');dgBoxcontin.className='dgBoxcontin';if(setup.background)
dgBoxcontin.style.backgroundColor=setup.background;var dgDivBox=document.createElement('DIV');dgDivBox.className='dgDivBox';dgDivBox.id='btn'+this.dialogDivID+index;dgDivBox.appendChild(dgBoxcontin);if(type=='iframe'){var ifrHTML='<iframe id="'+this.dialogDivID+'FRM" frameborder=0 scrolling="auto" allowTransparency="allowtransparency" class="dialogIframe"';ifrHTML+=' style="width:'+(width-this._borderWidth)+'px;height:'+(height-this._borderHeight)+'px;" src="'+setup.src+'"';if(setup.allowSubmit){this.ifrNameIdx++;ifrHTML+=' onload="oDialog.frameOnload('+index+');"';if(typeof(setup.addButtonCommands)!='undefined'&&setup.addButtonCommands){this.addButtons=[];for(var p=0;p<setup.addButtonCommands.length;p++)
this.addButtons.push(setup.addButtonCommands[p]);}}
ifrHTML+=' name="dialogFrame'+this.ifrNameIdx+'"></iframe>';dgBoxcontin.innerHTML=ifrHTML;}
else if(type=='alert'||type=='confirm'||type=='ynquestion'){dgBoxcontin.innerHTML=setup.content;if(width==0)
width=350;dgBoxcontin.style.width=(width-this._borderWidth)+'px';top-=100;}
else if(type=='content'){dgBoxcontin.innerHTML=setup.content;if(width==0)
width=450;dgBoxcontin.style.width=(width-this._borderWidth)+'px';if(setup.scroll)
dgBoxcontin.style.overflow='scroll';if(height>0)
dgBoxcontin.style.height=height+'px';}
if(height==0)
height=80+this._borderHeight;if(jh.browser.msie&&jh.browser.version.substring(0,3)=='6.0')
dgBoxcontin.style.height=(height-this._borderHeight)+'px';var dgMc=document.createElement('DIV');dgMc.className='dgMc';dgMc.appendChild(dgDivBox);if(setup.buttonPanel){setup.idx=index;var dgBtns=oDialog.btnPanel(type,setup);dgMc.appendChild(dgBtns);}
var dgHead=document.createElement('DIV');dgHead.className='dgHead';if(setup.icon&&setup.icon!='none'){var shotcut=document.createElement('DIV');shotcut.className='shotcut '+setup.icon;dgHead.appendChild(shotcut);}
var dgClose=document.createElement('DIV');dgClose.className='dgClose';dgClose.setAttribute('idx',index);dgClose.onclick=function(){if(setup.onUnLoad)
setup.onUnLoad();oDialog.close(this.getAttribute('idx'));}
var spanClose=document.createElement('SPAN');spanClose.title='Đóng';spanClose.innerHTML='&nbsp;';dgClose.appendChild(spanClose);dgHead.appendChild(dgClose);var h3=document.createElement('H3');h3.className='dgCline';var spanTitle=document.createElement('SPAN');spanTitle.innerHTML=setup.title;h3.appendChild(spanTitle);dgHead.appendChild(h3);var dialogDiv=document.createElement('DIV');dialogDiv.appendChild(dgHead);dialogDiv.appendChild(dgMc);dialogDiv.id=this.dialogDivID+index;dialogDiv.setAttribute("idx",index);dialogDiv.className='generic_dialog';jh(dialogDiv).css("z-index",oDialog.getzindexMax()+1);jh(dialogDiv).click(function(){oDialog.setPriority(this);});if(jh.browser.msie){var iev=jh.browser.version.substring(0,3);if(iev=='6.0'||iev=='7.0')
dialogDiv.style.width=width+'px';if(iev=='6.0'&&height>0)
dialogDiv.style.height=height+'px';}
if(setup.position){switch(setup.position){case"tl":setup.left=10;setup.top=10;break;case"tr":setup.left=b.clientWidth-width-10;setup.top=10;break;case"bl":setup.left=10
setup.top=d.clientHeight-height-65;break;case"br":setup.left=b.clientWidth-width-10;setup.top=d.clientHeight-height-65;break;}}
else{var chik=0;for(var ik=1;ik<oDialog.iindex;ik++)
chik+=20;if(!setup.left){setup.left=left+(b.clientWidth-width)/2;setup.left+=chik;}
if(!setup.top){setup.top=top+(d.clientHeight-height)/2;setup.top+=chik;}}
dialogDiv.style.left=setup.left+'px';dialogDiv.style.top=setup.top+'px';dialogDiv.setAttribute('modal',modal);if(modal){var modalID=this.dialogDivID+'MODAL';if(!winPar.document.getElementById(modalID)){var modalDiv=document.createElement('DIV');modalDiv.id=modalID;modalDiv.className='modalDiv';modalDiv.style.top=0+'px';modalDiv.style.left=0+'px';modalDiv.style.width=b.clientWidth+'px';modalDiv.style.height=b.clientHeight+'px';winPar.document.body.appendChild(modalDiv);jh(modalDiv).css("z-index",oDialog.getzindexMax());}}
winPar.document.body.appendChild(dialogDiv);winPar.dialogDragDrop(dialogDiv.id);if(callback)
callback(index);if(autoClose>0)
this.timeoutId=setTimeout('oDialog.close('+index+');',autoClose);return index;},ynquestion:function(message,onYES,onNO,setup){var data=cloneObj(setup);data.content=message;data.modal=true;data.buttonPanel=true;if(!data.icon)
data.icon='question';data.onOKclick=function(){onYES();oDialog.close(oDialog.index);}
data.onNOclick=function(){onNO();oDialog.close(oDialog.index);}
return this.openDialog('ynquestion',data,null);},confirm:function(message,onConfirmed,setup){var data=cloneObj(setup);data.content=message;data.modal=true;data.buttonPanel=true;if(!data.icon)
data.icon='question';data.onOKclick=function(){onConfirmed();oDialog.close(oDialog.index);}
return this.openDialog('confirm',data,null);},shTimerID:null,hide:function(id){if(typeof(id)=='undefined')
id=this.showDivIDdef;jh('#'+id).hide(1000);if(this.shTimerID)
clearTimeout(this.shTimerID);},show:function(message,duration,callback,id){if(message!=''){if(typeof(id)=='undefined')
id=this.showDivIDdef;if(typeof(duration)=='undefined')
duration=4000;var divContainer=jh('#'+id);divContainer.html('<div class="notice2">'+message+'</div>');var d=window.document.documentElement;divContainer.css("top",d.clientHeight-jh(divContainer).height());divContainer.slideToggle("fast",callback);this.shTimerID=setTimeout('oDialog.hide()',duration);}},alertError:function(message,onCallback,setup){if(!setup)
setup={};if(!setup.icon)
setup.icon='error';if(!setup.title)
setup.title='Thông báo lỗi';if(!setup.autoClose)
setup.autoClose=4000;return this.alert(message,onCallback,setup);},alertWarning:function(message,onCallback,setup){if(!setup)
setup={};if(!setup.icon)
setup.icon='warning';if(!setup.title)
setup.title='Cảnh báo';if(!setup.autoClose)
setup.autoClose=3000;return this.alert(message,onCallback,setup);},alert:function(message,onCallback,setup){var data=cloneObj(setup);if(!data.icon)
data.icon='info';data.content=message;data.buttonPanel=true;data.modal=true;return this.openDialog('alert',data,onCallback);},openIframe:function(url,caption,onCallback,setup){var data=cloneObj(setup);if(!data.icon)
data.icon='info';data.src=url;data.title=caption;return this.openDialog('iframe',data,onCallback);},openContent:function(html,caption,onCallback,setup){var data=cloneObj(setup);if(!data.icon)
data.icon='info';data.content=html;data.title=caption;return this.openDialog('content',data,onCallback);},openCalendar:function(txtObj,showTime,_value,callback,offsetLeft,offsetTop){var ext='';var option={width:205,height:0,icon:'none',modal:true}
if(txtObj){option.left=txtObj.offsetLeft;option.top=txtObj.offsetTop+txtObj.offsetHeight;if(!offsetTop)
offsetTop=70;option.top+=offsetTop;if(!offsetLeft)
offsetLeft=162;option.left+=offsetLeft;option.modal=false;if(txtObj.value!=''){var _reg=new RegExp(/(\d+)\/(\d+)\/(\d+)(\s*.*?$)?/ig);_reg=_reg.exec(txtObj.value);_value={day:_reg[1]*1,month:_reg[2]*1,year:_reg[3]*1};ext=_reg[4];}}
var curIdx=this.iindex;curIdx--;var strCalendar='<div id="dvCalMain'+curIdx+'"></div>';return this.openContent(strCalendar,'<img src="'+dnnUrlFull+'images/blank.gif" onclick="clPre();" class="calendarPre" />  <span id="calendarTitle'+curIdx+'"></span>  <img src="'+dnnUrlFull+'images/blank.gif" class="calendarNex" onclick="clNex();" />',function(){initCalendar(_value,function(result){var week=result.w;var day=result.d;var month=result.m;var yeah=result.y;var title=result.t;if(!ext)
ext='';if(txtObj){if(showTime!=ext){if(showTime||ext!=''){var dateNow=new Date();ext=' '+dateNow.getHours()+':'+dateNow.getMinutes();}}
txtObj.value=day+'/'+month+'/'+yeah+ext;}
if(callback)
callback(result);oDialog.close(oDialog.iindex);},'dvCalMain'+curIdx,'calendarTitle'+curIdx);},option);},buzz:function(boxIdx){var movefactor=5;var posarr=[[1,1],[1,-1],[-1,-1],[-1,1],[1,-1],[-1,-1],[-1,1],[1,1],[-1,-1],[-1,1],[1,1],[1,-1],[-1,1],[1,1],[1,-1],[-1,-1],[1,1],[1,-1],[-1,-1],[-1,1],[1,1],[1,-1],[-1,-1],[-1,1],[1,-1],[-1,-1],[-1,1],[1,1],[-1,-1],[-1,1],[1,1],[1,-1],[-1,1],[1,1],[1,-1],[-1,-1],[1,1],[1,-1],[-1,-1],[-1,1]];if(typeof(boxIdx)!='undefined'){var dirg=jh("#"+oDialog.dialogDivID+boxIdx);var dirgOffet=dirg.offset();}
var index=0;function MoveFunc(){var pos=posarr[index];if(pos){try{if(typeof(boxIdx)=='undefined'||boxIdx==-1)
window.moveBy(pos[0]*movefactor,pos[1]*movefactor);else{dirg.css("top",dirgOffet.top+(pos[0]*movefactor));dirg.css("left",dirgOffet.left+(pos[1]*movefactor));}}
catch(x){}}
index++;if(index<posarr.length)
intervalId=setTimeout(MoveFunc,20);}
var intervalId=setTimeout(MoveFunc,20);}};
