//jCalix -- © 2010 Marc-Emmanuel Ramage & NVN STUDIOS
//jCalix sections
/*...............Specific.................*/

var base_url = 'http://oefshop.agence-tuesday.fr/';
//if (document.location.href.indexOf('www') != -1)
// base_url = 'http://www.nvn.fr/ajax/';

/*...............Core.................*/

var isIE = jCalix_checkNav('msie');
var isIE6 = jCalix_checkNav('msie 6');
var isIE7 = jCalix_checkNav('msie 7');
var isIE8 = jCalix_checkNav('msie 8');
var isChrome = jCalix_checkNav('chrome');
var isSafari = jCalix_checkNav('safari');
var isIphone = jCalix_checkNav('iphone');


//var onloadlist = new Array();
var histo = new Array();
var hashIndex = 0;
var ajax = false;
var currentHashIndex = 0;
var current_hash;
var fr = null;
var htmlpage = null;
var htmlbody = null;
var ajaxtimer = null;
var ajaxtimertick = 300;
var jCalix = new _$();


function _$(obj, options) {
    this.obj = obj;
    this.isArray = false;
    this.onloadlist = new Array();
    this.init = false;
    this.isEmpty = true;
    if(this.obj)
    this.isEmpty = false;
    this.getObject = function(i) {
    	if (i === 0) i = '0';
        if (i != null && this.obj.length > 1)
        return this.obj[i];
        else
        return this.obj;
    }
    this.get = function(i){
    	if(this.obj == null)
    	return null;
    	if (i === 0) i = '0';
    	if(this.isArray)
    	return this.obj[i];
    	else
    	return this.obj;
    }
    this.html = function(h) {

        if (h != null)
        this.obj.innerHTML = h;
        else
        return this.obj.innerHTML;
    }
    this.Display = function(d) {
        if (d)
        this.obj.style.display = d;
        else {
            var sty = this.Attributes('style');
            if(isIE7)
            return sty.display;
            if (sty) {
                if (sty.toLowerCase().indexOf('display: none') != -1)
                return 'none';
                else
                if (sty.toLowerCase().indexOf('display: block') != -1)
                return 'block';
                else
                if (sty.toLowerCase().indexOf('display: fixed') != -1)
                return 'fixed';
                else
                if (sty.toLowerCase().indexOf('display: inherited'))
                return 'inherited';
                else
                return null;
            } else
            return null;
        }
    }
    this.append = function(n) {
        this.obj.appendChild(n);
    }
    this.Parent = function(){
        return new _$(this.obj.parentNode);
    }   
    this.Childs = function(){
        return new _$(this.obj.childNodes);
    }        
    this.remove = function(n) {
        this.obj.removeChild(n);
    }    
    this.val = function(v) {
        if (v)
        this.Attributes('value', v);
        else
        return this.Attributes('value');
    }
    this.Attributes = function(n, v) {
        if (v)
        jCalix_setAttributes(this.obj, n, v);
        else
        return this.obj.getAttribute(n);

    }
    this.RemoveAttributes = function(n) {
    	if(isIE7 && n == 'class')
    	this.obj.removeAttribute('className');
    	else
        this.obj.removeAttribute(n);
    }   
    this.RemoveClass = function(c) {
    	if(isIE7){
    	if(this.obj.getAttribute('className'))	
	    this.obj.removeAttribute('className');
    	}
	    else{
	    if(this.obj.getAttribute('class'))	
	    this.obj.removeAttribute('class');
	    }
    }     
    this.Class = function(c) {
        if (c)
        jCalix_setClass(this.obj, c);
        else
        return jCalix_getClass(this.obj);
    }
    this.Id = function(id) {
        if (id)
        jCalix_setId(this.obj, id);
        else
        return jCalix_getId(this.obj);
    }
    this.Click = function(val){
    	if(val)
        this.obj.onclick = val;	
        else
        return this.obj.onclick;
    }    
    this.Change = function(val){
    	if(val)
        this.obj.onchange = val;	
        else
        return this.obj.onchange;
    }        
    this.Mouseover = function(val){
    	if(val)
        this.obj.onmouseover = val;	
        else
        return this.obj.onmouseover;
    }    
    this.Mouseout = function(val){
    	if(val)
        this.obj.onmouseout = val;	
        else
        return this.obj.onmouseout;
    }    
    this.Mousedown = function(val){
    	if(val)
        this.obj.onmousedown = val;	
        else
        return this.obj.onmousedown;
    }   
    this.Mouseup = function(val){
    	if(val)
        this.obj.onmouseup = val;	
        else
        return this.obj.onmouseup;
    }   
    this.Mousemove = function(val){
    	if(val)
        this.obj.onmousemove = val;	
        else
        return this.obj.onmousemove;
    }   
    this.Keydown = function(val){
    	if(val)
        this.obj.onkeydown = val;	
        else
        return this.obj.onkeydown;
    } 
    this.Keyup = function(val){
    	if(val)
        this.obj.onkeyup = val;	
        else
        return this.obj.onkeyup;
    }   
    this.Keypress = function(val){
    	if(val)
        this.obj.onkeypress = val;	
        else
        return this.obj.onkeypress;
    }                 
    this.Load = function(val){
        this.obj.onload = val;	
    }    
    this.Href = function(){
    	return this.obj.href;	
    }    
    this.Length = function() {
        return this.obj.length;
    }
    this.Style = function() {
        return this.obj.style;
    }
    this.getStyle = function() {
        return jCalix_getStyle(this.obj);
    }
    this.getPosition = function() {
        return jCalix_getPosition(this.obj);
    }
    this.getWidth = function() {
        return this.obj.offsetWidth;
    }
    this.getHeight = function() {
        return this.obj.offsetHeight;
    }
    this.Opacity = function(v) {
    	if (v === 0) v = '0';
        if (v)
        jCalix_setOpacity(this.obj, v);
        else
        return jCalix_getOpacity(this.obj);
    }
    this.Clone = function(){
    	return new _$(this.obj);
    }
    this.Append = function(node){
    	this.obj.appendChild(node.getObject());
    }
    if (typeof _$.initialized == 'undefined') {
        _$.prototype.addOnLoad = function(callback) {
            this.onloadlist[this.onloadlist.length] = callback;
        }
        _$.prototype.onLoad = function() {

            jCalix_loadEvent(this.onloadlist);
        }
        _$.prototype.toArray = function(tab) {
            return jCalix_toArray(tab);
        }
        _$.prototype.strContains = function(s1, s2) {
            return jCalix_containsString(s1, s2);
        }
        _$.prototype.setCookie = function(n, v, d, dom, path) {
            jCalix_setCookie(n, v, d, dom, path);
        }
        _$.prototype.getCookie = function(n) {
            return jCalix_getCook(n);
        }
        _$.prototype.checkNavigator = function(n) {
            return jCalix_checkNav(n);
        }
        _$.prototype.ajaxRequest = function(u, p, po, c) {
            return jCalix_ajax_request(u, p, po, c);
        }
        _$.prototype.ajaxSetLinks = function(options) {
            if (options == null)
            options = {
                callback_before: null,
                callback_in: null,
                callback_after: null
            };
            jCalix_setup_ajax_links(options.callback_before, options.callback_in, options.callback_after);
        }
        _$.prototype.initAjax = function() {
            jCalix_init_ajax();
        }
        _$.prototype.initAjaxHistory = function() {
            jCalix_init_history();
        }
        _$.prototype.addHistoryEntry = function(u, p) {
            jCalix_add_history_entry(u, p);
        }
        _$.prototype.CreateElement = function(n) {
            return new _$(document.createElement(n));
        }      
        
        _$.prototype.capture = function(ob) {
            var n = new _$();
            n.obj = ob;
            return n;
        }            
        _$.initialized = true;
    }
    if (obj) {
        var ret;
        if (typeof obj == 'object' || typeof obj == 'function')
        return this;        
        else {
            this.init = true;
            if (options == null)
            options = {
                node: null,
                index1: null,
                index2: null
            };
            if (obj.charAt(0) == '::') {
                obj = obj.split('::');
                obj = obj[1];
                if (options.node) {
                    if (options.index1 != null) {
                        this.obj = options.node.getElementsByTagName(obj)[options.index1];
                        return new _$(this.obj);
                    }
                    else {
                        this.obj = options.node.getElementsByTagName(obj);
                        if (this.obj)
                        if (this.obj.length == 1)
                        return new _$(this.obj[0]);
                        return jCalix_build_object_list(this.obj);
                    }
                } else {
                    if (options.index1 != null) {
                        this.obj = document.getElementsByTagName(obj)[options.index1];
                        return new _$(this.obj);
                    }
                    else {
                        this.obj = document.getElementsByTagName(obj);
                        if (this.obj)
                        if (this.obj.length == 1)
                        return new _$(this.obj[0]);
                        return jCalix_build_object_list(this.obj);
                    }
                }
            }
            if (obj.indexOf('#') != -1) {
                if (obj.indexOf('::') != -1) {
                    obj = obj.split('::');
                    if (document.getElementById(obj[0].substr(1)) == null) {
                        this.obj = null;
                        return new _$(this.obj);
                    }
                    if (options.index1 != null) {
                        if (options.node != null) {
                            this.obj = options.node.getElementById(obj[0].substr(1)).getElementsByTagName(obj[1])[options.index1];
                            return new _$(this.obj);
                        }
                        else {
                            this.obj = document.getElementById(obj[0].substr(1)).getElementsByTagName(obj[1])[options.index1];
                            return new _$(this.obj);
                        }
                    }
                    else {
                        if (options.node != null) {
                            this.obj = options.node.getElementById(obj[0].substr(1)).getElementsByTagName(obj[1]);
                            if (this.obj)
                            if (this.obj.length == 1)
                            return new _$(this.obj[0]);
                            return jCalix_build_object_list(this.obj);
                        }
                        else {
                            this.obj = document.getElementById(obj[0].substr(1)).getElementsByTagName(obj[1]);
                            if (this.obj)
                            if (this.obj.length == 1)
                            return new _$(this.obj[0]);
                            return jCalix_build_object_list(this.obj);
                        }
                    }
                } else
                if (options.node != null) {
                    this.obj = options.node.getElementById(obj.substr(1));
                    return new _$(this.obj);
                }
                else {
                    this.obj = document.getElementById(obj.substr(1));
                    return new _$(this.obj);
                }
            }
            else {
                if (options.index1 != null) {
                    if (obj.indexOf('::') != -1) {
                        obj = obj.split('::');
                        if (options.index2 != null) {
                            if (options.node != null) {
                                ret = jCalix_getElementsByClass(obj[0].substr(1), options.node);
                                if (ret != null) {
                                    if (ret[options.index1] == null)
                                    return new _$(null);
                                    this.obj = ret[options.index1].getElementsByTagName(obj[1])[options.index2];
                                    return new _$(this.obj);
                                }
                                else {
                                    this.obj = null;
                                    return new _$(this.obj);
                                }
                            }
                            else {
                                ret = jCalix_getElementsByClass(obj[0].substr(1));
                                if (ret != null) {
                                    if (ret[options.index1] == null)
                                    return new _$(null);
                                    this.obj = ret[options.index1].getElementsByTagName(obj[1])[options.index2];
                                    return new _$(this.obj);
                                }
                                else {
                                    this.obj = null;
                                    return new _$(this.obj);
                                }
                            }
                        } else {
                            if (options.node != null) {
                                ret = jCalix_getElementsByClass(obj[0].substr(1), options.node);
                                if (ret != null) {
                                    if (ret[options.index1] == null)
                                    return new _$(null);
                                    this.obj = ret[options.index1].getElementsByTagName(obj[1]);
                                    if (this.obj.length == 1)
                                    return new _$(this.obj[0]);
                                    return jCalix_build_object_list(this.obj);
                                }
                                else {
                                    this.obj = null;
                                    return new _$(this.obj);
                                }
                            }
                            else {
                                ret = jCalix_getElementsByClass(obj[0].substr(1));
                                if (ret != null) {
                                    if (ret[options.index1] == null)
                                    return new _$(null);
                                    this.obj = ret[options.index1].getElementsByTagName(obj[1]);
                                    if (this.obj.length == 1)
                                    return new _$(this.obj[0]);
                                    return jCalix_build_object_list(this.obj);
                                }
                                else {
                                    this.obj = null;
                                    return new _$(this.obj);
                                }
                            }
                        }
                    } else {
                        if (options.node != null) {
                            ret = jCalix_getElementsByClass(obj.substr(1), options.node);
                            if (ret != null) {
                                this.obj = ret[options.index1];
                                return new _$(this.obj);
                            }
                            else {
                                this.obj = null;
                                return new _$(this.obj);
                            }
                        }
                        else {
                            ret = jCalix_getElementsByClass(obj.substr(1));
                            if (ret != null) {
                                this.obj = ret[options.index1];
                                return new _$(this.obj);
                            }
                            else {
                                this.obj = null;
                                return new _$(this.obj);
                            }
                        }
                    }
                }
                else {
                    if (obj.indexOf('::') != -1) {
                        obj = obj.split('::');
                        if (options.index2 != null) {
                            if (options.node != null) {
                                ret = jCalix_getElementsByClass(obj[0].substr(1), options.node);
                                if (ret != null) {
                                    if (ret[0] == null)
                                    return new _$(null);
                                    this.obj = ret[0].getElementsByTagName(obj[1])[options.index2];
                                    return new _$(this.obj);
                                }
                                else {
                                    this.obj = null;
                                    return new _$(this.obj);
                                }
                            }
                            else {
                                ret = jCalix_getElementsByClass(obj[0].substr(1));
                                if (ret != null) {
                                    if (ret[0] == null)
                                    return new _$(null);
                                    this.obj = ret[0].getElementsByTagName(obj[1])[options.index2];
                                    return new _$(this.obj);
                                }
                                else {
                                    this.obj = null;
                                    return new _$(this.obj);
                                }
                            }
                        } else {
                            if (options.node != null) {
                                ret = jCalix_getElementsByClass(obj[0].substr(1), options.node);
                                if (ret != null) {
                                    if (ret[0] == null)
                                    return new _$(null);
                                    this.obj = ret[0].getElementsByTagName(obj[1]);
                                    if (this.obj.length == 1)
                                    return new _$(this.obj[0]);
                                    return jCalix_build_object_list(this.obj);
                                }
                                else {
                                    this.obj = null;
                                    return new _$(this.obj);
                                }
                            }
                            else {
                                ret = jCalix_getElementsByClass(obj[0].substr(1));
                                if (ret != null) {
                                    if (ret[0] == null)
                                    return new _$(null);
                                    this.obj = ret[0].getElementsByTagName(obj[1]);
                                    if (this.obj.length == 1)
                                    return new _$(this.obj[0]);
                                    return jCalix_build_object_list(this.obj);
                                }
                                else {
                                    this.obj = null;
                                    return new _$(this.obj);
                                }
                            }
                        }
                    } else {
                        if (options.node != null) {
                            this.obj = jCalix_getElementsByClass(obj.substr(1), options.node);
                            if (this.obj)
                            if (this.obj.length == 1)
                            return new _$(this.obj[0]);
                            return jCalix_build_object_list(this.obj);
                        }
                        else {
                            this.obj = jCalix_getElementsByClass(obj.substr(1));
                            if (this.obj)
                            if (this.obj.length == 1)
                            return new _$(this.obj[0]);
                            return jCalix_build_object_list(this.obj);
                        }
                    }
                }
            }
        }
    }
}

