﻿//回到顶部开始
var scrolltotop={
	setting: {startline:1, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
	controlHTML: '<img src="images/gotop3.gif" style="width:19px; height:63px" />',
	controlattrs: {offsetx:100, offsety:120}, 
	anchorkeyword: '#top', 

	state: {isvisible:false, shouldvisible:false},

	scrollup:function(){
		if (!this.cssfixedsupport) 
			this.$control.css({opacity:0}) 
		var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)
		if (typeof dest=="string" && jQuery('#'+dest).length==1) 
			dest=jQuery('#'+dest).offset().top
		else
			dest=0
		this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
	},

	keepfixed:function(){
		var $window=jQuery(window)
		var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx
		var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety
		this.$control.css({left:controlx+'px', top:controly+'px'})
	},

	togglecontrol:function(){
		var scrolltop=jQuery(window).scrollTop()
		if (!this.cssfixedsupport)
			this.keepfixed()
		this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
		if (this.state.shouldvisible && !this.state.isvisible){
			this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0])
			this.state.isvisible=true
		}
		else if (this.state.shouldvisible==false && this.state.isvisible){
			this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1])
			this.state.isvisible=false
		}
	},
	
	init:function(){
		jQuery(document).ready(function($){
			var mainobj=scrolltotop
			var iebrws=document.all
			mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest 
			mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
			mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+'</div>')
				.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'})
				.attr({title:'返回顶部'})
				.click(function(){mainobj.scrollup(); return false})
				.appendTo('body')
			if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') 
				mainobj.$control.css({width:mainobj.$control.width()}) 
			mainobj.togglecontrol()
			$('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
				mainobj.scrollup()
				return false
			})
			$(window).bind('scroll resize', function(e){
				mainobj.togglecontrol()
			})
		})
	}
}
scrolltotop.init()
//回到顶部结束

/**
* Added by jerry for resolve ie upgrade activity activeX control issue.
*
* param: url -- activeX's resource address
*        w   -- object's width
*        h   -- object's height
*
* call function like this:
*		insertFlash("index.swf", 600, 350);
*/

function insertFlash(url, w, h)
{
	 document.write('<div>');
	 document.write('<object width="'+ w +'" height="'+ h +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">'); 
	 document.write('<param name="movie" value="'+ url +'">');
	 document.write('<param name="wmode" value="transparent">');
	 document.write('<param name="menu" value="false">');
	 document.write('<param name="quality" value="high">');
	 document.write('<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="high" wmode="transparent" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
	 document.write('</object>');
	 document.write('</div>');
}

function insertQuickMov(url, w, h)
{
	
	 document.write('<div>');
	 document.write('<embed width="'+ w +'" height="'+ h +'" src="'+ url +'">'); 
	 document.write('</embed>');
	 document.write('</div>');
	 
}

function Menu1Start(w,ImgPath,BorderColor,BgColor,TexColor,TexHoverColor,TextBg)
{
document.writeln("<style type=\"text/css\">");
document.writeln("<!--");
document.writeln(".menu_navcc{width:"+w+"px; margin:0 auto;}");
document.writeln(".menu_nav{width:"+w+"px;height:48px;background:url("+ImgPath+"nav_bg.gif) repeat-x;float:left;margin-top:0px;}");
document.writeln(".menu_nav .nav_content{padding-left:25px;background:url("+ImgPath+"nav_l_bg.gif) no-repeat;float:left;}");
document.writeln(".menu_nav .nav_content li{width:88px;height:48px;padding-left:15px;padding-right:13px;background:url("+ImgPath+"nav_li_right.gif) no-repeat right center;float:left;line-height:37px;text-align:center;font-size:14px;font-weight:bold;position:relative;}");
document.writeln(".menu_nav .nav_content li a{color:#fff;width:88px;height:48px;display:block;line-height:48px;text-decoration:none;font-weight:bold;text-align:center;font-size:14px;}");
document.writeln(".menu_nav .nav_content li.current{line-height:37px;}");
document.writeln(".menu_nav .nav_content li em{background:url("+ImgPath+"bid_new.gif) no-repeat;width:35px;height:21px;display:inline-block;position:absolute;top:-20px;left:40px;}");
document.writeln(".menu_nav .nav_content li.current a,.menu_nav .nav_content li a:hover{width:88px;height:37px;background:url("+ImgPath+"nav_li_current.gif) no-repeat;display:block;color:#fff;}");
document.writeln(".menu_nav .nav_content li a:hover{background:url("+ImgPath+"nav_li_hover.gif) no-repeat;line-height:37px;text-decoration:none;font-weight:bold;}");
document.writeln(".menu_nav_right{padding-right:20px;background:url("+ImgPath+"nav_r_bg.gif) no-repeat right top;float:right;margin-left:10px;padding-top:13px;height:23px;padding-bottom:12px;}");
document.writeln("");
document.writeln(".menu_nav .nav_content li .submenu{width:115px;margin:0 auto;background:"+BgColor+";position:absolute;left:0;top:40px;display:none; height:auto;border:1px solid "+ BorderColor +";}");
document.writeln(".menu_nav .nav_content li .submenu dd{border-top:1px dotted #ddd;color:#fff;}");
document.writeln(".menu_nav .nav_content li .submenu dd a,.menu_nav .nav_content li .submenu dd a:link,.menu_nav .nav_content li .submenu dd a:visited,.menu_nav .nav_content li .submenu dd a:active{font-size:12px;height:25px;color:"+TexColor+";line-height:25px;text-align:left;font-weight:normal;padding-left:5px;width:115px;}");
document.writeln(".menu_nav .nav_content li .submenu dd a:hover{color:"+TexHoverColor+";height:20px;background:"+TextBg+";font-size:12px;height:25px;line-height:25px;text-align:left;font-weight:bold;padding-left:5px;width:110px;}");
document.writeln("-->");
document.writeln("</style>");
document.writeln("<div class=\"menu_navcc\">");
document.writeln("<div class=\"menu_nav clearfix\">");
document.writeln("<ul class=\"nav_content\" id=\"nav\">");
}
function Menu1End()
{
document.writeln("</ul>");
document.writeln("<div class=\"menu_nav_right\">");
document.writeln("</div>");
document.writeln("<script type=\"text/javascript\">");
document.writeln("<!--");
document.writeln("var nav = document.getElementById(\"nav\").childNodes;");
document.writeln("for (var i=0;i<nav.length;i++)");
document.writeln("{");
document.writeln("	if (nav[i].className==\"menu\")");
document.writeln("	{");
document.writeln("		nav[i].onmouseover = function(){fnNav(this,\"block\")};");
document.writeln("		nav[i].onmouseout = function(){fnNav(this,\"none\")};");
document.writeln("	}");
document.writeln("}");
document.writeln("function fnNav(obj,flag)");
document.writeln("{");
document.writeln("	obj.getElementsByTagName(\"dl\")[0].style.display = flag;");
document.writeln("}");
document.writeln("//-->");
document.writeln("</script>");
document.writeln("</div>");
document.writeln("</div>");
}
  
function killErrors() {  
return true;  
}  
window.onerror = killErrors;  

