ROTTXT = ['32 Hoteles en Escocia','2000 Fotografías','77 Opiniones de clientes','Garantía de mejor precio','Reservas en solo 3 clicks','Contacto directo con los Hoteles'];
ROTCOL = ['#000000','#100A04','#211508','#311F0C','#422A0F','#523413','#633F17','#73491B','#84541F','#945E23','#A56926','#B5732A','#C67E2E','#D68832'];

step=0;
incr=0;
mesg=0;
zttl=0;

function DoRotateBanner() {
  newstep = step;
  if (step == 2) {
    incr--;
    if (incr == -1) {
      newstep = 0;
      incr = 0;
    } else {
	  document.getElementById('rotater').color=ROTCOL[incr];
    }      
  }
  if (step == 1) {
    incr++;
    if (incr == 14) {
      newstep = 2;
      incr = (14-1);
      mesg++;
      if (mesg >= ROTTXT.length) {
        mesg = 0;
      }
      document.getElementById('rotater').innerHTML = '<b>'+ROTTXT[mesg]+'</b>';
    } else {
	  document.getElementById('rotater').color=ROTCOL[incr];
    }
  }
  if (step == 0) {
	newstep = 1;
	incr = 0;
	document.getElementById('rotater').color=ROTCOL[incr];
  }
  step = newstep;
  if (step == 0) {
  	setTimeout("DoRotateBanner();",2000+zttl*50);
	if (zttl < 160) zttl++;
  }
  if (step == 1) {
  	setTimeout("DoRotateBanner();",150);
  }
  if (step == 2) {
    if (incr == (14-1)) {
      setTimeout("DoRotateBanner();",500);
    } else {
      setTimeout("DoRotateBanner();",150);
    }
  }
  
}

function DoShare(page) {
  url = '';
  if (page == 1) {
    url = 'http://www.worldby.com/socializer/sharethis_socialnetwork.php';
  }
  if (page == 2) {
    url = 'http://www.worldby.com/socializer/sharethis_socialnetworkfriend.php';
  }
  if (page == 3) {
    url = 'http://www.worldby.com/socializer/sharethis_rssnetworks.php';
  }
  if (page == 4) {
    url = 'http://www.worldby.com/socializer/sharethis_socialnetworkgiveusalink.php';
  }
  if (url == '') {
  	return;
  }
  tester = document.location.href;
  if ((tester.indexOf('.php') != -1) || (tester.indexOf('.cgi') != -1)) {
    passurl = 'http://www.hotelsby.es/escocia/';
  } else {
    passurl = document.location.href;
  }
  metatags = document.getElementsByTagName("meta"); 
  url += '?url=';
  url += escape(passurl);
  url += '&title=';
  url += escape(document.title);
  url += '&tags=';
  for (i=0;i<metatags.length;i++) {
    if (metatags[i].getAttribute("name") == 'keywords') {
      url += escape(metatags[i].getAttribute("content"));
    }
  }
  window.open(url,'_blank');
}
