
var galleryLoader;
var selectedGallery = 0;
var showGallery_221 = false;
var requestUri_221 = location.href;
var re = /[\?&](ghash=(.*))/gi;
requestUri_221 = requestUri_221.replace(re, '');
if(requestUri_221.indexOf('?') < 0) {
    requestUri_221 = requestUri_221 + '?';
} else {
    requestUri_221 = requestUri_221 + '&';
}
if (galleryLoader == undefined || selectedGallery == 1) {
    showGallery_221 = true;
}
 showGallery_221 = true;
var imageGalleryLeftPos_221       = 31;
var previewImgContainerHeight_221 = 307;
var imageGalleryWidth_221         = 367;
var maxGalleryXPos_221            = 31;
var minGalleryXPos_221            = -525;
var thumbnailsPosition_221        = 'H';
var scrollingSpeed_221            = 60;
var slideShowDelay_221            = 5000;
var ihost_221                     = 'http://images.myrockypoint.com/';
var ipath_221                     = ihost_221 + '21/';
var Photos_221                    = new Array();
Photos_221[0] = new Array( ipath_221 + '5491.jpg', ipath_221 + 'thumbnail_5491.jpg', "pic4.jpg", "", "", "398", "300");
Photos_221[1] = new Array( ipath_221 + '5489.jpg', ipath_221 + 'thumbnail_5489.jpg', "pic2.jpg", "", "", "400", "298");
Photos_221[2] = new Array( ipath_221 + '5487.jpg', ipath_221 + 'thumbnail_5487.jpg', "flick3.jpg", "", "", "400", "266");
Photos_221[3] = new Array( ipath_221 + '5481.jpg', ipath_221 + 'thumbnail_5481.jpg', "dirtypic.jpg", "", "", "400", "267");
Photos_221[4] = new Array( ipath_221 + '5482.jpg', ipath_221 + 'thumbnail_5482.jpg', "dirtypic2.jpg", "", "", "400", "267");
Photos_221[5] = new Array( ipath_221 + '5483.jpg', ipath_221 + 'thumbnail_5483.jpg', "dirtypic3.jpg", "", "", "400", "267");
Photos_221[6] = new Array( ipath_221 + '5484.jpg', ipath_221 + 'thumbnail_5484.jpg', "dirtypic4.jpg", "", "", "400", "267");
Photos_221[7] = new Array( ipath_221 + '5485.jpg', ipath_221 + 'thumbnail_5485.jpg', "flick1.jpg", "", "", "234", "240");
Photos_221[8] = new Array( ipath_221 + '5486.jpg', ipath_221 + 'thumbnail_5486.jpg', "flick2.jpg", "", "", "376", "289");
Photos_221[9] = new Array( ipath_221 + '5488.jpg', ipath_221 + 'thumbnail_5488.jpg', "pic1.jpg", "", "", "388", "300");
Photos_221[10] = new Array( ipath_221 + '5490.jpg', ipath_221 + 'thumbnail_5490.jpg', "pic3.jpg", "", "", "400", "299");
if (showGallery_221) {
    var preloadPhotos_221 = new Array('' + ihost_221 + 'b_next.gif', '' + ihost_221 + 'b_next_over.gif', '' + ihost_221 + 'b_pause.gif', '' + ihost_221 + 'b_pause_over.gif', '' + ihost_221 + 'b_play.gif', '' + ihost_221 + 'b_play_over.gif', '' + ihost_221 + 'b_previous.gif', '' + ihost_221 + 'b_previous_over.gif', '' + ihost_221 + 'b_scroll_down.gif', '' + ihost_221 + 'b_scroll_down_over.gif', '' + ihost_221 + 'b_scroll_up.gif', '' + ihost_221 + 'b_scroll_up_over.gif', '' + ihost_221 + 'title_bg.gif', '' + ihost_221 + 'show_rental_details.gif', '' + ihost_221 + 'show_rental_details_over.gif', '' + ipath_221 + '5491.jpg', '' + ipath_221 + 'thumbnail_5491.jpg', '' + ipath_221 + 'thumbnail_5489.jpg');
    var preloadPhotos = new Array('' + ihost_221 + 'b_next.gif', '' + ihost_221 + 'b_next_over.gif', '' + ihost_221 + 'b_pause.gif', '' + ihost_221 + 'b_pause_over.gif', '' + ihost_221 + 'b_play.gif', '' + ihost_221 + 'b_play_over.gif', '' + ihost_221 + 'b_previous.gif', '' + ihost_221 + 'b_previous_over.gif', '' + ihost_221 + 'b_scroll_down.gif', '' + ihost_221 + 'b_scroll_down_over.gif', '' + ihost_221 + 'b_scroll_up.gif', '' + ihost_221 + 'b_scroll_up_over.gif', '' + ihost_221 + 'title_bg.gif', '' + ihost_221 + 'show_rental_details.gif', '' + ihost_221 + 'show_rental_details_over.gif', '' + ipath_221 + '5491.jpg', '' + ipath_221 + 'thumbnail_5491.jpg', '' + ipath_221 + 'thumbnail_5489.jpg');
    var preloadPhotosAfter_221 = new Array('' + ipath_221 + '5489.jpg', '' + ipath_221 + '5487.jpg', '' + ipath_221 + 'thumbnail_5487.jpg', '' + ipath_221 + '5481.jpg', '' + ipath_221 + 'thumbnail_5481.jpg', '' + ipath_221 + '5482.jpg', '' + ipath_221 + 'thumbnail_5482.jpg', '' + ipath_221 + '5483.jpg', '' + ipath_221 + 'thumbnail_5483.jpg', '' + ipath_221 + '5484.jpg', '' + ipath_221 + 'thumbnail_5484.jpg', '' + ipath_221 + '5485.jpg', '' + ipath_221 + 'thumbnail_5485.jpg', '' + ipath_221 + '5486.jpg', '' + ipath_221 + 'thumbnail_5486.jpg', '' + ipath_221 + '5488.jpg', '' + ipath_221 + 'thumbnail_5488.jpg', '' + ipath_221 + '5490.jpg', '' + ipath_221 + 'thumbnail_5490.jpg');
} else {
    var preloadPhotos_221 = new Array(ihost_221 + 'title_bg.gif');
    var preloadPhotos = new Array(ihost_221 + 'title_bg.gif');
}
function drawGallery_221()
{
    if (document.getElementById("gallery_slideshow_221") != null ) {
    igallery_221 = document.getElementById("gallery_slideshow_221");
    } else {
    igallery_221 = document.getElementById("gallery_slideshow");
    }
    if (showGallery_221) {
    preview_pane_221 = document.createElement('div');
    preview_pane_221.setAttribute('id', "previewPane_221");
    gncontainer_221 = document.createElement('div');
    gncontainer_221.setAttribute('id', "galleryTitle_221");
    gnscontainer_221 = document.createElement('div');
    gnTitle_221 = document.createTextNode( "2005 Rocky Point Spring Break" );
    gnscontainer_221.appendChild(gnTitle_221);
    gncontainer_221.appendChild(gnscontainer_221);
    preview_pane_221.appendChild(gncontainer_221);
    preview_pane_img_div_221 = document.createElement('div');
    preview_pane_img_div_221.setAttribute('id', 'gPreviewImgContainer_221');
    preview_pane_img_221 = document.createElement('img');
    preview_pane_img_221.setAttribute('id', 'gPreviewImg_221');
    if (Photos_221.length > 0) {
        var margin_top = roundnumber_221( (previewImgContainerHeight_221/2 - 4) - (Photos_221[0][6]/2), 0);
        preview_pane_img_221.setAttribute('src', Photos_221[0][0]);
        preview_pane_img_221.setAttribute('width', Photos_221[0][5]);
        preview_pane_img_221.setAttribute('height', Photos_221[0][6]);
        preview_pane_img_221.setAttribute('style', 'margin-top: ' + margin_top + 'px;');
    }
    preview_pane_img_div_221.appendChild(preview_pane_img_221);
    preview_pane_221.appendChild(preview_pane_img_div_221);
    itext_221 = document.createElement('div');
    itext_221.setAttribute('id', "imgTextContainer_221");
    if (Photos_221.length > 0 && Photos_221[0][3] != '') {
        itext_221.innerHTML = Photos_221[0][3];
    }
    preview_pane_221.appendChild(itext_221);
    sscontainer_221 = document.createElement('div');
    sscontainer_221.setAttribute('id', "slideShowContainer_221");
    prev_img_a_221 = document.createElement('a');
    prev_img_a_221.setAttribute('onclick', "prevPhoto_221();return false");
    prev_img_a_221.setAttribute('href', "javascript:prevPhoto_221();");
    prev_img_a_221.setAttribute('onfocus', "this.blur()");
    prev_img_221 = document.createElement('img');
    prev_img_221.setAttribute('id', 'prevSlideCtrl_221');
    prev_img_221.setAttribute('src', ihost_221 + 'b_previous.gif');
    prev_img_221.setAttribute('alt', 'Previous');
    prev_img_221.setAttribute('title', 'Previous');
    prev_img_a_221.appendChild(prev_img_221);
    sscontainer_221.appendChild(prev_img_a_221);
    stop_img_a_221 = document.createElement('a');
    stop_img_a_221.setAttribute('onclick', "stopSlideShow_221();return false");
    stop_img_a_221.setAttribute('href', "javascript:stopSlideShow_221();");
    stop_img_a_221.setAttribute('id', "stopSlideCtrlA_221");
    stop_img_a_221.setAttribute('onfocus', "this.blur()");
    stop_img_221 = document.createElement('img');
    stop_img_221.setAttribute('id', 'stopSlideCtrl_221');
    stop_img_221.setAttribute('src', ihost_221 + 'b_pause.gif');
    stop_img_221.setAttribute('alt', 'Pause');
    stop_img_221.setAttribute('title', 'Pause');
    stop_img_a_221.appendChild(stop_img_221);
    sscontainer_221.appendChild(stop_img_a_221);
    start_img_a_221 = document.createElement('a');
    start_img_a_221.setAttribute('onclick', "startSlideShow_221();return false");
    start_img_a_221.setAttribute('href', "javascript:startSlideShow_221();");
    start_img_a_221.setAttribute('id', "startSlideCtrlA_221");
    start_img_a_221.setAttribute('onfocus', "this.blur()");
    start_img_221 = document.createElement('img');
    start_img_221.setAttribute('id', 'startSlideCtrl_221');
    start_img_221.setAttribute('src', ihost_221 + 'b_play.gif');
    start_img_221.setAttribute('alt', 'Play');
    start_img_221.setAttribute('title', 'Play');
    start_img_a_221.appendChild(start_img_221);
    sscontainer_221.appendChild(start_img_a_221);
    next_img_a_221 = document.createElement('a');
    next_img_a_221.setAttribute('onclick', "nextPhoto_221();return false");
    next_img_a_221.setAttribute('href', "javascript:nextPhoto_221();");
    next_img_a_221.setAttribute('onfocus', "this.blur()");
    next_img_a_221.setAttribute('class', "none_221");
    next_img_a_221.setAttribute('className', "none_221");
    next_img_221 = document.createElement('img');
    next_img_221.setAttribute('id', 'nextSlideCtrl_221');
    next_img_221.setAttribute('src', ihost_221 + 'b_next.gif');
    next_img_221.setAttribute('alt', 'Next');
    next_img_221.setAttribute('title', 'Next');
    next_img_a_221.appendChild(next_img_221);
    sscontainer_221.appendChild(next_img_a_221);
    preview_pane_221.appendChild(sscontainer_221);
    icontainer_221 = document.createElement('div');
    icontainer_221.setAttribute('id', "galleryContainer_221");
    arr_left_img_div_221 = document.createElement('div');
    arr_left_img_div_221.setAttribute('id', "arrow_left_221");
    arr_left_img_221 = document.createElement('img');
    arr_left_img_221.setAttribute('src', ihost_221 + "b_scroll_left.gif");
    arr_left_img_221.setAttribute('id', "arrow_left_image_221");
    arr_left_img_221.setAttribute('width', "31");
    arr_left_img_221.setAttribute('height', "56");
    arr_left_img_div_221.appendChild(arr_left_img_221);
    icontainer_221.appendChild(arr_left_img_div_221);
    arr_right_img_div_221 = document.createElement('div');
    arr_right_img_div_221.setAttribute('id', "arrow_right_221");
    arr_right_img_221 = document.createElement('img');
    arr_right_img_221.setAttribute('src', ihost_221 + "b_scroll_right.gif");
    arr_right_img_221.setAttribute('id', "arrow_right_image_221");
    arr_right_img_221.setAttribute('width', "33");
    arr_right_img_221.setAttribute('height', "56");
    arr_right_img_div_221.appendChild(arr_right_img_221);
    icontainer_221.appendChild(arr_right_img_div_221);
    the_img_div_221 = document.createElement('div');
    the_img_div_221.setAttribute('id', "theImages_221");
    the_img_div_container_221 = document.createElement('div');
    the_img_div_container_221.setAttribute('style', "left: 31px;");
    for (var i=0; i<Photos_221.length; i++) {
        prev_img_a_221 = document.createElement('a');
        prev_img_a_221.setAttribute('onclick', "showPreview_221(Photos_221[" + i + "][0], " + i +", Photos_221[" + i + "][3], Photos_221[" + i + "][5], Photos_221[" + i + "][6]);return false");
        prev_img_a_221.setAttribute('href', "javascript:showPreview_221(Photos_221[" + i + "][0], " + i +", Photos_221[" + i + "][3], Photos_221[" + i + "][5], Photos_221[" + i + "][6]);");
        prev_img_221 = document.createElement('img');
        prev_img_221.setAttribute('src', Photos_221[i][1]);
        prev_img_221.setAttribute('alt', Photos_221[i][4]);
        if (i == Photos_221.length) {
            prev_img_221.setAttribute('style', 'margin: 0px;');
        }
        prev_img_a_221.appendChild(prev_img_221);
        the_img_div_container_221.appendChild(prev_img_a_221);
    }
    slide_end_div_221 = document.createElement('div');
    slide_end_div_221.setAttribute('id', "slideEnd_221");
    the_img_div_container_221.appendChild(slide_end_div_221);
    the_img_div_221.appendChild(the_img_div_container_221);
    icontainer_221.appendChild(the_img_div_221);
    igallery_221.appendChild(preview_pane_221);
    igallery_221.appendChild(icontainer_221);
}
}
window.ua = navigator.userAgent.toLowerCase();
var Safari = (ua.indexOf('safari') != -1)?true:false;

