//normal
Cufon.replace('.neoSansStyle, .neoSansBoldStyle, h1, h2, h4, .dialogBox h3', { fontFamily: 'NeoSans' });
//normal with shadow
Cufon.replace('.neoSansItalicStyle, p.shop_price, #shop_top h2, p.payment_heading, span.fr', { fontFamily: 'NeoSans', textShadow: '#fff 0px 1px' });
//medium with shadow
Cufon.replace('.neoSansMediumStyle, #ctl00_mainarea_content1 h3, .tour_right_element h3, #tabs ul li a, #qs label', { fontFamily: 'NeoSansMedium', textShadow: '#fff 0px 1px' });
//Nav neo sans has its own declaration as it is coloured differently. NAV ONLY
Cufon.replace('#navigation ul#nav > li > a, .refFont', { fontFamily: 'NeoSansMedium', textShadow: '#28851c -1px -1px', hover: { color: '#ace994'} });
Cufon.replace('.applied', { fontFamily: 'NeoSansMedium', textShadow: '#959186 -1px -1px'});
Cufon.replace('ul#cal a', { fontFamily: 'NeoSansMedium', hover: { color: '#fff', textShadow: '#28851c -1px -1px'} });

$(document).ready(function() {

$(".rem-link .refine-section").last().addClass('noBorder');
$(".refine-content .refine-section").last().addClass('noBorder');


/*small modals*/
$("#dialog, #genericContact, #brochureRequest, #newsSignup, #chooseMoreDates").dialog({ bgiframe: true, autoOpen: false, position: 'center', width: 440, modal: true, open: function (type, data) { $(this).parent().appendTo(jQuery("form:first")); } }); 

$('a.conactGeneric').click(function() { $('#genericContact').dialog('open'); return false; }); 
//$('a.registerIntbtn').click(function() { $('#registerInt').dialog('open'); return false; }); 
$('a.brochureRequest').click(function() { $('#brochureRequest').dialog('open'); return false; }); 
$('a.newsSignup').click(function() { $('#newsSignup').dialog('open'); return false; }); 
$('a.contactManager').click(function() { $('#dialog').dialog('open'); return false; });

/*Large Search Modals*/
$("#chooseMoreCnt, #chooseMoreCat, #chooseMorePr, #chooseMoreRegion, #chooseMorePrices,#chooseMoreLoc, #chooseMoreCnt2, #chooseMoreCat2, #chooseMoreSpecies, #chooseMoreSpecies2").dialog({ bgiframe: true, autoOpen: false, width: 640, modal: true, open: function(type, data) { $(this).parent().appendTo(jQuery("form:first")); } }); 

$('a.chooseMoreCnt').click(function() { $('#chooseMoreCnt').dialog('open'); return false; }); 
$('a.chooseMoreLoc').click(function() { $('#chooseMoreLoc').dialog('open'); return false; }); 
$('a.chooseMoreCat').click(function() { $('#chooseMoreCat').dialog('open'); return false; }); 
$('a.chooseMorePr').click(function() { $('#chooseMorePr').dialog('open'); return false; }); 
$('a.chooseMoreRegion').click(function() { $('#chooseMoreRegion').dialog('open'); return false; }); 
$('a.chooseMoreSpecies').click(function() { $('#chooseMoreSpecies').dialog('open'); return false; }); 

$('a.mc3r').click(function() { $('#chooseMoreCat2').dialog('open'); return false; }); 
$('a.mc3cat').click(function() { $('#chooseMoreCat2').dialog('open'); return false; }); 
$('a.mc3con').click(function() { $('#chooseMoreCnt2').dialog('open'); return false; }); 
$('a.mc3p').click(function() { $('#chooseMorePrices').dialog('open'); return false; }); 
$('a.mc3species').click(function() { $('#chooseMoreSpecies2').dialog('open'); return false; }); 
$('a.mc3d').click(function() { $('#chooseMoreDates').dialog('open'); return false; }); 

$("#detailedMap").dialog({ bgiframe: true, autoOpen: false, width: 574, modal: true }); 
$('a.detailedMap').click(function() { $('#detailedMap').dialog('open'); return false; }); 

// register interest form
	//define config object

$('.registerIntbtn').click(
	function (){

	var tt = $(this).attr('NavigateUrl');		

	//alert(tt);
	
	var dialogOpts = {
	modal: true,
	bgiframe: true,
	autoOpen: false,
	position: 'center',
	height: 590,
	width: 440,
	open: function() {
	//display correct dialog content
	
	$("#reg-cont").load(tt);}
	};

	$("#reg-cont").dialog(dialogOpts);	//end dialog

	$("#reg-cont").dialog("open");
	return false;
	}
);

//form field default values onfocus
$('#ctl00_mainarea_content1 input:text, #header input, form textarea, input.dobYear').each(function(){
    $.data(this, 'default', this.value);
}).focus(function(){
    if ($.data(this, 'default') == this.value) {
        this.value = '';
    }
}).blur(function(){
    if (this.value == '') {
        this.value = $.data(this, 'default');
    }
});

var $tabs = $('.tabbed').tabs();    
$('.my-text-link').click(function() { $tabs.tabs('select', 4); $('.my-text-link').hide(); return false; });    
$('li.five a').click(function() { $('.my-text-link').hide(); }); $('li.one a, li.two a, li.three a, li.four a').click(function() { $('.my-text-link').show(); }); 


function megaHoverOver() { $(this).find(".sub").stop().fadeTo('fast', 1).show(); }
function megaHoverOut() {
 $(this).find(".sub").stop().fadeTo('fast', 0, function() {
     $(this).hide();
 });
}
var config = {
 sensitivity: 2,   
 interval: 50,    
 over: megaHoverOver,   
 timeout: 0,  
 out: megaHoverOut    
};

$("ul#nav li .sub").css({ 'opacity': '0' });
$("ul#nav li").hoverIntent(config);

$("#header img").hover(function(){
$(this).stop().fadeTo(200, 0.8);},function(){$(this).stop().fadeTo(300, 1.0); });

$("table.TourGrid table:last").addClass("pagertable");

$(".expandable_box").css("display","none");

$('a.MenuTop').click(function(){   
$(this).toggleClass("MenuTopon");  
var id = $(this).attr("id");
var number = id.substring(6,id.length);
$("#myDiv"+number).slideToggle("slow");});   






// end doc ready
});


// tour extension external file
$(document).ready(function () {

    $('a.extension-lb').click(function (e) {
        var id = this.id;
        //alert(id);
        e.preventDefault();
        var divid = "#pextension" + id;
        $(divid).dialog({
            bgiframe: true,
            autoOpen: false,
            position: 'center',
            width: 650,
            modal: true,
            open: function (type, data) {
                $(this).load('tour_extension_lb.aspx?id=' + id, function () {
                    $(this).dialog('option', 'position', 'center');
                });
                $(this).parent().appendTo(jQuery("form:first"));
            }
        });
        $(divid).dialog('open'); return false;
    });

});//end tour extension external file



$(document).ready(function() {
$(".tweet").tweet({ username: "naturetrektours", count: 1, loading_text: "loading tweets..." });
});




