


var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmouseup = getMouseXY;
var tempX = 0;
var tempY = 0;





function msgBox(message)
    {

	
	

     var msgbox = document.getElementsByClassName("iceOutConStatActv")[0];

     msgbox.style.top = (tempY +"px"); 
     msgbox.style.left = (tempX +"px") ;



     message="Please wait "+message;
     msgbox.innerHTML =message + '<br/><img src="/vac/layout/temp1/images/connect_active.gif" style="width:100px;"/>';
  

     msgbox.style.display = "block";
     
        
     var tm= setTimeout ("myTimer()", 5000 );
    }



function getMouseXY(e) {

if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
}
else {  // grab the x-y pos.s if browser is NS
tempX = e.pageX;
tempY = e.pageY;
}  
if (tempX < 0){tempX = 0;}
if (tempY < 0){tempY = 0;}  
return true;
}//edn 



function doChk(x){

	if( x.value=='ALL' || x.value == 0){


		for(var i=2;i<50;i++){
	
			var y= x.id;
	                y= y.substring(0, y.lastIndexOf("_") );
			var z = document.getElementById( y +"_"+i );

			if( z == null)
				return;
			else
				z.checked=false;

		}//edn while

	}else{

		var y= x.id;
		y= y.substring(0, y.lastIndexOf("_") );

		var z = document.getElementById( y +"_1" );
		if( z.value=='ALL' || z.value == 0)
			z.checked=false;
	}//edn else

}//edn 



//galary img ------------------------------------------------------------------------------------
//set the starting image.
var i = 0;

// The array of div names which will hold the images.
var image_slide = new Array('image-1', 'image-2', 'image-3');

// The number of images in the array.
var NumOfImages = image_slide.length;

// The time to wait before moving to the next image. Set to 3 seconds by default.
var wait = 4000;

// The Fade Function
function SwapImage(x,y) {
        $(image_slide[x]).appear({ duration: 1.5 });
        $(image_slide[y]).fade({duration: 1.5});
}

// the onload event handler that starts the fading.
function StartSlideShow() {

        play = setInterval('Play()',wait);
        $('PlayButton').hide();
        $('PauseButton').appear({ duration: 0});

}

function Play() {
        var imageShow, imageHide;

        imageShow = i+1;
        imageHide = i;

        if (imageShow == NumOfImages) {
                SwapImage(0,imageHide);
                i = 0;
        } else {
                SwapImage(imageShow,imageHide);
                i++;
        }
}

function Stop () {
        clearInterval(play);
        $('PlayButton').appear({ duration: 0});
        $('PauseButton').hide();
}

function GoNext() {
    clearInterval(play);
    $('PlayButton').appear({ duration: 0});
    $('PauseButton').hide();
            
    var imageShow, imageHide;

    imageShow = i+1;
    imageHide = i;

    if (imageShow == NumOfImages) {
            SwapImage(0,imageHide);
            i = 0;
    } else {
            SwapImage(imageShow,imageHide);
            i++;
    }
}

function GoPrevious() {
    clearInterval(play);
    $('PlayButton').appear({ duration: 0});
    $('PauseButton').hide();

    var imageShow, imageHide;

    imageShow = i-1;
    imageHide = i;

    if (i == 0) {
            SwapImage(NumOfImages-1,imageHide);
            i = NumOfImages-1;

            

    } else {
            SwapImage(imageShow,imageHide);
            i--;
    }
           
}

//end galary img ------------------------------------------------------------------------------------

function openClose(name){

	var x = document.getElementById(name).style.display ;
	
	if( x == 'none' )
		document.getElementById(name).style.display='inline';
	else
		document.getElementById(name).style.display='none';
		
}


function msgBox1(message) {}
function msgBox19(message) {

    	var msgbox = document.getElementsByClassName("iceOutConStatActv")[0];
if( msgbox==null) return;    	
    	msgbox.style.display = "none"; 
    
    
        var a = document.getElementById("splashScreen");
        a.style.display="block";

        window.scroll(0,0);
}




function msgBox2(message)
    {

	
	

     var msgbox = document.getElementsByClassName("iceOutConStatActv")[0];
     msgbox.style.top = ("30%"); 
     msgbox.style.left = ("30%") ;
     msgbox.style.position="fixed";

     msgbox.style.width = ("500px") ;
     msgbox.style.height = ("200px") ;

     message="Please wait " + " : "+message;
     msgbox.innerHTML =message + '<br/><img src="/vac/layout/temp1/images/connect_active.gif" style="width:100px;"/>';
  

     msgbox.style.display = "block";
        
     window.scroll(0,0);

     var tm= setTimeout ("myTimer()", 5000 );
    }