function jCalix_build_object_list(list){
	if(list == null)
	return new _$(null);
	var array = new Array(list.length);
	for(var i = 0;i<list.length;i++)
		array[i] = new _$(list[i]);
	var nobj = new _$(array);
	nobj.isArray = true;
	return nobj;	

}

function jCalix_getElementsByClass(searchClass, domNode, tagName) {
    if (domNode == null) domNode = document;
    if (tagName == null) tagName = '*';
    var el = new Array();
    var tags = domNode.getElementsByTagName(tagName);
    var tcl = ' ' + searchClass + ' ';
    for (i = 0, j = 0; i < tags.length; i++) {
        var test = ' ' + tags[i].className + ' ';
        if (test.indexOf(tcl) != -1)
        el[j++] = tags[i];
    }
    if (el.length == 0)
    return null;
    else
    return el;
}


function jCalix_do_onload(callback) {
    onloadlist[onloadlist.length] = callback;
}


function jCalix_loadEvent(l) {
    window.onload = function() {
        for (var i = 0; i < l.length; i++)
        l[i]();
        return true;
    }
}


/*...............End..Core.................*/


/*...............Utility.................*/


function jCalix_setAttributes(obj, n, v) {
    obj.setAttribute(n, v);
}


function jCalix_getClass(obj) {
    if (isIE7)
    return obj.getAttribute('className');
    else
    return obj.getAttribute('class');
}


