var zxcBGColor='#FFFFCC';   // 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)

// **** Functional Code - NO NEED to Change
var zxcObj;
var zxcOOPCnt=0;
var zxcCursor=document.all?'hand':'pointer';

// Common Functions
function zxcCSBanner(zxcid,zxcpth,zxcary,zxcw,zxcspd){
	
 var zxcp=document.getElementById(zxcid)
 if (zxcp.offsetWidth>=zxcp.offsetHeight){
  zxcCSBanH(zxcp,zxcpth,zxcary,zxcw,zxcspd);
 }
 else {
  zxcCSBanV(zxcp,zxcpth,zxcary,zxcw,zxcspd);
 }
}

function zxcBannerStop(zxcid){
 clearTimeout(document.getElementById(zxcid).oopbr.to);
}

function zxcBannerStart(zxcid,zxcdir){
 var zxcobj=document.getElementById(zxcid);
 clearTimeout(zxcobj.oopbr.to);
zxcobj.oopbr.dir=zxcdir||zxcobj.oopbr.dir;
 zxcobj.oopbr.rotate();
}
function zxcCngDirection(zxcid,zxcdir){
	
 var zxcobj=document.getElementById(zxcid);
 clearTimeout(zxcobj.oopbr.to);
 zxcdir=zxcdir||-zxcobj.oopbr.dir;
 if (zxcdir>0){ zxcobj.oopbr.dir=1; }
 else { zxcobj.oopbr.dir=-1; }
 zxcobj.oopbr.rotate();
}


function zxcLink(zxcobj){
	
	//var custom;
	//var name="Image";
	//var destination = "popup_image.php?imglink="+zxcobj.url;
	//custom		= "toolbar=0, location=0, directories=0, status=0, menubar=0, "; 
	//custom	 += "scrollbars=0, resizable=no, width=700 , height=600";
	//window.open(destination, name, custom);	
 //window.top.location=zxcobj.url;
 SelectImg(zxcobj.url);
}

function zxcStyle(zxcele,zxcstyle){
 for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
}

// Horizontal Banner Functions
function zxcCSBanH(zxcp,zxcpth,zxcary,zxcw,zxcspd){
 
 for (var zxc0=0;zxc0<zxcary.length;zxc0++){
  for (var zxc1=0;zxc1<zxcary[zxc0].length;zxc1++){
   if (zxcary[zxc0][zxc1]==''){ zxcary[zxc0][zxc1]=null; }
  }
 }
 var zxch=zxcp.offsetHeight;

 zxcp.set=true;
 var zxcd=document.createElement('DIV');
zxcStyle(zxcd,{position:'absolute',left:'0px',bottom:'0px',height:zxch+'px'});
//zxcStyle(zxcd,{position:'relative',height:zxch+'px'}); 
 zxcp.appendChild(zxcd);
 zxcp.ary=[zxcd,zxcd.cloneNode(true),zxcd.cloneNode(true),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++){
  zxcp.cnt=0;
  var zxclft=10;
//for (var zxc4=0;zxc4<Math.max(zxcary.length,Math.ceil(zxcp.offsetWidth/zxcw)+1);zxc4++)
  for (var zxc4=0;zxc4<zxcary.length;zxc4++){ if (zxcary[zxcp.cnt][0].toUpperCase().match('I')){zxcobj=document.createElement('IMG');zxcobj.src=zxcpth+zxcary[zxcp.cnt][1]; zxch=zxcobj.height; zxcobj.border='1'; }
   if (zxcary[zxcp.cnt][0].toUpperCase().match('T')){ zxcobj=document.createElement('DIV'); zxcobj.innerHTML=zxcary[zxcp.cnt][1];  }
   if (zxcary[zxcp.cnt][2]){ zxcobj.url=zxcary[zxcp.cnt][2]; zxcStyle(zxcobj,{ cursor:zxcCursor}); zxcobj.onclick=function(){ zxcLink(this); } }
   zxcStyle(zxcobj,{position:'absolute',left:(zxclft)+'px', bottom:'10px',width:(zxcary[zxcp.cnt][3]||zxcw)+'px',height:(zxcary[zxcp.cnt][4]||zxch)+'px',backgroundColor:(zxcary[zxcp.cnt][5]||zxcBGColor),color:(zxcary[zxcp.cnt][6]||zxcTxtColor),textAlign:(zxcary[zxcp.cnt][7]||zxcTxtAlign),fontSize:(zxcary[zxcp.cnt][8]||zxcFontSize)});
   zxcp.ary[zxc3].appendChild(zxcobj);
   zxcStyle(zxcp.ary[zxc3],{width:(parseInt(zxcobj.style.left)+parseInt(zxcobj.style.width))+'px'});
   zxclft+=parseInt(zxcobj.style.width)+10;
   zxcp.cnt=++zxcp.cnt%zxcary.length;
  //alert(zxcp.cnt);
  }
 }
 var zxcw=parseInt(zxcp.ary[0].style.width);
 for (var zxc4=0;zxc4<zxcp.ary.length;zxc4++){
  zxcStyle(zxcp.ary[zxc4],{left:(zxcw*zxc4-zxcw)+'px'});
 }
 if (!zxcp.oopbr){ zxcp.oopbr=new zxcOOPBannerRotate(zxcp.ary,zxcspd,zxcw); }
}

function zxcOOPBannerRotate(zxcary,zxcspd,zxcw){
 this.ref='zxcoobr'+zxcOOPCnt++;
 window[this.ref]=this;
 this.ary=zxcary;
 this.spd=zxcspd||100;
 this.to=null;
 this.dir=1;
 this.w=zxcw;
}

