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 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("this action was aviod by your browser，if you want to enable，please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");
            }
         }
         var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
         prefs.setCharPref('browser.startup.homepage',url);
     }
}


//FlaschActiveX
function flashView(URL,SizeX,SizeY,transparent_YN){
	document.write( '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+SizeX+'" height="'+SizeY+'" id="menuLink" align="middle">');
	document.write('<param name="movie" value="'+URL+'" />');
	document.write('<param name="quality" value="high" />');
	if(transparent_YN == 'Y') {
		document.write(	'<param name="wmode" value="transparent"/>');
		//document.write(	'<param name="bgcolor" value="#ffffff" />');
	}
	//document.write('<param name=wmode value="opaque">');
	document.write(	'<embed src="'+URL+'" quality="high" width="'+SizeX+'" height="'+SizeY+'" name="menuLink" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  /></object>');
}


function ShowHide(id,top,left){
    var leftpx = (document.body.clientWidth - 960)/2 + left;
	var online= new Array();
	var arr = new Array();
	arr[0] = ['林敏丽','860008472','d301c40140685a6daaed40551ac84a7a00760f0a05c0166ad58555424b74c979','0574-81379164','nbdh7'];
	arr[1] = ['徐丽娜','860008478','c9e7ef551e78187f9102977a8822e47ae8eb840ca8374e8099ede050e79068f8','0574-66374113','nbdh2'];
	arr[2] = ['郑叶平','908884950','e3e8c89d67f95acd6ed2ae6ba4638b95626b33fc0dfce2e9a6fc27474833a8b8','0574-82333413','nbdh1'];
	arr[3] = ['孙易玲','645464335','2e023f8f6c2200617575c61ae17689b085d9055626f894f98cb84bd9bbcc2abb','0574-82362550','nbdh5'];
	qqlist = '';
	for(i=0;i<arr.length;i++){
		qqlist += arr[i][1]+':';
	}
	var sdate = new Date();
	var intHours = sdate.getHours();
	if(intHours>17 || intHours<8){
		qqstats = 'btn-qq-offline.gif';
	}else{
		qqstats = 'btn-qq.jpg';
	}
	str = '<script src="http://webpresence.qq.com/getonline?Type=1&'+qqlist+'"><\/script>';
	str += '<div style=" left:'+leftpx+'px; top:'+top+'px; padding:5px; width:264px; position:absolute;z-index:50; background:url(http://img2.nb-114.com/img/home.jpg) -380px -432px #FFFFFF; color:#333; border-left:#FDC395 solid 1px; border-right:#FDC395 solid 1px; border-bottom:#FDC395 solid 1px; float:left"><table width="100%" border="0" cellspacing="0" cellpadding="2">';
	for(i=0;i<arr.length;i++){
		str += '<tr><td width="50">'+arr[i][0]+'：</td><td width="45"><a href="tencent://message/?Menu=yes&uin='+arr[i][1]+'&Site=甬商网&Service=200&sigT='+arr[i][2]+'" target="_self"><img src="http://img2.nb-114.com/img/'+qqstats+'" alt="QQ交谈或留言" width="45" height="17" /></a></td><td width="42" align="center">';
		if(arr[i][4]){
		str += '<a href="javascript://" onclick="window.open(\'http://www.53kf.com/company.php?arg=nbdh&amp;style=1&amp;kf='+arr[i][4]+'&amp;kflist=off&amp;kfstat=1&amp;zdkf_type=1\',\'_blank\',\'height=473,width=703,fullscreen=3,top=200,left=200,status=yes,toolbar=no,menubar=no,resizable=no,scrollbars=no,location=no,titlebar=no,fullscreen=no\');" target="_self"><img src="http://www.53kf.com/kfimg.php?arg=nbdh&amp;style=1&amp;kf='+arr[i][4]+'&amp;on_img=http://img2.nb-114.com/img/online.gif&amp;off_img=http://img2.nb-114.com/img/offline.gif" alt="在线交谈或留言" width="36" height="18" /></a>';
		}else{
			str += '<img src="http://img2.nb-114.com/img/offline.gif" width="36" height="18" />'; 	
		}
		str += '</td><td>';
		if(arr[i][3]){
		str += '<img src="http://img2.nb-114.com/img/btn-tel.jpg" align="absmiddle" width="15" height="14" />&nbsp;'+arr[i][3];
		}
		str += '</td></tr>';
	}
	str += '</table></div>';
	
	var divid = document.getElementById(id);
	divid.style.display='block';
	divid.innerHTML=str;
	document.getElementById('ih1').className='ih11';
}
function HideDiv(id){
	document.getElementById(id).style.display='none';
	document.getElementById('ih1').className='ih1';
}
function KeepMenu(id){
	document.getElementById(id).style.display='block';
	document.getElementById('ih1').className='ih11';
}

function stag(num){
    var all_obj=document.getElementById('smenu').getElementsByTagName("LI");
    for(var i=0;i<all_obj.length;i++)
    {
		all_obj[i].className="";
        if(i==num)
        {
            all_obj[i].className="focus";
			$('typeid').value = num;
			if(num==3){
			$("ModuleName").disabled=false;
			$("key").disabled=false;
			}else{
			$("ModuleName").disabled=true;
			$("key").disabled=true;		
			}
		}
    }
}

function sform(){
	if(document.form1.word.value=="请输入您需要找的关键词" || document.form1.word.value==""){
		alert('请输入关键词');
		document.form1.word.focus();
		return false
	}
	var typeid = $('typeid').value;
	if(typeid==""||typeid=="0"){
		document.form1.action="http://www.nb-114.com/search/company.htm";
	}else if(typeid!="3"){
		document.form1.action="http://www.nb-114.com/search/tradeinfo.htm";
	}else if(typeid=="3"){
		$("key").value=$("word").value;
		document.form1.action="http://info.nb-114.com/search.asp";
		}
	return true;
}

//-----------------------------------------
function $(objId)
{
	var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string')
element = document.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}
String.prototype._indexOf = String.prototype.indexOf;
String.prototype.indexOf = function()
{
if(typeof(arguments[arguments.length - 1]) != 'boolean'){
return this._indexOf.apply(this.toLowerCase(),arguments);
}
else
{
var bi = arguments[arguments.length - 1];
var thisObj = this;
var idx = 0;
if(typeof(arguments[arguments.length - 2]) == 'number')
{
idx = arguments[arguments.length - 2];
thisObj = this.substr(idx);
}
var re = new RegExp(arguments[0],bi?'i':'');
var r = thisObj.match(re);
return r==null?-1:r.index + idx;
}
}
function $s() {//事件对象
	return event.target?event.target : event.srcElement;
}
//动态创建脚本
function CreateDomScript(url,objId)
{
	if($(objId)) document.body.removeChild($(objId));
	var objScript = document.createElement('script');
	objScript.id = objId;
	objScript.language = 'javascript';
	objScript.src = url;
	document.body.appendChild(objScript);
}
//随机数 能取到0  rnd(10) 0-10
function rnd(number) {
	var vNum
	vNum = Math.random()
	vNum = Math.round(vNum*number)
	return vNum;
}

//加载图片
function showimage(img){
	if(img.width>=img.height){
		if(img.width>250){
			img.width = 250;
		}
	}else if(img.width<img.height){
		if(img.height>250){
			img.height = 250;
		}
	}
}
function loadImage(url,w,h)
{
	nopic="http://img.nb-114.com/tradeinfo/nopic.jpg";
	var rndname=rnd(1000);
	document.write('<span id="showimg-'+rndname+'" style="color:#999999;"><img src="http://img.nb-114.com/user/loading.gif" /></span>');
	var img=new Image();
	img.src=url;
	
	if (img.width)
	{
		if (img.width>w || img.height>h)
		{
			if (img.width/img.height>w/h)
			{
				imgHTML='<img src="'+url+'" width="'+w+'" />';
			}
			else
			{
				imgHTML='<img src="'+url+'" height="'+h+'" />';
			}
		}
		else
		{
			imgHTML='<img src="'+url+'" />';
		}
			$("showimg-"+rndname).innerHTML=imgHTML;
		img.error=function(){$("showimg-"+rndname).innerHTML=imgHTML='<img src="'+nopic+'" height="'+h+'" />'}
	}
	else
	{
		img.onload=function(){
			if (img.width>w || img.height>h)
			{
				if (img.width/img.height>w/h)
				{
					imgHTML='<img src="'+url+'" width="'+w+'" />';
				}
				else
				{
					imgHTML='<img src="'+url+'" height="'+h+'" />';
				}
			}
			else
			{
				imgHTML='<img src="'+url+'" />';
			}
				$("showimg-"+rndname).innerHTML=imgHTML;
			img.error=function(){$("showimg-"+rndname).innerHTML=imgHTML='<img src="'+nopic+'" height="'+h+'" />'}
		}
	}
}
//文本框输入数字限制
function inputNumber()
{
	obj=$s();
	if (obj)
	{
		if (!isnumeric(obj.value))
			alert('请输入数字！');
	}
}
//报错提示
function PostError(error_info)
{
	alert(error_info);
}
//页面跳转
function Goto(url)
{
    location.href=url;
}
function Goto_Target(url,targetid)
{
    targetid.src=url;
}
//显示信息
function Msg(msg)
{
    alert(msg);
}
//接收参数
function Request(strName)
{
	var strHref = window.document.location.href;
	var intPos = strHref.indexOf("?");
	var strRight = strHref.substr(intPos + 1);

	var arrTmp = strRight.split("&");
	for(var i = 0; i < arrTmp.length; i++)
	{
		var arrTemp = arrTmp[i].split("=");

		if(arrTemp[0].toUpperCase() == strName.toUpperCase()) return arrTemp[1];
	}
	return "";
}
//显示隐藏层
function showhide(id){
  try{
    var panel=$(id);
    if(panel){
      if(panel.style.display=='none'){
        panel.style.display='block';
      }else{
        panel.style.display='none';
      }
    }
  }catch(e){}
}

//FlaschActiveX
function flashView(URL,SizeX,SizeY,transparent_YN){
	document.write( '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+SizeX+'" height="'+SizeY+'" id="menuLink" align="middle">');
	document.write(	'<param name="movie" value="'+URL+'" />');
	document.write(	'<param name="quality" value="high" />');
	if(transparent_YN == 'Y') {
		document.write(	'<param name="wmode" value="transparent"/>');
		//document.write(	'<param name="bgcolor" value="#ffffff" />');
	}
	document.write(	'<embed src="'+URL+'" quality="high" bgcolor="#ffffff" width="'+SizeX+'" height="'+SizeY+'" name="menuLink" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}
//************************* base  start ***********************************************

//************************* string  start ***********************************************
String.prototype.endWith=function(str){    
	return   (this.substr(this.length-str.length,this.length)==str);   
}      
String.prototype.startWith=function(str){    
	return   (this.substr(0,str.length)==str);   
}   
String.prototype.left=function(l){
	return   this.substring(0,parseInt(l))  ;
}   
String.prototype.right=function(l){
	return   this.substring(this.length-l,this.length)  ;
}
String.prototype.trim=function(){   
	return this.replace(/^ +/,"").replace(/ +$/,"");
}
String.prototype.cutStr=function(str1,str2){ //之间  
	return this.substring(this.indexOf(str1)+str1.length,this.indexOf(str2,this.indexOf(str1)+str1.length));
}
/*显示或隐藏*/
function showul(ulclsname,layername,styless)
{
	var showmore = document.getElementById(ulclsname);
	var Lshow = document.getElementById(layername);
	var disp="";
	if(Lshow)
	{
		if(Lshow.className == "tslisli1")
		{
            Lshow.innerHTML = "<A class=red style=cursor:hand onmouseover=this.style.textDecoration='underline'   onmouseout=this.style.textDecoration='' onclick=\"showul('"+ulclsname+"','"+layername+"','"+styless+"');\">简洁显示</A>";
			Lshow.className = "tslisli2";
			disp = "block";
		}
		else
		{
			Lshow.innerHTML = "<A class=red style=cursor:hand onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration=''  onclick=\"showul('"+ulclsname+"','"+layername+"','"+styless+"');\">显示全部</A>";
			Lshow.className = "tslisli1";
			disp = "none";
		}
	}
	var es = document.getElementById(ulclsname);
	for (var j = 0; j < es.childNodes.length; j++) {
		var child = es.childNodes.item(j);
		if (child && (child.tagName == 'li' || child.tagName == 'LI') && child.className && child.className == styless)child.style.display=disp;
	}
}
//验证电话号码
function check_tel(TelNumStr) 
{ 
    TelNumStr=trim(TelNumStr);
    if(TelNumStr.length==0 || TelNumStr==null)
		return false;
	// 电话：0开头7-8位的数字 手机：13开头9位数字 159开头8位数字 
	var reg=/([0-9]{3,4}\-[0-9]{7,8})|([0-9]{7,8})|(0{0,1}13[0-9]{9})|(\s)/; 
	return reg.test(TelNumStr);
} 
//检测域名
function check_domain(domain)
{
    domain=trim(domain);
    if(domain.length==0 || domain==null)
        return false;
    else
    {
        var filter=/^(www.)([a-z0-9-]){3,20}(.com|.cn|.net|.org|.cc|.tv|.biz|.info|.ac|.bj|.sh|.tj|.cq|.he|.sx|.nm|.ln|.jl|.hl|.js|.zj|.ah|.fj|.jx|.sd|.ha|.hb|.hn|.gd|.gx|.hi|.sc|.gz|.yn|.gs|.qh|.nx|.xj|.tw|hk|.mo){1,2}$/i;
        return filter.test(domain);
    }
}
//检测邮件格式
function check_email(email)
{
    email=trim(email);
    if(email.length==0 || email==null)
        return false;
    else
    {
        var filter=/^[\w\.\-]+@([\w\-]+\.)+[a-z]{2,4}$/ig;
        return filter.test(email);
    }
}
function isnumeric(str) {
    if(str.length==0 || str == null)
        return false;
	var filter=/^[0-9]{1,50}$/
	return filter.test(str);
}
//检测身份证格式
function check_keyid(keyid)
{
    keyid=trim(keyid);
    if(keyid.length!=15 && keyid.length!=18)
        return false;
    else if(keyid.length==15)
    {
        var filter=/^[0-9]{14}([0-9]|[xX]){1}$/ig;
        return filter.test(trim(keyid));
    }
    else if(keyid.length==18)
    {
        var filter=/^[0-9]{17}([0-9]|[xX]){1}$/ig;
        return filter.test(trim(keyid));
    }
}
//过滤空格
function trim(inputString) 
{
	return inputString.replace(/^ +/,"").replace(/ +$/,"");
}
   /*LTrim(string):去除左边的空格*/
  function ltrim(str) {
    var whitespace = new String(" \t\n\r");
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(0)) != -1) {
        var j=0, i = s.length;
        while (j < i && whitespace.indexOf(s.charAt(j)) != -1) {
            j++;
        }
        s = s.substring(j, i);
    }
    return s;
  }
  /*RTrim(string):去除右边的空格*/
  function rtrim(str) {
    var whitespace = new String(" \t\n\r");
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
        var i = s.length - 1;
        while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) {
            i--;
        }
        s = s.substring(0, i+1);
    }
    return s;
  }