var slideShowInterval_221;
var currentPhoto_221           = 0;
var arrowImageHeight_221       = 31;	// Height of arrow image in pixels;
var previewImage_221           = false;
var previewImageParent_221     = false;
var slideSpeed_221             = 0;
var previewImagePane_221       = false;
var slideEndMarker_221         = false;
var galleryContainer_221       = false;
var disablePlay_221            = false;

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

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

function roundnumber_221(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_221(newSrc, idx, imageText, width, height)
{
    currentPhoto_221 = idx;
    var previewImage_221 = document.getElementById('gPreviewImg_221');
    var margin_top_221 = roundnumber_221( (previewImgContainerHeight_221/2 - 4) - (height/2), 0);
    previewImage_221.src = newSrc;
    previewImage_221.width = width;
    previewImage_221.height = height;
    previewImage_221.setAttribute('style', 'margin-top: ' + margin_top_221 + 'px;');
    if (imageText == 'undefined') {
        imageText = '';
    }
    var imgTextContainer_221 = document.getElementById('imgTextContainer_221');
    if (imageText != '') {

    }
    imgTextContainer_221.innerHTML = imageText;
}

function initSlide_221(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_221 = 10;
    } else {
        if (thumbnailsPosition_221 == 'V') {
            slideSpeed_221 = e.clientY + Math.max(document.body.scrollTop, document.documentElement.scrollTop) - getTopPos_221(this);
            if(this.src.indexOf('down') >= 0) {
                slideSpeed_221 = (slideSpeed_221) * -1;
            } else {
                slideSpeed_221 = arrowImageHeight_221 - slideSpeed_221;
            }
            slideSpeed_221 = Math.round(slideSpeed_221 * 15 / arrowImageHeight_221);
        } else {
            if(this.id=='arrow_right_image_221') {
                slideSpeedMultiply_221 = Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_221 = -1 * slideSpeedMultiply_221;
                slideSpeed_221 = Math.max(-10, slideSpeed_221);
            } else {
                slideSpeedMultiply_221 = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_221 = 1 * slideSpeedMultiply_221;
                slideSpeed_221 = Math.min(10, slideSpeed_221);
                if(slideSpeed_221 < 0) { slideSpeed_221 = 10; }
            }
        }
    }
}

