var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);
var is_safari = (userAgent.indexOf('webkit') != -1 || userAgent.indexOf('safari') != -1);
var note_step = 0;
var note_oldtitle = document.title;
var note_timer;
function _$(id) {
	return document.getElementById(id);
}
function addSort(obj) {
	if (obj.value == 'addoption') {
 	var newOptDiv = document.createElement('div')
 	newOptDiv.id = obj.id+'_menu';
 	newOptDiv.innerHTML = '<h1>添加</h1><a href="javascript:;" onclick="addOption(\'newsort\', \''+obj.id+'\')" class="float_del">删除</a><div class="popupmenu_inner" style="text-align: center;">名称：<input type="text" name="newsort" size="10" id="newsort" class="t_input" /><input type="button" name="addSubmit" value="创建" onclick="addOption(\'newsort\', \''+obj.id+'\')" class="button" /></div>';
 	newOptDiv.className = 'popupmenu_centerbox';
 	newOptDiv.style.cssText = 'position: absolute; left: 50%; top: 380px; width: 400px; margin-left: -200px;';
 	document.body.appendChild(newOptDiv);
 	$('newsort').focus();
 	}
}

function addOption(sid, aid) {
	var obj = $(aid);
	var newOption = $(sid).value;
	$(sid).value = "";
	if (newOption!=null && newOption!='') {
		var newOptionTag=document.createElement('option');
		newOptionTag.text=newOption;
		newOptionTag.value="new:" + newOption;
		try {
			obj.add(newOptionTag, obj.options[0]); // doesn't work in IE
		} catch(ex) {
			obj.add(newOptionTag, obj.selecedIndex); // IE only
		}
		obj.value="new:" + newOption;
	} else {
		obj.value=obj.options[0].value;
	}
	// Remove newOptDiv
	var newOptDiv = document.getElementById(aid+'_menu');
	var parent = newOptDiv.parentNode;
	var removedChild = parent.removeChild(newOptDiv);
}

function checkAll(form, name) {
	for(var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if(e.name.match(name)) {
			e.checked = form.elements['chkall'].checked;
		}
	}
}

function cnCode(str) {
	return is_ie && document.charset == 'utf-8' ? encodeURIComponent(str) : str;
}

function isUndefined(variable) {
	return typeof variable == 'undefined' ? true : false;
}

function in_array(needle, haystack) {
	if(typeof needle == 'string' || typeof needle == 'number') {
		for(var i in haystack) {
			if(haystack[i] == needle) {
					return true;
			}
		}
	}
	return false;
}

function strlen(str) {
	return (is_ie && str.indexOf('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length;
}

function getExt(path) {
	return path.lastIndexOf('.') == -1 ? '' : path.substr(path.lastIndexOf('.') + 1, path.length).toLowerCase();
}

function doane(event) {
	e = event ? event : window.event;
	if(is_ie) {
		e.returnValue = false;
		e.cancelBubble = true;
	} else if(e) {
		e.stopPropagation();
		e.preventDefault();
	}
}
//缩小图片并添加链接
function resizeImg(id,size) {
    var theImages = document.getElementById(id).getElementsByTagName('img');
    for (i=0; i<theImages.length; i++) {
        theImages[i].onload = function() {
            if (this.width > size) {
                this.style.width = size + 'px';
                if (this.parentNode.tagName.toLowerCase() != 'a') {
                    var zoomDiv = document.createElement('div');
                    this.parentNode.insertBefore(zoomDiv,this);
                    zoomDiv.appendChild(this);
                    zoomDiv.style.position = 'relative';
                    zoomDiv.style.cursor = 'pointer';

                    this.title = '点击图片，在新窗口显示原始尺寸';

                    var zoom = document.createElement('img');
                    zoom.src = '/images/zoom.gif';
                    zoom.style.position = 'absolute';
                    zoom.style.marginLeft = size -28 + 'px';
                    zoom.style.marginTop = '5px';
                    this.parentNode.insertBefore(zoom,this);

                    zoomDiv.onmouseover = function() {
                        zoom.src = '/images/zoom_h.gif';
                    }
                    zoomDiv.onmouseout = function() {
                        zoom.src = '/images/zoom.gif';
                    }
                    zoomDiv.onclick = function() {
                        window.open(this.childNodes[1].src);
                    }
                }
            }
        }
    }
}

function add_fav(url,title) {
if(navigator.appName=="Microsoft Internet Explorer") {
window.external.addFavorite(url,title)
}else if (window.sidebar){
window.sidebar.addPanel(title,url, "");
}
}
function setHomepage(url){
if(document.all){
      document.body.style.behavior='url(#default#homepage)';
      document.body.setHomePage(url);
   }
   else if(window.sidebar){
        if(window.netscape){
             try{
                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             }
             catch(e){
                 alert("亲爱的用户你好：\n你使用的不是IE浏览器，此操作被浏览器阻挡了，你可以选择手动设置为首页功能，开启方法：先在地址栏内输入about:config,然后将项 signed.applets.codebase_principal_support 值该为true即可");
             }
        }
        var prefs=Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage',url);
   }
}
function showtype(t_id,ac) {
	$("#fw_button").hide();	$("#fw_title div.right").show(); $("#fw_load").hide();$("#fw_body").show();
	if (ac==0) $("#fw_body").html($("#type_"+t_id).html());
	else $("#fw_body").html($("#typebbs_"+t_id).html());

	$("#fw_title div.left").html("提示信息");
	if (t_id==1 || t_id==2 || t_id==5) $("#floatwin").css({width:'500px',height:''});
	else $("#floatwin").css({width:'300px',height:''});
	$("#floatwin").runfloatwin();
	return false;
}
//动态添加表格
var Browser = new Object();
Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument != 'undefined');
Browser.isIE = window.ActiveXObject ? true: false;
Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") != -1);
Browser.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);
Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);

