﻿function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == 'undefined') {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}
   function copyToClipBoard(){
    var clipBoardContent="";
    clipBoardContent+=document.title;
    clipBoardContent+="";
    clipBoardContent+=this.location.href;
    window.clipboardData.setData("Text",clipBoardContent);
    alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友");
  }
function _$(id) {
    return document.getElementById(id)
}
function $id(id) {
    return document.getElementById(id)
}
function $cE(tag) {
    return document.createElement(tag)
}
function $name(name, obj) {
    return document.getElementsByName(name)
}
function $tag(obj, tag) {
    if (typeof obj == 'undefined')
	{obj = document;
    return obj.getElementsByTagName(tag)
	}
}
function AutoHeight() {
    parent._$('rightiframe').height = document.body.scrollHeight
}
function addBookmark(title, url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url, "")
    } else if (document.all) {
        window.external.AddFavorite(url, title)
    } else if (window.opera && window.print) {
        return true
    }
}
function show(id) {
    var div = _$(id);
    div.style.display = (div.style.display == "") ? "none": ""
}
function AjaxLoading(type, id, msg) {
    parent._$(id).innerHTML = msg;
    if (type == 'show') parent._$(id).style.display = '';
    if (type == 'hide') parent._$(id).style.display = 'none'
}
function StartLoading() {
    document.write('<div id="loading" class="loading" style="color:#04AEFC;position:absolute;top:0;left:0;border:3px solid #04AEFC;background:#fff;padding:3px 10px;"><img src="images/loading.gif"/>&nbsp;页面加载中...</div>')
}
function EndLoading() {
    _$("loading").parentNode.removeChild(_$("loading"))
}
function Tab(name, cursel, n) {
    for (i = 1; i <= n; i++) {
        _$(name + i).className = (i == cursel) ? "hover": "";
        _$(name + "Box" + i).style.display = (i == cursel) ? "block": "none"
    }
}
function open_select(obj) {
    var no = _$('category').value;
    div_select(no);
    _$('select_list').style.display = ''
}
function div_select(no) {
    var _select = _$('select_list');
    var select_list = _select.getElementsByTagName('a');
    for (var i = 0; i < select_list.length; i++) {
        if (no == 0) {
            select_list[0].className = 'select_this';
            _$('category').value = "salesearch";
            _$('category_value').value = select_list[0].innerHTML
        }
        if (no == 1) {
            select_list[1].className = 'select_this';
            _$('category').value = "infosearch";
            _$('category_value').value = select_list[1].innerHTML
        }
     
        if (no == 2) {
            select_list[2].className = 'select_this';
            _$('category').value = "comsearch";
            _$('category_value').value = select_list[2].innerHTML
        } 
		
		  if (no == 3) {
            select_list[3].className = 'select_this';
            _$('category').value = "asksearch";
            _$('category_value').value = select_list[3].innerHTML
        } 
		
		else {
            select_list[i].className = ''
        }
    }
    _select.style.display = 'none'
}
function showNav(obj) {
    var subMenu = _$('quick_nav');
    subMenu.style.display = "";
    obj.className = 'hover';
    btn = obj.getElementsByTagName("a")[0];
    btn.style.color = '#fff'
}
function hideNav(obj) {
    var subMenu = _$('quick_nav');
    subMenu.style.display = "none";
    obj.className = '';
    btn = obj.getElementsByTagName("a")[0];
    btn.style.color = '#333'
}
function topTab(this_id, url) {
    window.name = this_id;
    var tab_this = parseInt(window.name);
    var tab = _$("top_menu_tab").getElementsByTagName("a");
    var tab_con = _$("top_menu_tabcon").getElementsByTagName("div");
    var tab_length = tab.length;
    for (i = 1; i <= tab_length; i++) {
        var tab_id = i - 1;
        tab[tab_id].className = (i == tab_this) ? "left_now": ""
    }
    _$("right_iframe").src = url + ".php";
    for (i = 1; i <= tab_length; i++) {
        _$('menu_' + i).style.display = (i == tab_this) ? "": "none"
    }
    left_menu('menu_' + this_id, '1')
}
function getconfirm(str) {
    var str;
    if (confirm(str) == true) return true;
    else return false
}
function SetWinHeight(obj) {
    var win = obj;
    if (document.getElementById) {
        if (win && !window.opera) {
            if (win.contentDocument && win.contentDocument.body.offsetHeight) win.height = win.contentDocument.body.offsetHeight;
            else if (win.Document && win.Document.body.scrollHeight) win.height = win.Document.body.scrollHeight
        }
    }
}
function is_Del(msg) {
    if (confirm(msg)) return true;
    else return false
}
function selectAll(obj) {
    for (var i = 0; i < obj.elements.length; i++) {
        if (obj.elements[i].type == "checkbox") obj.elements[i].checked = true
    }
}
function selectOther(obj) {
    for (var i = 0; i < obj.elements.length; i++) {
        if (obj.elements[i].type == "checkbox") {
            if (!obj.elements[i].checked) obj.elements[i].checked = true;
            else obj.elements[i].checked = false
        }
    }
}
function selectCancel(obj) {
    for (var i = 0; i < obj.elements.length; i++) {
        if (obj.elements[i].type == "checkbox") obj.elements[i].checked = false
    }
}
function is_checked(name) {
    var x = document.getElementsByName(name);
    var count = 0;
    for (var i = 0; i < x.length; i++) {
        if (x[i].checked) count += 1;
        else count = 0
    }
    parseInt(count);
    return count
}
function tableColor(o, a, b, c, d) {
    var t = _$(o).getElementsByTagName("tr");
    for (var i = 0; i < t.length; i++) {
        t[i].style.backgroundColor = (t[i].sectionRowIndex % 2 == 0) ? a: b;
        t[i].onclick = function() {
            if (this.x != "1") {
                this.x = "1";
                this.style.backgroundColor = d
            } else {
                this.x = "0";
                this.style.backgroundColor = (this.sectionRowIndex % 2 == 0) ? a: b
            }
        }
        t[i].onmouseover = function() {
            if (this.x != "1") this.style.backgroundColor = c
        }
        t[i].onmouseout = function() {
            if (this.x != "1") this.style.backgroundColor = (this.sectionRowIndex % 2 == 0) ? a: b
        }
    }
}
function tableColor2(id, OnColor, OutColor) {
    var t = _$(id).getElementsByTagName("tr");
    for (var i = 0; i < t.length; i++) {
        t[i].onmouseover = function() {
            if (this.x != "1") this.style.backgroundColor = OnColor
        }
        t[i].onmouseout = function() {
            if (this.x != "1") this.style.backgroundColor = OutColor
        }
    }
}
function breakOut() {
    if (window.top != window.self) window.top.location = "login.php"
}
function dochange(select_Id, text_Id) {
    var select_Value = _$(select_Id).value;
    var text_Value = _$(text_Id);
    text_Value.innerText = select_Value
}
var addH = 1;
function addHeight(id) {
    if (!_$(id)) return flase;
    var comment = _$(id);
    var nowH = parseInt(comment.style.height);
    if (nowH < 400) {
        nowH += 50;
        comment.style.height = nowH + "px";
        addH++;
        if (addH > 1) addH = 1;
        else window.setTimeout("addHeight(id)", "10")
    }
    AutoHeight()
}
function redHeight(id) {
    if (!_$(id)) return flase;
    var comment = _$(id);
    var nowH = parseInt(comment.style.height);
    if (nowH > 100) {
        nowH -= 50;
        comment.style.height = nowH + "px";
        addH++;
        if (addH > 1) addH = 1;
        else window.setTimeout("redHeight(id)", "10")
    }
    AutoHeight()
}
function is_browser() {
    var browser = '';
    if (window.XMLHttpRequest) {
        if (!window.ActiveXObject) browser = 'FF';
        else browser = 'IE7'
    } else {
        browser = 'IE6'
    }
    return browser
}
function getBodySize() {
    var bodySize = [];
    with(document.documentElement) {
        bodySize[0] = (scrollWidth > clientWidth) ? scrollWidth: clientWidth;
        bodySize[1] = (scrollHeight > clientHeight) ? scrollHeight: clientHeight
    }
    return bodySize
}
function TuneHeight() {
    var frm = document.getElementById("uploads");
    var subWeb = document.frames ? document.frames["goods_img_upload"].document: frm.contentDocument;
    if (frm != null && subWeb != null) frm.height = subWeb.documentElement.scrollHeight
}
var flag = false;
function DrawImage(ImgD, iwidth, iheight) {
    var image = new Image();
    image.src = ImgD.src;
    if (image.width > 0 && image.height > 0) {
        flag = true;
        if (image.width / image.height >= iwidth / iheight) {
            if (image.width > iwidth) {
                ImgD.width = iwidth;
                ImgD.height = (image.height * iwidth) / image.width
            } else {
                ImgD.width = image.width;
                ImgD.height = image.height
            }
            ImgD.alt = image.width + "×" + image.height
        } else {
            if (image.height > iheight) {
                ImgD.height = iheight;
                ImgD.width = (image.width * iheight) / image.height
            } else {
                ImgD.width = image.width;
                ImgD.height = image.height
            }
            ImgD.alt = image.width + "×" + image.height
        }
    }
    var nowheight = image.height;
    if (nowheight !== iheight) {
        ImgD.style.marginTop = ((iheight - ImgD.height) / 2) + "px"
    }
}
function setint(num) {
    num.value = num.value.replace(/\D/g, '');
    return true
}
function getImgPath(obj) {
    if (!obj.value.match(/.jpg|.gif|.png|.bmp/i)) {
        alert('图片格式无效！');
        return false
    }
    if (obj) {
        if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
            obj.select();
            return document.selection.createRange().text
        } else if (window.navigator.userAgent.indexOf("Firefox") >= 1) {
            if (obj.files) {
                return obj.files.item(0).getAsDataURL()
            }
            return obj.value
        }
        return obj.value
    }
}
function in_array(stringToSearch, arrayToSearch) {
    for (s = 0; s < arrayToSearch.length; s++) {
        thisEntry = arrayToSearch[s].toString();
        if (thisEntry == stringToSearch) return true
    }
    return false
}
function implode(glue, pieces) {
    return ((pieces instanceof Array) ? pieces.join(glue) : pieces)
}
function mousePosition(ev) {
    if (ev.pageX || ev.pageY) {
        return {
            x: ev.pageX,
            y: ev.pageY
        }
    }
    return {
        x: ev.clientX + document.body.scrollLeft - document.body.clientLeft,
        y: ev.clientY + document.body.scrollTop - document.body.clientTop
    }
}
function GetByClass(searchClass, node, tag) {
    var classElements = new Array();
    if (node == null) {
        node = document
    }
    if (tag == null) {
        tag = '*'
    }
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp("(^|\\s)" + searchClass + "(\\s|$)");
    for (i = 0, j = 0; i < elsLen; i++) {
        if (pattern.test(els[i].className)) {
            classElements[j] = els[i];
            j++
        }
    }
    return classElements
}
function unique(data) {
    data = data || [];
    var a = {};
    for (var i = 0; i < data.length; i++) {
        a[data[i]] = true
    };
    data.length = 0;
    for (var t in a) {
        data[data.length] = t
    }
    return data
}
var right_type = new Array(".gif", ".jpg", ".jpeg", ".png");
function checkImgType(fileURL) {
    var right_typeLen = right_type.length;
    var imgUrl = fileURL.toLowerCase();
    var postfixLen = imgUrl.length;
    var len4 = imgUrl.substring(postfixLen - 4, postfixLen);
    var len5 = imgUrl.substring(postfixLen - 5, postfixLen);
    for (i = 0; i < right_typeLen; i++) {
        if ((len4 == right_type[i]) || (len5 == right_type[i])) {
            return true
        }
    }
}
var right_type = new Array(".gif", ".jpg", ".jpeg", ".png", ".swf");
function changeSrc(filePicker) {
    if (!checkImgType(filePicker.value)) {
        _$("up_tishi").style.display = "";
        _$("up_tishi").className = "red_tishi";
        return false
    }
}
var defaultStep = 5;
var step = defaultStep;
function scrollDivDown(id) {
    clearTimeout(timerDown);
    document.getElementById(id).scrollTop += step;
    timerDown = setTimeout("scrollDivDown('" + id + "')", 10)
}
function scrollDivUp(id) {
    clearTimeout(timerUp);
    document.getElementById(id).scrollTop -= step;
    timerUp = setTimeout("scrollDivUp('" + id + "')", 10)
}
function scrollDivLeft(id) {
    clearTimeout(timerLeft);
    document.getElementById(id).scrollLeft += step;
    timerLeft = setTimeout("scrollDivLeft('" + id + "')", 10)
}
function scrollDivRight(id) {
    clearTimeout(timerRight);
    document.getElementById(id).scrollLeft -= step;
    timerRight = setTimeout("scrollDivRight('" + id + "')", 10)
}
var timerDown = "";
var timerUp = "";
var timerLeft = "";
var timerRight = "";
function stopScroll() {
    clearTimeout(timerDown);
    clearTimeout(timerUp);
    clearTimeout(timerLeft);
    clearTimeout(timerRight)
}
function text_srcoll(id, w, n) {
    var textBox = _$(id),
    can = true,
    w = w || 1500,
    fq = fq || 10,
    n = (n == -1) ? -1 : 1;
    textBox.innerHTML += textBox.innerHTML;
    textBox.onmouseover = function() {
        can = false
    };
    textBox.onmouseout = function() {
        can = true
    };
    var max = parseInt(textBox.scrollHeight / 2);
    new
    function() {
        var stop = textBox.scrollTop % 20 == 0 && !can;
        if (!stop) {
            var set = (n > 0) ? [max, 0] : [0, max];
            textBox.scrollTop == (set[0]) ? textBox.scrollTop = set[1] : textBox.scrollTop += n
        }
        setTimeout(arguments.callee, (textBox.scrollTop % 18) ? fq: w)
    }
}
function textSrcollPath(mode, id, lineHeight) {
    lineHeight = lineHeight || 20;
    var textBox = _$(id);
    if (mode == 'up') {
        textBox.scrollTop += lineHeight
    } else {
        textBox.scrollTop -= lineHeight
    }
}
function table_color(id, a, b, c, d) {
    var t = document.getElementById(id).getElementsByTagName("tr");
    for (var i = 0; i < t.length; i++) {
        t[i].style.backgroundColor = (t[i].sectionRowIndex % 2 == 0) ? a: b;
        t[i].onmouseover = function() {
            if (this.x != "1") this.style.backgroundColor = c
        }
        t[i].onmouseout = function() {
            if (this.x != "1") this.style.backgroundColor = (this.sectionRowIndex % 2 == 0) ? a: b
        }
    }
}

