/**
* Javascript Libary (JLib)
*
* A collection of my javascripts :)
*
* @author Jan Lengowski 
* @copyright Jan Lengowski 
*/

/**
* Global JLib Objects
*/
lib = new Object;

lib.path = "js/";
lib.availableFiles = ["browserCheck", "formCheck"];

/**
* Global Jlib events
*
*/
onload = function()
{
    /*lib.onload();*/
}

/**
* JLib onload event
*/
lib.onload = function()
{
	/*
    window.status = "JLib initialized";
    return true;
	*/
}

/**
* Check if some value is in an array
*/
lib.inArray = function(needle, haystack)
{
    for (i=0; i<haystack.length; i++)
    {
        if (haystack[i] == needle)
        {
            return true;
        }
    }
    return false;
}

/**
* Include function
* @param string Which file to include
* @return bool
*/
lib.include = function(srcFile)
{   
    if (!this.inArray(srcFile, this.availableFiles))
    {
        return false;
    }
    
    document.writeln('<script type="text/javascript" src="' + this.path + srcFile + '.js"></script>');
    
    return true;
}

/**
* Include browserCheck.js
*/
lib.include("browserCheck");
