﻿function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function CheckAll(thisform) {
for (var i=0;i<thisform.elements.length;i++) {
var e = thisform.elements[i];
if (e.name == 'del_id') { e.checked = thisform.chkall.checked; }
if (e.name == 'del_id2') { e.checked = thisform.chkall.checked; }
}}
function openwin(page,size)
{
window.open(page,"newuser","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,"+ size);
}           

function ViewWin(Path) {
var pw=window.open(Path,"viewwin","resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no");
pw.focus();  
}
function ViewWin2(Path) {
var vw=window.open(Path,"viewwin2","resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no");
//var pw=window.open(Path,"viewwin2","top=0,left=0,width=580,height="+(screen.Height-108)+",resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=yes,location=no");
vw.focus();  
}

function DeleteConfirm(thisform,cmsg) {
  var SelectCount=0;
  var SelectCount2=0;
  var msgconst="_________________________________________________\n";
  for ( var i=0;i<thisform.elements.length;i++)
  {var participant=thisform.elements[i];
  if (participant.name=="del_id" && participant.checked )	{	SelectCount++; } 
  if (participant.name=="del_id2" && participant.checked )	{	SelectCount2++; } }
  if (SelectCount<1 && SelectCount2<1 ){alert(msgconst+"\n请选择需要删除的记录!\n"+msgconst);return false; }
  else{ 
  if (cmsg=="") { cmsg=""; } else { cmsg=cmsg+"\n";}
  var msg=cmsg+"\n确定删除所选择的记录吗?\n"+msgconst;return confirm(msg);}	
}
function selectConfirm(thisform,cmsg) {
  var SelectCount=0;
  var SelectCount2=0;
  var msgconst="_________________________________________________\n";
  for ( var i=0;i<thisform.elements.length;i++)
  {var participant=thisform.elements[i];
  if (participant.name=="sel_id" && participant.checked )	{	SelectCount++; } 
  if (participant.name=="sel_id2" && participant.checked )	{	SelectCount2++; } }
  if (SelectCount<1 && SelectCount2<1 ){alert(msgconst+"\n请选择你的购买商品!\n"+msgconst);return false; }
  
}

function ValidPage(thisform){
var errormsg="\n Page field must be a numeric character!"
var valid = "0123456789"
var ok = true;
var temp;
if(parseInt(thisform.page.value)<1 || thisform.page.value.length<1)
{	ok=false; }
else
{
	for (var i=0; i<thisform.page.value.length; i++) 
	{
		temp = "" + thisform.page.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") 
		{
			ok = false;
			break;
		}
	}
}
if (ok) { return true;} else { alert(errormsg);return false; }
}

function PopUpCalendarDlg(ctrlobj)
{
	showx = event.screenX - event.offsetX - 4 - 210 ; 
	showy = event.screenY - event.offsetY + 18; 
	newWINwidth = 210 + 4 + 18;
	retval = window.showModalDialog("Include/Calendar.asp", "", "dialogWidth:400px; dialogHeight:300px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
	if( retval != null ){ ctrlobj.value = retval;}
}

