
var galleryLoader;
var selectedGallery = 0;
var showGallery_222 = false;
var requestUri_222 = location.href;
var re = /[\?&](ghash=(.*))/gi;
requestUri_222 = requestUri_222.replace(re, '');
if(requestUri_222.indexOf('?') < 0) {
    requestUri_222 = requestUri_222 + '?';
} else {
    requestUri_222 = requestUri_222 + '&';
}
if (galleryLoader == undefined || selectedGallery == 1) {
    showGallery_222 = true;
}
 showGallery_222 = true;
var imageGalleryLeftPos_222       = 31;
var previewImgContainerHeight_222 = 307;
var imageGalleryWidth_222         = 367;
var maxGalleryXPos_222            = 31;
var minGalleryXPos_222            = -804;
var thumbnailsPosition_222        = 'H';
var scrollingSpeed_222            = 60;
var slideShowDelay_222            = 5000;
var ihost_222                     = 'http://images.myrockypoint.com/';
var ipath_222                     = ihost_222 + '21/';
var Photos_222                    = new Array();
Photos_222[0] = new Array( ipath_222 + '5492.jpg', ipath_222 + 'thumbnail_5492.jpg', "beachpic.jpg", "", "", "348", "232");
Photos_222[1] = new Array( ipath_222 + '5493.jpg', ipath_222 + 'thumbnail_5493.jpg', "dirtypic1.jpg", "", "", "400", "267");
Photos_222[2] = new Array( ipath_222 + '5494.jpg', ipath_222 + 'thumbnail_5494.jpg', "dirtypic2.jpg", "", "", "400", "266");
Photos_222[3] = new Array( ipath_222 + '5495.jpg', ipath_222 + 'thumbnail_5495.jpg', "dirtypic3.jpg", "", "", "400", "266");
Photos_222[4] = new Array( ipath_222 + '5496.jpg', ipath_222 + 'thumbnail_5496.jpg', "flick1.jpg", "", "", "400", "300");
Photos_222[5] = new Array( ipath_222 + '5497.jpg', ipath_222 + 'thumbnail_5497.jpg', "flick2.jpg", "", "", "400", "300");
Photos_222[6] = new Array( ipath_222 + '5498.jpg', ipath_222 + 'thumbnail_5498.jpg', "flick3.jpg", "", "", "400", "266");
Photos_222[7] = new Array( ipath_222 + '5499.jpg', ipath_222 + 'thumbnail_5499.jpg', "flick4.jpg", "", "", "400", "266");
Photos_222[8] = new Array( ipath_222 + '5500.jpg', ipath_222 + 'thumbnail_5500.jpg', "flick5.jpg", "", "", "225", "300");
Photos_222[9] = new Array( ipath_222 + '5501.jpg', ipath_222 + 'thumbnail_5501.jpg', "flick6.jpg", "", "", "400", "266");
Photos_222[10] = new Array( ipath_222 + '5502.jpg', ipath_222 + 'thumbnail_5502.jpg', "flick7.jpg", "", "", "400", "266");
Photos_222[11] = new Array( ipath_222 + '5503.jpg', ipath_222 + 'thumbnail_5503.jpg', "smug1.jpg", "", "", "400", "267");
Photos_222[12] = new Array( ipath_222 + '5504.jpg', ipath_222 + 'thumbnail_5504.jpg', "smug2.jpg", "", "", "400", "267");
Photos_222[13] = new Array( ipath_222 + '5505.jpg', ipath_222 + 'thumbnail_5505.jpg', "smug3.jpg", "", "", "400", "300");
if (showGallery_222) {
    var preloadPhotos_222 = new Array('' + ihost_222 + 'b_next.gif', '' + ihost_222 + 'b_next_over.gif', '' + ihost_222 + 'b_pause.gif', '' + ihost_222 + 'b_pause_over.gif', '' + ihost_222 + 'b_play.gif', '' + ihost_222 + 'b_play_over.gif', '' + ihost_222 + 'b_previous.gif', '' + ihost_222 + 'b_previous_over.gif', '' + ihost_222 + 'b_scroll_down.gif', '' + ihost_222 + 'b_scroll_down_over.gif', '' + ihost_222 + 'b_scroll_up.gif', '' + ihost_222 + 'b_scroll_up_over.gif', '' + ihost_222 + 'title_bg.gif', '' + ihost_222 + 'show_rental_details.gif', '' + ihost_222 + 'show_rental_details_over.gif', '' + ipath_222 + '5492.jpg', '' + ipath_222 + 'thumbnail_5492.jpg', '' + ipath_222 + 'thumbnail_5493.jpg');
    var preloadPhotos = new Array('' + ihost_222 + 'b_next.gif', '' + ihost_222 + 'b_next_over.gif', '' + ihost_222 + 'b_pause.gif', '' + ihost_222 + 'b_pause_over.gif', '' + ihost_222 + 'b_play.gif', '' + ihost_222 + 'b_play_over.gif', '' + ihost_222 + 'b_previous.gif', '' + ihost_222 + 'b_previous_over.gif', '' + ihost_222 + 'b_scroll_down.gif', '' + ihost_222 + 'b_scroll_down_over.gif', '' + ihost_222 + 'b_scroll_up.gif', '' + ihost_222 + 'b_scroll_up_over.gif', '' + ihost_222 + 'title_bg.gif', '' + ihost_222 + 'show_rental_details.gif', '' + ihost_222 + 'show_rental_details_over.gif', '' + ipath_222 + '5492.jpg', '' + ipath_222 + 'thumbnail_5492.jpg', '' + ipath_222 + 'thumbnail_5493.jpg');
    var preloadPhotosAfter_222 = new Array('' + ipath_222 + '5493.jpg', '' + ipath_222 + '5494.jpg', '' + ipath_222 + 'thumbnail_5494.jpg', '' + ipath_222 + '5495.jpg', '' + ipath_222 + 'thumbnail_5495.jpg', '' + ipath_222 + '5496.jpg', '' + ipath_222 + 'thumbnail_5496.jpg', '' + ipath_222 + '5497.jpg', '' + ipath_222 + 'thumbnail_5497.jpg', '' + ipath_222 + '5498.jpg', '' + ipath_222 + 'thumbnail_5498.jpg', '' + ipath_222 + '5499.jpg', '' + ipath_222 + 'thumbnail_5499.jpg', '' + ipath_222 + '5500.jpg', '' + ipath_222 + 'thumbnail_5500.jpg', '' + ipath_222 + '5501.jpg', '' + ipath_222 + 'thumbnail_5501.jpg', '' + ipath_222 + '5502.jpg', '' + ipath_222 + 'thumbnail_5502.jpg', '' + ipath_222 + '5503.jpg', '' + ipath_222 + 'thumbnail_5503.jpg', '' + ipath_222 + '5504.jpg', '' + ipath_222 + 'thumbnail_5504.jpg', '' + ipath_222 + '5505.jpg', '' + ipath_222 + 'thumbnail_5505.jpg');
} else {
    var preloadPhotos_222 = new Array(ihost_222 + 'title_bg.gif');
    var preloadPhotos = new Array(ihost_222 + 'title_bg.gif');
}
function drawGallery_222()
{
    if (document.getElementById("gallery_slideshow_222") != null ) {
    igallery_222 = document.getElementById("gallery_slideshow_222");
    } else {
    igallery_222 = document.getElementById("gallery_slideshow");
    }
    if (showGallery_222) {
    preview_pane_222 = document.createElement('div');
    preview_pane_222.setAttribute('id', "previewPane_222");
    gncontainer_222 = document.createElement('div');
    gncontainer_222.setAttribute('id', "galleryTitle_222");
    gnscontainer_222 = document.createElement('div');
    gnTitle_222 = document.createTextNode( "2004 Rocky Point Spring Break" );
    gnscontainer_222.appendChild(gnTitle_222);
    gncontainer_222.appendChild(gnscontainer_222);
    preview_pane_222.appendChild(gncontainer_222);
    preview_pane_img_div_222 = document.createElement('div');
    preview_pane_img_div_222.setAttribute('id', 'gPreviewImgContainer_222');
    preview_pane_img_222 = document.createElement('img');
    preview_pane_img_222.setAttribute('id', 'gPreviewImg_222');
    if (Photos_222.length > 0) {
        var margin_top = roundnumber_222( (previewImgContainerHeight_222/2 - 4) - (Photos_222[0][6]/2), 0);
        preview_pane_img_222.setAttribute('src', Photos_222[0][0]);
        preview_pane_img_222.setAttribute('width', Photos_222[0][5]);
        preview_pane_img_222.setAttribute('height', Photos_222[0][6]);
        preview_pane_img_222.setAttribute('style', 'margin-top: ' + margin_top + 'px;');
    }
    preview_pane_img_div_222.appendChild(preview_pane_img_222);
    preview_pane_222.appendChild(preview_pane_img_div_222);
    itext_222 = document.createElement('div');
    itext_222.setAttribute('id', "imgTextContainer_222");
    if (Photos_222.length > 0 && Photos_222[0][3] != '') {
        itext_222.innerHTML = Photos_222[0][3];
    }
    preview_pane_222.appendChild(itext_222);
    sscontainer_222 = document.createElement('div');
    sscontainer_222.setAttribute('id', "slideShowContainer_222");
    prev_img_a_222 = document.createElement('a');
    prev_img_a_222.setAttribute('onclick', "prevPhoto_222();return false");
    prev_img_a_222.setAttribute('href', "javascript:prevPhoto_222();");
    prev_img_a_222.setAttribute('onfocus', "this.blur()");
    prev_img_222 = document.createElement('img');
    prev_img_222.setAttribute('id', 'prevSlideCtrl_222');
    prev_img_222.setAttribute('src', ihost_222 + 'b_previous.gif');
    prev_img_222.setAttribute('alt', 'Previous');
    prev_img_222.setAttribute('title', 'Previous');
    prev_img_a_222.appendChild(prev_img_222);
    sscontainer_222.appendChild(prev_img_a_222);
    stop_img_a_222 = document.createElement('a');
    stop_img_a_222.setAttribute('onclick', "stopSlideShow_222();return false");
    stop_img_a_222.setAttribute('href', "javascript:stopSlideShow_222();");
    stop_img_a_222.setAttribute('id', "stopSlideCtrlA_222");
    stop_img_a_222.setAttribute('onfocus', "this.blur()");
    stop_img_222 = document.createElement('img');
    stop_img_222.setAttribute('id', 'stopSlideCtrl_222');
    stop_img_222.setAttribute('src', ihost_222 + 'b_pause.gif');
    stop_img_222.setAttribute('alt', 'Pause');
    stop_img_222.setAttribute('title', 'Pause');
    stop_img_a_222.appendChild(stop_img_222);
    sscontainer_222.appendChild(stop_img_a_222);
    start_img_a_222 = document.createElement('a');
    start_img_a_222.setAttribute('onclick', "startSlideShow_222();return false");
    start_img_a_222.setAttribute('href', "javascript:startSlideShow_222();");
    start_img_a_222.setAttribute('id', "startSlideCtrlA_222");
    start_img_a_222.setAttribute('onfocus', "this.blur()");
    start_img_222 = document.createElement('img');
    start_img_222.setAttribute('id', 'startSlideCtrl_222');
    start_img_222.setAttribute('src', ihost_222 + 'b_play.gif');
    start_img_222.setAttribute('alt', 'Play');
    start_img_222.setAttribute('title', 'Play');
    start_img_a_222.appendChild(start_img_222);
    sscontainer_222.appendChild(start_img_a_222);
    next_img_a_222 = document.createElement('a');
    next_img_a_222.setAttribute('onclick', "nextPhoto_222();return false");
    next_img_a_222.setAttribute('href', "javascript:nextPhoto_222();");
    next_img_a_222.setAttribute('onfocus', "this.blur()");
    next_img_a_222.setAttribute('class', "none_222");
    next_img_a_222.setAttribute('className', "none_222");
    next_img_222 = document.createElement('img');
    next_img_222.setAttribute('id', 'nextSlideCtrl_222');
    next_img_222.setAttribute('src', ihost_222 + 'b_next.gif');
    next_img_222.setAttribute('alt', 'Next');
    next_img_222.setAttribute('title', 'Next');
    next_img_a_222.appendChild(next_img_222);
    sscontainer_222.appendChild(next_img_a_222);
    preview_pane_222.appendChild(sscontainer_222);
    icontainer_222 = document.createElement('div');
    icontainer_222.setAttribute('id', "galleryContainer_222");
    arr_left_img_div_222 = document.createElement('div');
    arr_left_img_div_222.setAttribute('id', "arrow_left_222");
    arr_left_img_222 = document.createElement('img');
    arr_left_img_222.setAttribute('src', ihost_222 + "b_scroll_left.gif");
    arr_left_img_222.setAttribute('id', "arrow_left_image_222");
    arr_left_img_222.setAttribute('width', "31");
    arr_left_img_222.setAttribute('height', "56");
    arr_left_img_div_222.appendChild(arr_left_img_222);
    icontainer_222.appendChild(arr_left_img_div_222);
    arr_right_img_div_222 = document.createElement('div');
    arr_right_img_div_222.setAttribute('id', "arrow_right_222");
    arr_right_img_222 = document.createElement('img');
    arr_right_img_222.setAttribute('src', ihost_222 + "b_scroll_right.gif");
    arr_right_img_222.setAttribute('id', "arrow_right_image_222");
    arr_right_img_222.setAttribute('width', "33");
    arr_right_img_222.setAttribute('height', "56");
    arr_right_img_div_222.appendChild(arr_right_img_222);
    icontainer_222.appendChild(arr_right_img_div_222);
    the_img_div_222 = document.createElement('div');
    the_img_div_222.setAttribute('id', "theImages_222");
    the_img_div_container_222 = document.createElement('div');
    the_img_div_container_222.setAttribute('style', "left: 31px;");
    for (var i=0; i<Photos_222.length; i++) {
        prev_img_a_222 = document.createElement('a');
        prev_img_a_222.setAttribute('onclick', "showPreview_222(Photos_222[" + i + "][0], " + i +", Photos_222[" + i + "][3], Photos_222[" + i + "][5], Photos_222[" + i + "][6]);return false");
        prev_img_a_222.setAttribute('href', "javascript:showPreview_222(Photos_222[" + i + "][0], " + i +", Photos_222[" + i + "][3], Photos_222[" + i + "][5], Photos_222[" + i + "][6]);");
        prev_img_222 = document.createElement('img');
        prev_img_222.setAttribute('src', Photos_222[i][1]);
        prev_img_222.setAttribute('alt', Photos_222[i][4]);
        if (i == Photos_222.length) {
            prev_img_222.setAttribute('style', 'margin: 0px;');
        }
        prev_img_a_222.appendChild(prev_img_222);
        the_img_div_container_222.appendChild(prev_img_a_222);
    }
    slide_end_div_222 = document.createElement('div');
    slide_end_div_222.setAttribute('id', "slideEnd_222");
    the_img_div_container_222.appendChild(slide_end_div_222);
    the_img_div_222.appendChild(the_img_div_container_222);
    icontainer_222.appendChild(the_img_div_222);
    igallery_222.appendChild(preview_pane_222);
    igallery_222.appendChild(icontainer_222);
}
}
window.ua = navigator.userAgent.toLowerCase();
var Safari = (ua.indexOf('safari') != -1)?true:false;

