
/*-------------------------------------------------------------------------------------------------------
   
    Function for looping through long lists of JS includes this function, when fed an array will
    write the script tag to include the specified files as JS include files.
    
    NOTE: This written to look in the 'js' folder under the site's root folder (http://domain.com/js/)
    
    Directions:
	  config.loadComponents( { foldername:['filename.js'] } );
    
    Example:
	  config.loadComponents( { jquery:['jquery-ui'] } );
	  OUTPUT: <script src='http://domain.com/js/jquery/jquery-ui.js' type='text/javascript'></script>

-------------------------------------------------------------------------------------------------------*/

config.loadComponents = function (components) {
    for ( var key in components ) {
	  var obj = components[key];
	  for (var prop in obj) {
		var fileName = obj[prop];
		var ext = '.js';
		if (fileName.indexOf(ext) > -1){ext='';}
		var file = key + "/" + fileName + ext;
		document.write(unescape("%3Cscript src='" + config.jsLibrary + '/' + file + "' type='text/javascript'%3E%3C/script%3E"));
	  }
    }
}

config.loadComponents( {
    lib:[
	  'jquery.js',
	  'chili-1.7.pack.js',
	  'jquery.easing.js',
	  'jquery.delay.js',
	  'jquery.dimensions.js',
	  'jquery.hoverIntent.minified.js',
	  'jquery.corner.js',
	  'jquery.selectbox-0.4.js',
	  'jquery.validationEngine.js'
    ]
    } );
	  //'jquery.facebox/jquery.facebox',
