// JavaScript Document


var Init_class = function(){
	this.lang = 'fr';
	this.lang_url_prefix ="";
	this.langArray = new Array('en', 'fr');
	this.rootPath="";
	this.actionsPath="";
	this.uploadPath="";
	this.rewriteModData="";
	this.onLoadObjects = new Array();
	this.onLoadObjectsNr = 0;
    this.currentUrl = "";
	this.apsoluteUrl = "";
    this.userfilesPath ="userfiles/";
    this.htmlPath ="html/";
    
	
}

Init_class.prototype = {
	alert:function(){
		alert(this.onLoadObjectsNr);
	},
	addOnLoadObject:function(obj)
	{
		this.onLoadObjects[this.onLoadObjectsNr] = obj;
		this.onLoadObjectsNr = this.onLoadObjectsNr +1;
	}
	,
	getOnLoadObjects:function()
	{
		return [this.onLoadObjects, this.onLoadObjectsNr];
	}
	,
    getRootPath :function(){
        return this.rootPath;
    }
    ,
	getUserfilesPath :function(){
        return this.userfilesPath;
    }
    ,
    getHtmlPath :function(){
		return this.htmlPath;
	}
	,
	getActionsPath :function(){
		return this.actionsPath;
	}
	,
	getLangUrlPrefix :function(){
        return this.lang_url_prefix;
    }
    ,
    getLanguage :function(){
        return this.lang;
    }
    ,
    getApsoluteUrl :function(){
		return this.apsoluteUrl;
	}
	,
	setRootPath: function(path)
	{
		this.rootPath = path;
	}
	,
	setActionsPath: function(path)
	{
		this.actionsPath = path;
	}
	,
	setLanguage: function(lang)
	{
		this.lang = lang;
	}
	,
	setLangUrlPrefix: function(lang)
	{
		this.lang_url_prefix = lang;
	}
	,
	setLanguageArray: function(array)
	{
		this.langArray = array;
	}
	,
	setup: function(rootPath, actionsPath, uploadPath, LUP, lang, url, ap_url)
	{
		this.setRootPath(rootPath);
		this.setActionsPath(actionsPath);
		this.setUploadPath(uploadPath);
		this.setLangUrlPrefix(LUP);
		this.setLanguage(lang);
        this.setCurrentUrl(url);
		this.setApsoluteUrl(ap_url);
	}
	,
	setCurrentUrl: function(url)
    {
        this.currentUrl = url;
    }
    ,
    setApsoluteUrl: function(url)
	{
		this.apsoluteUrl = url;
	}
	,
	setUploadPath: function(path)
	{
		this.uploadPath = path;
	}
	,
	getCurrentUrl: function()
	{
		return this.currentUrl;
	}
	,
	getUploadPath: function()
	{
		return this.uploadPath;
	}
	,
	onLoad:function()
	{
		//this.getRootPath();
	}
    ,
    zIndexMax:function(Element, zInd)
    {
        var obj = this;
        var zMax = zInd;
        Element.childElements().each(
            function(elem){
                
                if(elem.childElements().length>0)
                {
                    var zMaxResult = obj.zIndexMax(elem, zMax)
                    if(zMax < zMaxResult)
                        zMax = zMaxResult;
                }
                if(elem.getStyle('z-index') && elem.getStyle('z-index') > zMax ){
                    zMax = parseInt(elem.getStyle('z-index'));
                }
            }
        )
        return zMax;
    }
}

var InitObj = new Init_class();