zxcOOPBannerRotate.prototype.rotate=function(){
 this.ary[1].style.left=(parseInt(this.ary[1].style.left)+this.dir)+'px';
 this.ary[0].style.left=(parseInt(this.ary[1].style.left)-this.w)+'px';
 this.ary[2].style.left=(parseInt(this.ary[2].style.left)+this.dir)+'px';
 this.ary[3].style.left=(parseInt(this.ary[2].style.left)+this.w*2)+'px';
 if (this.dir<0&&parseInt(this.ary[1].style.left)+this.w<0){
  this.ary[1].style.left=(parseInt(this.ary[2].style.left)+this.w)+'px';
  this.ary.reverse();
 }
 if (this.dir>0&&parseInt(this.ary[1].style.left)>this.w){
  this.ary[1].style.left=(parseInt(this.ary[2].style.left)-this.w)+'px';
  this.ary.reverse();
 }
 this.setTimeOut('rotate();',this.spd);
}

zxcOOPBannerRotate.prototype.setTimeOut=function(zxcf,zxcd){
 this.to=setTimeout('window.'+this.ref+'.'+zxcf,zxcd);
}


// Vertical Banner Functions
function zxcCSBanV(zxcp,zxcpth,zxcary,zxcw,zxcspd){
 for (var zxc0=0;zxc0<zxcary.length;zxc0++){
  for (var zxc1=0;zxc1<zxcary[zxc0].length;zxc1++){
   if (zxcary[zxc0][zxc1]==''){ zxcary[zxc0][zxc1]=null; }
  }
 }
 var zxcw=zxcp.offsetWidth;
 zxcp.set=true;
 var zxcd=document.createElement('DIV');
 zxcStyle(zxcd,{position:'absolute',left:'0px',top:'0px',width:zxcw+'px'});
 zxcp.appendChild(zxcd);
 zxcp.ary=[zxcd,zxcd.cloneNode(true),zxcd.cloneNode(true),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++){
  zxcp.cnt=0;
  var zxctp=0;
  for (var zxc4=0;zxc4<Math.max(zxcary.length,Math.ceil(zxcp.offsetHeight/zxcw)+1);zxc4++){
   if (zxcary[zxcp.cnt][0].toUpperCase().match('I')){ zxcobj=document.createElement('IMG'); zxcobj.src=zxcpth+zxcary[zxcp.cnt][1]; }
   if (zxcary[zxcp.cnt][0].toUpperCase().match('T')){ zxcobj=document.createElement('DIV'); zxcobj.innerHTML=zxcary[zxcp.cnt][1]; }
   if (zxcary[zxcp.cnt][2]){ zxcobj.url=zxcary[zxcp.cnt][2]; zxcStyle(zxcobj,{ cursor:zxcCursor}); zxcobj.onclick=function(){ zxcLink(this); } }
   zxcStyle(zxcobj,{position:'absolute',left:'0px',top:(zxctp)+'px',width:(zxcary[zxcp.cnt][3]||zxcw)+'px',height:(zxcary[zxcp.cnt][4]||zxcw),backgroundColor:(zxcary[zxcp.cnt][5]||zxcBGColor),color:(zxcary[zxcp.cnt][6]||zxcTxtColor),textAlign:(zxcary[zxcp.cnt][7]||zxcTxtAlign),fontSize:(zxcary[zxcp.cnt][8]||zxcFontSize)});
   zxcp.ary[zxc3].appendChild(zxcobj);
   zxcStyle(zxcp.ary[zxc3],{height:(parseInt(zxcobj.style.top)+parseInt(zxcobj.style.height))+'px',backgroundColor:'red'});
   zxctp+=parseInt(zxcobj.style.height);
   zxcp.cnt=++zxcp.cnt%zxcary.length;
  }
 }
 var zxch=parseInt(zxcp.ary[0].style.height);
 for (var zxc4=0;zxc4<zxcp.ary.length;zxc4++){
  zxcStyle(zxcp.ary[zxc4],{top:(zxch*zxc4-zxch)+'px'});
 }
 if (!zxcp.oopbr){ zxcp.oopbr=new zxcOOPBannerRotateV(zxcp.ary,zxcspd,zxch); }
}

function zxcOOPBannerRotateV(zxcary,zxcspd,zxch){
 this.ref='zxcoobr'+zxcOOPCnt++;
 window[this.ref]=this;
 this.ary=zxcary;
 this.spd=zxcspd||100;
 this.to=null;
 this.dir=1;
 this.h=zxch;
}

zxcOOPBannerRotateV.prototype.rotate=function(){
 this.ary[1].style.top=(parseInt(this.ary[1].style.top)+this.dir)+'px';
 this.ary[0].style.top=(parseInt(this.ary[1].style.top)-this.h)+'px';
 this.ary[2].style.top=(parseInt(this.ary[2].style.top)+this.dir)+'px';
 this.ary[3].style.top=(parseInt(this.ary[2].style.top)+this.h*2)+'px';
 if (this.dir<0&&parseInt(this.ary[1].style.top)+this.h<0){
  this.ary[1].style.top=(parseInt(this.ary[2].style.top)+this.h)+'px';
  this.ary.reverse();
 }
 if (this.dir>0&&parseInt(this.ary[1].style.top)>this.h){
  this.ary[1].style.top=(parseInt(this.ary[2].style.top)-this.h)+'px';
  this.ary.reverse();
 }
 this.setTimeOut('rotate();',this.spd);
}

zxcOOPBannerRotateV.prototype.setTimeOut=function(zxcf,zxcd){
 this.to=setTimeout('window.'+this.ref+'.'+zxcf,zxcd);
}
//-->