function chkForm2(theform) {
  if (theform.keywords.value == "") {
    alert("请输入关键字！");
    theform.keywords.focus();
    return false;
  }
}
function doSearch(tmpForm) {
  var keywords = trim(tmpForm.keywords.value);
  tmpForm.keywords.value = keywords;
  var cnmnsm = tmpForm.cnmnsm.value;
  //http://china.21-plastic.com
  var chinaplasticcom = "http://china.21-plastic.com"

  if ((keywords == "请输入关键字名称") || (keywords == "开始新搜索...") || (keywords == "")) {
    alert("请输入关键字！");
    tmpForm.keywords.focus();
    return false;
  }
  if (cnmnsm == "infosearch") {
    url = chinaplasticcom + "/search/news_search.asp";
    tmpForm.action = url;
  }
  if (cnmnsm == "salesearch") {
    url = chinaplasticcom + "/search/search.asp";
    tmpForm.action = url;
  }
  if (cnmnsm == "buysearch") {
    url = chinaplasticcom + "/search/search.asp";
    tmpForm.action = url;
  }
  if (cnmnsm == "product") {
    url = "/search/product_search.asp";
    tmpForm.action = url;
  }
  if (cnmnsm == "comsearch") {
    url = chinaplasticcom + "/search/com_search.asp";
    tmpForm.action = url;
  }
  if (cnmnsm == "process_search") {
    url = "/search/search.asp";
    tmpForm.action = url;
  }
  if (cnmnsm == "secsearch") {
    url = chinaplasticcom + "/search/search.asp";
    tmpForm.action = url;
  }
  if (cnmnsm == "jobrcsearch") {
    url = "/job/PersonalJob.asp";
    tmpForm.action = url;
  }
  if (cnmnsm == "asksearch") {
    url = chinaplasticcom + "/search/ask_search.asp";

    tmpForm.action = url;
  }
}
function trim(inputString) {

  if (typeof inputString != "string") {
    return inputString;
  }
  var retValue = inputString;
  var ch = retValue.substring(0, 1);
  ch = retValue.substring(retValue.length - 1, retValue.length);
  return retValue;
}

