function sch(form){e=document.sel.sq.selectedIndex;e=document.sel.sq[e].value;k=document.sel.k.value;
if(document.sel.k.value==""){alert("请输入关键词！");document.sel.k.focus();return}
if(e=="yah1"){window.open("http://search.chinese.yahoo.com/search/gb?p="+k);}
if(e=="yah"){window.open("http://search.yahoo.com/bin/search?p="+k);}
if(e=="soh1"){window.open("http://www.sohoo.com.cn/cgi-bin/sohoo/sohoosearch.dll?MfcISAPICommand=DEFAULT&y=site&keyword="+k+"&search=%CB%D1%CB%F7");}
if(e=="tonghua"){window.open("http://search.tonghua.com.cn/search?p="+k);}
if(e=="yo1"){window.open("http://www.goyoyo.com.cn/gyy/guide/gquery%20GB%20"+k+"?");}
if(e=="srsnet"){window.open("http://www.srsnet.com/cgi-bin/richina.cgi?query="+k);}
if(e=="网易"){window.open("http://www.yeah.net/cgi-bin/search.cgi?key="+k);}
if(e=="whatsite"){window.open("http://www.whatsite.com.tw/main/search.cgi?keyword="+k+"&start=0&REXP=OR&x=36&y=15")}
if(e=="kimo"){window.open("http://search.kimo.com.tw/cgi-bin/srchfz.pl?srchcdn=B0&query="+k+"&x=22&y=9")}
if(e=="yam"){window.open("http://www.yam.com.tw/b5/search?k="+k+"&x=9&y=18")}
if(e=="excite"){window.open("http://search.excite.com/search.gw?search="+k);}
}

//全选
function SelectAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }

//首页登陆
function frmgo(){
	switch (formgoto.select.value){
		case "1":
			//虚拟课室
			formgoto.action="/classroom/login.php";
			break;
		case "2":
			//校务系统
			formgoto.action="/admin/login.php";
			break;
		case "3":
			//教案系统
			formgoto.action="/admin/login.php";
			break;
		case "5":
			//评语系统
			formgoto.action="/admin/login.php";
			break;
	}
	if(formgoto.username.value=="" || formgoto.password.value==""){
		alert("请输入用户名和密码！");
		formgoto.username.focus();
		return false;
	}
	return true;
}
//End 首页登陆

//BBS查询
function bbs(){
	if(bbssearch.key.value==""){
		alert("请输入查找关键字！");
		bbssearch.key.focus();
		return false;
	}
	return true;
}

//课程表查询
function kecheng(){
	formk.action="/classroom/kecheng/findkecheng.php";
	formk.submit();
}
//
//学生成绩查询
function chengji(){
	if(formkk.sname.value=="学生学号" || formkk.sname.value==""){
		alert("请输入学生学号！");
		formkk.sname.focus();
		return false;
	}
	return true;
}
//End 学生成绩查询
function openIT(theURL,W,H,X,Y, wname) {
	CLOSEdwn 		= "images/close_dwn.gif"
	CLOSEup 		= "images/close_up.gif"
	CLOSEovr 		= "images/close_ovr.gif"
	MINIdwn 		= "images/mini_dwn.gif"
	MINIup 			= "images/mini_up.gif"
	MINIovr 		= "images/mini_ovr.gif"
	NONEgrf 		= "images/none.gif"
	CLOCKgrf		= "images/clock.gif"
	titHTML 	    	= "<font size=2 color=#999966>&nbsp;『易点通』媒体播放系统</font>"
	titWIN			= "&nbsp;『易点通』媒体播放系统"
	winBORDERCOLOR   	= "#745c34"
	winBORDERCOLORsel	= "#745c34"
	winBGCOLOR    		= "#333333"
	winBGCOLORsel 		= "#333333"
	return openchromeless(theURL, wname, W, H, X, Y, NONEgrf, CLOSEdwn, CLOSEup, CLOSEovr, MINIdwn, MINIup, MINIovr, CLOCKgrf, titHTML, titWIN, winBORDERCOLOR, winBORDERCOLORsel, winBGCOLOR, winBGCOLORsel)
}

function check_search(keyword){
var key;
if (document.searchform.key.value==""){
alert ("请输入要搜索的关键字！");
document.searchform.key.focus();
return false;
}
return true;
}
////////////////无边框窗口//////////////////
function showcontent(content)
{
		moveLayer(name,mouseX+60,mouseY);		
		writecontent(content);
		showLayer(name);
}

function hidecontent()
{
		hideLayer(name);
}

function writecontent(content)
{
		var alt="<table width=90% align=right ><tr><td><span class=ct-def2>"+
					content+
					"</span></td></tr></table>";
		replaceContent(name,alt);
}

function openit(url,w,h){
	var xpos=0,ypos=0,targetx=(screen.width-w)/2,targety=(screen.height-h)/4;
	window.open(url,'openit','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=1,resizable=0,width='+w+',top=5,left=50,height='+h+',left='+targetx+',top='+targety)
}

function openfull(url){
	window.open(url,'openfull','fullscreen=1');
}

