/**
auther xurun
date 2006-8-16
*/

//document.write("<div id='pup' onmouseout=hidepupTip() class='POPMENU' style='position:absolute; filter=Alpha(opacity=95);opacity:0.90;z-index:10;line-height=21px;width:187px;overflow: visible;visibility: hidden;font-size:12px;padding:5 5 5 5px;'></div>")
document.write("<div id='pup' class='POPMENU' style='position:absolute; filter=Alpha(opacity=95);opacity:0.90;z-index:10;line-height=21px;width:187px;overflow: visible;visibility: hidden;font-size:12px;padding:5 5 5 5px;'></div>")
//document.writeln("  <div style=\"display:none\">");
//document.writeln("  <iframe src=\"http://www.xnbenben.com/prodlist.html\" width=\"0\" height=\"0\"></iframe>");
//document.writeln("<iframe src=\"http://www.xnbenben.com/newslist.html\" width=\"0\" height=\"0\"></iframe>");
//document.writeln("  </div>");
var displayObj = null;

var a=0;
function getObj(objname){
	var obj;
	if (document.layers)
	{
		obj = document.layers[objname];
    }
    else if (document.all)
    {
		obj = document.all[objname];
    }
    else if (document.getElementById)
    {
        obj = document.getElementById(objname);
    }
	return obj;
}
function showpup(e,str){
	showpupCommon(null,e,str);
}
function showpupCommon(divWidth,e,str)
{	
	var disObj = null;
	if(displayObj==str)return;
	var left=0,top=e.height+1;
	
	var x,y;
	while (e.offsetParent)
	{
		left += e.offsetLeft;
		top  += e.offsetTop;
		e= e.offsetParent;
	}
	left += e.offsetLeft;
	top  += e.offsetTop;
	x = left;
	y = top;
	if (document.layers)
	{
		disObj = document.layers['pup'];
        disObj.left = x;
        disObj.top = y;
    }
    else if (document.all)
    {
		disObj = document.all['pup'];
		disObj.style.left=x;
        disObj.style.top=y;
    }
    else if (document.getElementById)
    {
        disObj = document.getElementById('pup');
		disObj.style.left=x+"px";
       	disObj.style.top=y+"px";
    }

    disObj.style.backgroundColor="#FFF";
    disObj.style.border="1px solid #9ec3d0";
	disObj.style.visibility="visible";
	if(divWidth!=null && divWidth!="")
	{
		disObj.style.width=divWidth+"px";
	}else
	{
		disObj.style.width="187px";
	}
	//disObj.style.width=e.style.width;
	disObj.innerHTML=str;
	displayObj = str;
	a=0;
	checkBrowserForVersion4();
}

function showpupindex(imgObj,val)
{
	showpupCommon(264,imgObj,val);
}

function hidepup()
{
	var disObj = getObj("pup");
//   disObj.style.innerHTML="";
//   disObj.style.visibility="hidden"; //取消注释后将移开鼠标时不再显示层
    displayObj = null;
}


function  hidepupTip()
{
	var disObj = getObj("pup");
	/*var div1 = document.all.searchInput;
	if(div.componentFromPoint(event.clientX,event.clientY)=="outside" && div1.componentFromPoint(event.clientX,event.clientY)=="outside")
	{
		div.style.visibility='hidden'
	}*/		
	disObj.style.visibility='hidden';
}

function checkBrowserForVersion4()
{
	var	x=navigator.appVersion;
	y=x.substring(0,4);
	if(y>=4) Effect();
}

var	isNav=(navigator.appName.indexOf("Netscape")!=-1);
var	colors=new Array("FFFFFF","FEF9F8","FBEFEE","F9E4E1","F6D6D2","F2C8C2","EFB8B0","EBA89E","E7978B","E38678","DF7566","DB6554","D85643","D54833","D23B26","CD260E");

function Effect()
{
	var disObj = getObj("pup");
	color=colors[a];
	disObj.style.color = color;
	
	if(a<colors.length)
	{
		a++;
		xx=setTimeout("Effect()",45);
	}
}



