
//弹出窗口
function openWindow(URL,Width,Height) { 
window.open(URL,'','width='+Width+',height='+Height+',resizable=1,scrollbars=0,status=no,toolbar=no,location=no,menu=no');
}

//弹出窗口，固定位置left=100,top=100
function openWindowS(URL,Width,Height) { 
window.open(URL,'','width='+Width+',height='+Height+',resizable=1,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=100,top=100');
}

//弹出窗口，用户指定位置
function openWindowP(URL,Width,Height,left,top) { 
window.open(URL,'','width='+Width+',height='+Height+',resizable=1,scrollbars=0,status=no,toolbar=no,location=no,menu=no,left='+left+',top='+top);
}

//弹出窗口，用户指定窗口名称和位置
function openWindowPN(URL,winname,Width,Height,left,top) { 
window.open(URL,winname,'width='+Width+',height='+Height+',resizable=1,scrollbars=0,status=no,toolbar=no,location=no,menu=no,left='+left+',top='+top);
}

function go(URL){
	window.location = URL
}

//在新窗口中打开页面
function openNewWindow(URL) {
	window.open(URL)
}

//-------------------------------------------------------------------------------
//弹出窗口，固定位置left=100,top=100; 固定大小800;500; add by Marco
function openWindowS2(URL)
{
	openWindowS(URL, 800, 500);
}
function openWindowS3(URL)
{
	openWindowS(URL, 640, 480);
}

function SingleWindow(URL,Width,Height) { 
window.open(URL,'','width='+Width+',height='+Height+',resizable=1,scrollbars=0,status=no,toolbar=no,location=no,menu=no');
}

function SingleWindowS(URL,Width,Height) { 
window.open(URL,'','width='+Width+',height='+Height+',resizable=1,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=200,top=200,titlebar=0');
}

function GetDetail(Title,TitleType,TitleIndex){
SingleWindowS('http://www.newegg.com.cn/detail.aspx?TitleType='+TitleType + '&TitleIndex='+TitleIndex,640,480)
} 

// modified by Zodiac, 2003-07-02
//function showbasket(Item,Width,Height ) { 
//var d;
//var t;
//d=new Date();
//t=d.getTime();
function showbasket(SysNo,Width,Height ) { 
window.open('../Sale/Shoppingcart.aspx?Action=Add&productno='+SysNo,'basketlist','width='+Width+',height='+Height+',resizable=1,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=20,top=20,titlebar=0');
//window.open('basket.aspx?time='+t+'&item='+Item+'&ordernum='+document.item.OrderNum.value,'basketlist','width='+Width+',height='+Height+',resizable=1,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=200,top=200,titlebar=0');
}

function showbasket2(Item,Width,Height ) { 
var d;
var t;
d=new Date();
t=d.getTime();

window.open('basket2.aspx?time='+t+'&item='+Item+'&ordernum='+document.item.OrderNum.value,'basketlist','width='+Width+',height='+Height+',resizable=1,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=200,top=200,titlebar=0');
}

function gobasket(Width,Height ) { 
window.open('basket.aspx','basketlist','width='+Width+',height='+Height+',resizable=1,scrollbars=1,status=no,toolbar=no,location=no,menu=no,left=200,top=200,titlebar=0');
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

/*****************************************/
/** Added by SeanQu 2006/05/10 ***********/
/*****************************************/

function verifyCheckBoxIsChecked(formID)
{
	var form = document.forms[formID];
	var i = 0;
	var loop = 0;
	
	for (loop=0; loop < form.elements.length; loop++) 
	{ 
		if(form.elements[loop].type == "checkbox" && form.elements[loop].checked)
		{ 
			i = i + 1;
		}
	}    			
	
	if(i < 2)
	{
	    alert("您至少要选择两种商品，谢谢！");    
	    return false;
	}
	else
	{
	    return true;
	}
}

/*****************************************/

/*

//-------------------------------------------------------------
//Added by Garry.gu
//

//在客户端刷新下拉框
function refreshComboWithSql(objName,strsql,bNull){
	var i;
	var path="/web/Modules/GetDicXml.aspx";
	
	//清空下拉框
	for(i=document.all[objName].options.length-1;i>=0;--i){ 
		document.all[objName].options.remove(i); 
	}
	 
	//alert(strSql);
	var oXMLDoc=new ActiveXObject('MSXML'); 
	sURL=path+"?strsql="+strsql;
	oXMLDoc.url=sURL;  
	var oRoot=oXMLDoc.root; 
	if(bNull){
		var oOption=document.createElement('OPTION'); 
		document.all[objName].options.add(oOption); 
	}
	//alert("ee");
	if(oRoot.children!=null){
		for(var i=0;i<oRoot.children.length;++i){
			oItem=oRoot.children.item(i); 
			sName=oItem.children.item(1).text; 
			sValue=oItem.children.item(0).text;
			var oOption=document.createElement('OPTION'); 
			oOption.text=sName; 
			oOption.value=sValue;
			document.all[objName].options.add(oOption); 
		} 
	}
	document.all[objName].focus();
}

function refreshEmpByDuty(empObjName,dutyValue,bNull){
	//alert("aa");
	var strsql;
	strsql="select a.DutySysNo,b.EmployeeName from duty_item a inner join employee b on a.EmployeeSysNo=b.sysno  where a.dutySysNo=" + dutyValue;
	//alert(strsql);
	
	refreshComboWithSql(empObjName,strsql,bNull);
}

//
//Stopped.
//------------------------------------------------------------------
*/