function openhide(url){
	var xpos=0,targetx=(screen.width)*2;
	window.open(url,'openhide','left='+targetx);
//	window.open(url,'openhide','width=500,heigt=400');
}

function openwin(url,w,h){
	var xpos=0,ypos=0,targetx=(screen.width-w)/2,targety=(screen.height-h)/4;
	window.open(url,'openwin','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=1,resizable=0,width='+w+',top=5,left=50,height='+h+',left='+targetx+',top='+targety)
}

function show(id,w,h){
window.open('/main.php?op=show&id='+id,'url'+id,'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h+',top=0,left=0')
//window.location='main.php?op=show&threadid='+id;
}

function more(i){
window.open('main.php?op=more&i='+i,'url','toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=640,height=480,top=0,left=0')
//window.location='main.php?op=more&i='+i;
}

function more1(i){
window.open('index.php?op=more&i='+i,'url','toolbar=1,location=0,directories=1,status=0,menubar=0,scrollbars=1,resizable=0,width=640,height=480,top=0,left=0')
//window.location='main.php?op=more&i='+i;
}
function MM_swapImgRestore() { //v3.0
  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_preloadImages() { //v3.0
  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_findObj(n, d) { //v3.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); return x;
}

function MM_swapImage() { //v3.0
  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];}
}
////////////////无边框窗口//////////////////

//////////////网址收集 and 学生主页/////////////////////
function addyes(){
	addnew.style.display='';
	anew.name.value='';
	anew.http.value='';
	anew.content.value='';
	if(anew.work=="[object]") anew.work.value='';
	anew.content.focus();
	anew.name.focus();
}

function edits(id,name,http,content){
	addnew.style.display='';
	anew.name.value=name;
	anew.http.value=http;
	anew.content.value=content;
	if(anew.work=="[object]") anew.work.value='edit';
	if(anew.editid=="[object]") anew.editid.value=id;
	anew.content.focus();
	anew.name.focus();
}

function back(){
	addnew.style.display='none';
}

function submitcheck(){
	if(anew.name.value==''){
		alert('请输入网站名称！');
		anew.name.focus();
		return false;
	}
	if(anew.http.value==''){
		alert('请输入网站地址！');
		anew.http.focus();
		return false;
	}
	if(anew.content.value==''){
		alert('请输入网站简介！');
		anew.content.focus();
		return false;
	}
return true;
}
function manage(){
	d2.style.display='';
	d1.style.display='';
	//mana.style.display='none';
	form1.password.focus();
	form1.username.focus();
}
function dele(url) {
  result = confirm('真的要删除该记录吗?');
  if (result){
		window.location.href=url;
	}
}
//投票区
function votesubmit(){
  if(frmoption.votecheck.value==""){
     alert('请选择投票项!');
     return false;
  }
return true;
}

//////////////网址收集/////////////////////

/*
top.window.moveTo(0,0); 
if (this.name!='fullscreen'){ 
	self.focus();
	window.opener = null;
	var mx=screen.width;
	var my=screen.height-55;

	top.window.moveTo(0,0); 
	if  (document.all)  { 
	top.window.resizeTo(screen.availWidth,screen.availHeight); 
	} 
	else  if  (document.layers||document.getElementById)  { 
	if  (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){ 
	top.window.outerHeight  =  screen.availHeight; 
	top.window.outerWidth  =  screen.availWidth; 
	} 
	} 
	//window.open(location.href,'fullscreen','top='+y+',left='+x+',width='+mx+',height='+my+',resizable=1,menubar=0,scrollbars=1');
}
*/
//注销
function logout(){
 	result = confirm("注销操作会删除所有用户登陆信息！是否进行？");
	if(result){
		parent.main.location="/admin/logout.php";
		return true;
	}
	return false;
}
//End 注销

//系统登陆
function make_login(){
	k=window.showModalDialog('login.html','makelogin','dialogwidth=360px; dialogheight=160px; status=no')
	if(k==null){
//	  top.close(false);
	}else{
	  document.form1.username.value=k[0];
	  document.form1.password.value=k[1];
	  document.form1.submit();
	}
}

function media_login(){
	k=window.showModalDialog('login.html','medialogin','dialogwidth=360px; dialogheight=160px; status=no')
	if(k==null){
//	  top.close(false);
	}else{
	  document.form2.username.value=k[0];
	  document.form2.password.value=k[1];
	  document.form2.submit();
	}
}

function minwindow(){
	//执行窗口最小化过程
	this.focus();
	min.Click();
}
function closewindow(){
	//执行关闭窗口过程
	this.focus();
	closes.Click();
}

//最小化窗口
//window.document.write ("<OBJECT id=min type=application/x-oleobject classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11><PARAM NAME='Command' VALUE='Minimize'></OBJECT>");
/*窗口还原*/
//window.document.write ("<object id=hhctrl type=application/x-oleobject classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11><param name=Command value='Maximize'></object>");
//关闭窗口
//window.document.write ("<OBJECT id=closes type=application/x-oleobject classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11><param name=Command value=Close></object>");

