﻿// JScript File
    
    function openwin(Url,Title,Width,Height)
    {   
     window.open(Url,Title,"top=100,left=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+Width+",height="+Height); 
    }
//是否显示上传DIV
function fileupload()
{
    if (uploadform.style.visibility =="hidden") 
    {
        uploadform.style.visibility = "visible";
    }
    else
    {
        uploadform.style.visibility= "hidden";
    }

}


function AutoResizeImages(maxWidth) 
{ 
var imgs = document.getElementsByTagName("img"); 
for(var i = 0; i < imgs.length; i++) 
{ 
if(imgs[i].className != "FixedWidth") 
{ 
if(imgs[i].width > maxWidth) 
    {imgs[i].width = maxWidth; 
    }
} 
if(imgs[i].className != "FixedHeight") 
{ 
if(imgs[i].height > maxWidth ) 
    {imgs[i].width = maxWidth ; 
   }
} 
} 

} 

//隐藏显示左边的模块菜单
 var screen=true;i=0;width=0;
    function shiftwindow(){
     if(screen==false){
	window.parent.parent.mainFrame.cols='156,10,*';
	screen=true;}		
	else if(screen==true){
	window.parent.parent.mainFrame.cols='0,10,*';
	screen=false;}
	}
	 function shiftwindow2()	{		 	 
  //  var screen=true;i=0;width=0;
	if(screen==false){
			window.parent.mainFrame.cols='156,10,*';
			screen=true;		
		}
		else if(screen==true){		
			window.parent.mainFrame.cols='0,10,*';
			screen=false;	
		}
	}
	//还原显示左边的菜单
	function showmenu(){
   screen=false;//i=0;width=0;
    if(screen==false){
	window.parent.parent.mainFrame.cols='156,10,*';
	screen=true;}		
	else if(screen==true){
	window.parent.parent.mainFrame.cols='0,10,*';
	screen=false;}
	}


//点击DATAGRID GRIDVIEW中的行，加亮显示
var lastObj,lastColor,objTr;   
function Color(objTr) 
  {
	if(lastObj==undefined)
		{   
			lastObj   =   objTr;   
		}   
	lastObj.style.backgroundColor= lastColor; 
	lastObj   =   objTr;   
	lastColor=lastObj.style.backgroundColor;
	lastObj.style.backgroundColor   =   "#CFF3D5";   //   设置选中行背景色
}
//添加新学生
function Add_Student()
{
   window.open("Add_Student.aspx","Add","height=500, width=430, top=150, left=300, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no")
}

//全选DATAGRID
function chk(chk,id){
	var oEvent = document.all(id);
	var chks = oEvent.getElementsByTagName("INPUT");
	for(var i=0; i<chks.length; i++)
		{
		if(chks[i].type=="checkbox")
	chks[i].checked=chk.checked;
		}
	}

			
function alertq()
{alert("测试")}

/*
  // 打印页面设置 
	function printsetup(){ 　
　　wb.execwb(8,1); 
　　} 
　　　// 打印页面预览 
　　function printpreview(){ 
　　wb.execwb(7,1); 
　　} 
	//打印
　　function printit() 
　　{ 
　　if (confirm('确定打印吗？')) { 
　　wb.execwb(6,6) 
　　} 
　　} */



function ListenMusic( gourl , w, h ,l,t,win)
{
   var m_left = ( screen.width  - w  ) / 2;
   var m_top  = ( screen.height - h ) / 2;
	if( l != null && l != '' )m_left= m_left + l / 2;
	if( t != null && t != '' )m_top= m_top + t / 2;
	if( win == null || win == '')win = '';
    param = 'resizable=0, scrollbars=0, width=' + w + ', height=' + h + ', left=' + m_left + '; top=' + m_top;
    window.open ( gourl, win, param );
    try{window.event.returnValue = false;}catch(E){}
}
//控制发表评论的显示
var MORE_STATUS2 = true;
function pspl(){
	var sp = document.getElementById("sp2");
	var pl = document.getElementById("pl2");

	if(MORE_STATUS2){
		pl.style.display = "block";
		MORE_STATUS2 = false;
		sp.src="../images/up.gif"
	}else {
		pl.style.display = "none";
		MORE_STATUS2 = true;
		sp.src="../images/down.gif"
	}
}