_const_={baseurl:"http://videos.ibibo.com"};

var mvTmr=null,current=0;function changeView(n,parId)
{removeNode(n);obj=createNode(((n+10)%TOTAL_COUNT));$('imgCont').appendChild(obj);}
function left(parId)
{posLeft=parseInt($(parId).style.left);posLeft-=2;if(posLeft<-90)
{changeView(current,parId);current=getNextCurr();posLeft=0;}
$(parId).style.left=posLeft+'px';rmTmr();setTmr();}
function rmTmr()
{if(mvTmr)clearTimeout(mvTmr);}
function setTmr()
{mvTmr=setTimeout('left("slide");',50);}
function removeNode(n)
{obj=$(getID(n));obj.parentNode.removeChild(obj);}
function getNextCurr(){return(current+1)%TOTAL_COUNT;}
function getID(n){return'i'+n;}
function getImgUrl(n){return detailsArr[n].imgurl;}
function getLink(n)
{vid=detailsArr[n];return INDIVIDUAL_VIDEO_URL+vid.userid+"/"+vid.videoid;}
function createNode(n)
{id=getID(n);imgUrl=getImgUrl(n);aLink=getLink(n);aNode=$(getID(getNextCurr())).cloneNode(true);aNode.setAttribute('id',id);aNode.setAttribute('href',aLink);aNode.className='marL15';imgNode=aNode.getElementsByTagName('img')[0];imgNode.setAttribute('src',imgUrl);return aNode;}
function showDescr(id)
{rmTmr();n=id.replace(/^i/g,"");descrCont=$('videoDescriptionCont');vid=detailsArr[n]
caption=vid.caption;user=vid.username;playtime=vid.playtime;datetime=vid.datetime;descrText=["<table border='0' cellspacing='0' width='100%'><tr>","<td width='35%'><b>"+caption+"</b>&nbsp;&nbsp;by&nbsp; "+user+"</td>","<td>Duration&nbsp:&nbsp;<b>"+playtime+"</b>&nbsp;|&nbsp;Uploaded on "+datetime+"</td>","<td width='20%'></td>","</tr></table>"].join('');descrCont.innerHTML=descrText;descrCont.style.visibility='visible';}
function hideDescr(id)
{setTmr();$('videoDescriptionCont').style.visibility='hidden';}