
jh.install("cmsSearch",{},function(){jh.extend({cms_initSearch:function(){var c=jh.plugins.cmsSearch;c.txtSearch=jh("#txtSearch");c.searchTxtDefault='từ khóa';c.txtSearch.val(c.searchTxtDefault).click(function(){if(this.value==c.searchTxtDefault)
this.value='';}).keypress(function(evt){if(evt.keyCode==13&&!evt.shiftKey)
return jh.cms_search();});},cms_search:function(){var c=jh.plugins.cmsSearch;var txt=c.txtSearch.val()
if(txt==''||txt==c.searchTxtDefault)
return false;window.location.href=oAppPath+'search?q='+txt;}});});jh.install("cmsUtility",{},function(){jh.extend({printDocument:function(){var leftPos=(screen.availWidth-800)/2;var topPos=(screen.availHeight-600)/2;var popWindow=window.open('','popWindow','width=800,height=600,scrollbars=yes,resizable=yes,titlebar=0,top='+topPos+',left='+leftPos);popWindow.document.open();html='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>';html+='<head><title>www.baohatinh.vn</title>';html+='<link href="'+oDnnFullUrl+'css/detail3.css" type="text/css" rel="stylesheet" />';html+='<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><style>img {border:0px;}</style>';html+='</head><body>';html+='<div style="text-align:left;padding:5px;">';html+='<div id="OsDocument" class="bloc05" style="overflow:hidden;width:760px;">';html+=document.getElementById('content_document').innerHTML;html+='</div>';html+='<br /><div style="background:#EEE;padding:5px;"><a href="javascript:window.print();"><img border="0" alt="" src="'+oDnnUrl+'images/OsPrint.gif" style="cursor: pointer;"/>In bài viết này</a><hr/>';html+='<div style="font-family: Arial; font-size: xx-small;"> Copyright 2008 http://www.vpdt.vn</div></div>';html+='</div></body></html>';popWindow.document.write(html);popWindow.document.close();}});});var slideNew={data:[],showi:0,length:0,container:null,curent:5,slide:function(){var li=slideNew.data[slideNew.curent];slideNew.container.prepend(li);var curli=jh('#nmli'+slideNew.curent);curli.toggle(2000,function(){if(slideNew.curent==slideNew.length-1)
slideNew.curent=-1;slideNew.curent++;curli.next().next().next().next().remove();setTimeout('slideNew.slide();',2000);showTimes();});},init:function(objID_,link,data){slideNew.container=jh("#"+objID_);slideNew.length=data.length;for(var i=0;i<slideNew.length;i++){var item=data[i];var li='<li id="nmli'+i+'" style="display:none;"><a href="'+item.Link+'" target="_parent">'+item.Title+'</a><i class="stime" rel="'+item.Numb+'"></i></li>';slideNew.data.push(li);if(i<slideNew.curent){slideNew.container.prepend(li);jh('#nmli'+i).show();}
showTimes();}
setTimeout('slideNew.slide();',2000);}}
var oSlideShow1=new Object({});oSlideShow1.contr=function(objID_,imageRoot_,width_,height_,panelHeight_){var c=oSlideShow1;var objID=objID_;var a=this;var iTSTimer=0;var iTSCount,iTSCur,iTSFading,iTSPrev=0,iTSNext=0,iTSFastMove=0;var iFadeDelay=50;var video=oDnnUrl+'images/slideshow/video.gif';var Photo=oDnnUrl+'images/slideshow/photo.gif';var Next=oDnnUrl+'images/slideshow/next.gif';var Prev=oDnnUrl+'images/slideshow/prev.gif';var Next2=oDnnUrl+'images/slideshow/next2.gif';var Prev2=oDnnUrl+'images/slideshow/prev2.gif';var imageRoot=imageRoot_;var swidth=width_;var sheight=height_;var panelHeight=65;if(typeof(panelHeight_)!='undefined'&&panelHeight_>0)
panelHeight=panelHeight_;var arDivTopStory=[];var arDivTopStoryLayer=[];var arDivTopStoryTitle=[];function gmobj(o){if(document.getElementById)
return document.getElementById(o);if(document.all)
return document.all[o];if(document.layers)
return document[o];}
a.show=function(jsonDatas){var dvMain=document.createElement('DIV');dvMain.className='slideShow1';with(dvMain.style){width=swidth+'px';height=sheight+'px';}
var dv1=document.createElement('DIV');with(dv1.style){left=0;top=0;height='3px';width=(swidth+2)+'px';}
dv1.className="bor";dvMain.appendChild(dv1);var dv2=document.createElement('DIV');with(dv2.style){left=0;top=(sheight-1)+'px';height='3px';width=(swidth+2)+'px';}
dv2.className="bor";dvMain.appendChild(dv2);var dv3=document.createElement('DIV');with(dv3.style){left=0;top='3px';height=(sheight-4)+'px';width='3px';}
dv3.className="bor";dvMain.appendChild(dv3);var dv4=document.createElement('DIV');with(dv4.style){left=(swidth-1)+'px';top='3px';height=(sheight-4)+'px';width='4px';}
dv4.className="bor";dvMain.appendChild(dv4);iTSCount=jsonDatas.length-1;for(var i=0;i<=iTSCount;i++){var jsonData=jsonDatas[i];if(!jsonData||!jsonData.link)
break;var hlink=jsonData.link;var dvItem=document.createElement('DIV');dvItem.className='ima';with(dvItem.style){height=(sheight+2)+'px';width=(swidth+2)+'px';top=0;left=(i==0?0:'-1000px');}
dvItem.onmousemove=function(){a.cleartopstorycounter();}
dvItem.innerHTML='<a title="'+jsonData.title+'" href="'+hlink+'"><img class="thumb" src="'+imageRoot+jsonData.image+'" width="'+swidth+'" height="'+sheight+'" /></a>';dvMain.appendChild(dvItem);arDivTopStory.push(dvItem);var dvLayer=document.createElement('DIV');with(dvLayer.style){height=panelHeight+'px';width=(swidth+2)+'px';top=(sheight-panelHeight)+'px';left=(i==0?0:'-1000px');}
dvLayer.className='layer';dvLayer.onmousemove=function(){a.cleartopstorycounter();}
dvMain.appendChild(dvLayer);arDivTopStoryLayer.push(dvLayer);var dvItemTitle=document.createElement('DIV');with(dvItemTitle.style){height=panelHeight+'px';width=(swidth+2)+'px';top=(sheight-panelHeight)+'px';left=(i==0?0:'-1000px');}
dvItemTitle.className='cont';dvItemTitle.onmousemove=function(){a.cleartopstorycounter();}
var dvTitle1=document.createElement('DIV');with(dvTitle1.style){height='18px';width=(swidth-5)+'px';top='4px';left='3px';}
dvTitle1.title=jsonData.title;dvTitle1.className='title';dvTitle1.setAttribute('hk',hlink);dvTitle1.onclick=function(){window.location=this.getAttribute('hk');}
dvTitle1.innerHTML=jsonData.title;dvItemTitle.appendChild(dvTitle1);var dvTitle2=document.createElement('DIV');with(dvTitle2.style){height='18px';width=(swidth-5)+'px';top='5px';left='4px';}
dvTitle2.className='titleShadow';dvTitle2.innerHTML=jsonData.title;dvItemTitle.appendChild(dvTitle2);var dvTitle3=document.createElement('DIV');with(dvTitle3.style){height='18px';width=(swidth-15)+'px';top='28px';left='4px';}
dvTitle3.className='lead';var description=jsonData.head;if(jsonData.isVideo)
description+='<img src="'+video+'" hspace=2 />';if(jsonData.isPhoto)
description+='<img src="'+Photo+'" hspace=2 />';dvTitle3.innerHTML=description;dvItemTitle.appendChild(dvTitle3);dvMain.appendChild(dvItemTitle);arDivTopStoryTitle.push(dvItemTitle);}
var dvPanel=document.createElement('DIV');with(dvPanel.style){height='32px';width='40px';top=(sheight-19)+'px';left=(swidth-26)+'px';}
dvPanel.className='panel';var imgPre=document.createElement('IMG');imgPre.id='imgTSPrev'+objID;imgPre.src=Prev2;imgPre.hspace=2;imgPre.vspace=0;imgPre.onmouseover=function(){iTSPrev=1;this.src=Prev;}
imgPre.onmouseout=function(){iTSPrev=0;this.src=Prev2;}
imgPre.onclick=function(){a.changetopstory(-1,false);}
dvPanel.appendChild(imgPre);var imgNex=document.createElement('IMG');imgNex.id='imgTSNext'+objID;imgNex.src=Next2;imgNex.hspace=2;imgNex.vspace=0;imgNex.onmouseover=function(){iTSNext=1;this.src=Next;}
imgNex.onmouseout=function(){iTSNext=0;if(!iTSFading)
this.src=Next2;}
imgNex.onclick=function(){a.changetopstory(1,false);}
dvPanel.appendChild(imgNex);dvMain.appendChild(dvPanel);gmobj(objID).appendChild(dvMain);iTSCur=0;setInterval(function(){topstorycounter();},100)}
a.changetopstory=function(direction,fade){var iTop,iBot;var oTop,oBot,oTopLayer,oBotLayer,oTopTitle,oBotTitle;iTop=iTSCur;iBot=iTop+direction;if(iBot<0)iBot=iTSCount;if(iBot>iTSCount)iBot=0;oTop=arDivTopStory[iTop];oBot=arDivTopStory[iBot];oTopLayer=arDivTopStoryLayer[iTop];oBotLayer=arDivTopStoryLayer[iBot];oTopTitle=arDivTopStoryTitle[iTop];oBotTitle=arDivTopStoryTitle[iBot];if(iTSFading==1){arDivTopStory[iTop+1].style.left='-1000px';arDivTopStoryLayer[iTop+1].style.left='-1000px';arDivTopStoryTitle[iTop+1].style.left='-1000px';outdirectionimage();iTSFading=0;}
iTSTimer=0;if(!fade){iTSFastMove=1;changeOpac(100,oBot);changeOpac(40,oBotLayer);changeOpac(100,oBotTitle);if(oTop){with(oTop.style){zIndex=1;left='-1000px';}}
if(oBot){with(oBot.style){zIndex=2;left=0;}}
oBotLayer.style.left=0;oTopLayer.style.left='-1000px';oBotTitle.style.left=0;oTopTitle.style.left='-1000px';iTSFading=0;iTSCur=iBot;}
else{iTSFastMove=0;changeOpac(100,oBot);changeOpac(0,oBotLayer);changeOpac(0,oBotTitle);oTop.style.zIndex=2;oBot.style.zIndex=1;oBot.style.left=0;oBotLayer.style.left=0;oBotTitle.style.left=0;iTSFading=1;changingdirectionimage(direction);changingtopstory(iTop,iBot,0,100);}}
function changingtopstory(iTop,iBot,iStep,iCurOpac){var oTop,oBot,oTopLayer,oBotLayer,oTopTitle,oBotTitle;oTop=arDivTopStory[iTop]
oBot=arDivTopStory[iBot]
oTopLayer=arDivTopStoryLayer[iTop];oBotLayer=arDivTopStoryLayer[iBot];oTopTitle=arDivTopStoryTitle[iTop];oBotTitle=arDivTopStoryTitle[iBot];if(iTSFading==1){if(iStep==0){if(iCurOpac>=0){changeOpac(iCurOpac,oTopTitle);changeOpac(iCurOpac*40/100,oTopLayer);iCurOpac-=5;setTimeout(function(){changingtopstory(iTop,iBot,0,iCurOpac)},iFadeDelay);}
else{setTimeout(function(){changingtopstory(iTop,iBot,1,100)},2000);}}
else if(iStep==1){if(iCurOpac>=0){changeOpac(iCurOpac,oTop);iCurOpac-=5;setTimeout(function(){changingtopstory(iTop,iBot,1,iCurOpac)},iFadeDelay);}
else{iTSCur=iBot;oTop.style.left='-1000px';oTopLayer.style.left='-1000px';oTopTitle.style.left='-1000px';setTimeout(function(){changingtopstory(iTop,iBot,2,0)},100);}}
else if(iStep==2){if(iCurOpac<=100){changeOpac(iCurOpac,oBotTitle);changeOpac(iCurOpac*40/100,oBotLayer);iCurOpac+=5;setTimeout(function(){changingtopstory(iTop,iBot,2,iCurOpac)},iFadeDelay);}
else{outdirectionimage();iTSFading=0;iTSTimer=0;}}}
else if(iStep<2&&iTSFastMove==0){oBot.style.left='-1000px';oBotLayer.style.left='-1000px';oBotTitle.style.left='-1000px';outdirectionimage();iTSFading=0;iTSTimer=0;}}
function changingdirectionimage(direction){if(direction>0)gmobj('imgTSNext'+objID).src=Next;else gmobj('imgTSPrev').src=Prev;}
function outdirectionimage(){if(iTSNext==0)gmobj('imgTSNext'+objID).src=Next2;if(iTSPrev==0)gmobj('imgTSPrev'+objID).src=Prev2;}
function topstorycounter(){iTSTimer++;if(iTSTimer>70){iTSTimer=0;a.changetopstory(1,true);}}
a.cleartopstorycounter=function(){changeOpac(100,arDivTopStory[iTSCur]);changeOpac(40,arDivTopStoryLayer[iTSCur]);changeOpac(100,arDivTopStoryTitle[iTSCur]);iTSFading=0;iTSTimer=0;}
function changeOpac(sopacity,obj){if(obj){with(obj.style){opacity=(sopacity/100);MozOpacity=(sopacity/100);KhtmlOpacity=(sopacity/100);filter="alpha(opacity="+sopacity+")";}}}};