function stopSlide_221()
{
    slideSpeed_221 = 0;
    this.src = this.src.replace('_over', '');
}

function slidePreviewPane_221()
{
    if(slideSpeed_221 != 0) {
        if (thumbnailsPosition_221 == 'V') {
            var topPos_221 = previewImagePane_221.style.top.replace(/[^\-0-9]/g,'')/1;

            if(slideSpeed_221 < 0 && slideEndMarker_221.offsetTop < (previewImageParent_221.offsetHeight - topPos_221)) {
                slideSpeed_221 = 0;
            }
            topPos_221 = topPos_221 + slideSpeed_221;
            if(topPos_221 > 0) {
                topPos_221 = 0;
            }
            previewImagePane_221.style.top = topPos_221 + 'px';
        } else {
            var leftPos_221 = previewImageParent_221.offsetLeft;
            leftPos_221 = leftPos_221/1 + slideSpeed_221;
            if(leftPos_221 > maxGalleryXPos_221) {
                leftPos_221 = maxGalleryXPos_221;
                slideSpeed_221 = 0;
            }
            if(leftPos_221 < minGalleryXPos_221){
                leftPos_221 = minGalleryXPos_221;
                slideSpeed_221 = 0;
            }
			previewImageParent_221.style.left = leftPos_221 + 'px';
        }
    }
    setTimeout('slidePreviewPane_221()', scrollingSpeed_221);
}

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

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

