
var galleryLoader;
var selectedGallery = 0;
var showGallery_219 = false;
var requestUri_219 = location.href;
var re = /[\?&](ghash=(.*))/gi;
requestUri_219 = requestUri_219.replace(re, '');
if(requestUri_219.indexOf('?') < 0) {
    requestUri_219 = requestUri_219 + '?';
} else {
    requestUri_219 = requestUri_219 + '&';
}
if (galleryLoader == undefined || selectedGallery == 1) {
    showGallery_219 = true;
}
 showGallery_219 = true;
var imageGalleryLeftPos_219       = 31;
var previewImgContainerHeight_219 = 307;
var imageGalleryWidth_219         = 367;
var maxGalleryXPos_219            = 31;
var minGalleryXPos_219            = -464;
var thumbnailsPosition_219        = 'H';
var scrollingSpeed_219            = 60;
var slideShowDelay_219            = 5000;
var ihost_219                     = 'http://images.myrockypoint.com/';
var ipath_219                     = ihost_219 + '21/';
var Photos_219                    = new Array();
Photos_219[0] = new Array( ipath_219 + '5457.jpg', ipath_219 + 'thumbnail_5457.jpg', "IMG_0344.jpg", "Let\'s get this party started.", "", "400", "300");
Photos_219[1] = new Array( ipath_219 + '5462.jpg', ipath_219 + 'thumbnail_5462.jpg', "pic3.jpg", "They are out during Spring Break!", "", "400", "300");
Photos_219[2] = new Array( ipath_219 + '5458.jpg', ipath_219 + 'thumbnail_5458.jpg', "P3151313.jpg", "Never Too Young!", "", "400", "300");
Photos_219[3] = new Array( ipath_219 + '5460.jpg', ipath_219 + 'thumbnail_5460.jpg', "pic1.jpg", "", "", "364", "300");
Photos_219[4] = new Array( ipath_219 + '5459.jpg', ipath_219 + 'thumbnail_5459.jpg', "thecrunkestcrew.jpg", "PARTY!!!", "", "400", "297");
Photos_219[5] = new Array( ipath_219 + '5461.jpg', ipath_219 + 'thumbnail_5461.jpg', "pic2.jpg", "This is what can happen when you least expect it.", "", "400", "298");
Photos_219[6] = new Array( ipath_219 + '5463.jpg', ipath_219 + 'thumbnail_5463.jpg', "pic4.jpg", "Immortalize yourself....", "", "400", "299");
Photos_219[7] = new Array( ipath_219 + '5464.jpg', ipath_219 + 'thumbnail_5464.jpg', "pic5.jpg", "We are young and ready to party...", "", "306", "300");
Photos_219[8] = new Array( ipath_219 + '5465.jpg', ipath_219 + 'thumbnail_5465.jpg', "pic6.jpg", "Girl on Girl", "", "306", "300");
Photos_219[9] = new Array( ipath_219 + '5466.jpg', ipath_219 + 'thumbnail_5466.jpg', "pic7.jpg", "These activities will be ongoing, keep an eye out!", "", "400", "300");
Photos_219[10] = new Array( ipath_219 + '5478.jpg', ipath_219 + 'thumbnail_5478.jpg', "newpic.jpg", "Probably the funnest thing to do down there, ride the banana boats!", "", "400", "300");
if (showGallery_219) {
    var preloadPhotos_219 = new Array('' + ihost_219 + 'b_next.gif', '' + ihost_219 + 'b_next_over.gif', '' + ihost_219 + 'b_pause.gif', '' + ihost_219 + 'b_pause_over.gif', '' + ihost_219 + 'b_play.gif', '' + ihost_219 + 'b_play_over.gif', '' + ihost_219 + 'b_previous.gif', '' + ihost_219 + 'b_previous_over.gif', '' + ihost_219 + 'b_scroll_down.gif', '' + ihost_219 + 'b_scroll_down_over.gif', '' + ihost_219 + 'b_scroll_up.gif', '' + ihost_219 + 'b_scroll_up_over.gif', '' + ihost_219 + 'title_bg.gif', '' + ihost_219 + 'show_rental_details.gif', '' + ihost_219 + 'show_rental_details_over.gif', '' + ipath_219 + '5457.jpg', '' + ipath_219 + 'thumbnail_5457.jpg', '' + ipath_219 + 'thumbnail_5462.jpg');
    var preloadPhotos = new Array('' + ihost_219 + 'b_next.gif', '' + ihost_219 + 'b_next_over.gif', '' + ihost_219 + 'b_pause.gif', '' + ihost_219 + 'b_pause_over.gif', '' + ihost_219 + 'b_play.gif', '' + ihost_219 + 'b_play_over.gif', '' + ihost_219 + 'b_previous.gif', '' + ihost_219 + 'b_previous_over.gif', '' + ihost_219 + 'b_scroll_down.gif', '' + ihost_219 + 'b_scroll_down_over.gif', '' + ihost_219 + 'b_scroll_up.gif', '' + ihost_219 + 'b_scroll_up_over.gif', '' + ihost_219 + 'title_bg.gif', '' + ihost_219 + 'show_rental_details.gif', '' + ihost_219 + 'show_rental_details_over.gif', '' + ipath_219 + '5457.jpg', '' + ipath_219 + 'thumbnail_5457.jpg', '' + ipath_219 + 'thumbnail_5462.jpg');
    var preloadPhotosAfter_219 = new Array('' + ipath_219 + '5462.jpg', '' + ipath_219 + '5458.jpg', '' + ipath_219 + 'thumbnail_5458.jpg', '' + ipath_219 + '5460.jpg', '' + ipath_219 + 'thumbnail_5460.jpg', '' + ipath_219 + '5459.jpg', '' + ipath_219 + 'thumbnail_5459.jpg', '' + ipath_219 + '5461.jpg', '' + ipath_219 + 'thumbnail_5461.jpg', '' + ipath_219 + '5463.jpg', '' + ipath_219 + 'thumbnail_5463.jpg', '' + ipath_219 + '5464.jpg', '' + ipath_219 + 'thumbnail_5464.jpg', '' + ipath_219 + '5465.jpg', '' + ipath_219 + 'thumbnail_5465.jpg', '' + ipath_219 + '5466.jpg', '' + ipath_219 + 'thumbnail_5466.jpg', '' + ipath_219 + '5478.jpg', '' + ipath_219 + 'thumbnail_5478.jpg');
} else {
    var preloadPhotos_219 = new Array(ihost_219 + 'title_bg.gif');
    var preloadPhotos = new Array(ihost_219 + 'title_bg.gif');
}
function drawGallery_219()
{
    if (document.getElementById("gallery_slideshow_219") != null ) {
    igallery_219 = document.getElementById("gallery_slideshow_219");
    } else {
    igallery_219 = document.getElementById("gallery_slideshow");
    }
    if (showGallery_219) {
    preview_pane_219 = document.createElement('div');
    preview_pane_219.setAttribute('id', "previewPane_219");
    gncontainer_219 = document.createElement('div');
    gncontainer_219.setAttribute('id', "galleryTitle_219");
    gnscontainer_219 = document.createElement('div');
    gnTitle_219 = document.createTextNode( "2007 Rocky Point Spring Break" );
    gnscontainer_219.appendChild(gnTitle_219);
    gncontainer_219.appendChild(gnscontainer_219);
    preview_pane_219.appendChild(gncontainer_219);
    preview_pane_img_div_219 = document.createElement('div');
    preview_pane_img_div_219.setAttribute('id', 'gPreviewImgContainer_219');
    preview_pane_img_219 = document.createElement('img');
    preview_pane_img_219.setAttribute('id', 'gPreviewImg_219');
    if (Photos_219.length > 0) {
        var margin_top = roundnumber_219( (previewImgContainerHeight_219/2 - 4) - (Photos_219[0][6]/2), 0);
        preview_pane_img_219.setAttribute('src', Photos_219[0][0]);
        preview_pane_img_219.setAttribute('width', Photos_219[0][5]);
        preview_pane_img_219.setAttribute('height', Photos_219[0][6]);
        preview_pane_img_219.setAttribute('style', 'margin-top: ' + margin_top + 'px;');
    }
    preview_pane_img_div_219.appendChild(preview_pane_img_219);
    preview_pane_219.appendChild(preview_pane_img_div_219);
    itext_219 = document.createElement('div');
    itext_219.setAttribute('id', "imgTextContainer_219");
    if (Photos_219.length > 0 && Photos_219[0][3] != '') {
        itext_219.innerHTML = Photos_219[0][3];
    }
    preview_pane_219.appendChild(itext_219);
    sscontainer_219 = document.createElement('div');
    sscontainer_219.setAttribute('id', "slideShowContainer_219");
    prev_img_a_219 = document.createElement('a');
    prev_img_a_219.setAttribute('onclick', "prevPhoto_219();return false");
    prev_img_a_219.setAttribute('href', "javascript:prevPhoto_219();");
    prev_img_a_219.setAttribute('onfocus', "this.blur()");
    prev_img_219 = document.createElement('img');
    prev_img_219.setAttribute('id', 'prevSlideCtrl_219');
    prev_img_219.setAttribute('src', ihost_219 + 'b_previous.gif');
    prev_img_219.setAttribute('alt', 'Previous');
    prev_img_219.setAttribute('title', 'Previous');
    prev_img_a_219.appendChild(prev_img_219);
    sscontainer_219.appendChild(prev_img_a_219);
    stop_img_a_219 = document.createElement('a');
    stop_img_a_219.setAttribute('onclick', "stopSlideShow_219();return false");
    stop_img_a_219.setAttribute('href', "javascript:stopSlideShow_219();");
    stop_img_a_219.setAttribute('id', "stopSlideCtrlA_219");
    stop_img_a_219.setAttribute('onfocus', "this.blur()");
    stop_img_219 = document.createElement('img');
    stop_img_219.setAttribute('id', 'stopSlideCtrl_219');
    stop_img_219.setAttribute('src', ihost_219 + 'b_pause.gif');
    stop_img_219.setAttribute('alt', 'Pause');
    stop_img_219.setAttribute('title', 'Pause');
    stop_img_a_219.appendChild(stop_img_219);
    sscontainer_219.appendChild(stop_img_a_219);
    start_img_a_219 = document.createElement('a');
    start_img_a_219.setAttribute('onclick', "startSlideShow_219();return false");
    start_img_a_219.setAttribute('href', "javascript:startSlideShow_219();");
    start_img_a_219.setAttribute('id', "startSlideCtrlA_219");
    start_img_a_219.setAttribute('onfocus', "this.blur()");
    start_img_219 = document.createElement('img');
    start_img_219.setAttribute('id', 'startSlideCtrl_219');
    start_img_219.setAttribute('src', ihost_219 + 'b_play.gif');
    start_img_219.setAttribute('alt', 'Play');
    start_img_219.setAttribute('title', 'Play');
    start_img_a_219.appendChild(start_img_219);
    sscontainer_219.appendChild(start_img_a_219);
    next_img_a_219 = document.createElement('a');
    next_img_a_219.setAttribute('onclick', "nextPhoto_219();return false");
    next_img_a_219.setAttribute('href', "javascript:nextPhoto_219();");
    next_img_a_219.setAttribute('onfocus', "this.blur()");
    next_img_a_219.setAttribute('class', "none_219");
    next_img_a_219.setAttribute('className', "none_219");
    next_img_219 = document.createElement('img');
    next_img_219.setAttribute('id', 'nextSlideCtrl_219');
    next_img_219.setAttribute('src', ihost_219 + 'b_next.gif');
    next_img_219.setAttribute('alt', 'Next');
    next_img_219.setAttribute('title', 'Next');
    next_img_a_219.appendChild(next_img_219);
    sscontainer_219.appendChild(next_img_a_219);
    preview_pane_219.appendChild(sscontainer_219);
    icontainer_219 = document.createElement('div');
    icontainer_219.setAttribute('id', "galleryContainer_219");
    arr_left_img_div_219 = document.createElement('div');
    arr_left_img_div_219.setAttribute('id', "arrow_left_219");
    arr_left_img_219 = document.createElement('img');
    arr_left_img_219.setAttribute('src', ihost_219 + "b_scroll_left.gif");
    arr_left_img_219.setAttribute('id', "arrow_left_image_219");
    arr_left_img_219.setAttribute('width', "31");
    arr_left_img_219.setAttribute('height', "56");
    arr_left_img_div_219.appendChild(arr_left_img_219);
    icontainer_219.appendChild(arr_left_img_div_219);
    arr_right_img_div_219 = document.createElement('div');
    arr_right_img_div_219.setAttribute('id', "arrow_right_219");
    arr_right_img_219 = document.createElement('img');
    arr_right_img_219.setAttribute('src', ihost_219 + "b_scroll_right.gif");
    arr_right_img_219.setAttribute('id', "arrow_right_image_219");
    arr_right_img_219.setAttribute('width', "33");
    arr_right_img_219.setAttribute('height', "56");
    arr_right_img_div_219.appendChild(arr_right_img_219);
    icontainer_219.appendChild(arr_right_img_div_219);
    the_img_div_219 = document.createElement('div');
    the_img_div_219.setAttribute('id', "theImages_219");
    the_img_div_container_219 = document.createElement('div');
    the_img_div_container_219.setAttribute('style', "left: 31px;");
    for (var i=0; i<Photos_219.length; i++) {
        prev_img_a_219 = document.createElement('a');
        prev_img_a_219.setAttribute('onclick', "showPreview_219(Photos_219[" + i + "][0], " + i +", Photos_219[" + i + "][3], Photos_219[" + i + "][5], Photos_219[" + i + "][6]);return false");
        prev_img_a_219.setAttribute('href', "javascript:showPreview_219(Photos_219[" + i + "][0], " + i +", Photos_219[" + i + "][3], Photos_219[" + i + "][5], Photos_219[" + i + "][6]);");
        prev_img_219 = document.createElement('img');
        prev_img_219.setAttribute('src', Photos_219[i][1]);
        prev_img_219.setAttribute('alt', Photos_219[i][4]);
        if (i == Photos_219.length) {
            prev_img_219.setAttribute('style', 'margin: 0px;');
        }
        prev_img_a_219.appendChild(prev_img_219);
        the_img_div_container_219.appendChild(prev_img_a_219);
    }
    slide_end_div_219 = document.createElement('div');
    slide_end_div_219.setAttribute('id', "slideEnd_219");
    the_img_div_container_219.appendChild(slide_end_div_219);
    the_img_div_219.appendChild(the_img_div_container_219);
    icontainer_219.appendChild(the_img_div_219);
    igallery_219.appendChild(preview_pane_219);
    igallery_219.appendChild(icontainer_219);
}
}
window.ua = navigator.userAgent.toLowerCase();
var Safari = (ua.indexOf('safari') != -1)?true:false;

