var zxcIFVarAry=new Array('zxcTitleTxt1','zxcFSz1','zxcUpDate','zxcPosted');
var zxcIFAry=new Array('Image Gallery Scroll','45','21/May/2006','21/May/2004');

var MessAry=[];
MessAry[0]=['MessPanel','resortTHM','resortmain'];
MessAry[1]='Image 1 of 8';
MessAry[2]='Image 2 of 8';
MessAry[3]='Image 3 of 8';
MessAry[4]='Image 4 of 8';
MessAry[5]='Image 5 of 8';
MessAry[6]='Image 6 of 8';
MessAry[7]='Image 7 of 8';
MessAry[8]='Image 8 of 8';



// **** Functional Code - NO NEED to Change

var zxcEvt=0;
var zxcOOPCnt=0;
var zxcCursor=document.all?'hand':'pointer';

function TxtAreaToggle(tb,r1,r2){
 if (tb.rows==r1){
  tb.rows=r2;
 }
 else {
  tb.rows=r1;
 }
}

function SelectTxtArea(obj){
 document.getElementById(obj).select();
}

function zxcGalleryScroll(){
 var zxcargs=zxcGalleryScroll.arguments;
 var zxcp=document.getElementById(zxcargs[0]);
 zxcp.gal=zxcp.getElementsByTagName('DIV')[0];
 zxcp.galml=zxcp.offsetWidth-zxcp.gal.offsetWidth;
 zxcp.cen=zxcp.offsetWidth/2;
 zxcp.top=zxcargs[5]||zxcp.gal.offsetHeight;
 zxcp.oop=new zxcOOPGal(zxcp);
 zxcp.bar=document.getElementById(zxcargs[3]);
 if (!zxcp.bar){
  zxcp.bar=zxcStyle('DIV',{position:'absolute',overflow:'hidden',cursor:'e-resize',left:(zxcPos(zxcp)[0]+zxcargs[6]||0)+'px',top:(zxcPos(zxcp)[1]+zxcargs[7]||0)+'px',width:(zxcargs[4]||zxcp.offsetWidth)+'px',height:(zxcargs[5]||0)+'px'},zxcargs[8]);
  zxcp.bar.className=zxcargs[9];
  document.getElementsByTagName('BODY')[0].appendChild(zxcp.bar);
 }
 zxcp.bar.p=zxcp;
 zxcOpacity(zxcp.bar,zxcargs[10]||100);
 zxcAddEvt(zxcp.bar,'zxcMove','mousemove');
 zxcAddEvt(zxcp.bar,'zxcMoveStop','mouseout');
 zxcp.main=document.getElementById(zxcargs[1]);
 if (zxcp.main){ zxcAddEvt(zxcp,'zxcClick','click'); zxcStyle(zxcp,{cursor:zxcCursor}); }
 if (zxcargs[2]){
  zxcp.mp=document.getElementById(zxcargs[2][0][0]);
  zxcp.mpary=zxcargs[2];
  zxcargs[2][0][1]=zxcargs[2][0][1]||'';
  zxcargs[2][0][2]=zxcargs[2][0][2]||'';
 }
}

function zxcClick(zxce){
 var zxcimgobj=zxcEventObj(zxce);
 if (this.mp){
 this.main.src=zxcimgobj.src.replace(this.mpary[0][1],this.mpary[0][2]);
  var zxcimgs=this.getElementsByTagName('IMG');
  for (var zxc0=0;zxc0<zxcimgs.length;zxc0++){
   if (zxcimgs[zxc0]==zxcimgobj){
    this.mp.innerHTML=this.mpary[zxc0+1]||zxcimgobj.title||'';
    break;
   }
  }
 }
 else { this.main.src=zxcimgobj.src; }
}

function zxcEventObj(zxce){
 if (!zxce) var zxce=window.event;
 zxce.cancelBubble=true;
 if (zxce.stopPropagation) zxce.stopPropagation();
 if (zxce.target) zxceobj=zxce.target;
 else if (zxce.srcElement) zxceobj=zxce.srcElement;
 if (zxceobj.nodeType==3) zxceobj=zxceobj.parentNode;
 return zxceobj;
}


function zxcMove(zxce){
 var zxcposx=zxcMse(zxce)[0]-zxcPos(this.p)[0];
 var zxcposy=zxcMse(zxce)[1]-zxcPos(this.p)[1];
 if (this.p.rp){ this.p.oop.dir=(1+Math.min(Math.abs(zxcposx-this.p.rp)/10,5)); }
 if (this.p.lp){ this.p.oop.dir=-(1+Math.min(Math.abs(zxcposx-this.p.lp)/10,5)); }
 if (zxcposx<this.p.cen&&this.p.oop.pos<0&&(this.p.oop.dir<=0)){
  this.p.rp=zxcposx;
  this.p.lp=null;
  clearTimeout(this.p.oop.to);
  this.p.oop.dir=1;
  this.p.oop.move();
 }
 else if (zxcposx>this.p.cen&&this.p.oop.pos>this.p.galml&&(this.p.oop.dir>=0)){
  this.p.rp=null;
  this.p.lp=zxcposx;
  clearTimeout(this.p.oop.to);
  this.p.oop.dir=-1;
  this.p.oop.move();
 }
}

