﻿
		function getcurrencyinfo(){

      $("#currencyinfo").text('Loading...');

      $("#currencyinfo").load("/js/currencyrates.php");

    }



$(document).ready(function(){



    $("a#inline").fancybox({

      'zoomSpeedIn':		300, 

      'zoomSpeedOut':	300, 

      'frameWidth': 770,

      'frameHeight': 478

    });



    $("#nav li").hover(

      function () {

        $(this).children("ul").fadeIn("500");

        $(this).addClass("active");

        return false;

      }, 

      function () {

        $(this).removeClass("active");

        $(this).children("ul").fadeOut("500");

      }

		);

		$("#skype").hover(

      function () {

        $(this).children("ul").fadeIn("500");

        $(this).addClass("active");

      }, 

      function () {

        $(this).removeClass("active");

        $(this).children("ul").fadeOut("500");

      }

		);

      

		$("ul.diagrammap li").hover(

      function () {

        $(this).children("blockquote").fadeIn("500");

      },

      function () {

        $("ul.diagrammap li blockquote").hide();

      }

      );

      

		$("ul.visainfo h5").click(

      function() {

        $(this).siblings("div.visainfo").slideToggle();

      }

		);

		

    getcurrencyinfo();

		

		$("#nav li ul").corner('5px top');

		$("body.safari .diagrammap blockquote,body.chrome .diagrammap blockquote,body.gecko .diagrammap blockquote,body.opera .diagrammap blockquote").corner('5px');

		

		$("body.safari #nav li ul,body.chrome #nav li ul,body.gecko #nav li ul,body.opera #nav li ul").corner('5px bottom');

		$(".sidebar > li, p.mission").corner('5px');

		$("body.ie .sidebar > li.white").corner('0px');

		$("body.ie .sidebar > li.white").css({border : '1px solid #ddd'});

		$("body.page-id-10 .post ul li a").corner('6px');

		$("body.safari #specialmessage,body.chrome #specialmessage,body.gecko #specialmessage,body.opera #specialmessage").corner('7px');

		

		function hidebacktotop(){

      //show back to top link if needed

      if(document.documentElement.scrollHeight&&document.body.scrollHeight){

        var winheight = parseInt(document.documentElement.scrollHeight)

        var boheight = parseInt(document.body.scrollHeight)

        if (winheight < boheight) 

        {

          $("#backtotop").hide();

        }else{

          $("#backtotop").fadeIn();

        }

      }

    }

    

    hidebacktotop();

    

    var resizeTimer = null;

    $(window).bind('resize', function() {

    if (resizeTimer) clearTimeout(resizeTimer);

    resizeTimer = setTimeout(hidebacktotop(), 100);

    });

		

});
