baseurl = "";

jQuery(document).ready(function()
{
    sw = screen.width;
    sh = screen.height;
    tw=0;
    if(sw == 1024)
    {
        //tw=-200;
    }
    else
    {
        //tw = -(sw*16)/100;
    }

    jQuery('.scroll-pane').jScrollPane();
    jQuery('.gliders').animate(
    {
        //position: 'absolute',
        right: tw
    }, 3000);

    jQuery('.glider').hover(function()
    {
        //jQuery(this).effect("highlight",{color: '#333'});
        jQuery(this).children('a').children('.img').slideToggle(300)
    });

    //jQuery('.glider').mouseout(function()
    //{
    //    jQuery(this).effect("highlight",{color: '#ccc'});
    //    jQuery(this).children('.img').slideUp('slow');
    //});

    // ------ when click on web----
    jQuery('#web').click(function()
    {
        jQuery('.content_text').slideUp(1000);
        jQuery('.glider').animate(
        {
            'margin-top' : '0',
            'margin-right' : '0',
            'margin-left' : '0'
        }, 1000);

        jQuery('.loadr').fadeIn();
        //-----ajax stuff---
        URL = baseurl+"getWeb.php";
        dataString="pageId=2";
        jQuery.ajax({
        type: "POST",
        url: URL,
        data: dataString,
        cache: false,
        success: function(html)
        {
            //jquery('#text').delay(2000).empty();
            jQuery('#text').html(html);
            imz_ldr();
            jQuery('.loadr').delay(500).fadeOut();
            jQuery('.content_text').slideDown(1000);
        }
        });

        loadx();
    });

    // ------ when click on graphic----
    jQuery('#gfx').click(function()
    {
        jQuery('.content_text').slideUp(1000);
        jQuery('.glider').animate(
        {
            'margin-top' : '0',
            'margin-right' : '0',
            'margin-left' : '0'
        }, 1000);

        jQuery('.loadr').fadeIn();
        //-----ajax stuff---
        URL = baseurl+"getWeb.php";
        dataString="pageId=1";
        jQuery.ajax({
        type: "POST",
        url: URL,
        data: dataString,
        cache: false,
        success: function(html)
        {
            //jquery('#text').delay(2000).empty();
            jQuery('#text').html(html);
            imz_ldr();
            jQuery('.loadr').delay(500).fadeOut();
            jQuery('.content_text').slideDown(1000);
        }
        });

        loadx();
    });

    // ------ when click on Photo----
    jQuery('#foto').click(function()
    {
        jQuery('.content_text').slideUp(1000);
        jQuery('.glider').animate(
        {
            'margin-top' : '0',
            'margin-right' : '0',
            'margin-left' : '0'
        }, 1000);

        jQuery('.loadr').fadeIn();
        //-----ajax stuff---
        URL = baseurl+"getFoto.php";
        dataString="pageId=3";
        jQuery.ajax({
        type: "POST",
        url: URL,
        data: dataString,
        cache: false,
        success: function(html)
        {
            //jquery('#text').delay(2000).empty();
            jQuery('#text').html(html);
            imz_ldr();
            jQuery('.loadr').delay(500).fadeOut();
            jQuery('.content_text').slideDown(1000);
        }
        });

        loadx();
    });

    // ------ when click on about----
    jQuery('#about').click(function()
    {
        jQuery('.content_text').slideUp(1000);
        jQuery('.glider').animate(
        {
            'margin-top' : '0',
            'margin-right' : '0',
            'margin-left' : '0'
        }, 1000);

        jQuery('.loadr').fadeIn();
        //-----ajax stuff---
        URL = baseurl+"getAbout.php";
        dataString="";
        jQuery.ajax({
        type: "POST",
        url: URL,
        data: dataString,
        cache: false,
        success: function(html)
        {
            //jquery('#text').delay(2000).empty();
            jQuery('#text').html(html);
            imz_ldr();
            jQuery('.loadr').delay(500).fadeOut();
            jQuery('.content_text').slideDown(1000);
        }
        });

        loadx();
    });

    // ------ when click on contact----

    jQuery('#contact').click(function()
    {
        jQuery('.content_text').slideUp(1000);
        jQuery('.glider').animate(
        {
            'margin-top' : '0',
            'margin-right' : '0',
            'margin-left' : '0'
        }, 1000);

        jQuery('.loadr').fadeIn();
        //-----ajax stuff---
        URL = baseurl+"getContact.php";
        dataString="";
        jQuery.ajax({
        type: "POST",
        url: URL,
        data: dataString,
        cache: false,
        success: function(html)
        {
            //jquery('#text').delay(2000).empty();
            jQuery('#text').html(html);
            imz_ldr();
            jQuery('.loadr').delay(500).fadeOut();
            jQuery('.content_text').slideDown(1000);
        }
        });

        loadx();
    });


    // ------ when click on new cat----
    jQuery('#nCat').click(function()
    {
        jQuery('.content_text').slideUp(1000);
        jQuery('.glider').animate(
        {
            'margin-top' : '0',
            'margin-right' : '0',
            'margin-left' : '0'
        }, 1000);

        jQuery('.loadr').fadeIn();
        //-----ajax stuff---
        URL = baseurl+"getWeb.php";
        dataString="pageId=4";
        jQuery.ajax({
        type: "POST",
        url: URL,
        data: dataString,
        cache: false,
        success: function(html)
        {
            //jquery('#text').delay(2000).empty();
            jQuery('#text').html(html);
            imz_ldr();
            jQuery('.loadr').delay(500).fadeOut();
            jQuery('.content_text').slideDown(1000);
        }
        });

        loadx();
    });

});

function loadx()
{
            var api = jQuery('.scroll-pane').jScrollPane(
            {
                showArrows:false,
                maintainPosition: false,
                autoReinitialiseDelay: 70,
                autoReinitialise: true
            }
        ).data('jsp');
        api.reinitialise();
}

function imz_ldr()
{
    $("a.gallery").fancybox({
        'titleShow'		: false,
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'elastic'
    });

    $("a[rel=imzs]").fancybox({
        'transitionIn'	: 'elastic',
        'transitionOut'	: 'elastic',
        'titlePosition' 	: 'over',
        'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
        }
    });

     jQuery('.content_text').animate(
    {
        'margin-top': '101px'
    }, 100);
     jQuery('.gliders').animate(
    {
        //'margin-top': '0'
    }, 1000);
}

