
var galleryLoader;
var selectedGallery = 0;
var showGallery_220 = false;
var requestUri_220 = location.href;
var re = /[\?&](ghash=(.*))/gi;
requestUri_220 = requestUri_220.replace(re, '');
if(requestUri_220.indexOf('?') < 0) {
    requestUri_220 = requestUri_220 + '?';
} else {
    requestUri_220 = requestUri_220 + '&';
}
if (galleryLoader == undefined || selectedGallery == 1) {
    showGallery_220 = true;
}
 showGallery_220 = true;
var imageGalleryLeftPos_220       = 31;
var previewImgContainerHeight_220 = 307;
var imageGalleryWidth_220         = 367;
var maxGalleryXPos_220            = 31;
var minGalleryXPos_220            = -558;
var thumbnailsPosition_220        = 'H';
var scrollingSpeed_220            = 60;
var slideShowDelay_220            = 5000;
var ihost_220                     = 'http://images.myrockypoint.com/';
var ipath_220                     = ihost_220 + '21/';
var Photos_220                    = new Array();
Photos_220[0] = new Array( ipath_220 + '5467.jpg', ipath_220 + 'thumbnail_5467.jpg', "pic1.jpg", "", "", "400", "299");
Photos_220[1] = new Array( ipath_220 + '5468.jpg', ipath_220 + 'thumbnail_5468.jpg', "pic2.jpg", "", "", "400", "300");
Photos_220[2] = new Array( ipath_220 + '5469.jpg', ipath_220 + 'thumbnail_5469.jpg', "pic3.jpg", "", "", "400", "297");
Photos_220[3] = new Array( ipath_220 + '5470.jpg', ipath_220 + 'thumbnail_5470.jpg', "pic4.jpg", "", "", "400", "298");
Photos_220[4] = new Array( ipath_220 + '5471.jpg', ipath_220 + 'thumbnail_5471.jpg', "pic5.jpg", "", "", "400", "299");
Photos_220[5] = new Array( ipath_220 + '5472.jpg', ipath_220 + 'thumbnail_5472.jpg', "pic10.jpg", "", "", "400", "299");
Photos_220[6] = new Array( ipath_220 + '5473.jpg', ipath_220 + 'thumbnail_5473.jpg', "pic6.jpg", "", "", "400", "298");
Photos_220[7] = new Array( ipath_220 + '5474.jpg', ipath_220 + 'thumbnail_5474.jpg', "pic7.jpg", "", "", "400", "300");
Photos_220[8] = new Array( ipath_220 + '5475.jpg', ipath_220 + 'thumbnail_5475.jpg', "pic8.jpg", "", "", "400", "299");
Photos_220[9] = new Array( ipath_220 + '5476.jpg', ipath_220 + 'thumbnail_5476.jpg', "pic9.jpg", "", "", "400", "299");
Photos_220[10] = new Array( ipath_220 + '5479.jpg', ipath_220 + 'thumbnail_5479.jpg', "flick1.jpg", "", "", "172", "240");
Photos_220[11] = new Array( ipath_220 + '5480.jpg', ipath_220 + 'thumbnail_5480.jpg', "flick2.jpg", "", "", "400", "271");
if (showGallery_220) {
    var preloadPhotos_220 = new Array('' + ihost_220 + 'b_next.gif', '' + ihost_220 + 'b_next_over.gif', '' + ihost_220 + 'b_pause.gif', '' + ihost_220 + 'b_pause_over.gif', '' + ihost_220 + 'b_play.gif', '' + ihost_220 + 'b_play_over.gif', '' + ihost_220 + 'b_previous.gif', '' + ihost_220 + 'b_previous_over.gif', '' + ihost_220 + 'b_scroll_down.gif', '' + ihost_220 + 'b_scroll_down_over.gif', '' + ihost_220 + 'b_scroll_up.gif', '' + ihost_220 + 'b_scroll_up_over.gif', '' + ihost_220 + 'title_bg.gif', '' + ihost_220 + 'show_rental_details.gif', '' + ihost_220 + 'show_rental_details_over.gif', '' + ipath_220 + '5467.jpg', '' + ipath_220 + 'thumbnail_5467.jpg', '' + ipath_220 + 'thumbnail_5468.jpg');
    var preloadPhotos = new Array('' + ihost_220 + 'b_next.gif', '' + ihost_220 + 'b_next_over.gif', '' + ihost_220 + 'b_pause.gif', '' + ihost_220 + 'b_pause_over.gif', '' + ihost_220 + 'b_play.gif', '' + ihost_220 + 'b_play_over.gif', '' + ihost_220 + 'b_previous.gif', '' + ihost_220 + 'b_previous_over.gif', '' + ihost_220 + 'b_scroll_down.gif', '' + ihost_220 + 'b_scroll_down_over.gif', '' + ihost_220 + 'b_scroll_up.gif', '' + ihost_220 + 'b_scroll_up_over.gif', '' + ihost_220 + 'title_bg.gif', '' + ihost_220 + 'show_rental_details.gif', '' + ihost_220 + 'show_rental_details_over.gif', '' + ipath_220 + '5467.jpg', '' + ipath_220 + 'thumbnail_5467.jpg', '' + ipath_220 + 'thumbnail_5468.jpg');
    var preloadPhotosAfter_220 = new Array('' + ipath_220 + '5468.jpg', '' + ipath_220 + '5469.jpg', '' + ipath_220 + 'thumbnail_5469.jpg', '' + ipath_220 + '5470.jpg', '' + ipath_220 + 'thumbnail_5470.jpg', '' + ipath_220 + '5471.jpg', '' + ipath_220 + 'thumbnail_5471.jpg', '' + ipath_220 + '5472.jpg', '' + ipath_220 + 'thumbnail_5472.jpg', '' + ipath_220 + '5473.jpg', '' + ipath_220 + 'thumbnail_5473.jpg', '' + ipath_220 + '5474.jpg', '' + ipath_220 + 'thumbnail_5474.jpg', '' + ipath_220 + '5475.jpg', '' + ipath_220 + 'thumbnail_5475.jpg', '' + ipath_220 + '5476.jpg', '' + ipath_220 + 'thumbnail_5476.jpg', '' + ipath_220 + '5479.jpg', '' + ipath_220 + 'thumbnail_5479.jpg', '' + ipath_220 + '5480.jpg', '' + ipath_220 + 'thumbnail_5480.jpg');
} else {
    var preloadPhotos_220 = new Array(ihost_220 + 'title_bg.gif');
    var preloadPhotos = new Array(ihost_220 + 'title_bg.gif');
}
function drawGallery_220()
{
    if (document.getElementById("gallery_slideshow_220") != null ) {
    igallery_220 = document.getElementById("gallery_slideshow_220");
    } else {
    igallery_220 = document.getElementById("gallery_slideshow");
    }
    if (showGallery_220) {
    preview_pane_220 = document.createElement('div');
    preview_pane_220.setAttribute('id', "previewPane_220");
    gncontainer_220 = document.createElement('div');
    gncontainer_220.setAttribute('id', "galleryTitle_220");
    gnscontainer_220 = document.createElement('div');
    gnTitle_220 = document.createTextNode( "2006 Rocky Point Spring Break" );
    gnscontainer_220.appendChild(gnTitle_220);
    gncontainer_220.appendChild(gnscontainer_220);
    preview_pane_220.appendChild(gncontainer_220);
    preview_pane_img_div_220 = document.createElement('div');
    preview_pane_img_div_220.setAttribute('id', 'gPreviewImgContainer_220');
    preview_pane_img_220 = document.createElement('img');
    preview_pane_img_220.setAttribute('id', 'gPreviewImg_220');
    if (Photos_220.length > 0) {
        var margin_top = roundnumber_220( (previewImgContainerHeight_220/2 - 4) - (Photos_220[0][6]/2), 0);
        preview_pane_img_220.setAttribute('src', Photos_220[0][0]);
        preview_pane_img_220.setAttribute('width', Photos_220[0][5]);
        preview_pane_img_220.setAttribute('height', Photos_220[0][6]);
        preview_pane_img_220.setAttribute('style', 'margin-top: ' + margin_top + 'px;');
    }
    preview_pane_img_div_220.appendChild(preview_pane_img_220);
    preview_pane_220.appendChild(preview_pane_img_div_220);
    itext_220 = document.createElement('div');
    itext_220.setAttribute('id', "imgTextContainer_220");
    if (Photos_220.length > 0 && Photos_220[0][3] != '') {
        itext_220.innerHTML = Photos_220[0][3];
    }
    preview_pane_220.appendChild(itext_220);
    sscontainer_220 = document.createElement('div');
    sscontainer_220.setAttribute('id', "slideShowContainer_220");
    prev_img_a_220 = document.createElement('a');
    prev_img_a_220.setAttribute('onclick', "prevPhoto_220();return false");
    prev_img_a_220.setAttribute('href', "javascript:prevPhoto_220();");
    prev_img_a_220.setAttribute('onfocus', "this.blur()");
    prev_img_220 = document.createElement('img');
    prev_img_220.setAttribute('id', 'prevSlideCtrl_220');
    prev_img_220.setAttribute('src', ihost_220 + 'b_previous.gif');
    prev_img_220.setAttribute('alt', 'Previous');
    prev_img_220.setAttribute('title', 'Previous');
    prev_img_a_220.appendChild(prev_img_220);
    sscontainer_220.appendChild(prev_img_a_220);
    stop_img_a_220 = document.createElement('a');
    stop_img_a_220.setAttribute('onclick', "stopSlideShow_220();return false");
    stop_img_a_220.setAttribute('href', "javascript:stopSlideShow_220();");
    stop_img_a_220.setAttribute('id', "stopSlideCtrlA_220");
    stop_img_a_220.setAttribute('onfocus', "this.blur()");
    stop_img_220 = document.createElement('img');
    stop_img_220.setAttribute('id', 'stopSlideCtrl_220');
    stop_img_220.setAttribute('src', ihost_220 + 'b_pause.gif');
    stop_img_220.setAttribute('alt', 'Pause');
    stop_img_220.setAttribute('title', 'Pause');
    stop_img_a_220.appendChild(stop_img_220);
    sscontainer_220.appendChild(stop_img_a_220);
    start_img_a_220 = document.createElement('a');
    start_img_a_220.setAttribute('onclick', "startSlideShow_220();return false");
    start_img_a_220.setAttribute('href', "javascript:startSlideShow_220();");
    start_img_a_220.setAttribute('id', "startSlideCtrlA_220");
    start_img_a_220.setAttribute('onfocus', "this.blur()");
    start_img_220 = document.createElement('img');
    start_img_220.setAttribute('id', 'startSlideCtrl_220');
    start_img_220.setAttribute('src', ihost_220 + 'b_play.gif');
    start_img_220.setAttribute('alt', 'Play');
    start_img_220.setAttribute('title', 'Play');
    start_img_a_220.appendChild(start_img_220);
    sscontainer_220.appendChild(start_img_a_220);
    next_img_a_220 = document.createElement('a');
    next_img_a_220.setAttribute('onclick', "nextPhoto_220();return false");
    next_img_a_220.setAttribute('href', "javascript:nextPhoto_220();");
    next_img_a_220.setAttribute('onfocus', "this.blur()");
    next_img_a_220.setAttribute('class', "none_220");
    next_img_a_220.setAttribute('className', "none_220");
    next_img_220 = document.createElement('img');
    next_img_220.setAttribute('id', 'nextSlideCtrl_220');
    next_img_220.setAttribute('src', ihost_220 + 'b_next.gif');
    next_img_220.setAttribute('alt', 'Next');
    next_img_220.setAttribute('title', 'Next');
    next_img_a_220.appendChild(next_img_220);
    sscontainer_220.appendChild(next_img_a_220);
    preview_pane_220.appendChild(sscontainer_220);
    icontainer_220 = document.createElement('div');
    icontainer_220.setAttribute('id', "galleryContainer_220");
    arr_left_img_div_220 = document.createElement('div');
    arr_left_img_div_220.setAttribute('id', "arrow_left_220");
    arr_left_img_220 = document.createElement('img');
    arr_left_img_220.setAttribute('src', ihost_220 + "b_scroll_left.gif");
    arr_left_img_220.setAttribute('id', "arrow_left_image_220");
    arr_left_img_220.setAttribute('width', "31");
    arr_left_img_220.setAttribute('height', "56");
    arr_left_img_div_220.appendChild(arr_left_img_220);
    icontainer_220.appendChild(arr_left_img_div_220);
    arr_right_img_div_220 = document.createElement('div');
    arr_right_img_div_220.setAttribute('id', "arrow_right_220");
    arr_right_img_220 = document.createElement('img');
    arr_right_img_220.setAttribute('src', ihost_220 + "b_scroll_right.gif");
    arr_right_img_220.setAttribute('id', "arrow_right_image_220");
    arr_right_img_220.setAttribute('width', "33");
    arr_right_img_220.setAttribute('height', "56");
    arr_right_img_div_220.appendChild(arr_right_img_220);
    icontainer_220.appendChild(arr_right_img_div_220);
    the_img_div_220 = document.createElement('div');
    the_img_div_220.setAttribute('id', "theImages_220");
    the_img_div_container_220 = document.createElement('div');
    the_img_div_container_220.setAttribute('style', "left: 31px;");
    for (var i=0; i<Photos_220.length; i++) {
        prev_img_a_220 = document.createElement('a');
        prev_img_a_220.setAttribute('onclick', "showPreview_220(Photos_220[" + i + "][0], " + i +", Photos_220[" + i + "][3], Photos_220[" + i + "][5], Photos_220[" + i + "][6]);return false");
        prev_img_a_220.setAttribute('href', "javascript:showPreview_220(Photos_220[" + i + "][0], " + i +", Photos_220[" + i + "][3], Photos_220[" + i + "][5], Photos_220[" + i + "][6]);");
        prev_img_220 = document.createElement('img');
        prev_img_220.setAttribute('src', Photos_220[i][1]);
        prev_img_220.setAttribute('alt', Photos_220[i][4]);
        if (i == Photos_220.length) {
            prev_img_220.setAttribute('style', 'margin: 0px;');
        }
        prev_img_a_220.appendChild(prev_img_220);
        the_img_div_container_220.appendChild(prev_img_a_220);
    }
    slide_end_div_220 = document.createElement('div');
    slide_end_div_220.setAttribute('id', "slideEnd_220");
    the_img_div_container_220.appendChild(slide_end_div_220);
    the_img_div_220.appendChild(the_img_div_container_220);
    icontainer_220.appendChild(the_img_div_220);
    igallery_220.appendChild(preview_pane_220);
    igallery_220.appendChild(icontainer_220);
}
}
window.ua = navigator.userAgent.toLowerCase();
var Safari = (ua.indexOf('safari') != -1)?true:false;

