function ResumeError(){return true;}window.onerror = ResumeError;

function CallFlash(flashUrl,flashWidth,flashHeight,flashWmode,flashVersion){document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="flash" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+flashVersion+'" border="0" width="'+flashWidth+'" height="'+flashHeight+'">');document.write('<param name="movie" value="'+flashUrl+'">');document.write('<param name="quality" value="high"> ');document.write('<param name="wmode" value="'+flashWmode+'"> ');document.write('<param name="menu" value="false"> ');document.write('<embed src="'+flashUrl+'" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" name="FlashBanner" width="'+flashWidth+'" height="'+flashHeight+'" quality="High" wmode="transparent">');document.write('</embed>');document.write('</object>');}//normal version 8.0.24

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',双击即可。");}var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);prefs.setCharPref('browser.startup.homepage',vrl);}}}

function showLocale(objD){var str;var yy = objD.getYear();if(yy<1900) yy = yy+1900;var MM = objD.getMonth()+1;if(MM<10) MM = '0' + MM;var dd = objD.getDate();if(dd<10) dd = '0' + dd;var ww = objD.getDay();if  (ww==0)  ww="星期日";if  (ww==1)  ww="星期一";if  (ww==2)  ww="星期二";if  (ww==3)  ww="星期三";if  (ww==4)  ww="星期四";if  (ww==5)  ww="星期五";if  (ww==6)  ww="星期六";str =yy + "年" + MM + "月" + dd + "日  " + ww;return(str);}

function thisDay(){var today;today = new Date();document.write('今天是：'+showLocale(today));}

function goPageTop(acceleration, goPageTopTime){acceleration = acceleration || 0.1;goPageTopTime = goPageTopTime || 16;var goPageTopX1 = 0;var goPageTopY1 = 0;var goPageTopX2 = 0;var goPageTopY2 = 0;var goPageTopX3 = 0;var goPageTopY3 = 0;if (document.documentElement){goPageTopX1 = document.documentElement.scrollLeft || 0;goPageTopY1 = document.documentElement.scrollTop || 0;}if (document.body){goPageTopX2 = document.body.scrollLeft || 0;goPageTopY2 = document.body.scrollTop || 0;}var goPageTopX3 = window.scrollX || 0;var goPageTopY3 = window.scrollY || 0;var goPageTopX = Math.max(goPageTopX1, Math.max(goPageTopX2, goPageTopX3));var goPageTopY = Math.max(goPageTopY1, Math.max(goPageTopY2, goPageTopY3));var goPageTopSpeed = 1 + acceleration;window.scrollTo(Math.floor(goPageTopX / goPageTopSpeed), Math.floor(goPageTopY / goPageTopSpeed));if(goPageTopX > 0 || goPageTopY > 0){	var invokeFunction = "goPageTop(" + acceleration + ", " + goPageTopTime + ")";window.setTimeout(invokeFunction, goPageTopTime);}}

function tabs(thisObj,Num){
if(thisObj.className == "current")return;var tabObj = thisObj.parentNode.id;var tabList = document.getElementById(tabObj).getElementsByTagName("li");for(i=0; i <tabList.length; i++){if (i == Num){thisObj.className = "current";document.getElementById(tabObj+"_content"+i).style.display = "block";}else{tabList[i].className = "normal";document.getElementById(tabObj+"_content"+i).style.display = "none";}
var linkItem=document.getElementById("linkImg");if (Num==0){linkItem.href='html.asp?type=4';}else if(Num==1){linkItem.href='html.asp?type=1';}
}}

function formSearch(str){var str;
	if(str.keyword.value=="" || str.keyword.value =="%")
	{alert('Input keywords!');str.keyword.focus();return false;}
}

function check_userGO(str){
	var str;
	if(str.DNS_User.value==""){alert('用户名不能够为空!');str.DNS_User.focus();return false;}
	if(str.DNS_Pass.value==""){alert('密码不能够为空!');str.DNS_Pass.focus();return false;}
}

