$(document).ready(function(){
$('a[rel*=facebox]').facebox()
$("a[rel^='prettyPhoto']").prettyPhoto();
//Section Tabs
	$("#sectionTabs").fadeIn();
    $("#sectionTabs > ul").tabs({ fx: { opacity: 'toggle' } });
	
	
// favnav tooltips 
$('.favorites a').tooltip({
	track: true,
	delay: 0,
	showURL: false,
	opacity: 0.85,
	extraClass: "right" 
});
	
  });



//Tabs for Search engines

function toggleDiv(divID, state){
    if(document.layers){ //netscape 4+

       document.layers[divID].visibility = state ? "show" : "hide";
       document.layers[divID].display = state ? "block" : "none";

    } else if(document.getElementById) { //netscape 6 internetExplorer 5+

        document.getElementById(divID).style.visibility = state ? "visible" : "hidden";
        document.getElementById(divID).style.display = state ? "block" : "none";

    } else {    //Internet Explorer 4

        document.all[divID].style.visibility = state ? "visible" : "hidden";
        document.all[divID].style.display = state ? "block" : "none";

    }
}


	function displayCruise(){
        toggleDiv('SearchCruiseDiv', 1);
	    toggleDiv('SearchLandDiv', 0);
	    toggleDiv('SearchHotelsDiv', 0);
        toggleDiv('SearchCarsDiv', 0);

		document.getElementById('ind-cruise').checked=true;
        document.getElementById('ind-land').checked=false;
        document.getElementById('ind-hotel').checked=false;
        document.getElementById('ind-car').checked=false;
	}
	function displayLand(){
        toggleDiv('SearchCruiseDiv', 0);
	    toggleDiv('SearchLandDiv', 1);
	    toggleDiv('SearchHotelsDiv', 0);
        toggleDiv('SearchCarsDiv', 0);

		document.getElementById('ind-cruise').checked=false;
        document.getElementById('ind-land').checked=true;
        document.getElementById('ind-hotel').checked=false;
        document.getElementById('ind-car').checked=false;
	}
    function displayHotel(){
        toggleDiv('SearchCruiseDiv', 0);
	    toggleDiv('SearchLandDiv', 0);
	    toggleDiv('SearchHotelsDiv', 1);
        toggleDiv('SearchCarsDiv', 0);

		document.getElementById('ind-cruise').checked=false;
        document.getElementById('ind-land').checked=false;
        document.getElementById('ind-hotel').checked=true;
        document.getElementById('ind-car').checked=false;
}
	function displayCar(){
        toggleDiv('SearchCruiseDiv', 0);
	    toggleDiv('SearchLandDiv', 0);
	    toggleDiv('SearchHotelsDiv', 0);
        toggleDiv('SearchCarsDiv', 1);

		document.getElementById('ind-cruise').checked=false;
        document.getElementById('ind-land').checked=false;
        document.getElementById('ind-hotel').checked=false;
        document.getElementById('ind-car').checked=true;
}


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')
}



			function openWin2(url, name) {
			popupWin = window.open(url, name, "width=350,height=420,left=0,right=0,toolbar=no,scrollbars=yes,location=0,resizable=no");
			}
			function openWin1(url, name) {
			popupWin = window.open(url, name, "width=715,height=750,left=0,right=0,toolbar=no,scrollbars=yes,location=0,resizable=yes");
			}
			function openWin3(url, name) {
			popupWin = window.open(url, name, "width=650,height=650,left=0,right=0,toolbar=no,scrollbars=yes,location=0,resizable=yes");
			}
