function search4(){
if(form1.abc0.checked)
window.open("http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey="+form1.key.value,"mspg0");
if(form1.abc1.checked)
window.open("http://site.search.sohu.com/sitesearch.jsp?page_index=0&key_word="+form1.key.value,"mspg1");
if(form1.abc2.checked)
window.open("http://psearch.163.com/Psearch?q="+form1.key.value,"mspg2");
if(form1.abc3.checked)
window.open("http://www.google.com/search?hl=zh-CN&lr=lang_zh-CN&q="+form1.key.value,"mspg3");
if(form1.abc4.checked)
window.open("http://cn.search.yahoo.com/search/cn?p="+form1.key.value,"mspg4");
if(form1.abc5.checked)
window.open("http://union.3721.com/search_result.htm?pid=S_jdz.info_14703&fw=union&name="+form1.key.value,"mspg5");
if(form1.abc6.checked)
window.open("http://search.yahoo.com/bin/search?p="+form1.key.value,"mspg6");
if(form1.abc7.checked)
window.open("http://www.baidu.com/baidu?tn=jdz.info&word="+form1.key.value,"mspg7");
if(form1.abc8.checked)
window.open("http://mp3search.baidu.com/wstsearch?tn=baidump3&ct=134217728&lm=-1&rn=&word="+form1.key.value,"mspg8");
if(form1.abc9.checked)
window.open("http://www.baidu.com/m?rn=10&tn=baidump3lyric&ct=150994944&lm=-1&word="+form1.key.value,"mspg9");
if(form1.abc10.checked)
window.open("http://images.google.com/images?ie=GB2312&hl=zh-CN&q="+form1.key.value,"mspg10");
return false;}


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function 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);
	}
	return x;
}