var Utils = new Object();
function rowindex(tr) {
  if (Browser.isIE) {
    return tr.rowIndex;
  } else {
    table = tr.parentNode.parentNode;
    for (i = 0; i < table.rows.length; i++) {
      if (table.rows[i] == tr) {
        return i;
      }
    }
  }
}
//复制URL地址
function setCopy(_sTxt){
	if(is_ie) {
		clipboardData.setData('Text',_sTxt);
		alert ("网址“"+_sTxt+"”\n已经复制到您的剪贴板中\n您可以使用Ctrl+V快捷键粘贴到需要的地方");
	} else {
		prompt("请复制地址:",_sTxt);
	}
}
function addImg(obj) {
  var src = obj.parentNode.parentNode;
  var idx = rowindex(src);
  var tbl = document.getElementById('gallery-table');
  var row = tbl.insertRow(idx + 1);
  var cell = row.insertCell( - 1);
  cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addImg)(.*)(\[)(\添加预订)/i, "$1removeImg$3$4删除预订");
}
function removeImg(obj) {
  var row = rowindex(obj.parentNode.parentNode);
  var tbl = document.getElementById('gallery-table');

  tbl.deleteRow(row);
}
/*js获得随机字符串 len需要获得的长度*/
function roundString (len){
		var str =  ['a','b','c','d','e','f','h','j','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
		var hash = '';
		for(i=0;i<len;i++){
			var r = str[Math.ceil(Math.random()*100)];
			if(r!=undefined)hash +=r;
		}
		if(hash.length<len)hash+=roundString(len-hash.length);
		return hash;
}
//显示提示信息
function showNotice(msg,options){
	var defaults = {width:300};
	var options = $.extend({},defaults,options);
	$('div').remove('#showAjaxMsg');//先删了再来
	$("body").append('<div id="showAjaxMsg">'+msg+'</div>');
    $("#showAjaxMsg").css({
								'border':'1px solid #E1562d',
								'z-index':'99999999',
								'text-align':'center',
								'line-height':'40px',
								'position':'absolute',
								//'background-color':'#000',
								'background-color':'#F4CD81',
								'top':'40%','left':'35%',
								'line-height':'40px',
								'width':'0px',
								'height':'0px',
								'font-size':'14px',
								'font-weight':'bold',
								'display':'none',
								'color':'#FFF'
	})
	$('embed, object, select').css({ 'visibility' : 'hidden' });
	$("#showAjaxMsg").animate({opacity: "1", left: "30%", top:"40%", height: "4", width: "4"}, 10)
		.animate({opacity: "1", left: "30%", top:"40%",height: "40", width: options.width},1000)
		.animate({opacity: "1",left: "30%", top:"40%",height: "40", width: options.width},2000)
		.animate({opacity: "0", left: "0", top:"40%"}, 400)
		.animate({opacity: "0", left: "0", top:"0",height:"0",width:'0'}, 0);
		$('embed, object, select').css({ 'visibility' : 'visible' });
		return false;
}
//加载等待框
function showLoading(){
		$("body").append('<div id="ajax_set_loading" style="position:absolute;background-color: #900; color: #525252;right:0px; top:0px;color:#FFF; padding:5px 6px; width:100px;">数据加载中...</div>');
	 var loading_dom = $("#ajax_set_loading");
	 if($(loading_dom).size()) {
			var init = $(loading_dom).offset();
			var init_top = init.top;
			init_left = 0;
			init_top = parseInt(init_top+0);
			function scrolltop() {
				var pageY = $(window).scrollTop();
				pageY = parseInt(pageY+0);
				if (pageY > init_top){
					 $(loading_dom).css({"top":pageY+'px',"right":init_left+'px'});
				 }else{ 
					$(loading_dom).css({"top":init_top+'px',"right":init_left+'px'});
				}
				window.setTimeout(scrolltop, 1);
			}
			scrolltop();
		}
	}
function closeLoading(){$("#ajax_set_loading").remove();}
$(function(){
	$(".loading").click(function(){showLoading();});
	$(this).ajaxStart(function(){showLoading();});
	$(this).ajaxSuccess(function(){closeLoading();});
})
//添加收藏兼容firefox
function AddFavorite(sURL, sTitle)
{
    try{ window.external.addFavorite(sURL, sTitle);
    } catch (e){
        try{
            window.sidebar.addPanel(sTitle, sURL, '');
        }catch (e){
            alert('加入收藏失败，请使用Ctrl+D进行添加');
        }
    }
}
//设为首页
function SetHome(obj,vrl){
        try{obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);}
        catch(e){if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                        }
                        catch (e)  {
                                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]设置为'true'");
                        }
						try{
                        var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
							}
						catch(e){}
                 }
        }
}
//获取复选框按钮值
function   getRadioBoxValue(radioName)  
{  
	var obj = document.getElementsByName(radioName); 
    for(i=0;i<obj.length;i++)
	{  
		if(obj[i].checked)
		{
			return   obj[i].value;
		}  
	}          
	return "undefined";
}
/*
 * 检测一个字符串是否为空
*/
function empty (string){
	return $.trim(string)==''?true:false;
}
/*
 * jquery的ajax方式获取数据
*/
function getData(urls){
	var obj = $.ajax({
		url: urls+'&rand='+Math.random(),
		async: false,
		cache:false
	});
return obj.responseText;
}
/** 
 * 检查 是否 含有 特殊字符 
 *含有 返回 false 没有返回 true 
 **/
 function chkstr(str){
	for (var i = 0; i < str.length; i++){
	   if (str.charCodeAt(i) < 127 && !str.substr(i,1).match(/^\w+$/ig)){
		   return false;
	   }
	}
	return true;
}
/**
 * 检查 是否 符合 email 邮箱的规范  符合 true 不符合 false
 * @param email string
 * @return boolean
 */