var slideShowInterval_220;
var currentPhoto_220           = 0;
var arrowImageHeight_220       = 31;	// Height of arrow image in pixels;
var previewImage_220           = false;
var previewImageParent_220     = false;
var slideSpeed_220             = 0;
var previewImagePane_220       = false;
var slideEndMarker_220         = false;
var galleryContainer_220       = false;
var disablePlay_220            = false;

function getTopPos_220(inputObj)
{
    var returnValue = inputObj.offsetTop;
    while((inputObj = inputObj.offsetParent) != null) {
        returnValue += inputObj.offsetTop;
    }
    return returnValue;
}

function getLeftPos_220(inputObj)
{
    var returnValue = inputObj.offsetLeft;
    while((inputObj = inputObj.offsetParent) != null) {
        returnValue += inputObj.offsetLeft;
    }
    return returnValue;
}

function roundnumber_220(n, d)
{
    n = n - 0;
    if (d == null) d = 2;
    var f = Math.pow(10, d);
    n += Math.pow(10, - (d + 1));
    n = Math.round(n * f) / f;
    n += Math.pow(10, - (d + 1));
    n += '';
    return d == 0 ? n.substring(0, n.indexOf('.')) :  n.substring(0, n.indexOf('.') + d + 1);
}

function showPreview_220(newSrc, idx, imageText, width, height)
{
    currentPhoto_220 = idx;
    var previewImage_220 = document.getElementById('gPreviewImg_220');
    var margin_top_220 = roundnumber_220( (previewImgContainerHeight_220/2 - 4) - (height/2), 0);
    previewImage_220.src = newSrc;
    previewImage_220.width = width;
    previewImage_220.height = height;
    previewImage_220.setAttribute('style', 'margin-top: ' + margin_top_220 + 'px;');
    if (imageText == 'undefined') {
        imageText = '';
    }
    var imgTextContainer_220 = document.getElementById('imgTextContainer_220');
    if (imageText != '') {

    }
    imgTextContainer_220.innerHTML = imageText;
}

