﻿<!--
//弹出窗口
function openWindow(url, name, width, height) {
window.open( url, name, 'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width='+width+',height='+height+',top=30,left=230');
}

//打开新窗口
function popnew(url,title,width,height){
    var w = 1024;
    var h = 768;

    if (document.all || document.layers){
        w = screen.availWidth;
        h = screen.availHeight;
    }

    var leftPos = (w/2-width/2);
    var topPos = (h/2.3-height/2.3);

    window.open(url,title,"width="+width+",height="+height+",top="+topPos+",left="+leftPos+",scrollbars=no,resizable=no,status=no")
}

//脚本容错
function stopError() {
return true;
          }
window.onerror = stopError;

function showbg(){
eval("select_list.style.display='';");
}
function showoutbg(){
eval("select_list.style.display='none';");
}

function doZoom(size){
	document.getElementById('zoom').style.fontSize=size+'px'
	}

//TAB切换
function swap_tab(n){
	for(var i=1;i<=2;i++){
		var curC=document.getElementById("tab_"+i);
		var curB=document.getElementById("tab_t"+i);
		if(n==i){
			curC.style.display="block";
			curB.className="active"
		}else{
			curC.style.display="none";
			curB.className="normal"
		}
	}
} 

function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}

// Correctly handle PNG transparency in Win IE 5.5 or higher.


function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
   var img = document.images[i]
   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
   i = i-1
      }
      }
   }
window.attachEvent("onload", correctPNG);

function isEmail(str){
  var isEmail = (((((str.indexOf("@") != -1) && (str.indexOf(".") != -1)) && (((str.lastIndexOf("@")-str.lastIndexOf("."))<-1))) && str.indexOf("@")!=0) && (str.length-str.lastIndexOf(".")>1));
  if (isEmail){
	return (true);
  }else{
	return (false);
  }
}


function MailCheck(){
if(mailform.Email.value == "")
		{
			alert("请输入电子邮件地址！");
			mailform.Email.focus();
			return false;
		}
if (isEmail(mailform.Email.value) == false)
		{
			alert("请输入有效的电子邮件地址！");
			mailform.Email.focus();
			return false;
		}
return true;
}