var slideShowInterval_222;
var currentPhoto_222           = 0;
var arrowImageHeight_222       = 31;	// Height of arrow image in pixels;
var previewImage_222           = false;
var previewImageParent_222     = false;
var slideSpeed_222             = 0;
var previewImagePane_222       = false;
var slideEndMarker_222         = false;
var galleryContainer_222       = false;
var disablePlay_222            = false;

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

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

function roundnumber_222(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_222(newSrc, idx, imageText, width, height)
{
    currentPhoto_222 = idx;
    var previewImage_222 = document.getElementById('gPreviewImg_222');
    var margin_top_222 = roundnumber_222( (previewImgContainerHeight_222/2 - 4) - (height/2), 0);
    previewImage_222.src = newSrc;
    previewImage_222.width = width;
    previewImage_222.height = height;
    previewImage_222.setAttribute('style', 'margin-top: ' + margin_top_222 + 'px;');
    if (imageText == 'undefined') {
        imageText = '';
    }
    var imgTextContainer_222 = document.getElementById('imgTextContainer_222');
    if (imageText != '') {

    }
    imgTextContainer_222.innerHTML = imageText;
}

function initSlide_222(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_222 = 10;
    } else {
        if (thumbnailsPosition_222 == 'V') {
            slideSpeed_222 = e.clientY + Math.max(document.body.scrollTop, document.documentElement.scrollTop) - getTopPos_222(this);
            if(this.src.indexOf('down') >= 0) {
                slideSpeed_222 = (slideSpeed_222) * -1;
            } else {
                slideSpeed_222 = arrowImageHeight_222 - slideSpeed_222;
            }
            slideSpeed_222 = Math.round(slideSpeed_222 * 15 / arrowImageHeight_222);
        } else {
            if(this.id=='arrow_right_image_222') {
                slideSpeedMultiply_222 = Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_222 = -1 * slideSpeedMultiply_222;
                slideSpeed_222 = Math.max(-10, slideSpeed_222);
            } else {
                slideSpeedMultiply_222 = 10 - Math.floor((e.clientX - this.offsetLeft) / 5);
                slideSpeed_222 = 1 * slideSpeedMultiply_222;
                slideSpeed_222 = Math.min(10, slideSpeed_222);
                if(slideSpeed_222 < 0) { slideSpeed_222 = 10; }
            }
        }
    }
}