//统计某个字符串的个数
function charcount(str,chr)
{
    return str.split(chr).length;
}
function encodeurl(str)
{
    var i=window.encodeURIComponent?encodeURIComponent:escape;
    return i(str);
}
//************************* string  end ***********************************************



function loading_html(objId,msg,top,left)
{
var str='<div style="margin:-28px 0px 0px 100px;padding:8px;position:absolute;z-index:50;"> <span id="lod_ing" style="padding:7px 6px 5px 6px;border:1px #CCCCCC solid; height:20px;background:#FFFFE0;">'+msg+'</span></div>';
try
{
	if($(objId)) document.body.removeChild($(objId));
	var objdiv = document.createElement('div');
	objdiv.id = objId;
	document.body.appendChild(objdiv);
	$(objId).innerHTML=str;
	if(top!=null && top!=0)
	{
	    $(objId).style.top=(document.documentElement.scrollTop+top)+'px';
	}
    if(left!=null && left!=0)
	{
	    $(objId).style.top=left+'px';
	}
}
catch(e)
{

}  
}
//************************* from  start ***********************************************

//读取复选框值
function read_checkbox(rname){
	var str=''  
	var temp=document.getElementsByName(rname);
	for (i=0;i<temp.length;i++){
    if(temp[i].checked){
      if (str==''){str=temp[i].value}else{str=str+','+temp[i].value}
      }
 	}
	return str;
}
//读取单选框值
function read_radio(rname){   
	var temp=document.getElementsByName(rname);
	for (i=0;i<temp.length;i++){
    if(temp[i].checked){
      return temp[i].value;
      }
 	}
	return "";
}
//通用取值函数分三类进行取值
//文本输入框,直接取值el.value
//单多选,遍历所有选项取得被选中的个数返回结果"00"表示选中两个
//单多下拉菜单,遍历所有选项取得被选中的个数返回结果"0"表示选中一个
function GetFieldValue(el)
{
    //取得表单元素的类型
    var sType = el.type;
    switch(sType)
    {
        case "text":
        case "hidden":
        case "password":
        case "file":
        case "textarea": return el.value;
        case "checkbox":
        case "radio": return GetValueChoose(el);
        case "select-one":
        case "select-multiple": return GetValueSel(el);
    }

//取得radio,checkbox的选中值，多个值用";"分开
    function GetValueChoose(el)
    {
        var sValue = "";
        //取得第一个元素的name,搜索这个元素组
        var tmpels = document.getElementsByName(el.name);
        for(var i=0;i<tmpels.length;i++)
        {
            if(tmpels[i].checked)
            {
                sValue += tmpels[i].value+";";
            }
        }
        return sValue;
    }
    //取得select的选中值，多个值用";"分开
    function GetValueSel(el)
    {
        var sValue = "";
		var l=0;
        for(var i=0;i<el.options.length;i++)
        {
            //单选下拉框提示选项设置为value=""
            if(el.options[i].selected )
            {
                sValue += el.options[i].value+";";
				l++;
            }
        }
		sValue=l==1?sValue.replace(";",""):sValue;
        return sValue;
    }
}

