jQuery(document).load(function() {

	$("a").each(function(){this.onmouseup = this.blur();});
	$('a').click(function() { $(this).blur(); });

 
    var fnaviConfig = {
        interval: 100,
        sensitivity: 10,
        over: addFnavi,
        out: removeFnavi
    }
    $('#fnavi > li').hoverIntent(fnaviConfig);
    $('blockquote').hover(
        function() { $(this).stop().animate({ color:"red" }, 250) },
        function() { $(this).stop().animate({ color:"black" }, 250) }
    );
        
     
    var url = location.href.substring((location.href.lastIndexOf("/")));
       
    $("a[href='" + url + "']").parent('li').addClass('active');
    
    /*
    var theWindow        = $(window),
        $bg              = $("#bg"),
        aspectRatio      = $bg.width() / $bg.height();

    function resizeBg() {

            if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
                $bg
                    .removeClass()
                    .addClass('bgheight');
            } else {
                $bg
                    .removeClass()
                    .addClass('bgwidth');
            }

    } 
        */
    
    
});

/*
function footer() {
    jQuery('#fnavi > li > a').hover(
        function() { jQuery(this).next('ul').stop().show('200') },
        function() { jQuery(this).next('ul').stop().hide('200') }        
    );
}
*/

function addFnavi(){  
    $(this).addClass("hovering");  
}  
function removeFnavi(){  
    $(this).removeClass("hovering");  
} 

jQuery(document).ready(function() {

	jQuery('#logo').fadeIn(1); 
	
});

function getUrlVar(name)
{
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if(results == null)
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}

jQuery.extend(jQuery.browser, {SafariMobile : navigator.userAgent.toLowerCase().match(/iP(hone|ad)/i) } );