function initSlide_220(e)
{
    if(document.all) {
        e = event;
    }
    var id = this.id;

    if(this.src.indexOf('over') < 0) {
        this.src = this.src.replace('.gif','_over.gif');
    }

    if (Safari) {
      slideSpeed_220 = 10;
    } else {
        if (thumbnailsPosition_220 == 'V') {
            slideSpeed_220 = e.clientY + Math.max(document.body.scrollTop, document.documentElement.scrollTop) - getTopPos_220(this);
            if(this.src.indexOf('down') >= 0) {
                slideSpeed_220 = (slideSpeed_220) * -1;
            } else {
                slideSpeed_220 = arrowImageHeight_220 - slideSpeed_220;
            }
            slideSpeed_220 = Math.round(slideSpeed_220 * 15 / arrowImageHeight_220);
        } else {
            if(this.id=='arrow_right_image_220') {
                slideSpeedMultiply_220 = Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_220 = -1 * slideSpeedMultiply_220;
                slideSpeed_220 = Math.max(-10, slideSpeed_220);
            } else {
                slideSpeedMultiply_220 = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_220 = 1 * slideSpeedMultiply_220;
                slideSpeed_220 = Math.min(10, slideSpeed_220);
                if(slideSpeed_220 < 0) { slideSpeed_220 = 10; }
            }
        }
    }
}

