// Default JS Content - Do Not Delete


$(document).ready(function(){


$('#propnav li li').hide().parent().prev().append('<span class="expand open" style="float:right;margin:-3px 0px -4px 0"><img src="/i/SITE_100520_15115843_1EGU2/templates/plus.gif"></span>');
$('#propnav .expand').click(function(){
	var $t = $(this);
	if($t.hasClass('open')){
		$t.addClass('close').removeClass('open');
		$t.html('<img src="/i/SITE_100520_15115843_1EGU2/templates/minus.gif">');
		$t.parent().next().children().show();
	}else{
		$t.html('<img src="/i/SITE_100520_15115843_1EGU2/templates/plus.gif">');
		$t.addClass('open').removeClass('close');
		$t.parent().next().children().hide();
	}
	return false;
});
var url = document.location.href.replace(/.*.com/i,'');
$('#propnav a').each(function(){
	var $t = $(this);
	if(url == $t.attr('href')){
		$t.css({'text-decoration':'underline'});
		$t.parent().show().siblings().show();
	}
});

if(document.location.href.match(/com\/jamaica_ocho_rios_tours_excursions\//)) $('#propnav h2').html('<a href="/jamaica_ocho_rios_tours_excursions/">Jamaica Ocho Rios</a>');
else if(document.location.href.match(/com\/costa_rica_atlantic_tours_excursions/)) $('#propnav h2').html('<a href="/costa_rica_atlantic_tours_excursions/">Costa Rica Atlantic</a>');
else if(document.location.href.match(/com\/costa_rica_pacific_tours_excursions/)) $('#propnav h2').html('<a href="/costa_rica_pacific_tours_excursions/">Costa Rica Pacific</a>');
else if(document.location.href.match(/com\/st_lucia_tours_excursions\//)) $('#propnav h2').html('<a href="/st_lucia_tours_excursions/">St. Lucia</a>');
else if(document.location.href.match(/com\/dominica_tours_excursions\//)) $('#propnav h2').html('<a href="/dominica_tours_excursions/">Dominica</a>');
else if(document.location.href.match(/com\/costa_rica_pac%ED/)) $('#propnav h2').html(unescape('<a href="/costa_rica_pac%EDfico/">Costa Rica Pac%EDfico</a>'));
else if(document.location.href.match(/com\/costa_rica_atl%E1/)) $('#propnav h2').html(unescape('<a href="/costa_rica_atl%E1ntico//">Costa Rica Atl%E1ntico</a>'));


/*Update Live Chat Link*/
var l = 'http://sa.live2support.com/ls3/l2seml12917-0-0.html';
if(document.location.href.match(/com\/jamaica_ocho_rios_tours_excursions\//)) l = 'http://sa.live2support.com/ls3/l2seml12917-0-7.html';
if(document.location.href.match(/com\/costa_rica/)) l = 'http://sa.live2support.com/ls3/l2seml12917-0-5.html';
if(document.location.href.match(/com\/welcome_to_rainforest_adventures_st_lucia\//)) l = 'http://sa.live2support.com/ls3/l2seml12917-0-8.html';
if(document.location.href.match(/com\/dominica_tours_excursions\//)) l = 'http://sa.live2support.com/ls3/l2seml12917-0-6.html';
$('.liveChat').attr('href',l);



jQuery.flvlightbox = function(options){
        
    var c = '';
    if(typeof(options)=='string')c=options;
    
    var o = {
        height: '400',
        width: '600',
        content: c,
        modalcss: {
            background:'#000000',
            filter: 'alpha(opacity=70)',
            opacity: .7
        },
        wincss: {
            background: '#FFFFFF',
            border: '1px solid #000000',
            zIndex: '9999'
        }
    };
    $.extend(o,options);
    
    $(document.body).css('overflow','hidden');
    var removeIt = function(){
        $(modal).remove();
        $(win).remove();
        $(window).unbind('resize scroll',moveIt);
        $(document.body).css('overflow','');
    };
    var modal = document.createElement('div');
    $(modal).css($.extend(o.modalcss,{
        position:	'absolute',
        top: $(document).scrollTop()+'px',
        left: $(document).scrollLeft()+'px',
        height: $(window).height()+'px',
        width: $(window).width()+'px'
    })).click(removeIt).appendTo(document.body);
    
    var closebox = document.createElement('div');
    $(closebox).css({
        position: 'absolute',
        cursor: 'pointer',
        top: '-12px',
        left:  (o.width-8)+'px'
    }).html('<img src="/i/SITE_100520_15115843_1EGU2/templates/btn_close.gif">').click(removeIt);
    
    var win = document.createElement('div');
    $(win).css($.extend(o.wincss,{
        position: 'absolute',
        top: ($(document).scrollTop()+($(window).height()-o.height)/2)+'px',
        left: ($(document).scrollLeft()+($(window).width()-o.width)/2)+'px',
        height: o.height+'px',
        width: o.width+'px'
    })).html(o.content).prepend(closebox).appendTo(document.body).animate({
    },500,'linear',function(){
        $(this).animate({
        },500,'linear',function(){
        });
    });
    var moveIt = function(){
        $(win).css({
            top: ($(document).scrollTop()+($(this).height()-o.height)/2)+'px',
            left: ($(document).scrollLeft()+($(this).width()-o.width)/2)+'px'
        });
        $(modal).css({
            top: $(document).scrollTop()+'px',
            left: $(document).scrollLeft()+'px',
            height: $(this).height()+'px',
            width: $(this).width()+'px'
        });
    };
};

});