function stopSlide_222()
{
    slideSpeed_222 = 0;
    this.src = this.src.replace('_over', '');
}

function slidePreviewPane_222()
{
    if(slideSpeed_222 != 0) {
        if (thumbnailsPosition_222 == 'V') {
            var topPos_222 = previewImagePane_222.style.top.replace(/[^\-0-9]/g,'')/1;

            if(slideSpeed_222 < 0 && slideEndMarker_222.offsetTop < (previewImageParent_222.offsetHeight - topPos_222)) {
                slideSpeed_222 = 0;
            }
            topPos_222 = topPos_222 + slideSpeed_222;
            if(topPos_222 > 0) {
                topPos_222 = 0;
            }
            previewImagePane_222.style.top = topPos_222 + 'px';
        } else {
            var leftPos_222 = previewImageParent_222.offsetLeft;
            leftPos_222 = leftPos_222/1 + slideSpeed_222;
            if(leftPos_222 > maxGalleryXPos_222) {
                leftPos_222 = maxGalleryXPos_222;
                slideSpeed_222 = 0;
            }
            if(leftPos_222 < minGalleryXPos_222){
                leftPos_222 = minGalleryXPos_222;
                slideSpeed_222 = 0;
            }
			previewImageParent_222.style.left = leftPos_222 + 'px';
        }
    }
    setTimeout('slidePreviewPane_222()', scrollingSpeed_222);
}

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

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