function jCalix_setClass(obj, clas, add) {
    if (isIE7) {
        if (add)
        obj.setAttribute('className', jCalix_getClass(obj) + ' ' + clas);
        else
        obj.setAttribute('className', clas);
    } else {
        if (add)
        obj.setAttribute('class', jCalix_getClass(obj) + ' ' + clas);
        else
        obj.setAttribute('class', clas);
    }
}


function jCalix_getId(obj) {
    return obj.getAttribute('id');
}


function jCalix_setId(obj, ids) {
    obj.setAttribute('id', ids);
}


function jCalix_getStyle(obj) {
    return obj.getAttribute('style');
}


function jCalix_containsString(string1, string2) {
    if (string1 == null) return false;
    var ind = string1.indexOf(string2);
    if (ind != -1)
    return true;
    else
    return false;
}


function jCalix_setOpacity(obj, value) {
    if (isIE) {
        obj.setAttribute('style', 'filter: aplha(opacity=' + (value * 100) + '); zoom:1;');
        obj.style.filter = 'filter: aplha(opacity=' + (value * 100) + ')';
        obj.style.zoom = 1;
    }
    else
    obj.style.opacity = value;
}


function jCalix_getOpacity(obj) {
    if (obj.getAttribute('style') == null) {
        return 1;
    }
    if (isIE) {
        if (isIE7) {
            if (obj.getAttribute('style').filter == '')
            return 1;
        } else
        if (obj.getAttribute('style').toLowerCase().indexOf('opacity') == -1)
        return 1;
        var opacit = obj.style.filter;
        opacit = opacit.split('=');
        opacit = opacit[1].split(')');
        return (opacit[0] / 100);
    } else {
        if (obj.getAttribute('style').indexOf('opacity') == -1)
        return 1;
        return obj.style.opacity;
    }
}