function zxcMoveStop(){
 clearTimeout(this.p.oop.to);
 this.p.lp=null; this.p.rp=null; this.p.oop.dir=0;
}

function zxcOOPGal(zxcobj){
 this.obj=zxcobj;
 this.ref='zxcgal'+zxcOOPCnt++;
 window[this.ref]=this;
 this.dir=0;
 this.pos=zxcobj.gal.offsetLeft;
 this.to=null;
}

zxcOOPGal.prototype.move=function(){
 if ((this.dir<0&&this.pos>this.obj.galml)||(this.dir>0&&this.pos<0)){
  this.obj.gal.style.left=(this.pos+=this.dir)+'px';
  this.setTimeOut('move();',20);
 }
 else {
  if (this.dir<0){ this.obj.gal.style.left=this.obj.galml+'px'; }
  else { this.obj.gal.style.left='0px'; }
 }
}

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

function zxcMse(event){
 if(!event) var event=window.event;
 if (document.all){ return [event.clientX+zxcDocS()[0],event.clientY+zxcDocS()[1]]; }
 else { return[event.pageX,zxcMseY=event.pageY]; }
}

function zxcDocS(){
 var zxcsx,zxcsy;
 if (!document.body.scrollTop){ zxcsx=document.documentElement.scrollLeft; zxcsy=document.documentElement.scrollTop; }
 else { zxcsx=document.body.scrollLeft; zxcsy=document.body.scrollTop; }
 return [zxcsx,zxcsy];
}

function zxcPos(zxcobj){
 zxclft=zxcobj.offsetLeft;
 zxctop=zxcobj.offsetTop;
 while(zxcobj.offsetParent!=null){
  zxcpar=zxcobj.offsetParent;
  zxclft+=zxcpar.offsetLeft;
  zxctop+=zxcpar.offsetTop;
  zxcobj=zxcpar;
 }
 return [zxclft,zxctop];
}

function zxcStyle(zxcele,zxcstyle,zxctxt){
 if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
 for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
 if (zxctxt){ zxcele.appendChild(document.createTextNode(zxctxt)); }
 return zxcele;
}

function zxcOpacity(zxcobj,zxcopc){
 if (zxcopc<0||zxcopc>100){ return; }
 if (zxcobj.style.MozOpacity!=null){ zxcobj.style.MozOpacity=(zxcopc/100)-.001; }
 else if (zxcobj.style.opacity!=null){ zxcobj.style.opacity=(zxcopc/100)-.001; }
 else if (zxcobj.style.filter!=null){ zxcobj.style.filter = 'alpha(opacity='+zxcopc+')';	}
 else if (zxcobj.KHTMLOpacity!=null){ zxcobj.KHTMLOpacity=(zxcopc/100)-.001; }
}

function zxcEventAdd(zxco,zxct,zxcf) {
 if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
 else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e); }); }
 else {
  var zxcPrev=zxco["on" + zxct];
  if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
  else { zxco['on'+zxct]=zxco[zxcf]; }
 }
}

function zxcAddEvt(zxc,zxcfun,zxcevt){
 zxc['zxcaddEvt'+zxcEvt]=window[zxcfun];
 zxcEventAdd(zxc,zxcevt,'zxcaddEvt'+zxcEvt);
 zxcEvt++;
}

function InitScripts(){
 if (self.location.toString().toLowerCase().match('vicsjavascripts')){
  pnInitSearchPanel();
 }
 //zxcGalleryScroll('Gallery1','MainImg',MessAry,null,500,20,20,-30,'<<<< | MouseOver this Scroll Bar | >>>>','bar',50);
 //zxcGalleryScroll('Gallery1','MainImg',MessAry,null,80,80,-80,7,'<<<<','bar1',50);
 //zxcGalleryScroll('Gallery1','MainImg',MessAry,null,80,80,620,7,'>>>>','bar1',50);
 //zxcGalleryScroll('Gallery3','MainImg',MessAry,'Gallery3');
 zxcGalleryScroll('Gallery1','MainImg',MessAry,'arrowLeft');  // must name id (arrowLeft) same as div with image
 zxcGalleryScroll('Gallery1','MainImg',MessAry,'arrowRight'); // that you are going to use for scrolling
}

