/*<![CDATA[*/
// The effect is executed by an event call to function 'zxcBAnimator('left','tst1',20,260,2000);'
// where:
// parameter 0 = the mode(see Note 1).                                                                     (string)
// parameter 1 = the unique ID name or element object.                                                     (string or element object)
// parameter 2 = the start position of the effect.                                                         (digits, for opacity minimum 0, maximum 100)
// parameter 3 = the finish position of the effect.                                                        (digits, for opacity minimum 0, maximum 100)
// parameter 4 = (optional) period of time between the start and finish of the effect in milliseconds.     (digits or defaults to 2000 milliSeconds)
//
//  Note 1:  The default units(excepting opacity) are 'px'.
//  Note 2:  Examples modes: 'left', 'top', 'width', 'height', 'opacity.
//           For hyphenated modes, the first character after the hyphen must be upper case, all others lower case.
//  Note 3:  To 'toggle' the effect include '#' in parameter 0.
//           The first call will set the toggle parameters.
//           Subsequent calls with '#' in parameter 0 and the same start and finish parameters will 'toggle' the effect.
//  Note 4:  The function may be re-executed with a different set of parameters (start/finish time or period)
//           whenever required, say from an onclick/mouseover/out event.
//           The period parameter will be retained unless re-specified.

function zxcBAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,zxctime){
 if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj); }
 if (!zxcobj||(!zxcsrt&&!zxcfin)||zxcsrt==zxcfin) return;
 var zxcoop=zxcobj[zxcmde.replace(/[-#]/g,'')+'oop'];
 if (zxcoop){
  clearTimeout(zxcoop.to);
  if (zxcoop.srtfin[0]==zxcsrt&&zxcoop.srtfin[1]==zxcfin&&zxcmde.match('#')) zxcoop.update([zxcoop.data[0],(zxcoop.srtfin[0]==zxcoop.data[2])?zxcfin:zxcsrt],zxctime);
  else zxcoop.update([zxcsrt,zxcfin],zxctime);
 }
 else zxcobj[zxcmde.replace(/[-#]/g,'')+'oop']=new zxcBAnimatorOOP(zxcmde,zxcobj,zxcsrt,zxcfin,zxctime);
}

function zxcBAnimatorOOP(zxcmde,zxcobj,zxcsrt,zxcfin,zxctime){
 this.srtfin=[zxcsrt,zxcfin];
 this.to=null;
 this.obj=zxcobj;
 this.mde=zxcmde.replace(/[-#]/g,'');
 this.update([zxcsrt,zxcfin],zxctime);
}

zxcBAnimatorOOP.prototype.update=function(zxcsrtfin,zxctime){
 this.time=zxctime||this.time||2000;
 this.data=[zxcsrtfin[0],zxcsrtfin[0],zxcsrtfin[1]];
 this.srttime=new Date().getTime();
 this.cng();
}

zxcBAnimatorOOP.prototype.cng=function(){
 var zxcms=new Date().getTime()-this.srttime;
 this.data[0]=(this.data[2]-this.data[1])/this.time*zxcms+this.data[1];
 if (this.mde!='left'&&this.mde!='top'&&this.data[0]<0) this.data[0]=0;
 if (this.mde!='opacity') this.obj.style[this.mde]=this.data[0]+'px';
 else  this.opacity(this.data[0]);
 if (zxcms<this.time) this.to=setTimeout(function(zxcoop){return function(){zxcoop.cng();}}(this), 10);
 else {
  this.data[0]=this.data[2];
  if (this.mde!='opacity') this.obj.style[this.mde]=this.data[0]+'px';
  else  this.opacity(this.data[0]);
 }
}

zxcBAnimatorOOP.prototype.opacity=function(zxcopc){
 if (zxcopc<0||zxcopc>100){ return; }
 this.obj.style.filter='alpha(opacity='+zxcopc+')';
 this.obj.style.opacity=this.obj.style.MozOpacity=this.obj.style.KhtmlOpacity=zxcopc/100-.001;
}

var TextAry=[]
TextAry[0]='"The invested partnership in assisting us in finding the best crew for our organisation"';
TextAry[1]='"...wilsonhalligan have always provided a personal service where you know time is spent matching the right candidates for the position"';
TextAry[2]='"Supreme Service"<br /><br />"Very professional people and very friendly"<br /><br />"Friendly, professional staff"';
TextAry[3]='"So far we have been provided with CV\'s of candidates who match our exact needs"<br /><br />"Personal service to us Captains to try and match personalities, abilities and requirements"';
TextAry[4]='"...They treated me as a valued crew member and were looking out for my best interests."';
TextAry[5]='"The only crew agent who actually gets to know about you as a person..."<br /><br />"I trust the individuals that run it that they will not waste my time with irrelevant personnel"';
TextAry[6]='"Professional and efficient"<br /><br />"Their honest and reliable approach"<br /><br />"Personal, knowledgeable, trustworthy"';
TextAry[7]='"All crew hired have always been professional and very well reviewed"<br /><br />"Friendly, responsive and proactive attitude"';
TextAry[8]='"Very friendly, reliable, personal service - trustworthy"<br /><br />"...wilsonhalligan look at crew as real people and match their skills with the right job..."';
TextAry[9]='"Discretion, honesty and sincerity"<br /><br />"Very friendly and give good advice"';
TextAry[10]='"...Honest appraisal of candidates, will not recommend anyone they do not think is right for the vacancy..."';
TextAry[11]='"...One of the few agents who know what the customer is looking for. With their personal touch they have the ability to understand the customers\' needs and deliver the correct candidates for the job..."';
TextAry[12]='"...I have always received honest answers to my questions even if this means that a candidate placement may be lost. This is an invaluable asset for a crewing agency and one that develops trust between the yacht and the agents"';
TextAry[13]='"The friendly and personal service is such a breath of fresh air. You actually listen to our needs and act on our best interests. I\'ve been recommending you to everyone I know in the industry"';
TextAry[14]='"...I will no longer use any other crew agent beside wilsonhalligan..."<br /><br />"The way wilsonhalligan are open, honest and you feel like you can trust them"';





function Fade(id,ary){
 var obj=document.getElementById(id);
 if (!obj.set){
  obj.set=true;
  obj.nu=0;
 }
 zxcBAnimator('opacity#',obj,0,100,1000);
 var nnu=Math.floor(Math.random()*ary.length);
 var txt=ary[Math.floor(Math.random()*ary.length)];
 while (obj.nu==nnu) nnu=Math.floor(Math.random()*ary.length);
 obj.nu=nnu;
 obj.innerHTML=ary[nnu];
 setTimeout(function(){ zxcBAnimator('opacity#',obj,0,100,1000); },9000);
 setTimeout(function(){ Fade(id,ary); },10000);
}

/*]]>*/