var slideShowInterval_219;
var currentPhoto_219           = 0;
var arrowImageHeight_219       = 31;	// Height of arrow image in pixels;
var previewImage_219           = false;
var previewImageParent_219     = false;
var slideSpeed_219             = 0;
var previewImagePane_219       = false;
var slideEndMarker_219         = false;
var galleryContainer_219       = false;
var disablePlay_219            = false;

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

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

function roundnumber_219(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_219(newSrc, idx, imageText, width, height)
{
    currentPhoto_219 = idx;
    var previewImage_219 = document.getElementById('gPreviewImg_219');
    var margin_top_219 = roundnumber_219( (previewImgContainerHeight_219/2 - 4) - (height/2), 0);
    previewImage_219.src = newSrc;
    previewImage_219.width = width;
    previewImage_219.height = height;
    previewImage_219.setAttribute('style', 'margin-top: ' + margin_top_219 + 'px;');
    if (imageText == 'undefined') {
        imageText = '';
    }
    var imgTextContainer_219 = document.getElementById('imgTextContainer_219');
    if (imageText != '') {

    }
    imgTextContainer_219.innerHTML = imageText;
}

function initSlide_219(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_219 = 10;
    } else {
        if (thumbnailsPosition_219 == 'V') {
            slideSpeed_219 = e.clientY + Math.max(document.body.scrollTop, document.documentElement.scrollTop) - getTopPos_219(this);
            if(this.src.indexOf('down') >= 0) {
                slideSpeed_219 = (slideSpeed_219) * -1;
            } else {
                slideSpeed_219 = arrowImageHeight_219 - slideSpeed_219;
            }
            slideSpeed_219 = Math.round(slideSpeed_219 * 15 / arrowImageHeight_219);
        } else {
            if(this.id=='arrow_right_image_219') {
                slideSpeedMultiply_219 = Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_219 = -1 * slideSpeedMultiply_219;
                slideSpeed_219 = Math.max(-10, slideSpeed_219);
            } else {
                slideSpeedMultiply_219 = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_219 = 1 * slideSpeedMultiply_219;
                slideSpeed_219 = Math.min(10, slideSpeed_219);
                if(slideSpeed_219 < 0) { slideSpeed_219 = 10; }
            }
        }
    }
}