Validator = {
Require : /.+/,
Email : /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
Phone : /^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/,
Mobile : /^((\(\d{3}\))|(\d{3}\-))?13\d{9}$/,
Url : /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/,
IdCard : /^\d{15}(\d{2}[A-Za-z0-9])?$/,
Currency : /^\d+(\.\d+)?$/,
Number : /^\d+$/,
Zip : /^[1-9]\d{5}$/,
QQ : /^[1-9]\d{4,8}$/,
Integer : /^[-\+]?\d+$/,
Double : /^[-\+]?\d+(\.\d+)?$/,
English : /^[A-Za-z]+$/,
Chinese : /^[\u0391-\uFFE5]+$/,
UnSafe : /^(([A-Z]*|[a-z]*|\d*|[-_\~!@#\$%\^&\*\.\(\)\[\]\{\}<>\?\\\/\'\"]*)|.{0,5})$|\s/,
IsSafe : function(str){return !this.UnSafe.test(str);},
SafeString : "this.IsSafe(value)",
Limit : "this.limit(value.length,getAttribute('min'), getAttribute('max'))",
LimitB : "this.limit(this.LenB(value), getAttribute('min'), getAttribute('max'))",
Date : "this.IsDate(value, getAttribute('min'), getAttribute('format'))",
Repeat : "value == document.getElementsByName(getAttribute('to'))[0].value",
Range : "getAttribute('min') < value && value < getAttribute('max')",
Compare : "this.compare(value,getAttribute('operator'),getAttribute('to'))",
Custom : "this.Exec(value, getAttribute('regexp'))",
Group : "this.MustChecked(getAttribute('name'), getAttribute('min'), getAttribute('max'))",
ErrorItem : [document.forms[0]],
ErrorMessage : ["以下原因导致提交失败：\t\t\t\t"],
Validate : function(theForm, mode,tb){
var obj = theForm || event.srcElement;
var count = obj.elements.length;
this.ErrorMessage.length = 1;
this.ErrorItem.length = 1;
this.ErrorItem[0] = obj;
for(var i=0;i<count;i++){
with(obj.elements[i]){
var _dataType = getAttribute("dataType");
if(typeof(_dataType) == "object" || typeof(this[_dataType]) == "undefined") continue;
this.ClearState(obj.elements[i]);
if(getAttribute("require") == "false" && value == "") continue;
switch(_dataType){
case "Date" :
case "Repeat" :
case "Range" :
case "Compare" :
case "Custom" :
case "Group" : 
case "Limit" :
case "LimitB" :
case "SafeString" :
if(!eval(this[_dataType])) {
this.AddError(i, getAttribute("msg"));
}
break;
default :
if(!this[_dataType].test(value)){
this.AddError(i, getAttribute("msg"));
}
break;
}
}
}
if(this.ErrorMessage.length > 1){
mode = mode || 1;
var errCount = this.ErrorItem.length;
switch(mode){
case 2 :
for(var i=1;i<errCount;i++)
this.ErrorItem[i].style.color = "red";
case 1 :
alert(this.ErrorMessage.join("\n"));
try{
	this.ErrorItem[1].focus();
}catch(e){
	return false;
}
break;
case 3 :
for(var i=1;i<errCount;i++){
try{
var span = document.createElement("SPAN");
span.id = "__ErrorMessagePanel";
span.style.color = "red";
this.ErrorItem[i].parentNode.appendChild(span);
span.innerHTML = this.ErrorMessage[i].replace(/\d+:/,"*");
}
catch(e){alert(e.description);}
}
try{
	this.ErrorItem[1].focus();
}catch(e){
	return false;
}
break;
default :
alert(this.ErrorMessage.join("\n"));
break;
}
return false;
}
if(tb!=undefined){
	tb.disabled=true;
}
return true;
},
limit : function(len,min, max){
min = min || 0;
max = max || Number.MAX_VALUE;
return min <= len && len <= max;
},
LenB : function(str){
return str.replace(/[^\x00-\xff]/g,"**").length;
},
ClearState : function(elem){
with(elem){
if(style.color == "red")
style.color = "";
var lastNode = parentNode.childNodes[parentNode.childNodes.length-1];
if(lastNode.id == "__ErrorMessagePanel")
parentNode.removeChild(lastNode);
}
},
AddError : function(index, str){
this.ErrorItem[this.ErrorItem.length] = this.ErrorItem[0].elements[index];
this.ErrorMessage[this.ErrorMessage.length] = this.ErrorMessage.length + ":" + str;
},
Exec : function(op, reg){
return new RegExp(reg,"g").test(op);
},
compare : function(op1,operator,op2){
switch (operator) {
case "NotEqual":
return (op1 != op2);
case "GreaterThan":
return (op1 > op2);
case "GreaterThanEqual":
return (op1 >= op2);
case "LessThan":
return (op1 < op2);
case "LessThanEqual":
return (op1 <= op2);
default:
return (op1 == op2); 
}
},
MustChecked : function(name, min, max){
var groups = document.getElementsByName(name);
var hasChecked = 0;
min = min || 1;
max = max || groups.length;
for(var i=groups.length-1;i>=0;i--)
if(groups[i].checked) hasChecked++;
return min <= hasChecked && hasChecked <= max;
},
IsDate : function(op, formatString){
formatString = formatString || "ymd";
var m, year, month, day;
switch(formatString){
case "ymd" :
m = op.match(new RegExp("^((\\d{4})|(\\d{2}))([-./])(\\d{1,2})\\4(\\d{1,2})$"));
if(m == null ) return false;
day = m[6];
month = m[5]--;
year = (m[2].length == 4) ? m[2] : GetFullYear(parseInt(m[3], 10));
break;
case "dmy" :
m = op.match(new RegExp("^(\\d{1,2})([-./])(\\d{1,2})\\2((\\d{4})|(\\d{2}))$"));
if(m == null ) return false;
day = m[1];
month = m[3]--;
year = (m[5].length == 4) ? m[5] : GetFullYear(parseInt(m[6], 10));
break;
default :
break;
}
if(!parseInt(month)) return false;
month = month==12 ?0:month; 
var date = new Date(year, month, day);
//return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate());
return (typeof(date) == "object" && year == date.getFullYear() && month <= 12 && day <= 31);
function GetFullYear(y){return ((y<30 ? "20" : "19") + y)|0;}
}
}

//判断屏幕宽度
function ifscreen(width){
	if(screen.width>=width){
		return true;
	}else{
		return false;
	}
}

//返回屏幕宽度减去你指定大小还剩多少
function newscreen(width){
	return screen.width-width
}

function urlto(url){
	return location.replace(url);
}

function openwin(url,x_width,y_width,title,scroll)
{
	var left=(screen.width-x_width)/2;
	var top=(screen.height-y_width)/2;
	if(scroll==undefined){
		scroll="no";
	}
	window.open(url,title,"top="+top+",left="+left+",alwaysRaised=yes,statusbar=no,menubar=no,toolbar=no,scrollbars="+scroll+",resizable=no,width=" + x_width + ",height=" + y_width);
}

function openwin2(url,width,height,str,scroll){
	if(str==undefined){
		str="";
	}
	if(scroll==undefined){
		scroll="no";
	}
	var userAgent = navigator.userAgent.toLowerCase();
	var is_opera  = (userAgent.indexOf('opera') != -1);
	var is_saf    = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == "Apple Computer, Inc."));
	var is_webtv  = (userAgent.indexOf('webtv') != -1);
	var is_ie  = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
	if(is_ie){
		ex=window.showModalDialog(url,str,"center:yes; dialogHeight:"+height+"px; dialogWidth:"+width+"px; status:no; scroll:"+scroll);
	}else{
		var left=(screen.width-width)/2;
		var top=(screen.height-height)/2;
		alert(url);
		if(url.indexOf('?')<=0){
			chr="?winmsgxx=";
		}else{
			chr="&winmsgxx=";
		}		
		window.open(url+chr+str,"","top="+top+",left="+left+",alwaysRaised=yes,statusbar=no,menubar=no,toolbar=no,scrollbars="+scroll+",resizable=no,width=" + width + ",height=" + height);
	}
}

function selectRo(sel,obj1,obj2,num,defdir) {
	if(defdir==undefined){
		defdir="";
	}
	for(i=1;i<=num;i++){
		if(sel==i){
			eval(obj1+i+".src='"+defdir+"inc/images/web/selectboxon.gif';");
		}else{
			eval(obj1+i+".src='"+defdir+"inc/images/web/selectboxoff.gif';");
		}
	}
	obj2.value=sel;
}


function selectRo2(obj1,obj2,defdir){
	if(defdir==undefined){
		defdir="";
	}
	if(obj2.value==""){
		obj1.src=defdir+"inc/images/web/selectboxon.gif";
		obj2.value=1;
	}else{
		obj1.src=defdir+"inc/images/web/selectboxoff.gif";
		obj2.value="";
	}
}

function divtimeshow(name,defdir,top,height,width,str){
	if(top==undefined){
		top="300";
	}
	if(height==undefined || height<=0 || height==""){
		height=window.screen.height;
	}
	if(width==undefined || width<=0 || width==""){
		width=window.screen.width;
	}
	if(defdir==undefined){
		defdir="";
	}
	if(str==undefined){
		str="资料下载中！，请等待。。。";
	}
	
	if((width/2)>300){
		width2=(width/2);
	}else{
		width2=300;
	}
	
	document.writeln("<div style=\"padding-top:"+top+";height:expression("+height+");width:expression("+width+");background-image:url('"+defdir+"Inc/images/Web/none.gif');position:absolute; z-index:100;top:0;left:0;\" id=\""+name+"\">");
	document.writeln("	<table align='center' cellpadding=0 cellspacing=0 width="+width2+" height=100 bgcolor=\"#9DC5E8\" style=\"border:1px solid #000000;\">");
	document.writeln("		<tr>");
	document.writeln("			<td align=center style=\"font-size:16px;color:#000000\">");
	document.writeln("				<img src=\""+defdir+"inc/images/web/sending.gif\" align=\"absmiddle\">&nbsp;&nbsp;"+str);
	document.writeln("			</td>");
	document.writeln("		</tr>");
	document.writeln("	</table>");
	document.writeln("</div>");
}

function divtimehide(name){
	eval(name+".style.display='none';");
}

function divtimeshow2(name){
	eval(name+".style.display='';");
}

function startTimer() {
    window.setTimeout("timeout()", 1800000);
}

function resetTimer() {
    window.setTimeout("timeout()", 1800000);
}

function timeout() {
    window.setTimeout("timeout()", 1800000);
	top.location.href="./OA_index.jsp";
}


// #############################################################################
function open_s_window(url,title,x_width,y_width,type,obj)
{
	var left=(screen.width-x_width)/2;
	var top=(screen.height-y_width)/2;
	if(obj!=""){
		obj="&obj="+obj
	}
	window.open(url+"?Type="+type+obj,title,"top="+top+",left="+left+",statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=" + x_width + ",height=" + y_width);
}