// JavaScript Document

function zxcExternal(zxcfun){
// Example to call a function where the obj.url(field 2 of the array) is 'FunctionName^|^functionparameter'
// function 'FunctionName' will be called passing 'functionparameter' as a parameter
 var zxcdata=zxcfun.split('^|^');
 if (typeof(window[zxcdata[0]])=='function') window[zxcdata[0]](zxcdata[1]);
}

var zxcBGColor='#FFFFFF';   // The default background color of banner elements (string)
var zxcTxtColor='black';      // The default text color of banner elements (string)
var zxcTxtAlign='center';   // The default text alignment of banner elements (string)
var zxcFontSize='22px';     // The default font size of banner elements (string)



// **** Example Image Path and Content Array

var ImgPath='images/';
var ContentAry=[ImgPath]
ContentAry[1]=['IMG','blank.png',2  ,30   ,];
ContentAry[2]=['IMG','blank.png','',2  ,30   ,];
ContentAry[3]=['TXT','<a href=http://www.apweekly.com/Videos target=_blank><img src=images/ap.png border=0></a>','#',85  ,30,];

ContentAry[4]=['TXT','<a href=http://frames.mathrubhumi.com/index.php target=_blank><img src=images/mb4frames.jpg border=0></a>','#',160,40 ,];

ContentAry[5]=['TXT','<a href=http://www.dinamani.com/videos.asp target=_blank><img src=images/dinamani.png border=0></a>','#' ,140  ,33,];
ContentAry[6]=['TXT','<a href=http://indiainteracts.com/video target=_blank><img src=images/indianint.png border=0></a>','#' ,200  ,35,]; 

ContentAry[7]=['TXT','<a href=http://videos.expressbuzz.com target=_blank><img src=images/expressbuzz.jpg border=0></a>','#' ,140  ,37,];




ContentAry[8]=['TXT','<a href=http://www.mediacurry.com/ target=_blank><img src=images/m-curry.png border=0></a>','#' ,123  ,37,];
ContentAry[9]=['TXT','<a href=http://www.muft.tv/index.php?option=com_content&amp;task=view&amp;id=15624&amp;Itemid=195 target=_blank><img src=images/muft.png border=0></a>','#' ,140  ,25,];
ContentAry[10]=['TXT','<a href=http://videos.oneindia.in/ target=_blank><img src=images/oneindia.png border=0></a>','#' ,137  ,37,];
ContentAry[11]=['TXT','<a href=http://food.sulekha.com/videos/partner/indiainteracts.htm? target=_blank><img src=images/sulekha.png border=0></a>','#' ,178  ,39,];
ContentAry[12]=['TXT','<a href=http://thatshindi.oneindia.in/video/ target=_blank><img src=images/thatshindi.png border=0></a>','#',110  ,35 ,];
ContentAry[13]=['TXT','<a href=http://thatstamil.oneindia.in/movies/videos/index.html target=_blank><img src=images/thatstamil.png border=0></a>','#',110  ,30 ,];
ContentAry[14]=['TXT','<a href=http://www.thuglak.com/thuglak/shows.php target=_blank><img src=images/thuglak.png border=0></a>','#',172  ,29 ,];

ContentAry[15]=['TXT','<a href=http://sports.mathrubhumi.com/index.php  target=_blank><img src=images/mb4sports.jpg  border=0></a>','#',120,40 ,];



ContentAry[16]=['TXT','<a href=http://video.aol.com/video-search/query/indiainteracts%20videos; target=_blank><img src=images/aol.jpg border=0></a>','#',110  ,30 ,];
ContentAry[17]=['TXT','<a href=http://www.istream.in/index.html  target=_blank><img src=images/istream.jpg border=0></a>','#',200  ,30 ,];
ContentAry[18]=['TXT','<a href=http://www.patrika.com/videos.aspx?fn=MCsyMDIzOXx8MTI5  target=_blank><img src=images/patrika.jpg border=0></a>','#',150  ,32 ,];
ContentAry[19]=['TXT','<a href=http://www.dinakaran.com/newvids/  target=_blank><img src=images/dinakaran.jpg border=0></a>','#',130  ,32 ,];
ContentAry[20]=['TXT','<a href=http://webindia123.com target=_blank><img src=images/webmedia.jpg border=0></a>','#',180  ,29 ,];

ContentAry[21]=['TXT','<a href=http://www.aniin.com target=_blank><img src=images/ani.jpg border=0></a>','#',110,30 ,];
ContentAry[22]=['TXT','<a href=http://www.mathrubhumi.com  target=_blank><img src=images/marthu.jpg border=0></a>','#',110,35 ,];
ContentAry[23]=['TXT','<a href=http://eves.mathrubhumi.com  target=_blank><img src=images/mb4eves.jpg border=0></a>','#',120,40 ,];
ContentAry[24]=['TXT','<a href=http://www.bebo.com/subbuM target=_blank><img src=images/bebo.png border=0></a>','#' ,138  ,37,];



