$(document).ready(function() {

$('a[rel*=facebox]').facebox() 

$(".earlybooking tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
$(".earlybooking tr:odd").addClass("alt");

/*
// accordion on ak shore excursions apge
jQuery('#accordion').accordion({ 
    autoHeight: false,
    active: false, 	
	animated: 'easeslide' 
});
*/


//cruises	


	$('.getAdvantage').click(function () { 
		$(this).append('<img class="loadingImg" src="/images/layout/small-loading.gif" />');
		$('#loading').show('fast');
		$('#main').hide();
		$('#main').empty();
		$.ajax({
			  url: "/small-ship-advantage.html",
			  cache: false,
			  success: function(html){
				$('#main').fadeIn(1500).append(html);
			  }
		});
		$('#loading').fadeOut('slow');
		$('.loadingImg').fadeOut();
		return false;
	});


});



agents = [
	"Teresa, Harriet, Patrick or Vicki C",
	"Harriet, Patrick, Vicki C or Diane",
	"Patrick, Vicki C, Diane or Judith",
	"Vicki C, Diane, Judith or Linda",
	"Diane, Judith, Linda or Chris",
	"Judith, Linda, Chris or Teresa",
	"Linda, Chris, Teresa or Harriet",
	"Chris, Teresa, Harriet or Patrick"	
	]
function getRandomText() {                               
	var rand = Math.round(Math.random()*(agents.length-1)); 
	document.write(agents[rand]);                                     
}


window.onload = function() {

if (!document.getElementsByTagName) {
		return false; 
	} 
	// create an array of objects of each link in the document 
	var popuplinks = document.getElementsByTagName("a");
	// loop through each of these links (anchor tags) 	
	for (var i=0; i < popuplinks.length; i++) {	
		// if the link has a class of "popup"...	
		if (popuplinks[i].getAttribute("class") == "pop800") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			pop800(this.getAttribute("href"));	
			return false; 	
			} 	
		} else if (popuplinks[i].getAttribute("class") == "pop700") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			pop700(this.getAttribute("href"));	
			return false; 	
			} 	
		} else
		if (popuplinks[i].getAttribute("class") == "pop600") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			pop600(this.getAttribute("href"));	
			return false; 	
			} 	
		} else 
		if (popuplinks[i].getAttribute("class") == "pop500") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			pop500(this.getAttribute("href"));	
			return false; 	
			} 	
		}
	} 
} 

function pop800(linkURL) {
window.open(linkURL,'popup','width=820,height=750,left=0,right=0,toolbar=no,scrollbars=yes,location=0,resizable=no')
}
function pop700(linkURL) {
window.open(linkURL,'popup','width=700,height=700,left=0,right=0,toolbar=no,scrollbars=yes,location=0,resizable=no')
}
function pop600(linkURL) {
window.open(linkURL,'popup','width=600,height=500,left=0,right=0,toolbar=no,scrollbars=yes,location=0,resizable=no')
}
function pop500(linkURL) {
window.open(linkURL,'popup','width=500,height=500,left=0,right=0,toolbar=no,scrollbars=no,location=0,resizable=no')
}





