//===============================================================================
//版权所有： 精英时代科技发展有限公司
//编码日期： 2005年01月01日
//编码人员： 
//功能描述： 一些公用的JavaScript函数
//===============================================================================


// 将一个字符串转换为数组。
function SplitStr(strIn)
{
  var s, ss;
  var s = strIn;
  // 在每个,字符处进行分解。
  ss = s.split(',');
  return(ss);
}


//在屏幕中央弹出一个模式对话框
function popModalDialog(url,args,height,width){
    return window.showModalDialog(url,args,"dialogHeight:"+height+"px;dialogWidth:"+width+"px;center:yes;help:no;resizable:no;status:no;");
}

//在屏幕中央弹出一个窗口
function popup(url,height,width){
	var top=parseInt((screen.availHeight-height)/2)
    var left=parseInt((screen.availWidth-width)/2)
	window.open(url,"","location=0,height="+height+"px,width="+width+"px,top="+top+"px,left="+left+"px,status=0,resizable=0,scrollbars=1")
}
//在屏幕中央弹出一个指定名字的窗口
function popupnamewin(url,sname,height,width){
	var top=parseInt((screen.availHeight-height)/2)		
    var left=parseInt((screen.availWidth-width)/2)
	window.open(url,sname,"location=0,height="+height+"px,width="+width+"px,top="+top+"px,left="+left+"px,status=0,resizable=0,scrollbars=1")
}
//弹出一个最大的窗口
function popupBigWindow(url,winname){
	var top,left,width=790,height=540
		if (screen.width==800 && screen.height==600){
		   top=0;
		   left=0;
		}
		else {
		  top=parseInt((screen.availHeight-height)/2);
          left=parseInt((screen.availWidth-width)/2);
		}
	return window.open(url,winname,"location=0,width="+width+"px,height="+height+"px,top="+top+"px,left="+left+"px,resizable=1,scrollbars=1,status=1")
}
//在规定位置弹出一个窗口
function popupat(url,top,left,height,width){
	window.open(url,"ad","location=0,height="+height+"px,width="+width+"px,top="+top+"px,left="+left+"px,status=0,resizable=0,scrollbars=0")
}
//弹出一个最大的窗口
function popupMaxWindow(url){
	var correctheight=parseInt(window.screen.availHeight)-30
    var correctwidth=parseInt(window.screen.availWidth)-10
	window.open(url,null,"location=0,height="+correctheight+"px,width="+correctwidth+"px,top=0px,left=0px,resizable=0,scrollbars=0")
}
//===============================================================================
//功能描述： 用JavaScript得到从地址栏传过来的参数的值(主要用在HTML页面)
//输入参数： 1)strSearch 整个window.location.search值，包括问号
//		    2)strFeild  要得到值的字段
//输出参数： 1)字段的值
//===============================================================================
function getQueryString(strSearch,strFeild){
   var strValue=strSearch.substr(1,strSearch.length-1)
	   alert(strFeild);
   var myArray = strValue.split("&");
   		for (i = 0; i < myArray.length; i++){
		  var myArray1 = myArray[i].split("=");
			  if (myArray1[0]==strFeild){
                 return myArray1[1]
			 }					
		}  
}
function changetab(which){
  var thisid=99     
      for (var i=0;i<document.all("seltab").length;i++){
          document.all("seltab").item(i).className="seltab"
          if (i==0) {
             document.all("selspan").item(i).className="unselspanlt"
          }
          else {
             document.all("selspan").item(i).className="unselspan"
          }
          document.all("seldiv").item(i).className="unseldiv"
          if (which==document.all("seltab").item(i)){
             thisid=i
             document.all("seldiv").item(i).className="seldiv"
             if (i==0) {
                document.all("selspan").item(i).className="selspanlt"
                }
             else {document.all("selspan").item(i).className="selspan"}
             if (i>0){document.all("seltab").item(i-1).className="seltablt"}
          }
          if (i==thisid+1){document.all("seltab").item(i).className="seltabrt"}
      }  
}
function popresizewin(url,sname,height,width){
	var top=parseInt((screen.availHeight-height)/2)		
    var left=parseInt((screen.availWidth-width)/2)
	var oWin=window.open(url,sname,"location=0,height="+height+"px,width="+width+"px,top="+top+"px,left="+left+"px,status=0,resizable=1,scrollbars=1")
	oWin.focus();
}	