// =================================== //
// Image Resizing  //
// v1.0 - May 14,2006 //
// ----------------------------------- //
// Created by Lloyd Hassell//
// Website: lloydhassell.brinkster.net //
// Email: lloydhassell@hotmail.com //
// =================================== //

// INITIALIZATION:

var imageResizing=new Object();

imageResizing.resizingObj=new Object();

// CONFIGURATION:

imageResizing.increment=20;
imageResizing.frameRate=50;

// MAIN:

function resizeImageBy(IMGNAME,X,Y,INCREMENT,FRAMERATE,RESIZEENDFUNC,MAXSIZE) {
   var tempImgObj=getImgObj(IMGNAME);
   if(tempImgObj.height + Y>MAXSIZE){
return;
}
   X=tempImgObj.width + X;
   Y=tempImgObj.height + Y;
   resizeImageInit(IMGNAME,tempImgObj,X,Y,INCREMENT,FRAMERATE,RESIZEENDFUNC);
   }

function resizeImageTo(IMGNAME,WIDTH,HEIGHT,INCREMENT,FRAMERATE,RESIZEENDFUNC) {
   var tempImgObj=getImgObj(IMGNAME);
   if (isBlank(WIDTH) && !isBlank(HEIGHT)) WIDTH=Math.round(tempImgObj.width * HEIGHT / tempImgObj.height);
   if (!isBlank(WIDTH) && isBlank(HEIGHT)) HEIGHT=Math.round(tempImgObj.height * WIDTH / tempImgObj.width);
   resizeImageInit(IMGNAME,tempImgObj,WIDTH,HEIGHT,INCREMENT,FRAMERATE,RESIZEENDFUNC);
   }

function resizeImageInit(IMGNAME,IMGOBJ,ENDWIDTH,ENDHEIGHT,INCREMENT,FRAMERATE,RESIZEENDFUNC) {
   if (!imageResizing.resizingObj[IMGNAME]) {
  imageResizing.resizingObj[IMGNAME]=new Object();
  imageResizing.resizingObj[IMGNAME].imgObj=IMGOBJ;
  imageResizing.resizingObj[IMGNAME].defaultWidth=IMGOBJ.width;
  imageResizing.resizingObj[IMGNAME].defaultHeight=IMGOBJ.height;
  }
   imageResizing.resizingObj[IMGNAME].startWidth=IMGOBJ.width;
   imageResizing.resizingObj[IMGNAME].startHeight=IMGOBJ.height;
   if (ENDWIDTH<0) ENDWIDTH=0;
   imageResizing.resizingObj[IMGNAME].endWidth=(isBlank(ENDWIDTH)) ? imageResizing.resizingObj[IMGNAME].defaultWidth : ENDWIDTH;
   if (ENDHEIGHT<0) ENDHEIGHT=0;
   imageResizing.resizingObj[IMGNAME].endHeight=(isBlank(ENDHEIGHT)) ? imageResizing.resizingObj[IMGNAME].defaultHeight : ENDHEIGHT;
   imageResizing.resizingObj[IMGNAME].distX=imageResizing.resizingObj[IMGNAME].endWidth - imageResizing.resizingObj[IMGNAME].startWidth;
   imageResizing.resizingObj[IMGNAME].distY=imageResizing.resizingObj[IMGNAME].endHeight - imageResizing.resizingObj[IMGNAME].startHeight;
   imageResizing.resizingObj[IMGNAME].distZ=Math.sqrt(Math.pow(imageResizing.resizingObj[IMGNAME].distX,2) + Math.pow(imageResizing.resizingObj[IMGNAME].distY,2));
   imageResizing.resizingObj[IMGNAME].currentDistZ=0;
   imageResizing.resizingObj[IMGNAME].angle=Math.atan(imageResizing.resizingObj[IMGNAME].distX/imageResizing.resizingObj[IMGNAME].distY);
   imageResizing.resizingObj[IMGNAME].increment=(isBlank(INCREMENT)) ? imageResizing.increment : INCREMENT;
   imageResizing.resizingObj[IMGNAME].frameRate=(isBlank(FRAMERATE)) ? imageResizing.frameRate : FRAMERATE;
   imageResizing.resizingObj[IMGNAME].resizeEndFunc=(isBlank(RESIZEENDFUNC)) ? null : new Function(RESIZEENDFUNC);
   window.clearTimeout(imageResizing.resizingObj[IMGNAME].timeout);
   if (imageResizing.resizingObj[IMGNAME].distZ>0) resizeImage(IMGNAME);
   }

function resizeImage(IMGNAME) {
   imageResizing.resizingObj[IMGNAME].currentDistZ += imageResizing.resizingObj[IMGNAME].increment;
   if (imageResizing.resizingObj[IMGNAME].currentDistZ>imageResizing.resizingObj[IMGNAME].distZ) imageResizing.resizingObj[IMGNAME].currentDistZ=imageResizing.resizingObj[IMGNAME].distZ;
   if (imageResizing.resizingObj[IMGNAME].distY>0) {
  imageResizing.resizingObj[IMGNAME].imgObj.width=Math.round(imageResizing.resizingObj[IMGNAME].startWidth + Math.sin(imageResizing.resizingObj[IMGNAME].angle) * imageResizing.resizingObj[IMGNAME].currentDistZ);
  imageResizing.resizingObj[IMGNAME].imgObj.height=Math.round(imageResizing.resizingObj[IMGNAME].startHeight + Math.cos(imageResizing.resizingObj[IMGNAME].angle) * imageResizing.resizingObj[IMGNAME].currentDistZ);
  }
   else if (imageResizing.resizingObj[IMGNAME].distY<0) {
  imageResizing.resizingObj[IMGNAME].imgObj.width=Math.round(imageResizing.resizingObj[IMGNAME].startWidth - Math.sin(imageResizing.resizingObj[IMGNAME].angle) * imageResizing.resizingObj[IMGNAME].currentDistZ);
  imageResizing.resizingObj[IMGNAME].imgObj.height=Math.round(imageResizing.resizingObj[IMGNAME].startHeight - Math.cos(imageResizing.resizingObj[IMGNAME].angle) * imageResizing.resizingObj[IMGNAME].currentDistZ);
  }
   if (imageResizing.resizingObj[IMGNAME].currentDistZ != imageResizing.resizingObj[IMGNAME].distZ) imageResizing.resizingObj[IMGNAME].timeout=window.setTimeout('resizeImage(\'' + IMGNAME + '\')',imageResizing.resizingObj[IMGNAME].frameRate);
   else if (imageResizing.resizingObj[IMGNAME].resizeEndFunc != null) imageResizing.resizingObj[IMGNAME].resizeEndFunc();
   }

   //   _ _ _ _ _ _
