

function DelOrders(Uid,i)
{
	if (confirm("You should identify deleted? "))
	{
		window.location.href="?UID="+Uid+"&DelOrdersID="+i;
	}
}

function SubmitCartS(Uid,s){
	if (confirm("To order your set?")){
		window.location.href="?UID="+Uid+"&SubmitCartS="+s;
	}
}


function checkPass(){
	if(document.form1.Password.value!=document.form1.AffirmPass.value)
		{
			window.alert("Two codes are different, please re-entry!");
			document.form1.Password.value="";
			document.form1.AffirmPass.value="";
			document.form1.Password.focus();
			return false;
		}
}



function RegPass(){
	//checkPass();

	if(cTrim(document.form1.UserName.value,0).length<4)
		{
			window.alert("UserName (4 to 20 characters)!")
			document.form1.UserName.focus();
			return false;
		}

	if(cTrim(document.form1.Password.value,0).length<4)
		{
			window.alert("Password (4 to 20 characters)!")
			document.form1.Password.focus();
			return false;
		}

	if(document.form1.Password.value!=document.form1.AffirmPass.value)
		{
			window.alert("Two codes are different, please re-entry!");
			document.form1.Password.value="";
			document.form1.AffirmPass.value="";
			document.form1.Password.focus();
			return false;
		}
	//else
	
	//	return checkPass();

		
	if(cTrim(document.form1.PassQuestion.value,0)=="")
		{
			window.alert("PassQuestion!")
			document.form1.PassQuestion.focus();
			return false;
		}
	if(cTrim(document.form1.QuestionAnswer.value,0)=="")
		{
			window.alert("QuestionAnswer!")
			document.form1.QuestionAnswer.focus();
			return false;
		}
	if(cTrim(document.form1.Consignee.value,0)=="")
		{
			window.alert("Your Full Name!")
			document.form1.Consignee.focus();
			return false;
		}
	if(cTrim(document.form1.CompanyName.value,0)=="")
		{
			window.alert("CompanyName!")
			document.form1.CompanyName.focus();
			return false;
		}

	if(cTrim(document.form1.ReceiveAddress.value,0)=="")
		{
			window.alert("ReceiveAddress!")
			document.form1.ReceiveAddress.focus();
			return false;
		}

	if(cTrim(document.form1.Country.value,0)=="")
		{
			window.alert("ReceiveAddress!")
			document.form1.ReceiveAddress.focus();
			return false;
		}

	if(cTrim(document.form1.Email.value,0)=="")
		{
			window.alert("Email!")
			document.form1.Email.focus();
			return false;
		}

	if(cTrim(document.form1.Telephone3.value,0) == "")
		{
			window.alert("Telephone!")
			document.form1.Telephone3.focus();
			return false;
		}
	if(cTrim(document.form1.Fax3.value,0) == "")
		{
			window.alert("Fax3!")
			document.form1.Fax3.focus();
			return false;
		}
}




//****************************************************************
// Description: sInputString 为输入字符串，iType为类型，分别为
// 0 - 去除前后空格; 1 - 去前导空格; 2 - 去尾部空格
// cTrim(String,iType)
function cTrim(sInputString,iType)
{
var sTmpStr = ' '
var i = -1

if(iType == 0 || iType == 1)
{
while(sTmpStr == ' ')
{
++i
sTmpStr = sInputString.substr(i,1)
}
sInputString = sInputString.substring(i)
}

if(iType == 0 || iType == 2)
{
sTmpStr = ' '
i = sInputString.length
while(sTmpStr == ' ')
{
--i
sTmpStr = sInputString.substr(i,1)
}
sInputString = sInputString.substring(0,i+1)
}
return sInputString
}
//****************************************************************


