var ImgAry=[];

/*ImgAry[0]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/wcca.jpg','','http://www.wccatv.com/'];

ImgAry[1]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/womag.jpg','','http://www.worcestermagazine.com/'];

ImgAry[2]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/vocero.jpg','','http://www.vocerohispano.com/'];

ImgAry[3]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/mega-small.jpg','','http://www.misslatinaworcester.com'];

ImgAry[4]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/herbert.jpg','','http://www.herbertbergflorist.com/'];

ImgAry[5]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/compare-foods-logo.jpg','','http://www.comparesupermarkets/'];

ImgAry[6]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/hanover-color.jpg','','http://www.thehanovertheatre.org/'];

ImgAry[7]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/charterlogocolor-1.jpg','','http://www.charter.com/'];

ImgAry[8]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/tn_classique-ii.jpg','','http://www.classiquemedicalspa.com/'];

ImgAry[9]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/alpha-travel.jpg','','http://www.alphatravelagency.com/'];

ImgAry[10]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/small-smiles.jpg','','http://www.smallsmilesusa.com/'];

ImgAry[11]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/sonia.jpg','','http://www.soniasautosales.com/'];

ImgAry[12]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/rubens-transportation-1.jpg','','http://www.rubentransport.com/'];

ImgAry[13]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/bally.jpg','','http://www.ballyfitness.com/'];

ImgAry[14]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/overthetopgym.jpg','','http://www.overthetopgym.org/'];

ImgAry[15]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/el-show-de-fernandito-tvbanner-1.jpg','','http://www.elshowdefernandito.com/'];

ImgAry[16]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/direct-air-logo.jpg','','http://www.visitdirectair.com/'];

ImgAry[17]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/tumoda.jpg','','http://www.tumodaspa.com/'];

ImgAry[18]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/hair-excitement.jpg','','http://www.hairexcitement.com/'];

ImgAry[19]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/arena_family-dental_-logo.jpg','','http://arenadental.com/'];

ImgAry[20]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/genesis-logo---miss-latina.jpg','','http://www.genesisphotography.com/'];

ImgAry[21]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/lindiana.jpg','','http://www.lindianaschoolofdance.com/'];

ImgAry[22]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/tn_logowithglowiicopy.jpg','','http://www.salsastorm.com/'];

ImgAry[23]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/demitek_logo.jpg','','http://www.domitek.net/'];

ImgAry[24]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/lafemmina-logo.jpg','','http://www.lafemminamodelingcenter/'];

ImgAry[25]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/htv-bussines-card.jpg','','http://www.htvvideo.com/'];

ImgAry[26]=['http://www.misslatinaworcester.com/templates/misslatina/images_sponsor/accounting-solutions.jpg','','http://www.asieztax.com/'];
*/
ImgAry[0]=['/templates/misslatina/images_sponsor/tn_logowithglowiicopy.jpg','','http://www.salsastorm.com/'];
ImgAry[1]=['/templates/misslatina/images_sponsor/genesis-logo---miss-latina.jpg','','http://www.genesisphotography.com/'];
ImgAry[2]=['/templates/misslatina/images_sponsor/lindiana.jpg','','http://www.lindianaschoolofdance.com/'];
ImgAry[3]=['/templates/misslatina/images_sponsor/demitek_logo.jpg','','http://www.domitek.net/'];
ImgAry[4]=['/templates/misslatina/images_sponsor/vocero.jpg','','http://www.vocerohispano.com/'];
ImgAry[5]=['/templates/misslatina/images_sponsor/wcca.jpg','','http://www.wccatv.com/'];
ImgAry[6]=['/wp-content/themes/twentyten/images_sponsor/Clear Channel Outdoor logo.jpg','','http://www.clearchanneloutdoor.com/'];
ImgAry[7]=['/templates/misslatina/images_sponsor/direct-air-logo.jpg','','http://www.visitdirectair.com/'];









function IMPRScroller(IMPRmde,IMPRid,IMPRrun,IMPRud,IMPRspd,IMPRsrt){
 var IMPRp=document.getElementById(IMPRid);
 if (!IMPRp[IMPRmde+'scroll']) return IMPRp[IMPRmde+'scroll']= new IMPRScrollerOOP(IMPRmde,IMPRp,IMPRrun,IMPRud,IMPRspd,IMPRsrt);
 var IMPRoop=IMPRp[IMPRmde+'scroll']
 clearTimeout(IMPRp.to);
 IMPRoop.spd=IMPRspd||IMPRoop.spd;
 IMPRoop.ud=IMPRud||-IMPRoop.ud;
 IMPRp[IMPRmde+'run']=(IMPRrun=='stop'||IMPRrun=='start')?IMPRrun:(IMPRp[IMPRmde+'run']=='stop')?'start':'stop';
 if (IMPRp[IMPRmde+'run']=='start') IMPRoop.scroll();
}