//通用返回函数,验证没通过返回的效果.分三类进行取值
//文本输入框,光标定位在文本输入框的末尾
//单多选,第一选项取得焦点
//单多下拉菜单,取得焦点
function GoBack(el)
{
    //取得表单元素的类型
    var sType = el.type;
    switch(sType)
    {
        case "text":
        case "hidden":
        case "password":
        case "file":
        case "textarea": el.focus();var rng = el.createTextRange(); rng.collapse(false); rng.select();
        case "checkbox":
        case "radio": var els = document.getElementsByName(el.name);els[0].focus();
        case "select-one":
        case "select-multiple":el.focus();
    }
}


//RootNodes methods
function RootNodes(id, title) {
    this.id = id;
    this.title = title;
    this.childNodes = new Array();
    this.childOptions = new Array();
    this.addChildNode = addChildNode;
    this.option = new Option(this.title, this.id);
    if(this.id == 0){
    	this.option.style.color="#CCCCCC";
	}
    this.getChildOptions = getChildOptions;
}
//childNode methods
function childNode(parent, id, title) {
    this.parent = parent;
    this.id = id;
    this.title = title;
    this.childNodes = new Array();
    this.childOptions = new Array();
    this.addChildNode = addChildNode;
    this.option = new Option(this.title, this.id);
    if(this.id == 0){
    	this.option.style.color="#CCCCCC";
	}
    this.getChildOptions = getChildOptions;
    parent.addChildNode(this);
}