function SetCwinHeight(iframeObj){if (document.getElementById){if (iframeObj){if (iframeObj.contentDocument && iframeObj.contentDocument.body.offsetHeight){iframeObj.height = iframeObj.contentDocument.body.offsetHeight;} else if (document.frames[iframeObj.name].document && document.frames[iframeObj.name].document.body.scrollHeight){  iframeObj.height = document.frames[iframeObj.name].document.body.scrollHeight;}}}}

function correctPNG(){var arVersion = navigator.appVersion.split("MSIE");var version = parseFloat(arVersion[1]);if ((version >= 5.5) && (document.body.filters)){for(var j=0; j<document.images.length; j++){ var img = document.images[j];var imgName = img.src.toUpperCase();if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){var imgID = (img.id) ? "id='" + img.id + "' " : "" 
	var imgClass = (img.className) ? "class='" + img.className + "' " : "" 
	var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 
	var imgStyle = "display:inline-block;" + img.style.cssText 
	if (img.align == "left") imgStyle = "float:left;" + imgStyle 
	if (img.align == "right") imgStyle = "float:right;" + imgStyle 
	if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
	var strNewHTML = "<span " + imgID + imgClass + imgTitle 
	+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" 
	+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
	+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
	img.outerHTML = strNewHTML;j = j-1}}}}
var isIE6=false;
document.write("<!--[if lte IE 6]><script>isIE6=true;</scr"+"ipt><![endif]-->");
if(isIE6){
	//alert("ie6");
	window.attachEvent("onload", correctPNG);
}

function AutoScroll(obj){
	$(obj).find("ul:first").animate({
		marginTop:"-100px"
	},600,function(){
		$(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
	});
}
$(document).ready(function(){
setInterval('AutoScroll("#verticalScroll")',5000)
});

(function($){ 
$.fn.ImageResizeV1 = function(settings){ 
//一些默认配置； 
settings = $.extend({ 
height:0, 
width:0, 
loading:"static\/common\/image_loading.gif"
},settings);
var images = this; 
$(images).hide(); 
var loadding = new Image(); 
loadding.className="image_loadding" 
loadding.src = settings.loading; 
$(images).after(loadding); 
//预加载 
var preLoad = function($this){ 
var img = new Image(); 
img.src = $this.src; 
if (img.complete) {
processImg.call($this);
return; 
} 
//$this.src = loadding.src;//会导致获取错误的尺寸
img.onload = function(){ 
//$this.src = this.src; //会导致获取错误的尺寸 
processImg.call($this); 
img.onload=function(){}; 
} 
} 
//计算图片尺寸； 
function processImg(){ 
//if(settings.height===0||settings.width ===0) return; 
var m = this.height-settings.height; 
var n = this.width - settings.width; 
if(m>n) 
this.height = this.height>settings.height ? settings.height : this.height; 
else 
this.width = this.width >settings.width ? settings.width : this.width;
$(this).next(".loadding").remove()
$(this).show();
var height = $(this).parent().height() //获取当前显示图片所在层的高
//alert(height)
if(height){
paddingtop = parseInt((height - $(this).height())/2)
if(paddingtop*2 !== height){
$(this).css("padding-top",paddingtop +"px")
$(this).css("padding-bottom",paddingtop +"px")
}
}
}
return $(images).each(function(){ 
preLoad(this); 
}); 
} 
})(jQuery);

$.fn.extend({
	myMenu: function() {
		$(this).children('ul').children('li').hover(
			function() {
				if(!$(this).children('ul').hasClass('focus')) {
					$(this).addClass('focus');
					$(this).children('ul:first').stop(true, true).animate({ height:'show' }, 'fast');
				}
			},
			function() {
				$(this).removeClass('focus');
				$(this).children('ul:first').stop(true, true).animate({height:'hide', opacity:'hide'}, 'slow');
			}
		);
		$(this).children('ul').children('li').children('ul').hover(
			function() {
				$(this).addClass('focus');
			},
			function() {
				$(this).removeClass('focus');
			}
		);
	}
});
$(document).ready(function() {
	$('#nav').myMenu();
});