function IMPRScrollerOOP(IMPRmde,IMPRp,IMPRrun,IMPRud,IMPRspd,IMPRsrt){
 this.p=IMPRp;
 var IMPRc=this.p.getElementsByTagName('DIV')[0]
 this.vh=(IMPRmde.charAt(0).toLowerCase()=='v');
 this.mde=IMPRmde;
 this.ary=[];
 this.ary[0]=[IMPRc,0];
 var IMPRmax=(((this.vh)?this.ary[0][0].offsetHeight:this.ary[0][0].offsetWidth))+((this.vh)?this.p.offsetHeight:this.p.offsetWidth);
 this.wh=(this.mde.charAt(0).toLowerCase()=='v')?this.ary[0][0].offsetHeight:this.ary[0][0].offsetWidth;
 var IMPRpos=0;
 while (IMPRpos<IMPRmax){
  var IMPR1=this.ary.length;
  this.ary[IMPR1]=[IMPRES(this.ary[0][0].cloneNode(true),{},this.p),IMPRpos+=this.wh];
  IMPRES(this.ary[IMPR1][0],{position:'absolute',left:((this.vh)?0:this.ary[IMPR1][1])+'px',top:((this.vh)?this.ary[IMPR1][1]:0)+'px'});
 }
 this.ud=IMPRud||-1;
 this.spd=IMPRspd||100;
 this.p.to=null;
 this.data=[IMPRpos,-this.wh];
 this.p[this.mde+'run']=(IMPRrun=='stop'||IMPRrun=='start')?IMPRrun:'start';
 if (this.p[this.mde+'run']) this.p.to=setTimeout(function(IMPRoop){return function(){IMPRoop.scroll();}}(this),IMPRsrt||500);
}

IMPRScrollerOOP.prototype.scroll=function(){
 if (this.p[this.mde+'run']=='start'){
  for (var IMPR1=0;IMPR1<this.ary.length;IMPR1++){
   this.ary[IMPR1][1]+=this.ud;
   IMPRES(this.ary[IMPR1][0],{position:'absolute',left:((this.vh)?0:this.ary[IMPR1][1])+'px',top:((this.vh)?this.ary[IMPR1][1]:0)+'px'});
   if ((this.ud<0&&this.ary[IMPR1][1]<=this.data[1])||(this.ud>0&&this.ary[IMPR1][1]>this.data[0])) this.ary[IMPR1][1]=this.data[(this.ud<0)?0:1];
  }
 }
 this.p.to=setTimeout(function(IMPRoop){return function(){IMPRoop.scroll();}}(this),this.spd);
}

function IMPRES(IMPRele,IMPRstyle,IMPRp,IMPRtxt){
 if (typeof(IMPRele)=='string'){ IMPRele=document.createElement(IMPRele); }
 for (key in IMPRstyle){ IMPRele.style[key]=IMPRstyle[key]; }
 if (IMPRp){ IMPRp.appendChild(IMPRele); }
 if (IMPRtxt){ IMPRele.appendChild(document.createTextNode(IMPRtxt)); }
 return IMPRele;
}