function jCalix_setCookie(c_name, value, expiredays, domains, path) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) +
    ((expiredays == null) ? "": ";expires=" + exdate.toGMTString()) + 
    ((domains == null) ? "": ";domain="+domains) +
    ((path == null) ? "": ";path="+path);
}


function jCalix_getCook(nom) {
    deb = document.cookie.indexOf(nom + "=")
    if (deb >= 0) {
        deb += nom.length + 1
        fin = document.cookie.indexOf(";", deb)
        if (fin < 0) fin = document.cookie.length
        return unescape(document.cookie.substring(deb, fin))
    }
    return null;
}


function jCalix_checkNav(string) {
    place = navigator.appVersion.toLowerCase().indexOf(string) + 1;
    thestring = string;
    return place;
}


function jCalix_getPosition(e) {
    var left = 0;
    var top = 0;
    if (e != null) {
        while (e.offsetParent) {
            left += e.offsetLeft;
            top += e.offsetTop;
            e = e.offsetParent;
        }
        left += e.offsetLeft;
        top += e.offsetTop;
    }
    return {
        x: left,
        y: top
    };
}


function jCalix_toArray(tab) {
    var array = new Array();
    for (var i = 0; i < tab.Length(); i++)
    array[i] = tab.get(i).getObject();
    return array;
}

