
var MP_NODE = Class.create();
MP_NODE.prototype = {
    initialize: function() {

        this.node = null;
        this.offsetHeight = 0;
        this.height = 0;
    }
}

var upInterval;
var downInterval;
function loadWowi() {

    var imgUp = new Array(2);
    var imgDown = new Array(2);
    var contentList = new Array(2);
    imgUp[0] = document.getElementById('titleImgUp');
    imgDown[0] = document.getElementById('titleImgDown');
    imgUp[1] = document.getElementById('pageImgUp');
    imgDown[1] = document.getElementById('pageImgDown');
    contentList[0] = document.getElementById('titleList');
    var contentListObj0 = new MP_NODE();
    contentListObj0.node = contentList[0];
    contentListObj0.offsetHeight = contentList[0].offsetHeight;
    contentList[0].style.height = '320px';
    contentListObj0.height = contentList[0].style.height;


    contentList[1] = document.getElementById('pageList');
    var contentListObj1 = new MP_NODE();
    contentListObj1.node = contentList[1];
    contentListObj1.offsetHeight = contentList[1].offsetHeight;
    contentList[1].style.height = '320px';
    contentListObj1.height = contentList[1].style.height;

    imgUp[0].onmouseover = function() { upInterval = setInterval(function() { contentUpDown(contentListObj0, 'up', 0, 5, imgUp[0], imgDown[0], contentList[0]); }, 50); this.className = "pageImgUpOver"; };
    imgUp[0].onmouseout = function() { clearInterval(upInterval); clearInterval(downInterval); this.className = "pageImgUp"; };
    imgUp[0].onmousedown = function() { this.onmouseout(); upInterval = setInterval(function() { contentUpDown(contentListObj0, 'up', 0, 20, imgUp[0], imgDown[0], contentList[0]); }, 30); };
    imgUp[0].onmouseup = function() { this.onmouseout(); this.onmouseover(); };
    imgDown[0].onmouseover = function() { downInterval = setInterval(function() { contentUpDown(contentListObj0, 'down', 0, 5, imgUp[0], imgDown[0], contentList[0]); }, 50); this.className = "pageImgDownOver"; };
    imgDown[0].onmouseout = function() { clearInterval(upInterval); clearInterval(downInterval); this.className = "pageImgDown"; };
    imgDown[0].onmousedown = function() { this.onmouseout(); downInterval = setInterval(function() { contentUpDown(contentListObj0, 'down', 0, 20, imgUp[0], imgDown[0], contentList[0]); }, 30); };
    imgDown[0].onmouseup = function() { this.onmouseout(); this.onmouseover(); };
    //setObjectAttribute(imgDown[0], 'className', 'bntb');


    imgUp[1].onmouseover = function() { upInterval = setInterval(function() { contentUpDown(contentListObj1, 'up', 0, 5, imgUp[1], imgDown[1], contentList[1]); }, 50); this.className = "pageImgUpOver"; };
    imgUp[1].onmouseout = function() { clearInterval(upInterval); clearInterval(downInterval); this.className = "pageImgUp"; };
    imgUp[1].onmousedown = function() { this.onmouseout(); upInterval = setInterval(function() { contentUpDown(contentListObj1, 'up', 0, 20, imgUp[1], imgDown[1], contentList[1]); }, 30); };
    imgUp[1].onmouseup = function() { this.onmouseout(); this.onmouseover(); };
    imgDown[1].onmouseover = function() { downInterval = setInterval(function() { contentUpDown(contentListObj1, 'down', 0, 5, imgUp[1], imgDown[1], contentList[1]); }, 50); this.className = "pageImgDownOver"; };
    imgDown[1].onmouseout = function() { clearInterval(upInterval); clearInterval(downInterval); this.className = "pageImgDown"; };
    imgDown[1].onmousedown = function() { this.onmouseout(); downInterval = setInterval(function() { contentUpDown(contentListObj1, 'down', 0, 20, imgUp[1], imgDown[1], contentList[1]); }, 30);};
    imgDown[1].onmouseup = function() { this.onmouseout(); this.onmouseover(); };
    //setObjectAttribute(imgDown[1], 'className', 'bntb');
    //}

}
function contentScroll() {
    var zoom = document.getElementById('ozoom');
    var imgUp = document.getElementById('imgUp');
    var imgDown = document.getElementById('imgDown');
    var contentListObj = new MP_NODE();
    contentListObj.node = zoom;
    contentListObj.offsetHeight = zoom.offsetHeight;
    zoom.style.height = '350px';
    contentListObj.height = zoom.height;

    imgUp.onmouseover = function() { upInterval = setInterval(function() { contentUpDown(contentListObj, 'up', 0, 2, imgUp, imgDown, zoom); }, 50); };
    imgUp.onmouseout = function() { clearInterval(upInterval); clearInterval(downInterval);};
    imgUp.onmousedown = function() { this.onmouseout(); upInterval = setInterval(function() { contentUpDown(contentListObj, 'up', 0, 20, imgUp, imgDown, zoom); }, 30); };
    imgUp.onmouseup = function() { this.onmouseout(); this.onmouseover(); };
    imgDown.onmouseover = function() { downInterval = setInterval( function() { contentUpDown(contentListObj, 'down', 0, 2, imgUp, imgDown, zoom);}, 50);};
    imgDown.onmouseout = function() { clearInterval(upInterval); clearInterval(downInterval);};
    imgDown.onmousedown = function() { this.onmouseout(); downInterval = setInterval(function() { contentUpDown(contentListObj, 'down', 0, 20, imgUp, imgDown, zoom); }, 30);};
    imgDown.onmouseup = function() { this.onmouseout(); this.onmouseover(); };
}
function getValue(node, propertyName) {
    if (propertyName == 'margin-top' && node.style.marginTop) {
        if (node.style.marginTop.indexOf('px')) {
            var value = node.style.marginTop.substring(0, node.style.marginTop.indexOf('px'));
            return parseInt(value);
        }
        else if (node.style.marginTop == '' || node.style.marginTop == "")
            return 0;
        else
            return parseInt(node.style.marginTop);
    }
    else if (propertyName == 'height' && node.style.height) {
        if (node.style.height.indexOf('px')) {
            var value = node.style.height.substring(0, node.style.height.indexOf('px'));
            return parseInt(value);
        }
        else if (node.style.height == '' || node.style.height == "")
            return 0;
        else
            return parseInt(node.style.height);
    }
    return 0;
}
function contentUpDown(node, type, start, step, imgUp, imgDown, list) {
    if (type == 'up' && getValue(node.node, 'margin-top') < start) {
        node.node.style.marginTop = getValue(node.node, 'margin-top') + step + 'px';
        node.node.style.height = getValue(node.node, 'height') - step + 'px';
    }
    else if (type == 'down' && getValue(node.node, 'height') <= node.offsetHeight) {
        node.node.style.marginTop = getValue(node.node, 'margin-top') - step + 'px';
        node.node.style.height = getValue(node.node, 'height') + step + 'px';
    }

    //setObjectAttribute(imgUp, 'className', 'bnta');
    //setObjectAttribute(imgDown, 'className', 'bntb');
}

/*
END特效
*/
