function openWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function default_home(theURL){
	this.home.style.behavior='url(#default#homepage)';this.home.setHomePage(theURL);
}

function bookmarkit(theURL,theName){
	window.external.addFavorite(theURL,theName);
	}

function checknull(theField,theAlert)
{
	if (theField.value==""){
		alert(theAlert); 
		theField.focus();
		return false;
	}else{
		tmp=theField.value;
		while(tmp.charAt(0)==" ")
			tmp=tmp.substring(1);
		if (tmp==""){
			alert(theAlert);
			theField.focus();
			return false;
		}
	}
	return true;
}

function checkbox(theField,theAlert){
   if (theField.value){
		if (!theField.checked){
				alert(theAlert); 
			return false;
			}
   }else{
		len=theField.length;
		flag=false;
		for (i=0;i<len;i++)
		{
			if ( theField[i].checked)
				flag=true;
		}
		if (!flag){
			alert(theAlert);
			return false;
		}
   } 
   return true;
 }

function ifChecked(theField){
   if (theField.value){
		if (!theField.checked){
			return false;
			}
   }else{
		len=theField.length;
		flag=false;
		for (i=0;i<len;i++)
		{
			if ( theField[i].checked)
				flag=true;
		}
		if (!flag){
			return false;
		}
   } 
   return true;
 }

function cfmclick(theAlert)
{
    if (confirm(theAlert))
		return true;
		else
		return false;
}

function checkselect(theField,theAlert)
{
   if (theField.value){
		if (!theField.checked){
				alert(theAlert); 
			return false;
			}
   }else{
		len=theField.length;
		flag=false;
		for (i=0;i<len;i++)
		{
			if ( theField[i].checked)
				flag=true;
		}
		if (!flag){
			alert(theAlert);
			return false;
		}
   } 
   return true;
 }

function checksize(theField,theNum,theAlert)
{
	if (theField.value.length>theNum){
		alert(theAlert);
		return false;
	}
	return true;
}

function checkemail(theField,theAlert)
{
	temp=theField.value
	if ((temp == null) || (temp.length == 0)){
	    window.alert(theAlert);	
		theField.focus();
		return false;
	}		
	len = temp.length;
	if(len>0)
	{
		if (len > 100)
		{
			window.alert(theAlert);
			theField.focus();
			return false;
		}
		pos1 = temp.indexOf("@");
		pos2 = temp.indexOf(".");
		pos3 = temp.lastIndexOf("@");
		pos4 = temp.lastIndexOf(".");
		if ((pos1 <= 0)||(pos1 == len)||(pos2 <= 0)||(pos2 == len))
		{
			window.alert(theAlert);
			theField.focus();
			return false;
		}
		else
		{
			if( (pos1 == pos2 - 1)||(pos1 == pos2 + 1)||( pos1 != pos3 )||( pos4 < pos3 ) )
			{
				window.alert(theAlert);
				theField.focus();
				return false;
			}
		}		
	}
	return true;
}

function cfmalert(theAlert)
{
    if (confirm(""+theAlert+""))
		return true;
		else
		return false;
}

function cfminfo(theField)
{
	if (!checkvalue(theField))
		return false;
    if (confirm("确认操作吗？"))
		return true;
	else
		return false;
}

function checkvalue(theField)
{
   if (theField.value){
		if (!theField.checked){
				alert("请选择纪录！"); 
			return false;
			}
   }else{
		len=theField.length;
		flag=false;
		for (i=0;i<len;i++)
		{
			if ( theField[i].checked)
				flag=true;
		}
		if (!flag){
			alert("请选择纪录！");
			return false;
		}
   } 
   return true;
 }

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function load(Object)
{ 
	if (Object.selectedIndex > 0) 
		location = Object.options[Object.selectedIndex].value;
}

function load2(Object)
{ 
	if (Object.selectedIndex > 0) 
		window.open(Object.options[Object.selectedIndex].value,'','');
}

function printit(){  
	if (window.print) {
		window.print() ;  
	} else {
		var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 2);
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}