function stopSlide_219()
{
    slideSpeed_219 = 0;
    this.src = this.src.replace('_over', '');
}

function slidePreviewPane_219()
{
    if(slideSpeed_219 != 0) {
        if (thumbnailsPosition_219 == 'V') {
            var topPos_219 = previewImagePane_219.style.top.replace(/[^\-0-9]/g,'')/1;

            if(slideSpeed_219 < 0 && slideEndMarker_219.offsetTop < (previewImageParent_219.offsetHeight - topPos_219)) {
                slideSpeed_219 = 0;
            }
            topPos_219 = topPos_219 + slideSpeed_219;
            if(topPos_219 > 0) {
                topPos_219 = 0;
            }
            previewImagePane_219.style.top = topPos_219 + 'px';
        } else {
            var leftPos_219 = previewImageParent_219.offsetLeft;
            leftPos_219 = leftPos_219/1 + slideSpeed_219;
            if(leftPos_219 > maxGalleryXPos_219) {
                leftPos_219 = maxGalleryXPos_219;
                slideSpeed_219 = 0;
            }
            if(leftPos_219 < minGalleryXPos_219){
                leftPos_219 = minGalleryXPos_219;
                slideSpeed_219 = 0;
            }
			previewImageParent_219.style.left = leftPos_219 + 'px';
        }
    }
    setTimeout('slidePreviewPane_219()', scrollingSpeed_219);
}

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

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