function initGalleryScript_222()
{
    drawGallery_222();

    previewImageParent_222 = document.getElementById('theImages_222');
    if( previewImageParent_222 != null ) {
        galleryContainer_222  = document.getElementById('galleryContainer_222');

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

        var images_222 = previewImagePane_222.getElementsByTagName('IMG');
        for(var no=0; no<images_222.length; no++) {
            images_222[no].onmouseover = revealThumbnail_222;
            images_222[no].onmouseout = hideThumbnail_222;
        }
        slideEndMarker_222 = document.getElementById('slideEnd_222');

        if (thumbnailsPosition_222 == 'V') {
            document.getElementById('arrow_up_image_222').onmousemove = initSlide_222;
            document.getElementById('arrow_up_image_222').onmouseout = stopSlide_222;

            document.getElementById('arrow_down_image_222').onmousemove = initSlide_222;
            document.getElementById('arrow_down_image_222').onmouseout = stopSlide_222;
        } else {
            document.getElementById('arrow_left_image_222').onmousemove = initSlide_222;
            document.getElementById('arrow_left_image_222').onmouseout = stopSlide_222;

            document.getElementById('arrow_right_image_222').onmousemove = initSlide_222;
            document.getElementById('arrow_right_image_222').onmouseout = stopSlide_222;
        }

        document.getElementById('prevSlideCtrl_222').onmousemove = initCtrlBtn_222;
        document.getElementById('prevSlideCtrl_222').onmouseout = stopCtrlBtn_222;

        document.getElementById('startSlideCtrl_222').onmousemove = initCtrlBtn_222;
        document.getElementById('startSlideCtrl_222').onmouseout = stopCtrlBtn_222;

        document.getElementById('stopSlideCtrl_222').onmousemove = initCtrlBtn_222;
        document.getElementById('stopSlideCtrl_222').onmouseout = stopCtrlBtn_222;

        document.getElementById('nextSlideCtrl_222').onmousemove = initCtrlBtn_222;
        document.getElementById('nextSlideCtrl_222').onmouseout = stopCtrlBtn_222;

        slidePreviewPane_222();
    }
}

