﻿function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".mainFrame.location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function OpenScript(url,width,height)
{
	var win = window.open(url,"SelectToSort",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
function CheckAll(form)
{
	for(var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (form.chkall.checked == true) {
			e.checked = true;
		}
		else {
			e.checked = false;
		}
	}
}

//----------------------自动时间
//-- 使用方法 <div id="ggg"><script type="text/javascript">setInterval('cnTime("ggg")',1000);</sc ript></div>
function dateStr(){
	var now = new Date();
	var yearStr = now.getYear();
	var monthStr = now.getMonth()+1;
	var dayStr = now.getDate();
	return(yearStr+'-'+monthStr+'-'+dayStr);
}
function timeStr(){
	var now = new Date();
	var hh = now.getHours();
	var mm = now.getMinutes();
	var ss = now.getTime() % 60000;
		ss = (ss - (ss % 1000)) / 1000;
	var clock = hh+':';
		if (mm < 10) clock += '0';
		clock += mm+':';
		if (ss < 10) clock += '0';
		clock += ss;
	return(clock);
}
function weekStr_CN(){
	var week = new Array();
		week[0] = "星期日";
		week[1] = "星期一";
		week[2] = "星期二";
		week[3] = "星期三";
		week[4] = "星期四";
		week[5] = "星期五";
		week[6] = "星期六";
	var now = new Date();
	return(week[now.getDay()]);
}
function weekStr_EN(){
	var week = new Array();
		week[0] = "Sunday";
		week[1] = "Monday";
		week[2] = "Tuesday";
		week[3] = "Wednesday";
		week[4] = "Thursday";
		week[5] = "Friday";
		week[6] = "Saturday";
	var now = new Date();
	return(week[now.getDay()]);
}
function cnTime(realTime){
	document.getElementById(realTime).innerHTML = dateStr() + ' ' + timeStr();
}
//----------------------自动时间结束

//----------------------后台小工具
function modalDialog(url, name, width, height)
{
	if (width == undefined)
	{width = 400;}
	if (height == undefined)
	{height = 300;}
	x = (window.screen.width - width) / 2;
	y = (window.screen.height - height) / 2;
	try
	{
		window.showModalDialog(url, name, 'dialogWidth=' + (width) + 'px; dialogHeight=' + (height+5) + 'px; status=off');
	}catch (ex){
		window.open(url, name, 'height='+height+', width='+width+', left='+x+', top='+y+', toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, modal=yes');
	}
}
//----------------------后台小工具结束
function zkShow1(k,n,m){	//k为移动上方,n为最大,m为当前
	var i;
	for(i=1;i<=n;i++){
		name1="titleUp"+i;
		tr1="titleDown"+i;
		eval(name1).className='font5';
		eval(tr1).style.display='none';
	}
	eval("titleUp"+k).className='font5 top_table2';
	eval("titleUp"+m).className='font5 top_table2';
	eval("titleDown"+k).style.display='block';
}
/*
function zkShow2(k,n){	//k为移动上方,n为最大
	var i;
	for(i=1;i<=n;i++){
		name1="titleUp"+i;
		tr1="titleDown"+i;
		eval(name1).className='font5';
		eval(tr1).style.display='none';
	}
	eval("titleUp"+k).className='font5 top_table2';
	eval("titleDown"+k).style.display='block';
}
*/
function zkShow2(k,n){	//k为移动上方,n为最大
	var i;
	for(i=1;i<=n;i++){
		name1="titleUp"+i;
		eval(name1).className='font5';
	}
	eval("titleUp"+k).className='font5 top_table2';
}
function zkShow3(n,m){
	var i;
	for(i=1;i<=n;i++){
		name1="contentTit"+i;
		tr1="contentTr"+i;
		eval(name1).className='main_table2';
		eval(tr1).style.display='none';
	}
	eval("contentTit"+m).className='main_table';
	eval("contentTr"+m).style.display='block';
}
function zkShow4(m,n){
	var i;
	for(i=1;i<=n;i++){
		tr1="resSort"+i;
		eval(tr1).style.display='none';
	}
	if(m!=0)
		eval("resSort"+m).style.display='block';
}