function initGalleryScript_219()
{
    drawGallery_219();

    previewImageParent_219 = document.getElementById('theImages_219');
    if( previewImageParent_219 != null ) {
        galleryContainer_219  = document.getElementById('galleryContainer_219');

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

        var images_219 = previewImagePane_219.getElementsByTagName('IMG');
        for(var no=0; no<images_219.length; no++) {
            images_219[no].onmouseover = revealThumbnail_219;
            images_219[no].onmouseout = hideThumbnail_219;
        }
        slideEndMarker_219 = document.getElementById('slideEnd_219');

        if (thumbnailsPosition_219 == 'V') {
            document.getElementById('arrow_up_image_219').onmousemove = initSlide_219;
            document.getElementById('arrow_up_image_219').onmouseout = stopSlide_219;

            document.getElementById('arrow_down_image_219').onmousemove = initSlide_219;
            document.getElementById('arrow_down_image_219').onmouseout = stopSlide_219;
        } else {
            document.getElementById('arrow_left_image_219').onmousemove = initSlide_219;
            document.getElementById('arrow_left_image_219').onmouseout = stopSlide_219;

            document.getElementById('arrow_right_image_219').onmousemove = initSlide_219;
            document.getElementById('arrow_right_image_219').onmouseout = stopSlide_219;
        }

        document.getElementById('prevSlideCtrl_219').onmousemove = initCtrlBtn_219;
        document.getElementById('prevSlideCtrl_219').onmouseout = stopCtrlBtn_219;

        document.getElementById('startSlideCtrl_219').onmousemove = initCtrlBtn_219;
        document.getElementById('startSlideCtrl_219').onmouseout = stopCtrlBtn_219;

        document.getElementById('stopSlideCtrl_219').onmousemove = initCtrlBtn_219;
        document.getElementById('stopSlideCtrl_219').onmouseout = stopCtrlBtn_219;

        document.getElementById('nextSlideCtrl_219').onmousemove = initCtrlBtn_219;
        document.getElementById('nextSlideCtrl_219').onmouseout = stopCtrlBtn_219;

        slidePreviewPane_219();
    }
}