function checkemail(email){
	var   pattern   =   /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/; 
    if(!pattern.test(email)){ 
    	return false;
    }
    return true;
}
function is_email(email){
	return checkemail(email);	
}
/**
 * 是否 是 一个 正确的手机号  是 true 不是 false
 * 支持 13 150 151
 * @param int mobile
 * @return boolean
 */
function is_mobile(mobile){
	var reg =/^1(3[0-9]|5[0,1,2,3,6,8,9]|8[6,8,9])[0-9]{8}$/;
    if(!reg.test(mobile)){
        return false;
    }else{
        return true;
    }
}
function get_data(urls){
	var obj = $.ajax({
		url: urls+'&rand='+Math.random(),
		async: false,
		cache:false
	});
	return $.trim(obj.responseText);
}
function inArray(v,ary){
	if(!$.isArray(array))return false;
	for(k in ary){
		if(ary[k]==v)return true;
	}
	return false;
}
function checkAllFormData(ids,classes){
	$("#"+ids).click(function(){
		$("."+classes).attr('checked',$("#"+ids).attr('checked'));
	});
}
function get_checkbox_val(c){
	var checked = $("."+c).map(function(){
		if($(this).attr('checked'))return $(this).val();
	}).get().join(',');
	return $.trim(checked)==''? false:checked;
}
function isIe6(){return $.browser.version==6.0?true:false;}
function showWidow(obj,title,w,h){
	$(obj).newWindow({windowTitle:title,ajaxURL:$(obj).attr('name'),width:w,height:h,resizeable:true,maximizeButton:true,showLayer:true});
}
function open_new_window(options){
	$("body").newWindow(options)
}
function add_categroy(vv,vtitle){
	window.parent.open_new_window({
	ajaxURL:vv,
	windowTitle:vtitle,
	showLayer:true,
	width:600,
	height:300
	});	
}
function opencat(cat,img){
	if(cat.style.display=="none"){
	cat.style.display="";
	img.src="/template/default/images/class2.gif";
	}	else {
	cat.style.display="none"; 
	img.src="/template/default/images/class1.gif";
	}
}
function EndSortChange(a,b)
{
   var aa=document.getElementById(a);
   var bb=document.getElementById(b);
	if(aa.style.display=='')
	{
		aa.style.display='none';
		bb.className='SortEndFolderOpen';
	}
	else
	{
		aa.style.display='';
		bb.className='SortEndFolderClose';
		
	}
}
function SortChange(a,b)
{
  var aa=document.getElementById(a);
   var bb=document.getElementById(b);
	if(aa.style.display=='')
	{
		aa.style.display='none';
		bb.className='SortFolderOpen';
	}
	else
	{
		aa.style.display='';
		bb.className='SortFolderClose';
	}
}
//焦点图片播放器
function focucImgPlayer(id){
	var interv=3000; //切换间隔时间
	var intervSpeed=10; //切换速度,0不使用渐显
	var timer, timer1, timer2, timer3;
	
	var change = _$(id + '-change');
	if(!change){return}
	change = change.getElementsByTagName('li');
	if(!change){return}
	var picnum = change.length;
	if(!picnum){return}
	var txt = _$(id + '-txt');
	var img = _$(id + '-img');
	var i,cpic,tpic,timer,cls,title,src,href,a,p;
	var list='';
	for(i=0;i<picnum;i++){
		cls = i == 0 ? '' : 'alpha';
		p = change[i].getElementsByTagName('p')[0];
		a = p.getElementsByTagName('a')[0]
		title = a.innerHTML;
		href = a.href;
		var srcimg = change[i].getElementsByTagName('img')[0];
		src = srcimg.src.replace('_s', '_w');
		list += '<div class="'+cls+'"><a href="'+href+'" target="_blank"><img src="'+src+'" title="'+title+'" /></a></div>';
		change[i].index = i;
		change[i].link = p.innerHTML + '<p>' + ( srcimg.attributes['description'] ? srcimg.attributes['description'].value : '' ) + '</p>';
		change[i].onclick = function(){
			cpic = cpic ? cpic : 0;
			list[cpic].opacity = 0;
			alpha(list[cpic]);
			setActive(cpic?cpic:0);
			cpic = tpic = this.index;
			list[tpic].opacity = 100;
			alpha(list[tpic]);
			txt.innerHTML = this.link;
			setActive(tpic,true);
			tpic = tpic == (picnum - 1) ? 0 : tpic + 1;
			window.clearInterval(timer);
			timer = window.setInterval(loop, interv + 1000);
		}
	}
	img.innerHTML = list;
	setActive(0, true); 
	list = img.getElementsByTagName('div');
	function setActive(n,f){if(f){change[n].className='active';txt.innerHTML=change[n].link}else{change[n].className=''}}
	if(picnum < 2){return}
	//控制图层透明度
	function alpha(o){if(document.all){o.style.filter="alpha(opacity="+o.opacity+")";}else{o.style.opacity=(o.opacity/100)}}
	//渐显
	var fadeon=function(){tpic=tpic>=0?tpic:1;var o=list[tpic];if(intervSpeed>0){if(!o.opacity){o.opacity=0}o.opacity+=5;if(o.opacity<10){setActive(tpic,true)}}else{setActive(tpic,true);o.opacity=100}alpha(o);if(o.opacity<100){window.clearTimeout(timer1);timer1=setTimeout(fadeon,intervSpeed)}else{cpic=tpic;tpic=tpic==(picnum-1)?0:tpic+1;}}
	//渐隐
	var fadeout=function(){cpic=cpic>0?cpic:0;var o=list[cpic];if(intervSpeed>0){if(!o.opacity){o.opacity=100}o.opacity-=5;if(o.opacity>90){setActive(cpic);}}else{setActive(cpic);o.opacity=0}alpha(o);if(o.opacity>0){window.clearTimeout(timer2);timer2=setTimeout(fadeout,intervSpeed)}}
	//循环
	var loop = function(){fadeout();window.clearTimeout(timer3);timer3=setTimeout(fadeon,intervSpeed+40)}
	timer = window.setInterval(loop, interv);
}
//走马灯滚动的总脚本Begin
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;
	}
}
//走马灯滚动的总脚本End