//  /  //  /_ _ /  /
//   _ _ _ /  /_ _   _ _ _ _ _ _   /  //_ //  /_ _
//  /  _ _   //  /  /  //  _ _  \ /  //  //  _ _  \
// /  /_ /  //  /_ /  //  /  /  //  /_ _ /  //  /_ /  /
// \_ _ _ _/ \_ _//_ /  /_ //_ _ _ //_ / \_ _ _ _/
// _ /  /
///_ _ /   Version 1.08 - Dec 22,2005
//
// ----------------------------------------------------
//   The Cross-Browser Dynamic HTML Scripting Library
// ----------------------------------------------------
//
//   Created by Lloyd Hassell
//Website: lloydhassell.com/dynlib
// Email: lloydhassell@hotmail.com
//

// --- 1. BROWSER DETECTION --- //

var dyn=(document.all||document.layers||document.getElementById) ? true : false;

var ie=(navigator.appName.indexOf('Microsoft') != -1) ? true : false;
var ie4=(ie && document.all && !document.getElementById) ? true : false;
var ie5=(ie && document.getElementById && navigator.userAgent.indexOf('MSIE 6.0')==-1) ? true : false;
var ie6=(ie && document.getElementById && !ie5) ? true : false;
var ie4Min=(ie4||ie5||ie6) ? true : false;
var ie5Min=(ie5||ie6) ? true : false;
var ie6Min=ie6;

var ns=(navigator.appName.indexOf('Netscape') != -1) ? true : false;
var ns4=(ns && document.layers) ? true : false;
var ns6=(ns && document.getElementById) ? true : false;
var ns4Min=(ns4||ns6) ? true : false;
var ns6Min=ns6;

// --- 2. CURSOR --- //

var cursorPageX,cursorPageY;
var cursorWinX,cursorWinY;

function captureCursor() {
   if (dyn && !cursorCaptured) {
  if (ns) document.captureEvents(Event.MOUSEMOVE);
  document.onmousemove=updateCursorPos;
  cursorCaptured=true;
  }
   }

var cursorCaptured=false;