function RegOrder(){
	if(cTrim(document.form1.FirstName.value,0).length<1)
		{
			window.alert("FirstName!")
			document.form1.FirstName.focus();
			return false;
		}
	if(cTrim(document.form1.LastName.value,0).length<1)
		{
			window.alert("LastName!")
			document.form1.LastName.focus();
			return false;
		}
	if(cTrim(document.form1.Address.value,0).length<1)
		{
			window.alert("Address!")
			document.form1.Address.focus();
			return false;
		}
	if(cTrim(document.form1.City.value,0).length<1)
		{
			window.alert("City!")
			document.form1.City.focus();
			return false;
		}
	if(cTrim(document.form1.State.value,0).length<1)
		{
			window.alert("State!")
			document.form1.State.focus();
			return false;
		}
	if(cTrim(document.form1.Phone.value,0).length<1)
		{
			window.alert("Phone!")
			document.form1.Phone.focus();
			return false;
		}
	if(cTrim(document.form1.Email.value,0).length<1)
		{
			window.alert("Email!")
			document.form1.Email.focus();
			return false;
		}
	if(cTrim(document.form1.Company.value,0).length<1)
		{
			window.alert("Company!")
			document.form1.Company.focus();
			return false;
		}
	if(cTrim(document.form1.ItemNo.value,0).length<1)
		{
			window.alert("ItemNo!")
			document.form1.ItemNo.focus();
			return false;
		}
	if(cTrim(document.form1.Color.value,0).length<1)
		{
			window.alert("Color!")
			document.form1.Color.focus();
			return false;
		}
	if(cTrim(document.form1.Size.value,0).length<1)
		{
			window.alert("Size!")
			document.form1.Size.focus();
			return false;
		}
	if(cTrim(document.form1.Quantity.value,0).length<1)
		{
			window.alert("Quantity!")
			document.form1.Quantity.focus();
			return false;
		}

}


function checkStr(){
	
	if(document.form1.NewsTitle.value=="")
		{
			window.alert("请输入标题!")
			document.form1.NewsTitle.focus();
			return false;
		}
		
	if(document.form1.NewsContent.value=="")
		{
			window.alert("请输入内容!")
			document.form1.NewsContent.focus();
			return false;
		}

		
	if(document.form1.imgfile.value!="")
		{
			var str = document.form1.imgfile.value;
			var pos = str.lastIndexOf(".");
			var lastname = str.substring(pos,str.length);
			if (lastname.toLowerCase()!=".jpg" && lastname.toLowerCase()!=".gif" && lastname.toLowerCase()!=".bmp"  && lastname.toLowerCase()!=".jpeg" && lastname.toLowerCase()!=".png" ){
					alert("您上传的文件类型为"+lastname+"，图片必须为.jpg,.gif,.bmp,.jpeg,.png类型");
					document.form1.imgfile.focus();
					return false;}
			else{document.form1.action="?hadlogin=true&image=true";}
			document.form1.action="?hadlogin=true&image=true"
		}
}





//****************** Time (A) *****************
function  Year_Month(){  
        var  now  =  new  Date();  
        var  yy  =  now.getYear();  
        var  mm  =  now.getMonth();  
		var  mmm=new  Array();
		mmm[0]="January";
		mmm[1]="February  ";
		mmm[2]="March";
		mmm[3]="April";
		mmm[4]="May";
		mmm[5]="June";
		mmm[6]="July";
		mmm[7]="August";
		mmm[8]="September";
		mmm[9]="October";
		mmm[10]="November";
		mmm[11]="December";
		mm=mmm[mm];
        return(mm  );  }
function  thisYear(){  
        var  now  =  new  Date();  
        var  yy  =  now.getYear();  
        return(yy  );  }
function  Date_of_Today(){  
        var  now  =  new  Date();  
        return(now.getDate()  );  }