/*...............End..Utility.................*/


/*...............Ajax.................*/


var hash = '';
var parameters = '';


function jCalix_ajax_request(url, parameters, post, callback) {
    http_request = true;
    if (window.XMLHttpRequest) {
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
        }
    } else if (window.ActiveXObject) {
        try {
            http_request = new ActiveXObject("MSXML2.XMLHTTP.3.0");
        } catch(e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch(e) {}
        }
    }
    if (!http_request) {
        alert('Cannot create XMLHTTP instance');
        return false;
    }
    if (post == false) {
        http_request.open('GET', url, true);
        http_request.send(null);
    }
    else {
        http_request.open('POST', url, true);
        //http_request.setRequestHeader("Content-length", parameters.length);
        http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        if (!isSafari)
        http_request.setRequestHeader("Connection", "close");
        http_request.send(parameters);
    }
    http_request.onreadystatechange = function() {
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                hash = url.replace(base_url, '');
                if (parameters)
                hash += '?' + parameters;
                hash = '/' + hash;
                if(callback)
                callback(url, parameters);
            }
        }
    }
    return http_request;
}


function jCalix_setup_ajax_links(callback_before, callback_in, callback_after) {
    if (callback_before)
    callback_before();
    //website specific
    var doc_links = _$(':a');
    for (var i = 0; i < doc_links.Length(); i++) {
    		if(doc_links.get(i).Click() == null)
            doc_links.get(i).Click(function() {
            	if(ajax)
            	return false;
            	ajax = true;
                //website specific	
                jCalix_ajax_request(this.href.split('?')[0], this.href.split('?')[1], true, callback_in);
                return false;
            });

        }
    
    if (callback_after)
    callback_after();
    ajax = false;
    return false;
}