//leafage category methods
function LeafNode(parent, id, title) {
    this.parent = parent;
    this.id = id;
    this.title = title;
    this.option = new Option(this.title, this.id);
    if(this.id == 0){
    	this.option.style.color="#CCCCCC";
	}
    parent.addChildNode(this);
}
function addChildNode(childNode) {
    this.childNodes = this.childNodes.concat(childNode);
    this.childOptions = this.childOptions.concat(childNode.option);
}

function getChildOptions() {
    return this.childOptions;
}
/*纵向滚动*/
function slideLine(ul, delay, speed, lh) {
var slideBox = (typeof ul == 'string')?document.getElementById(ul):ul;
var delay = delay||1000, speed=speed||20, lh = lh||20;
var tid = null, pause = false;
var start = function() {
tid=setInterval(slide, speed);
}
var slide = function() {
if (pause) return;
slideBox.scrollTop += 2;
///alert(slideBox.scrollTop);
if (slideBox.scrollTop % lh == 0) {
clearInterval(tid);
slideBox.appendChild(slideBox.getElementsByTagName('li')[0]);
slideBox.scrollTop =0;
setTimeout(start, delay);
}
}
slideBox.onmouseover=function(){pause=true;}
slideBox.onmouseout=function(){pause=false;}
setTimeout(start, delay);
}
//向上翻屏滚动
function Marqueep()
{
	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();
}