function rprentals_button_219(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_219()
{
    if (this.id != 'startSlideCtrl_219' || disablePlay_219 == false) {
        if(this.src.indexOf('over') < 0) {
            this.src = this.src.replace('.gif', '_over.gif');
        }
    }
}
function stopCtrlBtn_219()
{
    if (this.id != 'startSlideCtrl_219' || disablePlay_219 == false) {
        if(this.src.indexOf('over') >= 0) {
            this.src = this.src.replace('_over', '');
        }
    }
}
function nextPhoto_219()
{
    currentPhoto_219++;
    if (currentPhoto_219 >= Photos_219.length) { currentPhoto_219 = 0; }
    showPreview_219(Photos_219[currentPhoto_219][0], currentPhoto_219, Photos_219[currentPhoto_219][3], Photos_219[currentPhoto_219][5], Photos_219[currentPhoto_219][6]);
}

function prevPhoto_219()
{
    currentPhoto_219--;
    if (currentPhoto_219 >= Photos_219.length || currentPhoto_219 < 0) { currentPhoto_219 = Photos_219.length-1; }
    showPreview_219(Photos_219[currentPhoto_219][0], currentPhoto_219, Photos_219[currentPhoto_219][3], Photos_219[currentPhoto_219][5], Photos_219[currentPhoto_219][6]);
}

function doSlideshow_219()
{
    nextPhoto_219( );
    slideShowInterval_219 = setTimeout("doSlideshow_219()", slideShowDelay_219);
}

function startSlideShow_219(initpic)
{
    slideShowInterval_219 = setTimeout("doSlideshow_219()", slideShowDelay_219);
    var elm = document.getElementById('startSlideCtrl_219');
    var elm_ctrl = document.getElementById('startSlideCtrlA_219');
    disablePlay_219 = true;
    if(elm.src.indexOf('over') < 0) {
        elm.src = elm.src.replace('.gif', '_over.gif');
    }
}

function stopSlideShow_219()
{
    clearTimeout(slideShowInterval_219);
    var elm = document.getElementById('startSlideCtrl_219');
    var elm_ctrl = document.getElementById('startSlideCtrlA_219');
    disablePlay_219 = false;
    if(elm.src.indexOf('over') >= 0) {
        elm.src = elm.src.replace('_over', '');
    }
}

function initGalleryScript()
{
    initGalleryScript_219();
}

function viodAction_219()
{

}

// Image Preloader
function ImagePreloader_219(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_219(images[i]);
}
ImagePreloader_219.prototype.preload_219 = 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_219.prototype.onload_219;
	oImage.onerror = ImagePreloader_219.prototype.onerror_219;
	oImage.onabort = ImagePreloader_219.prototype.onabort_219;

	// 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_219.prototype.onComplete_219 = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
ImagePreloader_219.prototype.onload_219 = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete_219();
}
ImagePreloader_219.prototype.onerror_219 = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete_219();
}
ImagePreloader_219.prototype.onabort_219 = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete_219();
}

// 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_219"><\/div>');
    var giv = new ImagePreloader_219(preloadPhotos_219, initGalleryScript_219);
    var aiv = new ImagePreloader_219(preloadPhotosAfter_219, viodAction_219);
}