function stopSlide_220()
{
    slideSpeed_220 = 0;
    this.src = this.src.replace('_over', '');
}

function slidePreviewPane_220()
{
    if(slideSpeed_220 != 0) {
        if (thumbnailsPosition_220 == 'V') {
            var topPos_220 = previewImagePane_220.style.top.replace(/[^\-0-9]/g,'')/1;

            if(slideSpeed_220 < 0 && slideEndMarker_220.offsetTop < (previewImageParent_220.offsetHeight - topPos_220)) {
                slideSpeed_220 = 0;
            }
            topPos_220 = topPos_220 + slideSpeed_220;
            if(topPos_220 > 0) {
                topPos_220 = 0;
            }
            previewImagePane_220.style.top = topPos_220 + 'px';
        } else {
            var leftPos_220 = previewImageParent_220.offsetLeft;
            leftPos_220 = leftPos_220/1 + slideSpeed_220;
            if(leftPos_220 > maxGalleryXPos_220) {
                leftPos_220 = maxGalleryXPos_220;
                slideSpeed_220 = 0;
            }
            if(leftPos_220 < minGalleryXPos_220){
                leftPos_220 = minGalleryXPos_220;
                slideSpeed_220 = 0;
            }
			previewImageParent_220.style.left = leftPos_220 + 'px';
        }
    }
    setTimeout('slidePreviewPane_220()', scrollingSpeed_220);
}