Marqueep.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);
}

Marqueep.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;
	}
}
/*鲜活度,t分钟刷新*/
function clickTime(tyid,tyid2,topnum,t)
{
var thistime = new Date();
var years = thistime.getYear();
var days = thistime.getDay();
var hours = thistime.getHours();
var minutes = thistime.getMinutes();
var seconds = thistime.getSeconds();
var lastDate = new Date(thistime.getYear(), thistime.getMonth(), thistime.getDate(),hours,t*parseInt(minutes/t));
if(hours>18 || hours<8){
//document.getElementById("mainbody").parentNode.className="row11";
if(hours>=18){
document.getElementById("mainbody").innerHTML = "下次更新时间是明日8:00";
}else{
document.getElementById("mainbody").innerHTML = "下次更新时间是今日8:00";
}
document.getElementById("lastTime").innerHTML="上次更新时间18:00";
}else{
//document.getElementById("mainbody").parentNode.className="row1";
minutes = (t-1) - minutes % t;
seconds = 59 - seconds;
var smin = lastDate.getMinutes();
if(smin<10)smin="0"+smin;
document.getElementById("lastTime").innerHTML="上次更新时间"+(lastDate.getHours())+":"+smin;
if(minutes == 0 && seconds == 0){
//window.location.reload();

document.getElementById('timeIframe').src='http://www.nb-114.com/updateopp.htm?oty='+tyid+'&oty2='+tyid2+'&topn='+topnum;

}else{
if(minutes<10)minutes="0"+minutes;
if(seconds<10)seconds="0"+seconds;
thistime = minutes + ":" + seconds;
document.getElementById("mainbody").innerHTML = "距离下次更新还有"+thistime;
}
}
setTimeout("clickTime("+tyid+","+tyid2+","+topnum+","+t+")",1000);
}

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("this action was aviod by your browser，if you want to enable，please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");
            }
         }
         var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
         prefs.setCharPref('browser.startup.homepage',url);
     }
}

//************************* from  end ***********************************************