ContentAry[25]=['TXT','<a href=http://www.in.com/videos/watchsearch.php?search_data=ventunotech&x=43&y=18; target=_blank><img src=images/in.jpg border=0></a>','#',110  ,30,];

ContentAry[26]=['TXT','<a href=http://www.bollyclips.com/bollywoodvideos  target=_blank><img src=images/bolly.jpg  border=0></a>','#',150  ,39,];
//ContentAry[27]=['TXT','<a href=http://loksatta.com/  target=_blank><img src=images/expressindia.com.png  border=0></a>','#',200  ,40,];
//ContentAry[27]=['TXT','<a href=http://tehelka.com/  target=_blank><img src=images/expressindia.com.png  border=0></a>','#',200  ,40,];
ContentAry[27]=['TXT','<a href= http://tehelka.com/ target=_blank><img src=images/tel.jpg border=0></a>','#',138  ,40,];
ContentAry[28]=['TXT','<a href=http://www.expressindia.com/  target=_blank><img src=images/expressindia.com.png border=0></a>','#',200  ,40,];
ContentAry[29]=['TXT','<a href=http://loksatta.com/  target=_blank><img src=images/nlslg.jpg border=0></a>','#',200  ,40,];
ContentAry[30]=['TXT','<a href=http://www.screenindia.com/  target=_blank><img src=images/screen.jpg border=0></a>','#',170  ,40,];
ContentAry[31]=['TXT','<a href=http://www.financialexpress.com/  target=_blank><img src=images/financial-logo.gif border=0></a>','#',350  ,40,];
ContentAry[32]=['TXT','<a href=http://www.swamifilms.com/  target=_blank><img src=images/swami.jpg border=0></a>','#',250  ,40,];
ContentAry[33]=['TXT','<a href=http://www.movd.in/  target=_blank><img src=images/movd_logo.gif  border=0></a>','#',200  ,40,];
ContentAry[34]=['TXT','<a href=http://www.maalaimalar.com/  target=_blank><img src=images/maalaimalar.jpg  border=0></a>','#',200  ,40,];
ContentAry[35]=['TXT','<a href=http://www.dailythanthi.com  target=_blank><img src=images/dailythanthi.jpg  border=0></a>','#',200  ,40,];
ContentAry[36]=['TXT','<a href=http://mangalam.com/index.php  target=_blank><img src=images/mangalam.jpg  border=0></a>','#',200  ,40,];









// **** Functional Code - NO NEED to Change


function zxcCSBanner(zxcid,zxcvh,zxcw,zxcspd,zxcaary){
 var zxcp=document.getElementById(zxcid);
 var zxcary=[]
 if (zxcaary){
  var zxcpth=zxcaary[0];
  for (var zxc0=1;zxc0<zxcaary.length;zxc0++){ zxcary[zxc0-1]=zxcaary[zxc0];  for (var zxc1=0;zxc1<zxcary[zxc0-1].length;zxc1++){ if (zxcary[zxc0-1][zxc1]==''){ zxcary[zxc0-1][zxc1]=null; } } }
 }
 else {
  var zxceles=zxcp.childNodes;
  for (var zxc0=0;zxc0<zxceles.length;zxc0++){ if (zxceles[zxc0].tagName=='DIV'){ zxcary.push([zxceles[zxc0],zxceles[zxc0].offsetWidth,zxceles[zxc0].offsetHeight]); } }
  for (var zxc1=0;zxc1<zxcary.length;zxc1++){ zxcp.removeChild(zxcary[zxc1][0]); }
 }
 var zxcwh=(zxcvh=='H')?[zxcp.offsetHeight,zxcp.offsetWidth,'left','top','width','height']:[zxcp.offsetWidth,zxcp.offsetHeight,'top','left','height','width'];
 zxcp.set=true;
 var zxcd=zxcStyle('DIV',{position:'absolute',left:'0px',top:'10px',width:zxcwh[0]+'px'});
 zxcp.appendChild(zxcd);
 zxcp.ary=[zxcd,zxcd.cloneNode(false),zxcd.cloneNode(false),zxcd.cloneNode(true)];
 for (var zxc2=1;zxc2<zxcp.ary.length;zxc2++){ zxcp.appendChild(zxcp.ary[zxc2]); }
 var zxcobj;
 for (var zxc3=0;zxc3<zxcp.ary.length;zxc3++){
  var zxccnt=0;
  var zxctp=0;
  for (var zxc4=0;zxc4<Math.max(zxcary.length,Math.ceil(zxcwh[1]/zxcwh[0])+1);zxc4++){
   if (typeof(zxcary[zxccnt][0])=='string'){
    if (zxcary[zxccnt][0].toUpperCase().match('I')){ zxcobj=zxcStyle('IMG'); zxcobj.src=zxcpth+zxcary[zxccnt][1]; }
    if (zxcary[zxccnt][0].toUpperCase().match('T')){ zxcobj=zxcStyle('DIV'); zxcobj.innerHTML=zxcary[zxccnt][1]; }
    if (zxcary[zxccnt][2]){ zxcobj.url=zxcary[zxccnt][2]; zxcStyle(zxcobj,{ cursor:((document.all)?'hand':'pointer')}); zxcobj.onclick=function(){ zxcLink(this); } }
    zxcStyle(zxcobj,{position:'absolute',backgroundColor:(zxcary[zxccnt][5]||zxcBGColor),color:(zxcary[zxccnt][6]||zxcTxtColor),textAlign:(zxcary[zxccnt][7]||zxcTxtAlign),fontSize:(zxcary[zxccnt][8]||zxcFontSize)});
    zxcobj.style[zxcwh[4]]=((zxcary[zxccnt][(zxcvh=='H')?3:4])||zxcw)+'px';
    zxcobj.style[zxcwh[5]]=((zxcary[zxccnt][(zxcvh=='H')?4:3])||zxcwh[0])+'px';
   }
   else {
    zxcobj=zxcary[zxccnt][0].cloneNode(true);
    zxcStyle(zxcobj,{position:'absolute',width:zxcary[zxccnt][1]+'px',height:zxcary[zxccnt][2]+'px'});
   }
   zxcobj.style[zxcwh[2]]=(zxctp)+'px';
   zxcobj.style[zxcwh[3]]='0px';
   zxcp.ary[zxc3].appendChild(zxcobj);
   zxcp.ary[zxc3].style[zxcwh[4]]=(parseInt(zxcobj.style[zxcwh[2]])+parseInt(zxcobj.style[zxcwh[4]]))+'px';
   zxctp+=parseInt(zxcobj.style[zxcwh[4]]);
   zxccnt=++zxccnt%zxcary.length;
  }
 }
 var zxchw=parseInt(zxcp.ary[0].style[zxcwh[4]]);
 for (var zxc4=0;zxc4<zxcp.ary.length;zxc4++){ zxcp.ary[zxc4].style[zxcwh[2]]=(zxchw*zxc4-zxchw)+'px'; }
 if (!zxcp.oopbr){ zxcp.oopbr=new zxcOOPBannerRotate(zxcp,zxcvh,zxcspd,zxchw); }
}

