/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function() {



    //    $("a.fancy_box").live('click', function (e){
    //        e.preventDefault();
    //        $(this).fancybox({
    //            'transitionIn'		: 'elastic',
    //            'transitionOut'		: 'elastic',
    //            'titlePosition' 	: 'outside',
    //            'titleShow'			: false
    //        });
    //
    //    });
    //

    //        $("a.iframe").fancybox({
    //            'width'			: '85%',
    //            'height'		: '95%',
    //            'autoScale'     	: false,
    //            'transitionIn'		: 'elastic',
    //            'transitionOut'		: 'elastic',
    //            'type'			: 'iframe'
    //        });

    //    $(".iframe").live('click', function (e){
    //        e.preventDefault();
    //        $(this).fancybox({
    //            'width'			: '85%',
    //            'height'		: '95%',
    //            'autoScale'     	: false,
    //            'transitionIn'		: 'elastic',
    //            'transitionOut'		: 'elastic',
    //            'type'			: 'iframe'
    //        });
    //
    //    });

    //    $("a.fancy_box").fancybox({
    //        'transitionIn'		: 'elastic',
    //        'transitionOut'		: 'elastic',
    //        'titlePosition' 	: 'outside',
    //        'titleShow'			: false
    //    });
    //
    //    $(".iframe").fancybox({
    //        'width'			: '85%',
    //        'height'		: '95%',
    //        'autoScale'     	: false,
    //        'transitionIn'		: 'elastic',
    //        'transitionOut'		: 'elastic',
    //        'type'			: 'iframe'
    //    });

    // fancybox ends

    // CONTACT FORM
    $("#contactFormContainer").load('contact.php');
    // SCROLL TO TOP
    $('a[href*=#]').click(function() {

        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
            && location.hostname == this.hostname) {

            var $target = $(this.hash);

            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');

            if ($target.length) {

                var targetOffset = $target.offset().top;

                $('html,body').animate({
                    scrollTop: targetOffset
                }, 1000);

                return false;

            }

        }

    });

});

function fs_popupCentered(url) {

        var popupWidth    = 850;
        var popupHeight   = 610;
        var popX 					= (screen.width - popupWidth) / 2;
        var popY					= (screen.height - popupHeight) / 2;
        var windowUrl			= url ;
        var windowOptions = "width="+ popupWidth +", height="+ popupHeight + ", top="+ popY +", left="+ popX + ", status=yes, toolbar=no, location=no ,scrollbars=1";

        //NOTE: dont use a variable or a string with spaces in it for window title, IE doesnt like it at all
        //and it the title is ignored by both browsers anyway !
        var windowObject	= window.open(windowUrl, 'window_title_is_ignored', windowOptions);
}