function  CurentTime(){  
        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  refreshCalendarClock(){  
		document.all.calendarClock1.innerHTML  =  Year_Month();  
		document.all.calendarClock2.innerHTML  =  Date_of_Today();  
		document.all.calendarClock3.innerHTML  =thisYear();  
		document.all.calendarClock4.innerHTML  =  CurentTime(); 
}
function  TimeNow(){  
		document.write('<font  id="calendarClock1"  >  </font>&nbsp;');
		document.write('<font  id="calendarClock2"  >  </font>,');
		document.write('<font  id="calendarClock3"  >  </font>&nbsp;');
		document.write('<font  id="calendarClock4"  >  </font>');
		setInterval('refreshCalendarClock()',1000);
}
//****************** Time (B) *****************

//****************** Image_Zoom (A) *****************
function resizepic(thispic){
	if(thispic.width>700) thispic.width=700;
}
function bbimg(o){
  var zoom=parseInt(o.style.zoom, 10)||100;
  zoom+=event.wheelDelta/12;
  if (zoom>0) o.style.zoom=zoom+'%';
  return false;
}
function fontZoomA(){
  if(curfontsize>8){
    document.getElementById('fontzoom').style.fontSize=(--curfontsize)+'pt';
	document.getElementById('fontzoom').style.lineHeight=(--curlineheight)+'pt';
  }
}
function fontZoomB(){
  if(curfontsize<64){
    document.getElementById('fontzoom').style.fontSize=(++curfontsize)+'pt';
	document.getElementById('fontzoom').style.lineHeight=(++curlineheight)+'pt';
  }
}
//****************** Image_Zoom (B) *****************

//****************** Tool_Left_Hid (A) *****************
var bFlag = true;
function adjust() {
    if(bFlag){
		window.parent.frames["mainFrame"].setAttribute("cols","0,10,*"); 
		window.DivID.innerHTML="<FONT color='#888888' face=webdings>4</FONT>"
	}
    else{
		window.parent.frames["mainFrame"].setAttribute("cols","150,10,*"); 
		window.DivID.innerHTML="<FONT color='#888888' face=webdings>3</FONT>"
	}
    bFlag = !bFlag;
}
//****************** Tool_Left_Hid (B) *****************

//****************** Div_Hid (A) *****************
function display(DivID){
	var DivName = eval("document.all."+DivID);
	dis(DivName);
}
function displays(DivID){
	var arrTmp = DivID.split(',');
	for(var i = 0; i < arrTmp.length; i++){
		var DivName = eval("document.all."+arrTmp[i].split(","));
		dis(DivName);
	}
}
function dis(DivName){
	if (DivName.style.display=="none"){
		DivName.style.display="";
	}
	else{
		DivName.style.display="none";
	}
}
//****************** Div_Hid (B) *****************

//****************** Mouse (A) *****************
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//****************** Mouse (B) *****************

//****************** Select menu (A) *****************
function GetResult(str){
	var SelBamboo = new ActiveXObject("Microsoft.XMLHTTP");
	SelBamboo.open("POST","../PublicClass/SelServer.asp?sel="+str,false);
	SelBamboo.send();
	BuildSel(unescape(SelBamboo.responseText),document.all.sel2)
	if (str.length <= 1){ 
		document.all.sel2.style.display='none';
	}
	else
		document.all.sel2.style.display=''; 
}
function GetResultS(str,SelID,SelID2,SelID3,SelID4,SelID5,SelID6){
	var SelBamboo = new ActiveXObject("Microsoft.XMLHTTP");
	SelBamboo.open("POST","../PublicClass/SelServer.asp?sel="+str,false);
	SelBamboo.send();
	BuildSel(unescape(SelBamboo.responseText),SelID);
	CheckSel(str,SelID,SelID2,SelID3,SelID4,SelID5,SelID6)
}
function BuildSel(str,sel){
	sel.options.length=0;
	var arrstr = new Array();
	arrstr = str.split(",");
	for(var i=0;i<arrstr.length;i++){
		sel.options[sel.options.length]=new Option(arrstr[i],arrstr[i])
	}
}
function CheckSel(str,SelID,SelID2,SelID3,SelID4,SelID5,SelID6){
	if (str.length <= 1){ 
		SelID.style.display='none';
		SelID2.style.display='none';
		SelID3.style.display='none';
		SelID4.style.display='none';
		SelID5.style.display='none';
		SelID6.style.display='none';
	}
	else{
		SelID.style.display=''; 
		SelID2.style.display=''; 
		SelID3.style.display=''; 
		SelID4.style.display=''; 
		SelID5.style.display=''; 
		SelID6.style.display=''; }
}
//****************** Select menu (B) *****************