function changeForm(o) {
  var oli = o.childNodes;

  var v = document.forms['navsearch']['cnmnsm'].value;
  switch (v) {
  case 'salesearch':
    document.forms['navsearch'].action = 'http://china.21-plastic.com/search/search.asp';
    break;
  case 'process_search':
    document.forms['navsearch'].action = 'http://china.21-plastic.com/search/search.asp';
    break;
  case 'buysearch':
    document.forms['navsearch'].action = '/search/search.asp';
    break;
  case 'comsearch':
    document.forms['navsearch'].action = 'http://china.21-plastic.com/search/com_search.asp';
    break;
  case 'infosearch':
    document.forms['navsearch'].action = 'http://china.21-plastic.com/search/news_search.asp';
    break;
  case 'asksearch':
    document.forms['navsearch'].action = 'http://ask.21-plastic.com/search.asp';
    break;
  case 'i':
    document.forms['navsearch'].action = 'http://china.21-plastic.com/search/news_search.asp';
    break;
  }

}

function sr_onfocus(o) {
  var v = o.value;
  if (v.substring(0, 3) == "请输入") o.value = "";o.style.color = "#000";
}

function checkTopSearch() {
  var v = document.getElementById("search_field").value;
  if (v.substring(0, 3) == "请输入" || v.substring(0, 3) == "") {
    alert('请输入关键字');
    return false;
  }
}

