// ======================================================
// Preload Images
// ======================================================
var img1a = new Image();
var img2a = new Image();
var img3a = new Image();
var img4a = new Image();
var img5a = new Image();
var img6a = new Image();
img1a.src = "/images/tab_home1r.gif";
img2a.src = "/images/tab_hotels1r.gif";
img3a.src = "/images/tab_vacations1r.gif";
img4a.src = "/images/tab_tickets1r.gif";
img5a.src = "/images/tab_attractions1r.gif";
img6a.src = "/images/tab_news1r.gif";

// ======================================================
// Function to swap images.
// ======================================================
function imgRollover(imageId,imageName,transitionSpeed)
{
if (transitionSpeed == undefined){transitionSpeed = 0.3}
    if(document.images)
    {
        if (document.all)
        {
            document.images[imageId].style.filter='blendTrans(duration='+transitionSpeed+')'
            document.images[imageId].filters.blendTrans.Apply()
        }        
        document.images[imageId].src = imageName;
        if (document.all)
        {
            document.images[imageId].filters.blendTrans.Play()
        }        
    }
}
function selectedtab(tabid,imageUrl)
{
    document.getElementById(tabid).src = imageUrl;
}

// ======================================================
// Function to add bookmark to firefox and IE4+.
// ======================================================
function addtofavorites(title, url){
if (document.all)
{
    window.external.AddFavorite(url, title);
}
else if (window.sidebar)
{
    window.sidebar.addPanel(title, url, "");
}
else
{
    alert("Add this URL to your favorites.\n\r Using Ctrl-D or Ctrl-T may work on most browsers.");
}
}

// ======================================================
// Function generate a window Popup message.
// ======================================================
function openWindow(sURL)
{
window.open(sURL,"popupwindow","status=1,toolbar=0,location=0,menubar=0,resizable=1,scrollbars=1")
}
/*
status  The status bar at the bottom of the window. 
toolbar  The standard browser toolbar, with buttons such as Back and Forward. 
location  The Location entry field where you enter the URL. 
menubar  The menu bar of the window 
directories  The standard browser directory buttons, such as What's New and What's Cool 
resizable Allow/Disallow the user to resize the window. 
scrollbars  Enable the scrollbars if the document is bigger than the window 
height Specifies the height of the window in pixels. (example: height='350') 
width  Specifies the width of the window in pixels. 
*/


// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = '/images/welcome_image3.jpg'
Pic[1] = '/images/welcome_image4.jpg'
Pic[2] = '/images/welcome_image1.jpg'
Pic[3] = '/images/welcome_image2.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoadImage = new Array()
for (i = 0; i < p; i++){
   preLoadImage[i] = new Image()
   preLoadImage[i].src = Pic[i]
}

function runSlideShow(){
   if(document.images.SlideShow)
   {
        if (document.all){
            document.images.SlideShow.style.filter="blendTrans(duration=2)"
            document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
            document.images.SlideShow.filters.blendTrans.Apply()      
        }
        document.images.SlideShow.src = preLoadImage[j].src
        if (document.all){
            document.images.SlideShow.filters.blendTrans.Play()
        }
        j = j + 1
        if (j > (p-1)) j=0
        t = setTimeout('runSlideShow()', slideShowSpeed)
  }
}