function initGalleryScript_221()
{
    drawGallery_221();

    previewImageParent_221 = document.getElementById('theImages_221');
    if( previewImageParent_221 != null ) {
        galleryContainer_221  = document.getElementById('galleryContainer_221');

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

        var images_221 = previewImagePane_221.getElementsByTagName('IMG');
        for(var no=0; no<images_221.length; no++) {
            images_221[no].onmouseover = revealThumbnail_221;
            images_221[no].onmouseout = hideThumbnail_221;
        }
        slideEndMarker_221 = document.getElementById('slideEnd_221');

        if (thumbnailsPosition_221 == 'V') {
            document.getElementById('arrow_up_image_221').onmousemove = initSlide_221;
            document.getElementById('arrow_up_image_221').onmouseout = stopSlide_221;

            document.getElementById('arrow_down_image_221').onmousemove = initSlide_221;
            document.getElementById('arrow_down_image_221').onmouseout = stopSlide_221;
        } else {
            document.getElementById('arrow_left_image_221').onmousemove = initSlide_221;
            document.getElementById('arrow_left_image_221').onmouseout = stopSlide_221;

            document.getElementById('arrow_right_image_221').onmousemove = initSlide_221;
            document.getElementById('arrow_right_image_221').onmouseout = stopSlide_221;
        }

        document.getElementById('prevSlideCtrl_221').onmousemove = initCtrlBtn_221;
        document.getElementById('prevSlideCtrl_221').onmouseout = stopCtrlBtn_221;

        document.getElementById('startSlideCtrl_221').onmousemove = initCtrlBtn_221;
        document.getElementById('startSlideCtrl_221').onmouseout = stopCtrlBtn_221;

        document.getElementById('stopSlideCtrl_221').onmousemove = initCtrlBtn_221;
        document.getElementById('stopSlideCtrl_221').onmouseout = stopCtrlBtn_221;

        document.getElementById('nextSlideCtrl_221').onmousemove = initCtrlBtn_221;
        document.getElementById('nextSlideCtrl_221').onmouseout = stopCtrlBtn_221;

        slidePreviewPane_221();
    }
}