function updateCursorPos(EVENT) {
   if (dyn) {
  if (ie) {
 cursorWinX=event.clientX - 2;
 cursorWinY=event.clientY - 2;
 var scrollLeft=(document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
 cursorPageX=cursorWinX + scrollLeft;
 var scrollTop=(document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
 cursorPageY=cursorWinY + scrollTop;
 }
  else {
 cursorPageX=EVENT.pageX;
 cursorPageY=EVENT.pageY;
 cursorWinX=cursorPageX - window.pageXOffset;
 cursorWinY=cursorPageY - window.pageYOffset;
 }
  if (dragLayerObj.isDragging) {
 moveLayerTo(dragLayerObj.layerObj,cursorPageX - dragLayerObj.cursorOffsetX,cursorPageY - dragLayerObj.cursorOffsetY);
 return false;
 }
  }
   }

// --- 3. DOCUMENT --- //

function getDocHeight() {
   if (ie4Min) return (document.body.scrollHeight>document.body.clientHeight) ? document.body.scrollHeight : document.body.clientHeight;
   else if (ns4Min) return (document.height>window.innerHeight) ? document.height : window.innerHeight;
   }

function getDocWidth() {
   if (ie4Min) return (document.body.scrollWidth>document.body.clientWidth) ? document.body.scrollWidth : document.body.clientWidth;
   else if (ns4Min) return (document.width>window.innerWidth) ? document.width : window.innerWidth;
   }

function getDocScrollLeft() {
   if (ie4Min) {
  if (document.documentElement && document.documentElement.scrollLeft) return document.documentElement.scrollLeft;
  else return document.body.scrollLeft;
  }
   else if (ns4Min) return window.pageXOffset;
   }

function getDocScrollTop() {
   if (ie4Min) {
  if (document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop;
  else return document.body.scrollTop;
  }
   else if (ns4Min) return window.pageYOffset;
   }

// --- 4. EVENTS --- //

function addObjEvent(OBJ,EVENT,FUNC) {
   if (dyn) {
  if (EVENT=='click') {
 if (ns4) OBJ.captureEvents(Event.CLICK);
 OBJ.onclick=new Function(FUNC);
 }
  else if (EVENT=='mousedown') {
 if (ns4) OBJ.captureEvents(Event.MOUSEDOWN);
 OBJ.onmousedown=new Function(FUNC);
 }
  else if (EVENT=='mouseup') {
 if (ns4) OBJ.captureEvents(Event.MOUSEUP);
 OBJ.onmouseup=new Function(FUNC);
 }
  else if (EVENT=='mouseover') {
 if (ns4) OBJ.captureEvents(Event.MOUSEOVER);
 OBJ.onmouseover=new Function(FUNC);
 }
  else if (EVENT=='mouseout') {
 if (ns4) OBJ.captureEvents(Event.MOUSEOUT);
 OBJ.onmouseout=new Function(FUNC);
 }
  }
   }

function removeObjEvent(OBJ,EVENT) {
   if (dyn) {
  if (EVENT=='click') {
 if (ns4) OBJ.releaseEvents(Event.CLICK);
 OBJ.onclick=null;
 }
  else if (EVENT=='mousedown') {
 if (ns4) OBJ.releaseEvents(Event.MOUSEDOWN);
 OBJ.onmousedown=null;
 }
  else if (EVENT=='mouseup') {
 if (ns4) OBJ.releaseEvents(Event.MOUSEUP);
 OBJ.onmouseup=null;
 }
  else if (EVENT=='mouseover') {
 if (ns4) OBJ.releaseEvents(Event.MOUSEOVER);
 OBJ.onmouseover=null;
 }
  else if (EVENT=='mouseout') {
 if (ns4) OBJ.releaseEvents(Event.MOUSEOUT);
 OBJ.onmouseout=null;
 }
  }
   }

// --- 5. HTML STRINGS --- //

function getATag(HREF,TARGET,ONMOUSEOVER,ONMOUSEOUT,OTHER) {
   var tempHtmlStr='<A';
   if (!isBlank(HREF)) tempHtmlStr += ' HREF="' + HREF + '"';
   if (!isBlank(TARGET)) tempHtmlStr += ' TARGET="' + TARGET + '"';
   if (!isBlank(ONMOUSEOVER)) tempHtmlStr += ' onMouseOver="' + ONMOUSEOVER + '"';
   if (!isBlank(ONMOUSEOUT)) tempHtmlStr += ' onMouseOut="' + ONMOUSEOUT + '"';
   if (!isBlank(OTHER)) tempHtmlStr += ' ' + OTHER;
   tempHtmlStr += '>';
   return tempHtmlStr;
   }

function getFontTag(COLOR,FACE,SIZE,OTHER) {
   var tempHtmlStr='<FONT';
   if (!isBlank(COLOR)) tempHtmlStr += ' COLOR="' + COLOR + '"';
   if (!isBlank(FACE)) tempHtmlStr += ' FACE="' + FACE + '"';
   if (!isBlank(SIZE)) tempHtmlStr += ' SIZE="' + SIZE + '"';
   if (!isBlank(OTHER)) tempHtmlStr += ' ' + OTHER;
   tempHtmlStr += '>';
   return tempHtmlStr;
   }

function getImgTag(NAME,SRC,WIDTH,HEIGHT,BORDER,ALIGN,HSPACE,VSPACE,ALT,OTHER) {
   var tempHtmlStr='<IMG';
   if (!isBlank(NAME)) tempHtmlStr += ' NAME="' + NAME + '"';
   if (!isBlank(SRC)) tempHtmlStr += ' SRC="' + SRC + '"';
   if (!isBlank(WIDTH)) tempHtmlStr += ' WIDTH="' + WIDTH + '"';
   if (!isBlank(HEIGHT)) tempHtmlStr += ' HEIGHT="' + HEIGHT + '"';
   if (!isBlank(BORDER)) tempHtmlStr += ' BORDER="' + BORDER + '"';
   if (!isBlank(ALIGN)) tempHtmlStr += ' ALIGN="' + ALIGN + '"';
   if (!isBlank(HSPACE)) tempHtmlStr += ' HSPACE="' + HSPACE + '"';
   if (!isBlank(VSPACE)) tempHtmlStr += ' VSPACE="' + VSPACE + '"';
   if (!isBlank(ALT)) tempHtmlStr += ' ALT="' + ALT + '"';
   if (!isBlank(OTHER)) tempHtmlStr += ' ' + OTHER;
   tempHtmlStr += '>';
   return tempHtmlStr;
   }

function getTableTag(CELLPADDING,CELLSPACING,BORDER,WIDTH,HEIGHT,OTHER) {
   var tempHtmlStr='<TABLE';
   if (!isBlank(CELLPADDING)) tempHtmlStr += ' CELLPADDING="' + CELLPADDING + '"';
   if (!isBlank(CELLSPACING)) tempHtmlStr += ' CELLSPACING="' + CELLSPACING + '"';
   if (!isBlank(BORDER)) tempHtmlStr += ' BORDER="' + BORDER + '"';
   if (!isBlank(WIDTH)) tempHtmlStr += ' WIDTH="' + WIDTH + '"';
   if (!isBlank(HEIGHT)) tempHtmlStr += ' HEIGHT="' + HEIGHT + '"';
   if (!isBlank(OTHER)) tempHtmlStr += ' ' + OTHER;
   tempHtmlStr += '>';
   return tempHtmlStr;
   }

function getTdTag(ALIGN,VALIGN,WIDTH,BGCOLOR,BACKGROUND,COLSPAN,ROWSPAN,NOWRAP,OTHER) {
   var tempHtmlStr='<TD';
   if (!isBlank(ALIGN)) tempHtmlStr += ' ALIGN="' + ALIGN + '"';
   if (!isBlank(VALIGN)) tempHtmlStr += ' VALIGN="' + VALIGN + '"';
   if (!isBlank(WIDTH)) tempHtmlStr += ' WIDTH="' + WIDTH + '"';
   if (!isBlank(BGCOLOR)) tempHtmlStr += ' BGCOLOR="' + BGCOLOR + '"';
   if (!isBlank(BACKGROUND)) tempHtmlStr += ' BACKGROUND="' + BACKGROUND + '"';
   if (!isBlank(COLSPAN)) tempHtmlStr += ' COLSPAN="' + COLSPAN + '"';
   if (!isBlank(ROWSPAN)) tempHtmlStr += ' ROWSPAN="' + ROWSPAN + '"';
   if (NOWRAP==true) tempHtmlStr += ' NOWRAP';
   if (!isBlank(OTHER)) tempHtmlStr += ' ' + OTHER;
   tempHtmlStr += '>';
   return tempHtmlStr;
   }

// --- 6. IMAGES --- //

function getImgObj(IMGNAME) {
   if (ns4) {
  var tempImgObj=null;
  var tempParentObj=(arguments.length==1) ? document : arguments[1];
  if (arguments.length==1 && document.images[IMGNAME] != null) tempImgObj=document.images[IMGNAME];
  else {
 for (var tempLayerLoop in tempParentObj.layers) {
var tempObj=tempParentObj.layers[tempLayerLoop];
var tempConstructor=tempObj.constructor + '';
if (tempConstructor.indexOf('function Layer()') != -1) {
   if (tempObj.document.images[IMGNAME] != null) return tempObj.document.images[IMGNAME];
   else if (tempObj.document.layers.length>0) tempImgObj=getImgObj(IMGNAME,tempObj);
   }
}
 }
  return tempImgObj;
  }
   else if (dyn) return document.images[IMGNAME];
   }

function loadImg(SRC) {
   if (dyn) {
  var tempImgObj=new Image();
  tempImgObj.src=SRC;
  return tempImgObj;
  }
   }

// --- 7. LAYER ADDING --- //

function addLayer(LAYERID,PARENTLAYEROBJ) {
   if (ie4Min) {
  if (isBlank(PARENTLAYEROBJ)) PARENTLAYEROBJ=document.body;
  PARENTLAYEROBJ.insertAdjacentHTML('BeforeEnd','<div id="' + LAYERID + '" style="position:absolute;left:0;top:0;width:1;visibility:hidden;"></div>');
  return (document.all) ? document.all[LAYERID] : document.getElementById(LAYERID);
  }
   else if (ns4) {
  if (isBlank(PARENTLAYEROBJ)) {
 document.layers[LAYERID]=new Layer(0);
 return document.layers[LAYERID];
 }
  else {
 PARENTLAYEROBJ.document.layers[LAYERID]=new Layer(0,PARENTLAYEROBJ);
 return PARENTLAYEROBJ.document.layers[LAYERID];
 }
  }
   else if (ns6) {
  if (isBlank(PARENTLAYEROBJ)) PARENTLAYEROBJ=document.body;
  var tempLayer=document.createElement('div');
  tempLayer.setAttribute('id',LAYERID);
  tempLayer.setAttribute('style','position:absolute;left:0;top:0;width:1;visibility:hidden;');
  PARENTLAYEROBJ.appendChild(tempLayer);
  return document.getElementById(LAYERID);
  }
   }

// --- 8. LAYER APPEARANCE --- //

function setLayerBgColor(LAYEROBJ,COLOR) {
   if (ns4) LAYEROBJ.document.bgColor=COLOR;
   else if (dyn) LAYEROBJ.style.backgroundColor=COLOR;
   }

function setLayerBgSrc(LAYEROBJ,SRC) {
   if (ns4) LAYEROBJ.background.src=SRC;
   else if (dyn) LAYEROBJ.style.backgroundImage='url(' + SRC + ')';
   }

// --- 9. LAYER CLIPPING --- //

function getLayerClipBottom(LAYEROBJ) {
   if (ns4) return LAYEROBJ.clip.bottom;
   else if (dyn) {
  var tempClipArray=LAYEROBJ.style.clip.substring(5,LAYEROBJ.style.clip.length - 3).split('px ');
  return parseInt(tempClipArray[2]);
  }
   }

function getLayerClipLeft(LAYEROBJ) {
   if (ns4) return LAYEROBJ.clip.left;
   else if (dyn) {
  var tempClipArray=LAYEROBJ.style.clip.substring(5,LAYEROBJ.style.clip.length - 3).split('px ');
  return parseInt(tempClipArray[3]);
  }
   }

function getLayerClipRight(LAYEROBJ) {
   if (ns4) return LAYEROBJ.clip.right;
   else if (dyn) {
  var tempClipArray=LAYEROBJ.style.clip.substring(5,LAYEROBJ.style.clip.length - 3).split('px ');
  return parseInt(tempClipArray[1]);
  }
   }

function getLayerClipTop(LAYEROBJ) {
   if (ns4) return LAYEROBJ.clip.top;
   else if (dyn) {
  var tempClipArray=LAYEROBJ.style.clip.substring(5,LAYEROBJ.style.clip.length - 3).split('px ');
  return parseInt(tempClipArray[0]);
  }
   }

function setLayerClip(LAYEROBJ,TOP,RIGHT,BOTTOM,LEFT) {
   if (dyn) {
  if (isBlank(TOP)) TOP=getLayerClipTop(LAYEROBJ);
  if (isBlank(RIGHT)) RIGHT=getLayerClipRight(LAYEROBJ);
  if (isBlank(BOTTOM)) BOTTOM=getLayerClipBottom(LAYEROBJ);
  if (isBlank(LEFT)) LEFT=getLayerClipLeft(LAYEROBJ);
  if (ns4) {
 LAYEROBJ.clip.left=LEFT;
 LAYEROBJ.clip.top=TOP;
 LAYEROBJ.clip.right=RIGHT;
 LAYEROBJ.clip.bottom=BOTTOM;
 }
  else LAYEROBJ.style.clip='rect(' + TOP + 'px ' +  RIGHT + 'px ' + BOTTOM + 'px '  + LEFT + 'px)';
  }
   }

// --- 10. LAYER DIMENSIONS --- //

function getLayerHeight(LAYEROBJ) {
   if (ie4) return LAYEROBJ.clientHeight;
   else if (ns4) return LAYEROBJ.clip.height;
   else if (dyn) return parseInt(LAYEROBJ.style.height);
   }

function getLayerWidth(LAYEROBJ) {
   if (ie4) return LAYEROBJ.clientWidth;
   else if (ns4) return LAYEROBJ.clip.width;
   else if (dyn) return parseInt(LAYEROBJ.style.width);
   }

function setLayerSize(LAYEROBJ,WIDTH,HEIGHT) {
   if (ie4) {
  if (!isBlank(WIDTH)) LAYEROBJ.style.pixelWidth=WIDTH;
  if (!isBlank(HEIGHT)) LAYEROBJ.style.pixelHeight=HEIGHT;
  }
   else if (ns4) {
  if (!isBlank(WIDTH)) LAYEROBJ.clip.right=WIDTH;
  if (!isBlank(HEIGHT)) LAYEROBJ.clip.bottom=HEIGHT;
  }
   else if (dyn) {
  if (!isBlank(WIDTH)) LAYEROBJ.style.width=WIDTH + 'px';
  if (!isBlank(HEIGHT)) LAYEROBJ.style.height=HEIGHT + 'px';
  }
   }

// --- 11. LAYER DRAGGING --- //

function addLayerDrag(LAYEROBJ,DRAGLAYEROBJ,DRAGENDFUNC) {
   if (dyn) {
  if (!cursorCaptured) captureCursor();
  LAYEROBJ.drag=new Object();
  LAYEROBJ.drag.layerObj=(!isBlank(DRAGLAYEROBJ)) ? DRAGLAYEROBJ : LAYEROBJ;
  LAYEROBJ.drag.onDragEnd=(!isBlank(DRAGENDFUNC)) ? new Function(DRAGENDFUNC) : null;
  if (ns4) {
 LAYEROBJ.captureEvents(Event.MOUSEDOWN);
 document.captureEvents(Event.MOUSEUP);
 }
  LAYEROBJ.onmousedown=dragLayerStart;
  document.onmouseup=dragLayerStop;
  }
   }

function removeLayerDrag(LAYEROBJ) {
   if (dyn) {
  LAYEROBJ.drag=null;
  LAYEROBJ.onmousedown=null;
  if (ns4) {
 LAYEROBJ.releaseEvents(Event.MOUSEDOWN);
 document.releaseEvents(Event.MOUSEUP);
 }
  }
   }

dragLayerObj=new Object();
dragLayerObj.isDragging=false;

function dragLayerStart() {
   if (!this.isSliding) {
  dragLayerObj.layerObj=this.drag.layerObj;
  dragLayerObj.cursorOffsetX=cursorPageX - getLayerLeft(dragLayerObj.layerObj);
  dragLayerObj.cursorOffsetY=cursorPageY - getLayerTop(dragLayerObj.layerObj);
  dragLayerObj.onDragEnd=this.drag.onDragEnd;
  setLayerOnTop(dragLayerObj.layerObj);
  dragLayerObj.isDragging=true;
  return true;
  }
   }

function dragLayerStop() {
   if (dragLayerObj.isDragging) {
  dragLayerObj.isDragging=false;
  if (dragLayerObj.onDragEnd != null) dragLayerObj.onDragEnd();
  return true;
  }
   }

// --- 12. LAYER HTML --- //

function setLayerHTML(LAYEROBJ,STR) {
   if (navigator.userAgent.indexOf('MSIE 5.0') && navigator.userAgent.indexOf('Mac') != -1) STR += '\n';
   if (ns4) {
  LAYEROBJ.document.open();
  LAYEROBJ.document.write(STR);
  LAYEROBJ.document.close();
  }
   else if (dyn) LAYEROBJ.innerHTML=STR;
   }

// --- 13. LAYER OBJECT --- //

function getLayerObj(LAYERID) {
   if (ie4) return document.all[LAYERID];
   else if (ns4) {
  var tempLayerObj=null;
  var tempParentObj=(arguments.length==1) ? document : arguments[1];
  for (var tempLayerLoop in tempParentObj.layers) {
 var tempObj=tempParentObj.layers[tempLayerLoop];
 var tempConstructor=tempObj.constructor + '';
 if (tempConstructor.indexOf('function Layer()') != -1) {
if (tempLayerLoop==LAYERID) return tempObj;
else if (tempObj.document.layers.length>0) tempLayerObj=getLayerObj(LAYERID,tempObj);
}
 }
  return tempLayerObj;
  }
   else if (dyn) return document.getElementById(LAYERID);
   }

// --- 14. LAYER POSITIONING --- //

function getLayerLeft(LAYEROBJ) {
   if (ns4) return LAYEROBJ.left;
   else if (dyn) return parseInt(LAYEROBJ.style.left);
   }

function getLayerTop(LAYEROBJ) {
   if (ns4) return LAYEROBJ.top;
   else if (dyn) return parseInt(LAYEROBJ.style.top);
   }

function moveLayerBy(LAYEROBJ,DISTX,DISTY) {
   if (ns4) {
  if (isBlank(DISTX)) DISTX=0;
  if (isBlank(DISTY)) DISTY=0;
  LAYEROBJ.moveBy(DISTX,DISTY);
  }
   else if (dyn) {
  if (!isBlank(DISTX)) LAYEROBJ.style.left=(parseInt(LAYEROBJ.style.left) + DISTX) + 'px';
  if (!isBlank(DISTY)) LAYEROBJ.style.top=(parseInt(LAYEROBJ.style.top) + DISTY) + 'px';
  }
   }

function moveLayerTo(LAYEROBJ,LEFT,TOP) {
   if (ns4) {
  if (isBlank(LEFT)) LEFT=getLayerLeft(LAYEROBJ);
  if (isBlank(TOP)) TOP=getLayerTop(LAYEROBJ);
  LAYEROBJ.moveTo(LEFT,TOP);
  }
   else if (dyn) {
  if (!isBlank(LEFT)) LAYEROBJ.style.left=LEFT + 'px';
  if (!isBlank(TOP)) LAYEROBJ.style.top=TOP + 'px';
  }
   }

// --- 15. LAYER SLIDING --- //

function slideLayerBy(LAYEROBJ,DISTX,DISTY,INCREMENT,FRAMERATE,SLIDEENDFUNC) {
   if (dyn) {
  var tempSlideId=LAYEROBJ.id;
  if (slideLayerObj[tempSlideId] != null) window.clearTimeout(slideLayerObj[tempSlideId].moveTimeout);
  var tempPosX=getLayerLeft(LAYEROBJ);
  var tempPosY=getLayerTop(LAYEROBJ);
  if (isBlank(DISTX)) DISTX=0;
  if (isBlank(DISTY)) DISTY=0;
  var tempEndX=tempPosX + DISTX;
  var tempEndY=tempPosY + DISTY;
  slideLayerObj[tempSlideId]=new slideLayerInit(LAYEROBJ,tempPosX,tempPosY,tempEndX,tempEndY,INCREMENT,FRAMERATE,SLIDEENDFUNC);
  slideLayerObj[tempSlideId].slideLayer();
  }
   }

function slideLayerTo(LAYEROBJ,LEFT,TOP,INCREMENT,FRAMERATE,SLIDEENDFUNC) {
   if (dyn) {
  var tempSlideId=LAYEROBJ.id;
  if (slideLayerObj[tempSlideId] != null) window.clearTimeout(slideLayerObj[tempSlideId].moveTimeout);
  var tempPosX=getLayerLeft(LAYEROBJ);
  var tempPosY=getLayerTop(LAYEROBJ);
  if (isBlank(LEFT)) LEFT=tempPosX;
  if (isBlank(TOP)) TOP=tempPosY;
  slideLayerObj[tempSlideId]=new slideLayerInit(LAYEROBJ,tempPosX,tempPosY,LEFT,TOP,INCREMENT,FRAMERATE,SLIDEENDFUNC);
  slideLayerObj[tempSlideId].slideLayer();
  }
   }

slideLayerObj=new Object();

function slideLayerInit(LAYEROBJ,POSX,POSY,ENDX,ENDY,INCREMENT,FRAMERATE,SLIDEENDFUNC) {
   dragLayerObj.isDragging=false;
   LAYEROBJ.isSliding=true;
   this.layerId=LAYEROBJ.id;
   this.layerObj=LAYEROBJ;
   this.posX=POSX;
   this.posY=POSY;
   this.posZ=0;
   this.endX=ENDX;
   this.endY=ENDY;
   this.incZ=(!isBlank(INCREMENT)) ? INCREMENT : 3;
   this.frameRate=(!isBlank(FRAMERATE)) ? FRAMERATE : 50;
   this.onSlideEnd=(!isBlank(SLIDEENDFUNC)) ? new Function(SLIDEENDFUNC) : null;
   this.moveTimeout=null;
   this.slideLayer=slideLayerMove;
   this.distX=this.endX - this.posX;
   this.dirX=(this.distX >= 0) ? 'right' : 'left';
   if (this.distX<0) this.distX *= -1;
   this.distY=this.endY - this.posY;
   this.dirY=(this.distY >= 0) ? 'down' : 'up';
   if (this.distY<0) this.distY *= -1;
   this.distZ=Math.sqrt(Math.pow(this.distX,2) + Math.pow(this.distY,2));
   this.slideAngle=Math.atan(this.distX / this.distY);
   this.incX=Math.sin(this.slideAngle) * this.incZ;
   this.incY=Math.cos(this.slideAngle) * this.incZ;
   }

function slideLayerMove() {
   if (this.posZ + this.incZ<this.distZ) {
  this.posX += (this.dirX=='right') ? this.incX : this.incX * -1;
  this.posY += (this.dirY=='down') ? this.incY : this.incY * -1;
  this.posZ += this.incZ;
  moveLayerTo(this.layerObj,Math.round(this.posX),Math.round(this.posY));
  slideLayerObj[this.layerId].moveTimeout=setTimeout('slideLayerObj[\'' + this.layerId + '\'].slideLayer()',this.frameRate);
  }
   else {
  this.posX=this.endX;
  this.posY=this.endY;
  moveLayerTo(this.layerObj,this.endX,this.endY);
  if (this.onSlideEnd != null) this.onSlideEnd();
  this.layerObj.isSliding=false;
  }
   }

// --- 16. LAYER STACKING --- //

function setLayerOnBottom(LAYEROBJ) {
   if (dyn) setLayerZIndex(LAYEROBJ,getLayerStack('<') - 1);
   }

function setLayerOnTop(LAYEROBJ) {
   if (dyn) setLayerZIndex(LAYEROBJ,getLayerStack('>') + 1);
   }

function getLayerStack(TYPE) {
   if (ie4) {
  var tempLayerZIndex=null;
  for (var tempLayerLoop in document.all) {
 if (typeof(document.all[tempLayerLoop])=='object' && (document.all[tempLayerLoop].tagName=='DIV'||document.all[tempLayerLoop].tagName=='SPAN')) {
if (tempLayerZIndex==null||eval('document.all[tempLayerLoop].style.zIndex ' + TYPE + ' tempLayerZIndex')) {
   tempLayerZIndex=document.all[tempLayerLoop].style.zIndex;
   }
}
 }
  }
   else if (ns4) {
  var tempParentObj=(arguments.length==1) ? document : arguments[1];
  var tempLayerZIndex=(arguments.length==1) ? null : arguments[2];
  for (var tempLayerLoop in tempParentObj.layers) {
 var tempConstructor=tempParentObj.layers[tempLayerLoop].constructor + '';
 if (tempConstructor.indexOf('function Layer()') != -1) {
if (tempLayerZIndex==null||eval('tempParentObj.layers[tempLayerLoop].zIndex ' + TYPE + ' tempLayerZIndex')) {
   tempLayerZIndex=tempParentObj.layers[tempLayerLoop].zIndex;
   }
if (tempParentObj.layers[tempLayerLoop].layers.length>0) {
   tempLayerZIndex=getLayerStack(TYPE,tempParentObj.layers[tempLayerLoop].document,tempLayerZIndex);
   }
}
 }
  }
   else if (dyn) {
  var tempLayerZIndex=null;
  var tempLayersObj=document.getElementsByTagName('div');
  for (var tempLayerLoop=0; tempLayerLoop<tempLayersObj.length; tempLayerLoop++) {
 if (tempLayerZIndex==null||eval('tempLayersObj[tempLayerLoop].style.zIndex ' + TYPE + ' tempLayerZIndex')) {
tempLayerZIndex=tempLayersObj[tempLayerLoop].style.zIndex;
}
 }
  }
   return parseInt(tempLayerZIndex);
   }

// --- 17. LAYER VISIBILITY --- //

function hideLayer(LAYEROBJ) {
   if (ns4) LAYEROBJ.visibility='hide';
   else if (dyn) LAYEROBJ.style.visibility='hidden';
   }

function showLayer(LAYEROBJ) {
   if (ns4) LAYEROBJ.visibility='show';
   else if (dyn) LAYEROBJ.style.visibility='visible';
   }

// --- 18. LAYER Z-INDEX --- //

function getLayerZIndex(LAYEROBJ) {
   if (ns4) return LAYEROBJ.zIndex;
   else if (dyn) return LAYEROBJ.style.zIndex;
   }

function setLayerZIndex(LAYEROBJ,ZINDEX) {
   if (ns4) LAYEROBJ.zIndex=ZINDEX;
   else if (dyn) LAYEROBJ.style.zIndex=ZINDEX;
   }

// --- 19. WINDOW --- //

function getWinHeight() {
   if (ie4Min) return document.body.clientHeight;
   else if (ns4Min) return window.innerHeight;
   }

function getWinWidth() {
   if (ie4Min) return document.body.clientWidth;
   else if (ns4Min) return window.innerWidth;
   }

// --- 20. OTHER CODE --- //

function isBlank(STR) {
   if (dyn) {
  if (STR==null) STR='';
  STR += '';
  STR=STR.replace(/^\s+|\s+$/g,'');
  return (STR=='') ? true : false;
  }
   }
/***********************************************************************
* File: JSFX_ImageFader.js  © JavaScript-FX.com
* Created : 2001/08/31
* Author  : Roy Whittle  (Roy@Whittle.com) www.Roy.Whittle.com
* Purpose : To create a fading effect for images
* History
* Date Version  Description
* 2001-08-091.0First version
* 2001-08-311.1Code split - others became
*JSFX_FadingRollovers,
* JSFX_ImageFader,
*JSFX_ImageZoom.
* 2002-01-271.2Completed development by converting to JSFX namespace
* 2002-02-211.3Added JSFX.fadeUpImg JSFX.fadeDownImg
* 2002-01-291.4Make "fade" a seperate object of "img"
* 2002-03-121.5Added an auto fade up/down for images
*with class imageFader
* 2002-08-291.6Thanks to piglet (http://homepage.ntlworld.com/thepiglet/)
*I now have a partial fix for NS7 and Mozilla 1.1.
***********************************************************************/
if(!window.JSFX)
JSFX=new Object();

JSFX.FadeImageRunning= false;
JSFX.FadeImageMinOpacity=40;
JSFX.FadeImageAutoUp=10;
JSFX.FadeImageAutoDown  =10;
JSFX.FadeImageSavedOver =null;
JSFX.FadeImageSavedOut  =null;
document.write('<STYLE TYPE="text/css">.imageFader{ position:relative; filter:alpha(opacity='+JSFX.FadeImageMinOpacity+'); -moz-opacity:'+JSFX.FadeImageMinOpacity/101+'}</STYLE>');
/*******************************************************************
*
* Function: actionOnMouseOver
*
* Description : Called automatically whenever an element in the
*document is "mousedOver". It checks to see if the
*element has the className=="imageFader" and if so
*starts fading up the element.
*
*****************************************************************/
JSFX.fadeImage_actionOnMouseOver=function(e)
{
srcElement=e ? e.target : event.srcElement;

if(srcElement.className && srcElement.className=="imageFader")
JSFX.fadeUp(srcElement);

/*** If the document already had an onMouseOver handler,call it ***/
if(JSFX.FadeImageSavedOver != null)
JSFX.FadeImageSavedOver(e);
}

/*******************************************************************
*
* Function: actionOnMouseOut
*
* Description : Called automatically whenever an element in the
*document is "mousedOut". It checks to see if the
*element has the className=="imageFader" and if so
*starts fading down the element.
*
*****************************************************************/
JSFX.fadeImage_actionOnMouseOut=function(e)
{
srcElement=e ? e.target : event.srcElement;

if(srcElement.className && srcElement.className=="imageFader")
JSFX.fadeDown(srcElement);

/*** If the document already had an onMouseOut handler,call it ***/
if(JSFX.FadeImageSavedOut != null)
JSFX.FadeImageSavedOut(e);
}
/*******************************************************************
*
* Function:fadeImageAuto
*
* Parameters  :minOpacity- Minimum opacity to fade down to.
*stepUp- fade up speed - larger=faster.
*stepDown - fade down speed- larger=faster.
*
* Description :Saves the documents original mousOver/Out handlers
*and installs the actionMouseOver/Out handlers
*of JSFX.fadeImage
*
*****************************************************************/
JSFX.fadeImageAuto=function(minOpacity,stepUp,stepDown)
{
if(minOpacity)
JSFX.FadeImageMinOpacity=minOpacity;
if(stepUp)
JSFX.FadeImageAutoUp= stepUp;
if(stepDown)
JSFX.FadeImageAutoDown= stepDown;

/*** Save the original document mouseOver/Out events ***/
JSFX.FadeImageSavedOver=document.onmouseover;
JSFX.FadeImageSavedOut =document.onmouseout;

document.onmouseover= JSFX.fadeImage_actionOnMouseOver ;
document.onmouseout= JSFX.fadeImage_actionOnMouseOut ;
JSFX.setMinOpacity(JSFX.FadeImageMinOpacity);
}
/*******************************************************************
*
* Function: setMinOpacity
*
* Description : sets the minimum opacity for all fading images from
*the default of 40 to the passed value.
*
*****************************************************************/
JSFX.setMinOpacity=function(minOpacity)
{
if(document.layers) return;

for(i=0;i<document.images.length;i++)
{
var img=document.images[i];
if(img.className=="imageFader")
{
if(img.filters)
img.filters.alpha.opacity=JSFX.FadeImageMinOpacity;
else
img.style.MozOpacity=JSFX.FadeImageMinOpacity/101;
}
}
}
/*******************************************************************
*
* Function: fadeUpImg
*
* Description : Finds the image in the document and calls JSFX.fadeUp
*
*****************************************************************/
JSFX.fadeUpImg=function(imgName,step)
{
if(document.layers||window.opera)
return;

img=document.images[imgName];
if(img)
JSFX.fadeUp(img,step);
}
/*******************************************************************
*
* Function: fadeUp
*
* Description : This function is based on the turn_on() function
*  of animate2.js (animated rollovers from www.roy.whittle.com).
*  Each fading image object is given a state.
*OnMouseOver the state is switched depending on the current state.
*Current state -> Switch to
*===========================
*null->OFF.
*OFF->FADE_UP
*FADE_DOWN->FADE_UP
*FADE_UP_DOWN->FADE_UP
*****************************************************************/
JSFX.fadeUp=function(img,step)
{

if(img)
{
if(!step) step=JSFX.FadeImageAutoUp;

if(img.fade==null)
{
img.fade=new Object();
img.fade.state="OFF";
img.fade.upStep=step;
img.fade.downStep =step;
img.fade.minOpacity =JSFX.FadeImageMinOpacity;
img.fade.index=img.fade.minOpacity;

}
if(img.fade.state=="OFF")
{
img.fade.upStep =step;
img.fade.state="FADE_UP";
JSFX.startImageFading();
}
else if( img.fade.state=="FADE_UP_DOWN"||img.fade.state=="FADE_DOWN")
{
img.fade.upStep =step;
img.fade.state="FADE_UP";
}
}
}
/*******************************************************************
*
* Function: fadeDownImg
*
* Description : Finds the image in the document and calls JSFX.fadeDown
*
*****************************************************************/
JSFX.fadeDownImg=function(imgName,step)
{
if(document.layers||window.opera)
return;

img=document.images[imgName];
if(img)
JSFX.fadeDown(img,step);
}
/*******************************************************************
*
* Function: fadeDown
*
* Description : This function is based on the turn_off function
*  of animate2.js (animated rollovers from www.roy.whittle.com).
*  Each zoom object is given a state.
*OnMouseOut the state is switched depending on the current state.
*Current state -> Switch to
*===========================
*ON->FADE_DOWN.
*FADE_UP->FADE_UP_DOWN.
*****************************************************************/
JSFX.fadeDown=function(img,step)
{
if(img)
{
if(!step) step=JSFX.FadeImageAutoDown;

if(img.fade.state=="ON")
{
img.fade.downStep =step;
img.fade.state="FADE_DOWN";
JSFX.startImageFading();
}
else if(img.fade.state=="FADE_UP")
{
img.fade.downStep =step;
img.fade.state="FADE_UP_DOWN";
}
}
}
/*******************************************************************
*
* Function: startImageFading
*
* Description : This function is based on the start_animating() function
*of animate2.js (animated rollovers from www.roy.whittle.com).
*If the timer is not currently running,it is started.
*Only 1 timer is used for all objects
*****************************************************************/
JSFX.startImageFading=function()
{
if(!JSFX.FadeImageRunning)
JSFX.FadeImageAnimation();
}

/*******************************************************************
*
* Function: FadeImageAnimation
*
* Description : This function is based on the Animate function
*of animate2.js (animated rollovers from www.roy.whittle.com).
*Each object has a state. This function
*modifies each object and (possibly) changes its state.
*****************************************************************/
JSFX.FadeImageAnimation=function()
{
JSFX.FadeImageRunning=false;
for(i=0;i<document.images.length;i++)
{
var img=document.images[i];
if(img.fade)
{
if(img.fade.state=="FADE_UP")
{
img.fade.index+=img.fade.upStep;
if(img.fade.index>100)
img.fade.index=100;

if(img.filters)
img.filters.alpha.opacity=img.fade.index;
else
img.style.MozOpacity=img.fade.index/101;

if(img.fade.index==100)
img.fade.state="ON";
else
JSFX.FadeImageRunning=true;
}
else if(img.fade.state=="FADE_UP_DOWN")
{
img.fade.index+=img.fade.upStep;
if(img.fade.index>100)
img.fade.index=100;

if(img.filters)
img.filters.alpha.opacity=img.fade.index;
else
img.style.MozOpacity=img.fade.index/101;

if(img.fade.index==100)
img.fade.state="FADE_DOWN";
JSFX.FadeImageRunning=true;
}
else if(img.fade.state=="FADE_DOWN")
{
img.fade.index-=img.fade.downStep;
if(img.fade.index<img.fade.minOpacity)
img.fade.index=img.fade.minOpacity;

if(img.filters)
img.filters.alpha.opacity=img.fade.index;
else
img.style.MozOpacity=img.fade.index/101;

if(img.fade.index==img.fade.minOpacity)
img.fade.state="OFF";
else
JSFX.FadeImageRunning=true;
}
}
}
/*** Check to see if we need to animate any more frames. ***/
if(JSFX.FadeImageRunning)
setTimeout("JSFX.FadeImageAnimation()",40);
}
function setOpacity(obj,opacity) {
// IE/Win
obj.style.filter='alpha(opacity:'+opacity+')';
// Safari<1.2,Konqueror
obj.style.KHTMLOpacity=opacity/100;
// Older Mozilla and Firefox
obj.style.MozOpacity=opacity/100;
// Safari 1.2,newer Firefox and Mozilla,CSS3
obj.style.opacity=opacity/100;
}

var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=='random')
{
myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
}
if(pos=='center')
{
myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;
}
else if((pos!='center' && pos!='random')||pos==null){myleft=0;mytop=20}
settings='width=' + w + ',height=' + h + ',top=' + mytop + ',left=' + myleft + ',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
win.focus();
}
var imageId='titulo';
function initImage() {
var image=document.getElementById(imageId);
setOpacity(image,0);
image.style.visibility="visible";
window.setTimeout("fadeIn(imageId,0);",1000);
}
function fadeIn(objId,opacity) {
if (document.getElementById) {
obj=document.getElementById(objId);
if (opacity<100) {
setOpacity(obj,opacity);
opacity += 3;
window.setTimeout("fadeIn('"+objId+"',"+opacity+")",100);
}
}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
var TINY={};
function $(i){return document.getElementById(i)}function $$(e,p){p=p||document;
return p.getElementsByTagName(e)}TINY.slideshow=function(n){this.infoSpeed=this.imgSpeed=this.speed=10;
this.thumbOpacity=this.navHover=70;
this.navOpacity=25;
this.scrollSpeed=5;
this.letterbox='#000';
this.n=n;
this.c=0;
this.a=[]};
TINY.slideshow.prototype={init:function(s,z,b,f,q){s=$(s);
var m=$$('li',s),i=0,w=0;
this.l=m.length;
this.q=$(q);
this.f=$(z);
this.r=$(this.info);
this.o=parseInt(TINY.style.val(z,'width'));
if(this.thumbs){var u=$(this.left),r=$(this.right);
u.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",-1,'+this.scrollSpeed+')');
u.onmouseout=r.onmouseout=new Function('TINY.scroll.cl("'+this.thumbs+'")');
r.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",1,'+this.scrollSpeed+')');
this.p=$(this.thumbs)}for(i;
i<this.l;
i++){this.a[i]={};
var h=m[i],a=this.a[i];
a.t=$$('h3',h)[0].innerHTML;
a.d=$$('p',h)[0].innerHTML;
a.l=$$('a',h)[0]?$$('a',h)[0].href:'';
a.p=$$('span',h)[0].innerHTML;
if(this.thumbs){var g=$$('img',h)[0];
this.p.appendChild(g);
w+=parseInt(g.offsetWidth);
if(i!=this.l-1){g.style.marginRight=this.spacing+'px';
w+=this.spacing}this.p.style.width=w+'px';
g.style.opacity=this.thumbOpacity/100;
g.style.filter='alpha(opacity='+this.thumbOpacity+')';
g.onmouseover=new Function('TINY.alpha.set(this,100,5)');
g.onmouseout=new Function('TINY.alpha.set(this,'+this.thumbOpacity+',5)');
g.onclick=new Function(this.n+'.pr('+i+',1)')}}if(b&&f){b=$(b);
f=$(f);
b.style.opacity=f.style.opacity=this.navOpacity/100;
b.style.filter=f.style.filter='alpha(opacity='+this.navOpacity+')';
b.onmouseover=f.onmouseover=new Function('TINY.alpha.set(this,'+this.navHover+',5)');
b.onmouseout=f.onmouseout=new Function('TINY.alpha.set(this,'+this.navOpacity+',5)');
b.onclick=new Function(this.n+'.mv(-1,1)');
f.onclick=new Function(this.n+'.mv(1,1)')}this.auto?this.is(0,0):this.is(0,1)},mv:function(d,c){var t=this.c+d;
this.c=t=t<0?this.l-1:t>this.l-1?0:t;
this.pr(t,c)},pr:function(t,c){clearTimeout(this.lt);
if(c){clearTimeout(this.at)}this.c=t;
this.is(t,c)},is:function(s,c){if(this.info){TINY.height.set(this.r,1,this.infoSpeed/2,-1)}var i=new Image();
i.style.opacity=0;
i.style.filter='alpha(opacity=0)';
this.i=i;
i.onload=new Function(this.n+'.le('+s+','+c+')');
i.src=this.a[s].p;
if(this.thumbs){var a=$$('img',this.p),l=a.length,x=0;
for(x;
x<l;
x++){a[x].style.borderColor=x!=s?'':this.active}}},le:function(s,c){this.f.appendChild(this.i);
var w=this.o-parseInt(this.i.offsetWidth);
if(w>0){var l=Math.floor(w/2);
this.i.style.borderLeft=l+'px solid '+this.letterbox;
this.i.style.borderRight=(w-l)+'px solid '+this.letterbox}TINY.alpha.set(this.i,100,this.imgSpeed);
var n=new Function(this.n+'.nf('+s+')');
this.lt=setTimeout(n,this.imgSpeed*100);
if(!c){this.at=setTimeout(new Function(this.n+'.mv(1,0)'),this.speed*1000)}if(this.a[s].l!=''){this.q.onclick=new Function('window.location="'+this.a[s].l+'"');
this.q.onmouseover=new Function('this.className="'+this.link+'"');
this.q.onmouseout=new Function('this.className=""');
this.q.style.cursor='pointer'}else{this.q.onclick=this.q.onmouseover=null;
this.q.style.cursor='default'}var m=$$('img',this.f);
if(m.length>2){this.f.removeChild(m[0])}},nf:function(s){if(this.info){s=this.a[s];
$$('h3',this.r)[0].innerHTML=s.t;
$$('p',this.r)[0].innerHTML=s.d;
this.r.style.height='auto';
var h=parseInt(this.r.offsetHeight);
this.r.style.height=0;
TINY.height.set(this.r,h,this.infoSpeed,0)}}};
TINY.scroll=function(){return{init:function(e,d,s){e=typeof e=='object'?e:$(e);
var p=e.style.left||TINY.style.val(e,'left');
e.style.left=p;
var l=d==1?parseInt(e.offsetWidth)-parseInt(e.parentNode.offsetWidth):0;
e.si=setInterval(function(){TINY.scroll.mv(e,l,d,s)},20)},mv:function(e,l,d,s){var c=parseInt(e.style.left);
if(c==l){TINY.scroll.cl(e)}else{var i=Math.abs(l+c);
i=i<s?i:s;
var n=c-i*d;
e.style.left=n+'px'}},cl:function(e){e=typeof e=='object'?e:$(e);
clearInterval(e.si)}}}();
TINY.height=function(){return{set:function(e,h,s,d){e=typeof e=='object'?e:$(e);
var oh=e.offsetHeight,ho=e.style.height||TINY.style.val(e,'height');
ho=oh-parseInt(ho);
var hd=oh-ho>h?-1:1;
clearInterval(e.si);
e.si=setInterval(function(){TINY.height.tw(e,h,ho,hd,s)},20)},tw:function(e,h,ho,hd,s){var oh=e.offsetHeight-ho;
if(oh==h){clearInterval(e.si)}else{if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'}}}}}();
TINY.alpha=function(){return{set:function(e,a,s){e=typeof e=='object'?e:$(e);
var o=e.style.opacity||TINY.style.val(e,'opacity'),d=a>o*100?1:-1;
e.style.opacity=o;
clearInterval(e.ai);
e.ai=setInterval(function(){TINY.alpha.tw(e,a,d,s)},20)},tw:function(e,a,d,s){var o=Math.round(e.style.opacity*100);
if(o==a){clearInterval(e.ai)}else{var n=o+Math.ceil(Math.abs(a-o)/s)*d;
e.style.opacity=n/100;
e.style.filter='alpha(opacity='+n+')'}}}}();
TINY.style=function(){return{val:function(e,p){e=typeof e=='object'?e:$(e);
return e.currentStyle?e.currentStyle[p]:document.defaultView.getComputedStyle(e,null).getPropertyValue(p)}}}();
