$(document).ready(function(){
    $('.hasNav').mouseenter(function(){$(this).children('ul').show();})
    $('.hasNav').mouseleave(function(){$(this).children('ul').hide();})
    
    $('.newsLetterLink').click(function(e){
        e.preventDefault();
        openNewsletterModal()
    });
    
    $('#linkMore').mouseenter(function() { $(this).children('a').css('color', '#B4955C'); $('#menuMore').addClass('menuRoll').css('visibility', 'visible'); })
    $('#linkMore').mouseleave(function() { $(this).children('a').css('color', '#3D372D'); $('#menuMore').css('visibility', 'hidden').removeClass('menuRoll'); })
    
});


function openNewsletterModal() {
    $('#modal_text').modal({
        appendTo: 'form',
        escClose: true,
        closeHTML: '<a class="modalCloseImg" title="' + closeTxt + '">X ' + closeTxt + '</a>',
        containerCss: { 'width': '726px' },
        onShow: function(dialog) {           
            if($(countryDrpdwnID).val() == countryVal) {
                $('.disclaimer_id').css({'display': 'block'});
                $('#modal_text .cont').addClass('cont_us');
            }
            $("a.btn_close", dialog.data).click(function() {
                $.modal.close();
            });
        },
        onOpen: {
        },
        persist: true
    });
}

function openThankYouModal() {
    $('#thankUMsg').modal({
        escClose: true,
        containerCss: { 'width': '553px !important' },
        closeHTML: '<a class="modalCloseImg closeThank" title="' + closeTxt + '">X ' + closeTxt + '</a>'
    });
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}
String.prototype.htrim = function() {
	return this.replace(/#/,"");
}

function hideCloseBtn() {
    $('a.modalCloseImg').css({'display':'none'});
}

function showCloseBtn() {
    $('a.modalCloseImg').show();
}
