Cufon.set('fontFamily', 'DendaNewCTT').set('separate', 'none');
Cufon.replace('h1, .cufon, .h2cufon h2, #m1bot li, .m2 li');
Cufon.replace('#contacts h2', {
    color: '-linear-gradient(#939ba5, #59636e, #535d67)'
}).replace('#contacts p', {
    color: '-linear-gradient(#11569f, #0f4a8d, #0f4a8d)'
});


$(function(){
    initMdrop($('#m1 li'));
    $('.jqtransform').jqTransform();
    $('.gallery-photo a').fancybox({padding: 0, hideOnContentClick: false});
    $('.gallery-video a').fancybox({padding: 0, frameWidth: 350, frameHeight: 310, callbackOnStart: fancyVideoStart, callbackOnClose: fancyVideoClose, hideOnContentClick: false});
    $('.gallery-vf a').fancybox({padding: 0, frameWidth: 350, frameHeight: 310, callbackOnStart: fancyVideoStart, callbackOnClose: fancyVideoClose, hideOnContentClick: false});
	$('#premium-video a').fancybox({padding: 0, frameWidth: 350, frameHeight: 310, callbackOnStart: fancyVideoStart, callbackOnClose: fancyVideoClose, hideOnContentClick: false});
	
});


function initMdrop(li) {
    var m2 = $('.m2');
    li.hover(
        function(){
            m2.css('position', 'static');
            $('.mdrop', this).show();
        },
        function(){
            $('.mdrop', this).hide();
            m2.css('position', 'relative');
        }
    );
}


function fancyVideoStart() {
    $('#fancy_bg').css({'z-index': 70});
    $('#fancy_close').css({'top': -21, 'right': -21});
    $('.fancy_bg_nw').css({'top': -50, 'left': -50});
    $('.fancy_bg_n').css({'top': -50, 'left': 15, 'right': 15}).width(320);
    $('.fancy_bg_ne').css({'top': -50, 'right': -50});
    $('.fancy_bg_e').css({'right': -50, 'top': 15, 'bottom': 15}).height(288);
    $('.fancy_bg_se').css({'bottom': -50, 'right': -50});
    $('.fancy_bg_s').css({'bottom': -50, 'left': 15, 'right': 15}).width(320);
    $('.fancy_bg_sw').css({'bottom': -50, 'left': -50});
    $('.fancy_bg_w').css({'left': -50, 'top': 15, 'bottom': 15}).height(288);
}


function fancyVideoClose() {
    $('#fancy_bg').css({'z-index': 101});
    $('#fancy_close').css({'top': -25, 'right': -25});
    $('.fancy_bg_nw').css({'top': -54, 'left': -54});
    $('.fancy_bg_n').css({'top': -54, 'left': 11, 'right': 11}).width('auto');
    $('.fancy_bg_ne').css({'top': -54, 'right': -54});
    $('.fancy_bg_e').css({'right': -54, 'top': 11, 'bottom': 11}).height('auto');
    $('.fancy_bg_se').css({'bottom': -54, 'right': -54});
    $('.fancy_bg_s').css({'bottom': -54, 'left': 11, 'right': 11}).width('auto');
    $('.fancy_bg_sw').css({'bottom': -54, 'left': -54});
    $('.fancy_bg_w').css({'left': -54, 'top': 11, 'bottom': 11}).height('auto');
}

function ProcOnFocusInput(fieldPinter,defString){
        if(fieldPinter.value==defString)fieldPinter.value="";
        }


function ProcOnBlurInput(fieldPinter,defString){
        if(fieldPinter.value=="")fieldPinter.value=defString;
        }
