var presentation = {
    
adjustFooter:function() {
    
    var footer = document.getElementById('footer');
    if (!footer) { return false; }
    footer.style.position = '';
    
    var winHeight = getDimensions.getWindowHeight();
    var pageHeight = getDimensions.getPageHeight();
    
    if (pageHeight > (winHeight + 1)) { footer.style.position = ''; }
    else { footer.style.position = 'absolute'; }
    
},

firstPara:function() {
    
    var content = document.getElementById('content');
    if (!content) { return; }
    var paras = content.getElementsByTagName('p');
    if (paras.length < 1) { return; }
    if (paras[0].className) { return; }
    paras[0].className = 'firstpara';
},

startList:function() {
    
    if (document.all&&document.getElementById) {
        navRoot = document.getElementById("nav");
        if (!navRoot) { return false; }
        for (i=0; i<navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            if (node.nodeName=="LI") {
                  node.onmouseover=function() {
                    this.className+=" over";
                  }
                  node.onmouseout=function() {
                    this.className=this.className.replace(" over", "");
                  }
            }
        }
    }
},

tabList:function() {

    var navRoot = document.getElementById('nav');
    if (!navRoot) { return false; }
    var navLis = navRoot.getElementsByTagName('li');
    var navLinks = navRoot.getElementsByTagName('a');
    for (var i = 0; i < navLinks.length; i++) {
    
        navLinks[i].onfocus = function() {
        
            this.className += ' current';
            var listitem = this.parentNode;
            listitem.className += ' over';
            var parent = listitem.parentNode;
            while (parent.nodeName != 'BODY') {
            
                parent = parent.parentNode;
                if (parent.nodeName == 'LI') {
                
                    parent.className += ' over';
                }
            }
            this.onblur = function() {
            
                for (var k = 0; k < navLis.length; k++) {
                
                    navLis[k].className = navLis[k].className.replace('over', '');
                }
                for (var m = 0; m < navLinks.length; m++) {
                
                    navLinks[m].className = navLinks[m].className.replace('current', '');
                }
                var parentofcurrent = false;
                var liChildren = listitem.childNodes;           
                for (var j = 0; j < liChildren.length; j++) {
                
                    var childClass = liChildren[j].className;
                    if (!childClass) { continue; }
                    if (childClass.search(/current/) != -1) {
                    
                        parentofcurrent = true; break;  
                    }
                }
                if (!parentofcurrent) {
                
                    listitem.className = listitem.className.replace('over', ''); 
                }
            }
        }
    }
},

liOver:function() {
    
    var contentslist = document.getElementById('contents');
    if (!contentslist) { return false; }
    var contentsLis = contentslist.getElementsByTagName('li');
    for (var i = 0; i < contentsLis.length; i++) {
        
        contentsLis[i].onmouseover = function() { //alert('hello')
            
            this.className += ' over';
        //  this.className='over';
            liLinks = this.getElementsByTagName('a');
            if (liLinks.length > 0) { 
            
                var theHref = liLinks[0].getAttribute('href'); // alert(theHref);
                this.onclick = function() { window.location = theHref; }
            }
            this.onmouseout = function() {
                
                this.className = this.className.replace('over', '');
            }
        }
    }
},

fixBoxHeight:function() {

    var contentsList = document.getElementById('contents');
    if (!contentsList) { return false; }
    var boxDivs = contentsList.getElementsByTagName('div');
    
    var maxHeight = 0;
    for (var i = 0; i < boxDivs.length; i++) {

        var boxHeight = boxDivs[i].offsetHeight;
        maxHeight = maxHeight > boxHeight ? maxHeight : boxHeight;
    }
    for (var i = 0; i < boxDivs.length; i++) {

        boxDivs[i].style.height = (maxHeight - 10) + 'px';
        var newspan = document.createElement('span');
        newspan.className = 'boxbottom';
        boxDivs[i].appendChild(newspan);
    }
},

lastPara:function() {
    
    var contentDiv = document.getElementById('content');
    if (!contentDiv) { return; }
    var contentParas = contentDiv.getElementsByTagName('p');
    if (contentParas.length < 1) { return; }
    contentParas[contentParas.length - 1].style.margin = 0;
},

imgNames:['box_151_top_a.png','box_230_top_a.png','box_151_bottom_a.png','box_230_bottom_a.png'],

imgPostload:function() {

    var imgs = new Array();
    for (var i = 0; i < presentation.imgNames.length; i++) {

        imgs[i] = new Image();
        imgs[i].src = image_dir + presentation.imgNames[i];
    }
},

flashInit:function() {
    
    var flashdiv = document.getElementById('home-animation');
    if (!flashdiv) { return; }

    swfobject.embedSWF(image_dir + "home-animation.swf", "home-animation", "500", "150", "9.0.0", null, null, {wmode:'transparent'});
}
    
}

coreFuncs.addLoadEvent(presentation.adjustFooter);
coreFuncs.addLoadEvent(presentation.firstPara);
coreFuncs.addLoadEvent(presentation.startList);
coreFuncs.addLoadEvent(presentation.tabList);
coreFuncs.addLoadEvent(presentation.liOver);
coreFuncs.addLoadEvent(presentation.imgPostload);
coreFuncs.addLoadEvent(presentation.fixBoxHeight);
coreFuncs.addLoadEvent(presentation.lastPara);
coreFuncs.addLoadEvent(presentation.flashInit);

coreFuncs.addResizeEvent(presentation.adjustFooter);