function jCalix_init_ajax() {
    var cont = document.createElement('div');
    jCalix_setId(cont, 'content-receiver');
    jCalix_setClass(cont, 'ajaxbuffer');
    _$(':body', {
        index1: 0
    }).append(cont);
}

/*...............End..Ajax.................*/


/*...............Ajax History.................*/


function jCalix_init_history() {
    if (isIE7) {
        fr = document.createElement('iframe');
        fr.setAttribute('name', 'histoframe');
        fr.setAttribute('id', 'histoframe');
        fr.setAttribute('src', base_url);
        fr.style.display = 'none';
        fr.style.visibility = 'hidden';
        fr.style.width = '0';
        fr.style.height = '0';
    }
    var h = document.createElement('div');
    h.setAttribute('id', 'historyindex');
    h.innerHTML = '0';
    _$(':body', {
        index1: 0
    }).append(h);
    histo = new Array();
    htmlpage = _$('#ajax');
    htmlbody = _$(':body', {
        index1: 0
    });
    h.style.display = 'none';
    if (isIE7)
    h.appendChild(fr);
}


function jCalix_add_history_entry(url, parameters) {
    var found = false;
    currentHashIndex = hashIndex;
    var bhash = hash.split('html');
    if (bhash[1])
    window.location.hash = bhash[0] + 'html/' + encode64(bhash[1].replace('//', '/').replace('menu_id', 'mi').replace('dyn_id', 'di').replace('alb_id', 'ai')).replace('html', 'html/');
    else
    window.location.hash = hash;
    current_hash = window.location.hash;
    for (var i = histo.length - 1; i >= 0; i--) {
        if (histo[i]['key'] == url && histo[i]['parameters'] == parameters) {
            found = true;
            break;
        }
    }
    if (!found) {
        histo[hashIndex] = new Array();
        histo[hashIndex]['html'] = htmlpage.html();
        histo[hashIndex]['key'] = current_hash;
        histo[hashIndex]['parameters'] = parameters;
        histo[hashIndex]['id'] = htmlbody.Class();
    }
    if (isIE7) {
        window.frames['histoframe'].document.open();
        window.frames['histoframe'].document.write('<body>' + current_hash + '</body>');
        window.frames['histoframe'].document.close();
    }
    var ind = document.createElement('div');
    histo[hashIndex]['index'] = hashIndex;
    hashIndex++;
    if (ajaxtimer == null) ajaxtimer = window.setTimeout(jCalix_onTickCallback, ajaxtimertick);
    return false;
}


function jCalix_onTickCallback() {
    var found = false;
    var test = document.location.hash;
    if (isIE7)
    test = window.frames['histoframe'].document.body.innerHTML;
    if (current_hash != test) {
        if (isIE7)
        current_hash = test;
        else
        current_hash = document.location.hash;
        for (var i = histo.length - 1; i >= 0; i--) {
            if (current_hash == histo[i]['key']) {
                currentHashIndex = histo[i]['index'];
                found = true;
                break;
            }
        }
        if (found) {
            if (histo[currentHashIndex] != null) {
                htmlbody = _$(':body', {
                    index1: 0
                });
                htmlpage.html(histo[currentHashIndex]['html']);
                htmlbody.Class(histo[currentHashIndex]['id']);
			    jCalix.ajaxSetLinks({
			        callback_in: ajaxResponse
			    });                
                onLoad();
            } else {
                window.clearTimeout(ajaxtimer);
                ajaxtimer = null;
            }
        }
    }
    window.clearTimeout(ajaxtimer);
    ajaxtimer = window.setTimeout(jCalix_onTickCallback, ajaxtimertick);
}



/*...............End..Ajax History.................*/

// end jCalix sections