function IMPRBAnimator(IMPRmde,IMPRobj,IMPRsrt,IMPRfin,IMPRtime){
 if (typeof(IMPRobj)=='string'){ IMPRobj=document.getElementById(IMPRobj); }
 if (!IMPRobj||(!IMPRsrt&&!IMPRfin)) return;
 var IMPRoop=IMPRobj[IMPRmde.replace(/[-#]/g,'')+'oop'];
 if (IMPRoop){
  clearTimeout(IMPRoop.to);
  if (IMPRoop.srtfin[0]==IMPRsrt&&IMPRoop.srtfin[1]==IMPRfin&&IMPRmde.match('#')) IMPRoop.update([IMPRoop.data[0],(IMPRoop.srtfin[0]==IMPRoop.data[2])?IMPRfin:IMPRsrt],IMPRtime);
  else IMPRoop.update([IMPRsrt,IMPRfin],IMPRtime);
 }
 else IMPRobj[IMPRmde.replace(/[-#]/g,'')+'oop']=new IMPRBAnimatorOOP(IMPRmde,IMPRobj,IMPRsrt,IMPRfin,IMPRtime);
}

function IMPRBAnimatorOOP(IMPRmde,IMPRobj,IMPRsrt,IMPRfin,IMPRtime){
 this.srtfin=[IMPRsrt,IMPRfin];
 this.to=null;
 this.obj=IMPRobj;
 this.mde=IMPRmde.replace(/[-#]/g,'');
 this.update([IMPRsrt,IMPRfin],IMPRtime);
}

IMPRBAnimatorOOP.prototype.update=function(IMPRsrtfin,IMPRtime){
 this.time=IMPRtime||this.time||2000;
 if (IMPRsrtfin[0]==IMPRsrtfin[1]) return;
 this.data=[IMPRsrtfin[0],IMPRsrtfin[0],IMPRsrtfin[1]];
 this.srttime=new Date().getTime();
 this.cng();
}

IMPRBAnimatorOOP.prototype.cng=function(){
 var IMPRms=new Date().getTime()-this.srttime;
 this.data[0]=(this.data[2]-this.data[1])/this.time*IMPRms+this.data[1];
 if (this.mde!='opacity') this.obj.style[this.mde]=this.data[0]+'px';
 else  this.opacity(this.data[0]);
 if (IMPRms<this.time) this.to=setTimeout(function(IMPRoop){return function(){IMPRoop.cng();}}(this), 10);
 else {
  if (this.mde!='opacity') this.obj.style[this.mde]=this.data[2]+'px';
  else  this.opacity(this.data[2]);
 }
}

IMPRBAnimatorOOP.prototype.opacity=function(IMPRopc){
 if (IMPRopc<0||IMPRopc>100){ return; }
 this.obj.style.filter='alpha(opacity='+IMPRopc+')';
 this.obj.style.opacity=this.obj.style.MozOpacity=this.obj.style.KhtmlOpacity=IMPRopc/100-.001;
}


function scrollerImg(IMPRid,IMPRary,IMPRdivsz,IMPRimgsz,IMPRopac,IMPRspd){
 IMPRdivsz=IMPRdivsz||'180*90';
 IMPRimgsz=IMPRimgsz||'180*90';
 IMPRopac=IMPRopac||'180*90';
 IMPRspd=IMPRspd||50;
 var IMPRp=document.getElementById(IMPRid);
 IMPRdivsz=IMPRdivsz.split('*');
 IMPRimgsz=IMPRimgsz.split('*');
 IMPRopac=IMPRopac.split('*');
 var IMPRc=IMPRES('DIV',{position:'relative'},IMPRp);
 for (var IMPR0=0;IMPR0<IMPRary.length;IMPR0++){
  var IMPRdiv=IMPRES('DIV',{position:'absolute',left:IMPRdivsz[0]*IMPR0+'px',top:'0px',width:IMPRdivsz[0]+'px',height:IMPRdivsz[1]+'px'},IMPRc);
  if (IMPRary[IMPR0][1]) IMPRdiv.title=IMPRary[IMPR0][1];
  var IMPRa=null;
  if (IMPRary[IMPR0][2]&&IMPRary[IMPR0][2]!=''){
   IMPRa=IMPRES('A',{},IMPRdiv);
   IMPRa.href=IMPRary[IMPR0][2];
  }
  var IMPRimg=IMPRES('IMG',{position:'absolute',left:(IMPRdivsz[0]-IMPRimgsz[0])/2+'px',top:(IMPRdivsz[1]-IMPRimgsz[1])/2+'px',width:IMPRimgsz[0]+'px',height:IMPRimgsz[1]+'px',borderWidth:'0px'},(IMPRary[IMPR0][2])?IMPRa:IMPRdiv);
  IMPRimg.src=IMPRary[IMPR0][0];
 }
 IMPRES(IMPRc,{width:IMPRdivsz[0]*IMPRary.length+'px',height:IMPRdivsz[1]+'px'});
 IMPRScroller('h',IMPRid,'start',-1,10,1200);
 var IMPRimgs=IMPRp.getElementsByTagName('IMG');
 var IMPRcnt=0;
 for (var IMPR1=0;IMPR1<IMPRimgs.length;IMPR1++){
  IMPRimgs[IMPR1].data=[(IMPRdivsz[0]-IMPRimgsz[0])/2,(IMPRdivsz[1]-IMPRimgsz[1])/2,IMPRimgsz[0]*1,IMPRdivsz[0]*1,IMPRimgsz[1]*1,IMPRdivsz[1]*1,IMPRopac[0]*1,IMPRopac[1]*1];

  IMPRimgs[IMPR1].onmouseover=function(){ IMPRReSize(this,IMPRspd); }
  IMPRimgs[IMPR1].onmouseout=function(){ IMPRReSize(this,IMPRspd); }

  if (window[IMPRary[IMPRcnt][3]])
  {
   IMPRimgs[IMPR1].nu=IMPRcnt;
   IMPRimgs[IMPR1].fun=IMPRary[IMPRcnt][3];
   IMPRimgs[IMPR1].onclick=function(){ window[this.fun](this.nu); }
  }

  IMPRcnt=++IMPRcnt%IMPRary.length
  IMPRBAnimator('opacity#',IMPRimgs[IMPR1],IMPRimgs[IMPR1].data[6],IMPRimgs[IMPR1].data[7],10);
 }
}

function IMPRReSize(IMPRobj,IMPRspd){
 IMPRBAnimator('width#',IMPRobj,IMPRobj.data[2],IMPRobj.data[3],IMPRspd);
 IMPRBAnimator('left#',IMPRobj,IMPRobj.data[0],0,IMPRspd);
 IMPRBAnimator('height#',IMPRobj,IMPRobj.data[4],IMPRobj.data[5],IMPRspd);
 IMPRBAnimator('top#',IMPRobj,IMPRobj.data[1],0,IMPRspd);
 IMPRBAnimator('opacity#',IMPRobj,IMPRobj.data[6],IMPRobj.data[7],IMPRspd);
}

