// added
function str_repeat ( $string, $repeat ) {
    var out	= '';

    for ( var i = 0; i< $repeat; i++ )
        out	+= $string;

    return out;
}
var directories	= String ( window.location ).match ( /\/[a-z0-9_.:]{1,}[\/]?/gi );
var pathToRoot	= str_repeat ( '../', directories.length );

/**
*   @name   :   Site
*/

/**
*   @name   :   Page
*   @type   :   Class
*   @desc   :   encapsulates Site functionality
*/
function Page(){}

/**
*   @name   :   include
*   @nmsp   :   Site
*   @type   :   Function
*   @desc   :   Dynamically inlcude external scripts
*/

Page.include	= function ( sScriptPath, sCSSPath )
{
	var pf		= document.getElementById ( "iPathFinder" );
	var pt		= ( !pf || !pf.src ) ? '/' : String ( pf.src ).substring ( 0, String ( pf.src ).indexOf ( "_assets/js/" ) );

	var oHead		= document.getElementsByTagName ( 'head' ).item ( 0 );
	var oScript		= document.createElement ( 'script' );

	oScript.src		= pt + sScriptPath + '?' + String ( new Date ( ) );
	oScript.type	= 'text/javascript';
	oHead.appendChild ( oScript );

	if ( sCSSPath ) {
		var oStyle	= document.createElement ( 'link' );
		oStyle.href	= pt + sCSSPath;
		oStyle.type	= 'text/css';
		oStyle.rel	= 'stylesheet';
		oHead.appendChild ( oStyle );
	}
}

Page.scriptname=function(){
    return window.location;
}

/**
*   IMPORTANT   :   Good design would only have one entry point
                    into your application. Javascript applied rule
                    based rather than ad-hoc
*/
window.onload=function(){
    setTimeout(function(){
        Page.include('_assets/js/specialised/PageExtensions/PageExtensions.js');   //  application.
        Page.include('_assets/js/global/imports.js');
    },2);
}