function rprentals_button_221(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_221()
{
    if (this.id != 'startSlideCtrl_221' || disablePlay_221 == false) {
        if(this.src.indexOf('over') < 0) {
            this.src = this.src.replace('.gif', '_over.gif');
        }
    }
}
function stopCtrlBtn_221()
{
    if (this.id != 'startSlideCtrl_221' || disablePlay_221 == false) {
        if(this.src.indexOf('over') >= 0) {
            this.src = this.src.replace('_over', '');
        }
    }
}
function nextPhoto_221()
{
    currentPhoto_221++;
    if (currentPhoto_221 >= Photos_221.length) { currentPhoto_221 = 0; }
    showPreview_221(Photos_221[currentPhoto_221][0], currentPhoto_221, Photos_221[currentPhoto_221][3], Photos_221[currentPhoto_221][5], Photos_221[currentPhoto_221][6]);
}

function prevPhoto_221()
{
    currentPhoto_221--;
    if (currentPhoto_221 >= Photos_221.length || currentPhoto_221 < 0) { currentPhoto_221 = Photos_221.length-1; }
    showPreview_221(Photos_221[currentPhoto_221][0], currentPhoto_221, Photos_221[currentPhoto_221][3], Photos_221[currentPhoto_221][5], Photos_221[currentPhoto_221][6]);
}

function doSlideshow_221()
{
    nextPhoto_221( );
    slideShowInterval_221 = setTimeout("doSlideshow_221()", slideShowDelay_221);
}

function startSlideShow_221(initpic)
{
    slideShowInterval_221 = setTimeout("doSlideshow_221()", slideShowDelay_221);
    var elm = document.getElementById('startSlideCtrl_221');
    var elm_ctrl = document.getElementById('startSlideCtrlA_221');
    disablePlay_221 = true;
    if(elm.src.indexOf('over') < 0) {
        elm.src = elm.src.replace('.gif', '_over.gif');
    }
}

function stopSlideShow_221()
{
    clearTimeout(slideShowInterval_221);
    var elm = document.getElementById('startSlideCtrl_221');
    var elm_ctrl = document.getElementById('startSlideCtrlA_221');
    disablePlay_221 = false;
    if(elm.src.indexOf('over') >= 0) {
        elm.src = elm.src.replace('_over', '');
    }
}

function initGalleryScript()
{
    initGalleryScript_221();
}

function viodAction_221()
{

}

// Image Preloader
function ImagePreloader_221(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_221(images[i]);
}
ImagePreloader_221.prototype.preload_221 = 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_221.prototype.onload_221;
	oImage.onerror = ImagePreloader_221.prototype.onerror_221;
	oImage.onabort = ImagePreloader_221.prototype.onabort_221;

	// 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_221.prototype.onComplete_221 = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
ImagePreloader_221.prototype.onload_221 = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete_221();
}
ImagePreloader_221.prototype.onerror_221 = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete_221();
}
ImagePreloader_221.prototype.onabort_221 = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete_221();
}

// 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_221"><\/div>');
    var giv = new ImagePreloader_221(preloadPhotos_221, initGalleryScript_221);
    var aiv = new ImagePreloader_221(preloadPhotosAfter_221, viodAction_221);
}