function zxcCngDirection(zxcid,zxcdir){
 var zxcoop=document.getElementById(zxcid).oopbr;
 if (!zxcoop){ return; }
 clearTimeout(zxcoop.to);
 zxcdir=zxcdir||-zxcoop.dir;
 if (zxcdir>0){ zxcoop.dir=1; }
 else { zxcoop.dir=-1; }
 zxcoop.rotate();
}

function zxcBannerStop(zxcid){
 var zxcoop=document.getElementById(zxcid).oopbr;
 if (!zxcoop){ return; }
 clearTimeout(zxcoop.to);
}

function zxcBannerStart(zxcid,zxcdir){
 var zxcoop=document.getElementById(zxcid).oopbr;
 if (!zxcoop){ return; }
 clearTimeout(zxcoop.to);
 zxcoop.dir=zxcdir||zxcoop.dir;
 zxcoop.rotate();
}

function zxcLink(zxcobj){
 if (zxcobj.url.indexOf('^|^')>-2) zxcExternal(zxcobj.url);
 else window.top.location=zxcobj.url;
}

function zxcStyle(zxcele,zxcstyle){
 if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
 for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
 return zxcele;
}


function zxcOOPBannerRotate(zxcp,zxcvh,zxcspd,zxchw){
 this.ref='zxcoobr'+zxcp.id;
 this.wh=(zxcvh=='H')?'left':'top';
 window[this.ref]=this;
 this.ary=zxcp.ary;
 this.spd=zxcspd||100;
 this.to=null;
 this.dir=1;
 this.h=zxchw;
}

zxcOOPBannerRotate.prototype.rotate=function(){
 this.ary[1].style[this.wh]=(parseInt(this.ary[1].style[this.wh])+this.dir)+'px';
 this.ary[0].style[this.wh]=(parseInt(this.ary[1].style[this.wh])-this.h)+'px';
 this.ary[2].style[this.wh]=(parseInt(this.ary[2].style[this.wh])+this.dir)+'px';
 this.ary[3].style[this.wh]=(parseInt(this.ary[2].style[this.wh])+this.h*2)+'px';
 if (this.dir<0&&parseInt(this.ary[1].style[this.wh])+this.h<0){
  this.ary[0].style[this.wh]=(parseInt(this.ary[2].style[this.wh])+this.h)+'px';
  this.ary.reverse();
 }
 if (this.dir>0&&parseInt(this.ary[1].style[this.wh])>this.h){
  this.ary[1].style[this.wh]=(parseInt(this.ary[2].style[this.wh])-this.h)+'px';
  this.ary.reverse();
 }
 this.setTimeOut('rotate();',this.spd);
}

zxcOOPBannerRotate.prototype.setTimeOut=function(zxcf,zxcd){
 this.to=setTimeout('window.'+this.ref+'.'+zxcf,zxcd);
}


