
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+")";}}}};