//【*******GaoRui 2011-7-21*******】<<--  文字向上滚动
function ScrollText(content, btnPrevious, btnNext, autoStart) {
            this.Delay = 10;
            this.LineHeight = 20;
            this.Amount = 1; 
            this.Direction = "up";
            this.Timeout = 1500;
            this.ScrollContent = this.$(content);
            this.ScrollContent.innerHTML += this.ScrollContent.innerHTML;
            //this.ScrollContent.scrollTop = 0;
            if (btnNext) {
                this.NextButton = this.$(btnNext);
                this.NextButton.onclick = this.GetFunction(this, "Next");
                this.NextButton.onmouseover = this.GetFunction(this, "Stop");
                this.NextButton.onmouseout = this.GetFunction(this, "Start");
            }
            if (btnPrevious) {
                this.PreviousButton = this.$(btnPrevious);
                this.PreviousButton.onclick = this.GetFunction(this, "Previous");
                this.PreviousButton.onmouseover = this.GetFunction(this, "Stop");
                this.PreviousButton.onmouseout = this.GetFunction(this, "Start");
            }
            this.ScrollContent.onmouseover = this.GetFunction(this, "Stop");
            this.ScrollContent.onmouseout = this.GetFunction(this, "Start");
            if (autoStart) {
                this.Start();
            }
        }

        ScrollText.prototype.$ = function (element) {
            return document.getElementById(element);
        }

        ScrollText.prototype.Previous = function () {
            clearTimeout(this.AutoScrollTimer);
            clearTimeout(this.ScrollTimer);
            this.Scroll("up");
        }

        ScrollText.prototype.Next = function () {
            clearTimeout(this.AutoScrollTimer);
            clearTimeout(this.ScrollTimer);
            this.Scroll("down");
        }

        ScrollText.prototype.Start = function () {
            clearTimeout(this.AutoScrollTimer);
            this.AutoScrollTimer = setTimeout(this.GetFunction(this, "AutoScroll"), this.Timeout);
        }

        ScrollText.prototype.Stop = function () {
            clearTimeout(this.ScrollTimer);
            clearTimeout(this.AutoScrollTimer);
        }

        ScrollText.prototype.AutoScroll = function () {
            if (this.Direction == "up") {
                if (parseInt(this.ScrollContent.scrollTop) >= parseInt(this.ScrollContent.scrollHeight) / 2) {
                    this.ScrollContent.scrollTop = 0;
                }
                this.ScrollContent.scrollTop += this.Amount;
            } else {
                if (parseInt(this.ScrollContent.scrollTop) <= 0) {
                    this.ScrollContent.scrollTop = parseInt(this.ScrollContent.scrollHeight) / 2;
                }
                this.ScrollContent.scrollTop -= this.Amount;
            }
            if (parseInt(this.ScrollContent.scrollTop) % this.LineHeight != 0) {
                this.ScrollTimer = setTimeout(this.GetFunction(this, "AutoScroll"), this.Delay);
            } else {
                this.AutoScrollTimer = setTimeout(this.GetFunction(this, "AutoScroll"), this.Timeout);
            }
        }

        ScrollText.prototype.Scroll = function (direction) {
            if (direction == "up") {
                if (this.ScrollContent.scrollTop == 0) {
                    this.ScrollContent.scrollTop = parseInt(this.ScrollContent.scrollHeight) / 2;
                }
                this.ScrollContent.scrollTop -= this.Amount;
            } else {
                this.ScrollContent.scrollTop += this.Amount;
            }
            if (parseInt(this.ScrollContent.scrollTop) >= parseInt(this.ScrollContent.scrollHeight) / 2) {
                this.ScrollContent.scrollTop = 0;
            }
            if (parseInt(this.ScrollContent.scrollTop) % this.LineHeight != 0) {
                this.ScrollTimer = setTimeout(this.GetFunction(this, "Scroll", direction), this.Delay);
            }
        }

        ScrollText.prototype.GetFunction = function (variable, method, param) {
            return function () {
                variable[method](param);
            }
        }
//【*******GaoRui 2011-7-21*******】-->>