function revealThumbnail_220()
{
    this.style.filter = 'alpha(opacity=100)';
    this.style.opacity = 1;
}

function hideThumbnail_220()
{
    this.style.filter = 'alpha(opacity=50)';
    this.style.opacity = 0.5;
}

function initGalleryScript_220()
{
    drawGallery_220();

    previewImageParent_220 = document.getElementById('theImages_220');
    if( previewImageParent_220 != null ) {
        galleryContainer_220  = document.getElementById('galleryContainer_220');

        previewImagePane_220 = document.getElementById('theImages_220').getElementsByTagName('DIV')[0];
        previewImagePane_220.style.top = '0px';

        var images_220 = previewImagePane_220.getElementsByTagName('IMG');
        for(var no=0; no<images_220.length; no++) {
            images_220[no].onmouseover = revealThumbnail_220;
            images_220[no].onmouseout = hideThumbnail_220;
        }
        slideEndMarker_220 = document.getElementById('slideEnd_220');

        if (thumbnailsPosition_220 == 'V') {
            document.getElementById('arrow_up_image_220').onmousemove = initSlide_220;
            document.getElementById('arrow_up_image_220').onmouseout = stopSlide_220;

            document.getElementById('arrow_down_image_220').onmousemove = initSlide_220;
            document.getElementById('arrow_down_image_220').onmouseout = stopSlide_220;
        } else {
            document.getElementById('arrow_left_image_220').onmousemove = initSlide_220;
            document.getElementById('arrow_left_image_220').onmouseout = stopSlide_220;

            document.getElementById('arrow_right_image_220').onmousemove = initSlide_220;
            document.getElementById('arrow_right_image_220').onmouseout = stopSlide_220;
        }

        document.getElementById('prevSlideCtrl_220').onmousemove = initCtrlBtn_220;
        document.getElementById('prevSlideCtrl_220').onmouseout = stopCtrlBtn_220;

        document.getElementById('startSlideCtrl_220').onmousemove = initCtrlBtn_220;
        document.getElementById('startSlideCtrl_220').onmouseout = stopCtrlBtn_220;

        document.getElementById('stopSlideCtrl_220').onmousemove = initCtrlBtn_220;
        document.getElementById('stopSlideCtrl_220').onmouseout = stopCtrlBtn_220;

        document.getElementById('nextSlideCtrl_220').onmousemove = initCtrlBtn_220;
        document.getElementById('nextSlideCtrl_220').onmouseout = stopCtrlBtn_220;

        slidePreviewPane_220();
    }
}

