/**
 * VARIABLES
 *
 */
    var debug = false;

  
/**
 * ISSET
 *
 * PHP style isset() method for variables and objects.
 */
    function isset(variable)  {
    	try {
    		if(typeof(eval(variable)) != 'undefined')
    		if(eval(variable) != null) return true;
    	} catch(e) {}
    	return false;
    }


/**
 * TRACE
 *
 * Browser safe console logging method.
 */
    function trace(msg) {
        try { window.console.log(msg) } catch (err) {}
    }


/**
 * INIT
 *
 * Init objects
 */
    $(document).ready(function(){
        //init_menu();
    });
    
    
/**
 * MENU
 *
 * Init menu
 */
    function init_menu() {
        $('#nav a, h1 a').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 - 75; // slight offset
                    $('html,body').animate({ scrollTop: targetOffset }, 1000);
                    return false;
                }
            }
        });
        
    }
    

/**
 * TOOLTIPS
 *
 * Init Tooltips
 */
    
    function init_tooltips() {
        $(".tooltip").hover(function() { $(this).append("<div class='tt'><u></u><b>" + $(this).attr("title") + "</b></div>"); }, function() { $(".tt").remove(); });
    }



/**
 * POPUP
 *
 * Init popups
 */
                             
	function init_popups() {
	    $("a.popup").fancybox({ 
	        inline: true, overlayOpacity: 0.2, margin:0, padding:0, autoDimensions: false,
            width: 500, overlayColor: "#000000", transitionIn: "fade", transitionOut: "fade", titlePosition: "over" 
        });
    }
                            