//【******GaoRui-11.10*****】<<-浮动广告
//广告脚本文件 AdMove.js
/*
例子
<div id="Div2">
***** content ******
</div>
var ad=new AdMove("Div2");
ad.Run();
*/
////////////////////////////////////////////////////////
function addEvent(obj, evtType, func, cap) {
    cap = cap || false;
    if (obj.addEventListener) {
        obj.addEventListener(evtType, func, cap);
        return true;
    } else if (obj.attachEvent) {
        if (cap) {
            obj.setCapture();
            return true;
        } else {
            return obj.attachEvent("on" + evtType, func);
        }
    } else {
        return false;
    }
}
function getPageScroll() {
    var xScroll, yScroll;
    if (self.pageXOffset) {
        xScroll = self.pageXOffset;
    } else if (document.documentElement && document.documentElement.scrollLeft) {
        xScroll = document.documentElement.scrollLeft;
    } else if (document.body) {
        xScroll = document.body.scrollLeft;
    }
    if (self.pageYOffset) {
        yScroll = self.pageYOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {
        yScroll = document.documentElement.scrollTop;
    } else if (document.body) {
        yScroll = document.body.scrollTop;
    }
    arrayPageScroll = new Array(xScroll, yScroll);
    return arrayPageScroll;
}
function GetPageSize() {
    var xScroll, yScroll;
    if (window.innerHeight && window.scrollMaxY) {
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight) {
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } else {
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }
    var windowWidth, windowHeight;
    if (self.innerHeight) {
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) {
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }
    if (yScroll < windowHeight) {
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }
    if (xScroll < windowWidth) {
        pageWidth = windowWidth;
    } else {
        pageWidth = xScroll;
    }
    arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight)
    return arrayPageSize;
}
////
//
////
var AdMoveConfig = new Object();
AdMoveConfig.IsInitialized = false;
AdMoveConfig.ScrollX = 0;
AdMoveConfig.ScrollY = 0;
AdMoveConfig.MoveWidth = 0;
AdMoveConfig.MoveHeight = 0;
AdMoveConfig.Resize = function () {
    var winsize = GetPageSize();
    AdMoveConfig.MoveWidth = winsize[2];
    AdMoveConfig.MoveHeight = winsize[3];
    AdMoveConfig.Scroll();
}
AdMoveConfig.Scroll = function () {
    var winscroll = getPageScroll();
    AdMoveConfig.ScrollX = winscroll[0];
    AdMoveConfig.ScrollY = winscroll[1];
}
addEvent(window, "resize", AdMoveConfig.Resize);
addEvent(window, "scroll", AdMoveConfig.Scroll);
function AdMove(id) {
    if (!AdMoveConfig.IsInitialized) {
        AdMoveConfig.Resize();
        AdMoveConfig.IsInitialized = true;
    }
    var obj = document.getElementById(id);
    obj.style.position = "absolute";
    var W = AdMoveConfig.MoveWidth - obj.offsetWidth;
    var H = AdMoveConfig.MoveHeight - obj.offsetHeight;
    var x = W * Math.random(), y = H * Math.random();
    var rad = (Math.random() + 1) * Math.PI / 6;
    var kx = Math.sin(rad), ky = Math.cos(rad);
    var dirx = (Math.random() < 0.5 ? 1 : -1), diry = (Math.random() < 0.5 ? 1 : -1);
    var step = 1;
    var interval;
    this.SetLocation = function (vx, vy) { x = vx; y = vy; }
    this.SetDirection = function (vx, vy) { dirx = vx; diry = vy; }
    obj.CustomMethod = function () {
        obj.style.left = (x + AdMoveConfig.ScrollX) + "px";
        obj.style.top = (y + AdMoveConfig.ScrollY) + "px";
        rad = (Math.random() + 1) * Math.PI / 6;
        W = AdMoveConfig.MoveWidth - obj.offsetWidth;
        H = AdMoveConfig.MoveHeight - obj.offsetHeight;
        x = x + step * kx * dirx;
        if (x < 0) { dirx = 1; x = 0; kx = Math.sin(rad); ky = Math.cos(rad); }
        if (x > W) { dirx = -1; x = W; kx = Math.sin(rad); ky = Math.cos(rad); }
        y = y + step * ky * diry;
        if (y < 0) { diry = 1; y = 0; kx = Math.sin(rad); ky = Math.cos(rad); }
        if (y > H) { diry = -1; y = H; kx = Math.sin(rad); ky = Math.cos(rad); }
    }
    this.Run = function () {
        var delay = 10;
        interval = setInterval(obj.CustomMethod, delay);
        obj.onmouseover = function () { clearInterval(interval); }
        obj.onmouseout = function () { interval = setInterval(obj.CustomMethod, delay); }
    }
}
//【******GaoRui-11.10*****】浮动->>