function rprentals_button_220(rpr_el)
{
    if(rpr_el.src.indexOf('over') < 0) {
        rpr_el.src = rpr_el.src.replace('.gif', '_over.gif');
    } else {
        rpr_el.src = rpr_el.src.replace('_over.gif', '.gif');
    }
}

/*** Slide show functions ***/
function initCtrlBtn_220()
{
    if (this.id != 'startSlideCtrl_220' || disablePlay_220 == false) {
        if(this.src.indexOf('over') < 0) {
            this.src = this.src.replace('.gif', '_over.gif');
        }
    }
}
function stopCtrlBtn_220()
{
    if (this.id != 'startSlideCtrl_220' || disablePlay_220 == false) {
        if(this.src.indexOf('over') >= 0) {
            this.src = this.src.replace('_over', '');
        }
    }
}
function nextPhoto_220()
{
    currentPhoto_220++;
    if (currentPhoto_220 >= Photos_220.length) { currentPhoto_220 = 0; }
    showPreview_220(Photos_220[currentPhoto_220][0], currentPhoto_220, Photos_220[currentPhoto_220][3], Photos_220[currentPhoto_220][5], Photos_220[currentPhoto_220][6]);
}

function prevPhoto_220()
{
    currentPhoto_220--;
    if (currentPhoto_220 >= Photos_220.length || currentPhoto_220 < 0) { currentPhoto_220 = Photos_220.length-1; }
    showPreview_220(Photos_220[currentPhoto_220][0], currentPhoto_220, Photos_220[currentPhoto_220][3], Photos_220[currentPhoto_220][5], Photos_220[currentPhoto_220][6]);
}

function doSlideshow_220()
{
    nextPhoto_220( );
    slideShowInterval_220 = setTimeout("doSlideshow_220()", slideShowDelay_220);
}

function startSlideShow_220(initpic)
{
    slideShowInterval_220 = setTimeout("doSlideshow_220()", slideShowDelay_220);
    var elm = document.getElementById('startSlideCtrl_220');
    var elm_ctrl = document.getElementById('startSlideCtrlA_220');
    disablePlay_220 = true;
    if(elm.src.indexOf('over') < 0) {
        elm.src = elm.src.replace('.gif', '_over.gif');
    }
}

function stopSlideShow_220()
{
    clearTimeout(slideShowInterval_220);
    var elm = document.getElementById('startSlideCtrl_220');
    var elm_ctrl = document.getElementById('startSlideCtrlA_220');
    disablePlay_220 = false;
    if(elm.src.indexOf('over') >= 0) {
        elm.src = elm.src.replace('_over', '');
    }
}

function initGalleryScript()
{
    initGalleryScript_220();
}

function viodAction_220()
{

}