function rprentals_button_222(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_222()
{
    if (this.id != 'startSlideCtrl_222' || disablePlay_222 == false) {
        if(this.src.indexOf('over') < 0) {
            this.src = this.src.replace('.gif', '_over.gif');
        }
    }
}
function stopCtrlBtn_222()
{
    if (this.id != 'startSlideCtrl_222' || disablePlay_222 == false) {
        if(this.src.indexOf('over') >= 0) {
            this.src = this.src.replace('_over', '');
        }
    }
}
function nextPhoto_222()
{
    currentPhoto_222++;
    if (currentPhoto_222 >= Photos_222.length) { currentPhoto_222 = 0; }
    showPreview_222(Photos_222[currentPhoto_222][0], currentPhoto_222, Photos_222[currentPhoto_222][3], Photos_222[currentPhoto_222][5], Photos_222[currentPhoto_222][6]);
}

function prevPhoto_222()
{
    currentPhoto_222--;
    if (currentPhoto_222 >= Photos_222.length || currentPhoto_222 < 0) { currentPhoto_222 = Photos_222.length-1; }
    showPreview_222(Photos_222[currentPhoto_222][0], currentPhoto_222, Photos_222[currentPhoto_222][3], Photos_222[currentPhoto_222][5], Photos_222[currentPhoto_222][6]);
}

function doSlideshow_222()
{
    nextPhoto_222( );
    slideShowInterval_222 = setTimeout("doSlideshow_222()", slideShowDelay_222);
}

function startSlideShow_222(initpic)
{
    slideShowInterval_222 = setTimeout("doSlideshow_222()", slideShowDelay_222);
    var elm = document.getElementById('startSlideCtrl_222');
    var elm_ctrl = document.getElementById('startSlideCtrlA_222');
    disablePlay_222 = true;
    if(elm.src.indexOf('over') < 0) {
        elm.src = elm.src.replace('.gif', '_over.gif');
    }
}

function stopSlideShow_222()
{
    clearTimeout(slideShowInterval_222);
    var elm = document.getElementById('startSlideCtrl_222');
    var elm_ctrl = document.getElementById('startSlideCtrlA_222');
    disablePlay_222 = false;
    if(elm.src.indexOf('over') >= 0) {
        elm.src = elm.src.replace('_over', '');
    }
}

function initGalleryScript()
{
    initGalleryScript_222();
}

function viodAction_222()
{

}

// Image Preloader
function ImagePreloader_222(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_222(images[i]);
}
ImagePreloader_222.prototype.preload_222 = 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_222.prototype.onload_222;
	oImage.onerror = ImagePreloader_222.prototype.onerror_222;
	oImage.onabort = ImagePreloader_222.prototype.onabort_222;

	// 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_222.prototype.onComplete_222 = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
ImagePreloader_222.prototype.onload_222 = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete_222();
}
ImagePreloader_222.prototype.onerror_222 = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete_222();
}
ImagePreloader_222.prototype.onabort_222 = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete_222();
}

// 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_222"><\/div>');
    var giv = new ImagePreloader_222(preloadPhotos_222, initGalleryScript_222);
    var aiv = new ImagePreloader_222(preloadPhotosAfter_222, viodAction_222);
}