function myTimer(){
	
	 var msgbox = document.getElementsByClassName("iceOutConStatActv")[0];
	 
	 var message="Please wait ... loading";
     msgbox.innerHTML =message + '<br/><img src="/vac/layout/temp1/images/connect_active.gif" style="width:100px;"/>';
  
	  

}







 function x(ship){


                var u= "/seo/promo/ads.jsp?tag="+ship+"&keyIndxValue="+ship+"&keyIndxType=ship";
                new Ajax.Updater('vacation_deals', u,
                        { method: 'get'
                         }
                );


                setTimeout("x('"+ship+"')", 3000);

        }


        function loadHdr(ship){


            var u= "/seo/header1.jsp?ship="+ship;
            new Ajax.Updater('hdr', u,
                    { method: 'get'
                     }
            );


            setTimeout("loadHdr('"+ship+"')", 18000);
         }

  function loadFtr(){


             var u= "/seo/footer.jsp";
             new Ajax.Updater('ftr', u,
                     { method: 'get'
                      }
             );

          }






     function specPromo(){


              var u= "/seo/promo/shipDeals_promo.jsp?ship="+ship;
              new Ajax.Updater('specPromo', u,
                      { method: 'get'
                       }
              );



        }


  function loadTools(ship){


                        loadHdr(ship);

                                x(ship);


                var u= "/seo/tool.jsp?ship="+ship;
                new Ajax.Updater('vacation_tool', u,
                        { method: 'get'
                         }
                );

                                cruiseDeals(ship);

                                loadFtr();

                                yBvc();

				sched(ship);

        }


        function cruiseDeals(ship){


            var u= "/seo/promo/shipDeals.jsp?ship="+ship;
            new Ajax.Updater('cruise_deals', u,
                    { method: 'get'
                     }
            );



        }


                var isLoaded=false;


 function y(ship){
                 if(isLoaded) return;
		
                loadTools(ship);


                 isLoaded=true;
        }


   function yBvc(){



                var u= "/seo/promo/yBvc.jsp";
            new Ajax.Updater('yBvc', u,
                    { method: 'get'
                     }
            );
            setTimeout("yBvc()", 5000);
        }

 function sched(ship){
 var u= "/seo/cruises.jsp?ship="+ship;

            new Ajax.Updater('sched', u,
                    { method: 'get'
                     }
            );

}


 function frntSpec(){


            var u= "/rss/carnival.htm";
            new Ajax.Updater('spcCCL', u,
                    { method: 'get'
                     }
            );



            var u= "/rss/destinations.htm";
            new Ajax.Updater('spcDest', u,
                    { method: 'get'
                     }
            );



            var u= "/rss/lastminutedeals.htm";
            new Ajax.Updater('spcLast', u,
                    { method: 'get'
                     }
            );

            var u= "/rss/norwegian_cruises.htm";
            new Ajax.Updater('spcNCL', u,
                    { method: 'get'
                     }
            );



            var u= "/rss/royalcaribbean.htm";
            new Ajax.Updater('spcRCL', u,
                    { method: 'get'
                     }
            );


            var u= "/rss/cruisedeals.htm";
            new Ajax.Updater('spcTop', u,
                    { method: 'get'
                     }
            );

}




 function loadSrc(where, fromSrc){


            
            new Ajax.Updater( where, fromSrc,
                    { method: 'get'
                     }
            );

}
 
 try{
	 var balloon    = new Balloon;
 }catch(e){}
 
 
 //function searchDest(x){self.location='/vac/destination/'+x;}
 //function searchShip(x){self.location='/vac/ship/'+x;}
 
 
 function searchDest(x){
	 if( x==''){alert("Invalid Destination"); return;}
	 self.location='/vac/cruises/'+x;
 }
 
 function searchShip(x){
	 if( x==''){alert("Invalid Ship"); return;}
	 self.location='/vac/cruises/'+x+'/';
 }
 
 function searchLine(x){
	 if( x==''){alert("Invalid Cruise Line"); return;}
	 self.location='/vac/cruises.seam?line='+x;
 }
 function searchSailDate(x){
	 
	 if( x==''){alert("Invalid Time"); return;}
	 self.location='/vac/cruises.seam?sailDate='+x;
 }
 
 function searchLen(x){
	 if( x==''){alert("Invalid Cruise Duration range"); return;}
	 self.location='/vac/cruises.seam?len='+x;
 }
 
 function searchPrice(x){
	 	if( x==''){alert("Please select price range"); return;}
	 	
	 	self.location='/vac/cruises.seam?priceRange='+x;
 }
 
 function searchDeparture(x){
	 if( x==''){alert("Invalid Departure"); return;}
	 self.location='/vac/cruises.seam?departure='+x;
 }
 
 function searchState(x){
	 if( x==''){alert("Invalid State"); return;}
	 self.location='/vac/cruises.seam?state='+x;
 }
 
 function searchSDt(x){

	 var m = x.sdm.options[x.sdm.selectedIndex].value;
	 var y = x.sdy.options[x.sdy.selectedIndex].value;
	 var d = x.sdd.options[x.sdd.selectedIndex].value;
	 
	 if( d==''){alert("Invalid Sail Date: date"); return;}
	 if( m==''){alert("Invalid Sail Date: month"); return;}
	 if( y==''){alert("Invalid Sail Date: year"); return;}
	
	 self.location='/vac/cruises.seam?sailDate='+y+'-'+m+'-'+d;
 }
 
 
 

 function searchDest_social(x){
	 if( x==''){alert("Invalid Destination"); return;}
	 self.location='/vac/tripplanner/trips.seam?dest='+x;
 }
 
 function searchShip_social(x){
	 if( x==''){alert("Invalid Ship"); return;}
	 self.location='/vac/tripplanner/trips.seam?ship='+x;
 }
 

 function searchDate_social(x){
	 
	 if( x==''){alert("Invalid Time"); return;}
	 self.location='/vac/tripplanner/trips.seam?dtr='+x;
 }
 
 function searchLen_social(x){
	 if( x==''){alert("Invalid Cruise Duration range"); return;}
	 self.location='/vac/tripplanner/trips.seam?len='+x;
 }
 
 function searchPrice_social(x){
	 	if( x==''){alert("Please select price range"); return;}
	 	
	 	self.location='/vac/tripplanner/trips.seam?priceR='+x;
 }
 
 function searchDeparture_social(x){
	 if( x==''){alert("Invalid Departure"); return;}
	 self.location='/vac/tripplanner/trips.seam?depart='+x;
 }
 

 function searchTripId_social(x){
 	 if( x==''){alert("Invalid Trip id"); return;}
 	 self.location='/vac/tripplanner/trip/'+x;
 }


 function searchCreator_social(x){
 	 if( x==''){alert("Invalid Creator nickname"); return;}
 	 self.location='/vac/tripplanner/trips.seam?cid='+x;
 }


 
 
 
 function ldNav(){
 
	// setTimeout("ldNav1()", 1000);
 }
 
 function ldNav1(){
	 
	 new Ajax.Updater( "hdr", "/vac/layout/temp1/menu.seam",
             { method: 'get'
              }
     );
	 
	 new Ajax.Updater( "ftr", "/vac/layout/temp1/footer.seam",
             { method: 'get'
              }
     );
	 
 }
 
 //quote
 function doChkQt(){

		var email = document.frmQ.email.value;
		var phone = document.frmQ.tel.value;
		
		if( email=='' && phone=='' ){
			 alert("Please provide your Email or Tel number");
			 return false;
		}//edn if


		return true;
			
	}//edn 
 
 




 var tabLinks = new Array();
 var contentDivs = new Array();

 function initTabs() {

   // Grab the tab links and content divs from the page
   var tabListItems = document.getElementById('tabs').childNodes;
   for ( var i = 0; i < tabListItems.length; i++ ) {
     if ( tabListItems[i].nodeName == "LI" ) {
       var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' );
       var id = getHash( tabLink.getAttribute('href') );
       tabLinks[id] = tabLink;
       contentDivs[id] = document.getElementById( id );
     }
   }

   // Assign onclick events to the tab links, and
   // highlight the first tab
   var i = 0;

   for ( var id in tabLinks ) {
     tabLinks[id].onclick = showTab;
     tabLinks[id].onfocus = function() { this.blur() };
     if ( i == 0 ) tabLinks[id].className = 'selected';
     i++;
   }

   // Hide all content divs except the first
   var i = 0;
 /*
   for ( var id in contentDivs ) {
     if ( i != 0 ) contentDivs[id].className = 'tabContent hide';
     i++;
   }
   */
 }

 function showTab() {
   var selectedId = getHash( this.getAttribute('href') );

   // Highlight the selected tab, and dim all others.
   // Also show the selected content div, and hide all others.
   for ( var id in contentDivs ) {
     if ( id == selectedId ) {
       tabLinks[id].className = 'selected';
       contentDivs[id].className = 'tabContent';
     } else {
       tabLinks[id].className = '';
       contentDivs[id].className = 'tabContent hide';
     }
   }

   // Stop the browser following the link
   return false;
 }

 function getFirstChildWithTagName( element, tagName ) {
   for ( var i = 0; i < element.childNodes.length; i++ ) {
     if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i];
   }
 }

 function getHash( url ) {
   var hashPos = url.lastIndexOf ( '#' );
   return url.substring( hashPos + 1 );
 }