// Image Preloader
function ImagePreloader_220(images, callback)
{
	// store the callback
	this.callback = callback;

	// initialize internal state.
	this.nLoaded = 0;
	this.nProcessed = 0;
	this.aImages = new Array;

	// record the number of images.
	this.nImages = images.length;

	// for each image, call preload()
	for ( var i = 0; i < images.length; i++ )
		this.preload_220(images[i]);
}
ImagePreloader_220.prototype.preload_220 = function(image)
{
	// create new Image object and add to array
	var oImage = new Image;
	this.aImages.push(oImage);

	// set up event handlers for the Image object
	oImage.onload = ImagePreloader_220.prototype.onload_220;
	oImage.onerror = ImagePreloader_220.prototype.onerror_220;
	oImage.onabort = ImagePreloader_220.prototype.onabort_220;

	// assign pointer back to this.
	oImage.oImagePreloader = this;
	oImage.bLoaded = false;
	oImage.source = image;

	// assign the .src property of the Image object
	oImage.src = image;
}
ImagePreloader_220.prototype.onComplete_220 = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
ImagePreloader_220.prototype.onload_220 = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete_220();
}
ImagePreloader_220.prototype.onerror_220 = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete_220();
}
ImagePreloader_220.prototype.onabort_220 = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete_220();
}

// Image Preloader
function ImagePreloader(images,callback)
{
	// store the callback
	this.callback = callback;

	// initialize internal state.
	this.nLoaded = 0;
	this.nProcessed = 0;
	this.aImages = new Array;

	// record the number of images.
	this.nImages = images.length;

	// for each image, call preload()
	for ( var i = 0; i < images.length; i++ )
		this.preload(images[i]);
}
ImagePreloader.prototype.preload = function(image)
{
	// create new Image object and add to array
	var oImage = new Image;
	this.aImages.push(oImage);

	// set up event handlers for the Image object
	oImage.onload = ImagePreloader.prototype.onload;
	oImage.onerror = ImagePreloader.prototype.onerror;
	oImage.onabort = ImagePreloader.prototype.onabort;

	// assign pointer back to this.
	oImage.oImagePreloader = this;
	oImage.bLoaded = false;
	oImage.source = image;

	// assign the .src property of the Image object
	oImage.src = image;
}
ImagePreloader.prototype.onComplete = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
ImagePreloader.prototype.onload = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete();
}
ImagePreloader.prototype.onerror = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete();
}
ImagePreloader.prototype.onabort = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete();
}

/**** invalid preloader ****
// Image Preloader
function ImagePreloader(images,callback)
{
	// store the callback
	this.callback = callback;

  for ( var i = 0; i < images.length; i++ ) { preLdImg(images[i]); }
  this.callback(images);
}

//this part special for safari only
function preLdImg(oHref) {
  if( typeof( oHref ) != 'string' ) { return; }
  if( window.imgLdAr ) { for( var x = 2; x < window.imgLdAr.length; x++ ){ imgLdAr[x].onerror = null; imgLdAr[x].onload = null; } }
  window.imgLdAr = new Array(); window.imgCount = 0; window.hasLoadedImg = new Array();
  for( var x = 2; x < arguments.length; x++ ) {
    if( typeof( arguments[x] ) != 'string' || !document.images ) { self.location.href = oHref; }
    imgLdAr[x] = new Image();
    imgLdAr[x].onload = new Function( //write the function as a string. Allows me to put in the number of images
      'if( hasLoadedImg[imgLdAr['+x+'].src] ){ return; } hasLoadedImg[imgLdAr['+x+'].src] = true; window.imgCount++;'+
      ( arguments[1] ? ( arguments[1] + '( window.imgCount / ' + ( arguments.length - 2 ) + ' );' ) : '' )+
      "if( imgCount == " + ( arguments.length - 2 ) + " ) { self.location.href = '"+oHref+"'; }" );
    imgLdAr[x].onerror = new Function( "for(var x = 2;x<window.imgLdAr.length;x++){imgLdAr[x].onerror=null;imgLdAr[x].onload=null;}if( window.confirm( 'Pre-load error:\\n\\nThe following image failed to load:\\n'+this.src+'\\n\\nDo you want to jump to the next page without pre-loading images?' ) ) { self.location.href = '"+oHref+"'; }" );
    imgLdAr[x].src = arguments[x];
    if( imgLdAr[x].complete ) { imgLdAr[x].onload(); }
  }
}
*******/


if (galleryLoader == undefined) {
    document.write('<div id="gallery_slideshow_220"><\/div>');
    var giv = new ImagePreloader_220(preloadPhotos_220, initGalleryScript_220);
    var aiv = new ImagePreloader_220(preloadPhotosAfter_220, viodAction_220);
}
