// http://www.jmorobinson.co.uk/binary-loves-you-too.php/2008/02/10/bookmarking_toolbar_v1_0
var onloads;function windowonloads(func){onloads=window.onload;if(typeof window.onload!='function'){window.onload=func}else{window.onload=function(){if(onloads)onloads();func()}}}

function DaysInMonth(varMonth,varYear){return 32-new Date(varYear,varMonth-1,32).getDate();}
String.prototype.stripPunctuation=function(){return this.replace(/[\.,;!#\$\/:\?'\(\)\[\]_\-\\ ]/g,"").toLowerCase()}
String.prototype.replaceAll=function(strFrom,strTo){var Tmp=this;while(Tmp.indexOf(strFrom)>-1)Tmp=Tmp.replace(strFrom,strTo);return Tmp;}
String.prototype.Right=function(str, n){if(n<=0)return "";else if(n>String(str).length)return str;else{var iLen=String(str).length;return String(str).substring(iLen,iLen-n);}}
function urlencode(strRaw){return escape(strRaw).replaceAll('+','%2B').replaceAll('%20','+').replaceAll('@','%40').replaceAll('/','%2F').replaceAll('*','%2A');}
function urldecode(strRaw){return unescape(strRaw).replaceAll('+',' ').replaceAll('%2B','+').replaceAll('%40','@').replaceAll('%2F','/').replaceAll('%2A','*');}

var DivImageNo=0;
var TotalImgs=0;
var DivCurrent=0;
var DivDestination=0;
function SelectImage(Dir)
 {
  DivImageNo+=Dir;
  if(DivImageNo<0)
   {
    DivImageNo=0;
   }
  else if(DivImageNo>TotalImgs-4)
   {
    DivImageNo=TotalImgs-4;
   }
  MoveImage(DivImageNo*105);
  return false;
 }
function MoveImage(imgwidth)
 {
  DivDestination=(-imgwidth)
  ScrollDiv();
  setTimeout('ScrollDiv()',10);
  return false;
 }
function ScrollDiv()
 {
  if(Math.abs(DivCurrent-DivDestination)<3)
   {
    DivCurrent=DivDestination;
   }
  else
   {
    DivCurrent+=(DivCurrent<DivDestination?3:-3);
    setTimeout('ScrollDiv()',10);
   }
  document.getElementById("scroller").style.left=DivCurrent+"px";
 }
function CountImages()
 {
  if (document.getElementById("scroller")!=null)
   {
    TotalImgs = document.getElementById("scroller").getElementsByTagName("img").length;
   }
 }
