//Anchor Scrolling
jQuery('.clear_prevent a').click(function(event){
    event.preventDefault();
});

jQuery('.pageTop').live('click',function(event){
    event.preventDefault();
});

function scrollWin(container){
    var negativeScroll = 190;
    $('html,body').animate({
        scrollTop: $("#"+container).offset().top-negativeScroll
    }, 1200);
}
function Contact() {
    this.toggleContainer = function(){
        if($('.contact_formLink').hasClass('selected') ){
            $('.contact_formLink').removeClass('selected');
            $("#contact_form").animate({
                opacity: 0
            }, 0 );
            $("#contact_form").animate({
                height: "0",
                opacity: 0
            }, 500, function(){

            });
            $('body').scrollTo( { top:0 , left:0}, 1000, {easing:'easeInOutCubic'});
        }else{
            $('.contact_formLink').addClass('selected');
            $("#contact_form").animate({
                opacity: 1
            }, 0 );
            $("#contact_form").animate({
                height: "900px",
                opacity: 1
            }, 500, function(){

            });
            $('body').scrollTo( { top:0 , left:0}, 1000, {easing:'easeInOutCubic'});
        }
    }
}

jQuery(document).ready(function(){
    if( $('body').hasClass('contact_formContent') ){
        $(".contact_formContent").fadeIn();
    }

    jQuery(window).trigger('resize');

    jQuery('#great_fancybox').fancybox({
        'transitionIn'	:	'elastic',
        'transitionOut'	:	'elastic',
        'speedIn'		:	600,
        'speedOut'		:	200,
        'overlayShow'	:	true,
        'type'	:	'iframe',
        'width' : document.body.clientWidth,
        'height' : 920,
        'overlayColor': '#000000',
        'scrolling': 'yes'

    });
    jQuery('#inline_great_fancybox').fancybox({
        'transitionIn'	:	'elastic',
        'transitionOut'	:	'elastic',
        'speedIn'		:	600,
        'speedOut'		:	200,
        'overlayShow'	:	true,
        'type'	:	'iframe',
        'width' : document.body.clientWidth,
        'height' : 920,
        'overlayColor': '#000000',
        'scrolling': 'yes'

    });

    var h90 = $(window).height();
    h90 = Math.round(h90 * .9);
    $(window).bind("resize", function(e){
        var h90 = $(window).height();
        h90 = Math.round(h90 * .9);
        $('#fancybox-content').height(h90);

    });
});