function Marquee()
{
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID)
	{
		alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!");
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "up":0 , "bottom":1 , "down":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3];
	if(typeof arguments[4] == "number")this.Height = arguments[4];
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8];
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}

Marquee.prototype.Start = function()
{
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.HalfHeight = Math.round(this.Height / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width + "px";
	this.ID.style.height = this.Height + "px";
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var templateLeft = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;display:inline;'><tr><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td></tr></table>";
	var templateTop = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;'><tr><td>MSCLASS_TEMP_HTML</td></tr><tr><td>MSCLASS_TEMP_HTML</td></tr></table>";
	var msobj = this;
	msobj.tempHTML = msobj.ID.innerHTML;
	if(msobj.Direction <= 1)
	{
		msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
	}
	else
	{
		if(msobj.ScrollStep == 0 && msobj.DelayTime == 0)
		{
			msobj.ID.innerHTML += msobj.ID.innerHTML;
		}
		else
		{
			msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
		}
	}
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function()
				{
					if(msobj.MouseOver == 1)
					{
						setTimeout(msobj.Continue,delaytime);
					}
					else
					{	clearInterval(msobj.TimerID);
						msobj.CTL = msobj.Stop = 0;
						msobj.TimerID = setInterval(msobj.StartID,timer);
					}
				}

	msobj.Pause = function()
			{
				msobj.Stop = 1;
				clearInterval(msobj.TimerID);
				setTimeout(msobj.Continue,delaytime);
			}

	msobj.Begin = function()
		{
			msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth / 2 : msobj.ID.scrollHeight / 2;
			if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step))			{
				msobj.ID.innerHTML = msobj.tempHTML;
				delete(msobj.tempHTML);
				return;
			}
			delete(msobj.tempHTML);
			msobj.TimerID = setInterval(msobj.StartID,timer);
			if(msobj.ScrollStep < 0)return;
			msobj.ID.onmousemove = function(event)
						{
							if(msobj.ScrollStep == 0 && msobj.Direction > 1)
							{
								var event = event || window.event;
								if(window.event)
								{
									if(msobj.IsNotOpera)
									{
										msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
									}
									else
									{
										msobj.ScrollStep = null;
										return;
									}
								}
								else
								{
									msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
								}
								msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
								msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
								msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
							}
						}
			msobj.ID.onmouseover = function()
						{
							if(msobj.ScrollStep == 0)return;
							msobj.MouseOver = 1;
							clearInterval(msobj.TimerID);
						}
			msobj.ID.onmouseout = function()
						{
							if(msobj.ScrollStep == 0)
							{
								if(msobj.Step == 0)msobj.Step = 1;
								return;
							}
							msobj.MouseOver = 0;
							if(msobj.Stop == 0)
							{
								clearInterval(msobj.TimerID);
								msobj.TimerID = setInterval(msobj.StartID,timer);
							}
						}
		}
	setTimeout(msobj.Begin,waittime);
}

Marquee.prototype.Scroll = function()
{
	switch(this.Direction)
	{
		case 0:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop >= this.ClientScroll)
				{
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
		break;

		case 1:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop <= 0)
				{
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
		break;

		case 2:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft >= this.ClientScroll)
				{
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
		break;

		case 3:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft <= 0)
				{
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
		break;
	}
}
//-->
