<!-- 
function killErrors() {
return true;
}
window.onerror = killErrors;

//设定图片显示尺寸
var flag=false; 
function DrawImage(ImgD,w,h){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= w/h){ 
    if(image.width>w){ 
      ImgD.width=w; 
      ImgD.height=(image.height*w)/image.width; 
    }else{ 
      ImgD.width=image.width; 
      ImgD.height=image.height; 
    } 
  }else{ 
    if(image.height>h){ 
      ImgD.height=h; 
      ImgD.width=(image.width*h)/image.height; 
    }else{ 
      ImgD.width=image.width; 
      ImgD.height=image.height; 
    } 
  } 
} 
} 


//改变图片大小
function resizepic(thispic)
{if(thispic.width>500) thispic.width=500;}


function doChange(objText, objDrop){
	if (!objDrop) return;
	var str = objText.value;
	var arr = str.split("|");
	objDrop.length=0;
	for (var i=0; i<arr.length; i++){
	objDrop.options[i] = new Option(arr[i], arr[i]);
	PicUrl=objDrop.options[i].value;
	}
	document.addform.WM_DefaultPicUrl.value = PicUrl;
	addform.WM_PicPreview.src = PicUrl;
	addform.WM_PicPreview.alt = PicUrl;
}

//当前时间
 
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++)  {
	TempChar= InString.substring (Count, Count+1);
	if (RefString.indexOf (TempChar, 0)==1)  
	return (false);
}
return (true);
}

function CharMode(iN){
	if (iN>=48 && iN <=57) //数字
		return 1; 
	if (iN>=65 && iN <=90) //大写字母
		return 2;
	if (iN>=97 && iN <=122) //小写
		return 4;
	else
		return 8; //特殊字符
}

function checkStrong(sPW){
	if (sPW.length<=4)
		return 0;  //密码太短
	Modes=0;
	for (i=0;i<sPW.length;i++){
		Modes|=CharMode(sPW.charCodeAt(i));
	}

	return bitTotal(Modes);
	
}	


function bitTotal(num){
	modes=0;
	for (i=0;i<4;i++){
		if (num & 1) modes++;
		num>>>=1;
	}
	return modes;
}

function pwStrength(pwd){
	O_color="#eeeeee";
	L_color="#FF0000";
	M_color="#FF9900";
	H_color="#33CC00";
	if (pwd==null||pwd==''){
		Lcolor=Mcolor=Hcolor=O_color;
		Text_L="弱";
		Text_M="中";
		Text_H="强";
	}	
	else{
		S_level=checkStrong(pwd);
		switch(S_level)	 {
			case 0:
			case 1:
				Lcolor=L_color;
				Mcolor=Hcolor=O_color;
				Text_L="弱";
				Text_M="&nbsp;";
				Text_H="&nbsp;";
				break;
			case 2:
				Lcolor=Mcolor=M_color;
				Hcolor=O_color;
				Text_L="&nbsp;";
				Text_M="中";
				Text_H="&nbsp;";
				break;
			default:
				Text_L="&nbsp;";
				Text_M="&nbsp;";
				Text_H="强";
				Lcolor=Mcolor=Hcolor=H_color;
				}
	 }	
	
	document.getElementById("strength_L").style.background=Lcolor;
	document.getElementById("strength_M").style.background=Mcolor;
	document.getElementById("strength_H").style.background=Hcolor;
//------------------------------
	document.getElementById("strength_L").innerHTML=Text_L;
	document.getElementById("strength_M").innerHTML=Text_M;
	document.getElementById("strength_H").innerHTML=Text_H;

	return;
}

// 显示无模式对话框
function ShowDialog(url, width, height) {
	var arr = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
}

//居中打开窗口
function openwindow( url, winName, width, height) {
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 )){
xposition = (screen.width - width) / 2;
yposition = (screen.height - height) / 2;}
theproperty= "width=" + width + "," 
+ "height=" + height + "," 
+ "location=0," 
+ "menubar=0,"
+ "resizable=1,"
+ "scrollbars=0,"
+ "status=0," 
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //仅适用于Netscape
+ "screeny=" + yposition + "," //仅适用于Netscape
+ "left=" + xposition + "," //IE
+ "top=" + yposition; //IE 
window.open( url,winName,theproperty );
}
	
//表单提交
function Ctlent(){
//ctrl + Enter
if(event.ctrlKey && window.event.keyCode==13){
  if(ClcKcntr()){
    this.document.addform.submit();
  }
}
//ctrl + s
if(event.ctrlKey && window.event.keyCode==83){
  if(ClcKcntr()){
    this.document.addform.submit();
  }
}
}
clckcnt=0;
function ClcKcntr(){
  clckcnt++;
  if(clckcnt > 1){
    alert('请求已经发出，请等待片刻!\n\n'+'不要重复提交，谢谢!');
	return false;
  }
  return true;
}

function AddProduct(addKeyword) {
  var revisedTitle ="";
  var currentTitle = document.myform.Product.value;
  var key = 0;
  var sel2=currentTitle.split(',');
  for(var i = 0;i < sel2.length;i ++) {
	if(sel2[i] == addKeyword) {
	   key=1;
	}
  }
  if(key==1){
    for(var i = 0;i < sel2.length;i ++) {
	  if(sel2[i] != addKeyword) {
        if(sel2[i]!=""){
		  if (currentTitle==""){
            revisedTitle = sel2[i];
          }else{
		    if (revisedTitle!=""){
              revisedTitle = revisedTitle+","+sel2[i]; 
			}else{
              revisedTitle = sel2[i]; 
			}
          }
		}
	  }
    }
  }else{
    if (currentTitle==""){
       revisedTitle = addKeyword; 
    }else{
       revisedTitle = currentTitle+","+addKeyword; 
    }
  }
  document.myform.Product.value=revisedTitle; 
}

//ajax提示框功能
var Obj=''
document.onmouseup=MUp
document.onmousemove=MMove

function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}

function MMove(){
if(Obj!=''){
  document.all(Obj).style.left=event.x-pX;
  document.all(Obj).style.top=event.y-pY;
  }
}

function MUp(){
if(Obj!=''){
  document.all(Obj).releaseCapture();
  Obj='';
  }
}
//上传完成后返回参数处理
function upcom(Spath,path){
  if(path!=""){
  if(Spath!=""){
      document.myform.SPic.value = Spath;
    }else{
      document.myform.SPic.value = path;
    }
    document.myform.Pic.value = path;
  }
  document.getElementById("up").style.display = "none";
  closeWithIframe();
}
//------------------------------


function DBC2SBC(input,str,flag){ 
var i; 
var result=''; 
for(i=0;i<str.length;i++){
str1=str.charCodeAt(i); 
if(str1<125&&!flag) 
result+=String.fromCharCode(str.charCodeAt(i)); 
else 
result+=String.fromCharCode(str.charCodeAt(i)-65248); 
}
input.value = result;
} 

//ajax提示框========================================
function openWithIframe(tit,url,w,h){
	var sWidth,sHeight;
	sWidth=document.body.clientWidth;
	sHeight=document.body.scrollHeight;
	if(sHeight<window.screen.height){sHeight=window.screen.height;}
	var bgObj=document.createElement("div");
	bgObj.setAttribute('id','bgDiv');
	bgObj.style.position="absolute";
	bgObj.style.top="0";
	bgObj.style.background="#000000";
	bgObj.style.filter="Alpha(Opacity=30);";
	bgObj.style.left="0";
	bgObj.style.width=sWidth + "px";
	bgObj.style.height=sHeight + "px";
	bgObj.style.zIndex = "10000";
    document.body.appendChild(bgObj);

    massage_box.style.left = (document.body.clientWidth - w) / 2;
    massage_box.style.top = (screen.height - h) / 2-80;
    massage_box.style.screenx = (document.body.clientWidth - w) / 2;//仅适用于Netscape
    massage_box.style.screeny = (screen.height - h) / 2-80;//仅适用于Netscape
    massage_box.style.width = w+"px";
    massage_box.style.height = h+"px";
    pop_title.innerHTML=tit;
    massage_box.style.display=''
    var popiframe='<iframe src="'+url+'" width="'+(w-11)+'px"  height="'+(h-36)+'px" frameborder=0 scrolling=auto></iframe>';
    pop_iframe.innerHTML=popiframe;
}
function closeWithIframe(){
    massage_box.style.display="none";
    document.body.removeChild(document.getElementById("bgDiv"));
}
document.write('<div id="massage_box" style="position:absolute; FILTER: progid:DXImageTransform.Microsoft.DropShadow();z-index:10001;display:none">');
document.write('<div style="border-width:1 1 3 1; width:100%; height:100%; background:#fff; color:#0590D3; font-size:12px; line-height:150%">');
document.write('<div onmousedown=MDown(massage_box) style="background:#0590D3; height:20px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;color:#fff;cursor:move;padding:0 0 4px 0">');
document.write('<div style="display:inline; width:200px; position:absolute;padding:3px 0 0 5px" id=pop_title></div>');
document.write('<span onClick="closeWithIframe()" style="float:right; display:inline; cursor:pointer;padding:3px 5px 0 0;font-size:12px">关闭</span>');
document.write('</div>');
document.write('<div style="padding:5px" id=pop_iframe></div>');
document.write('</div>');
document.write('</div>');
//ajax提示框功能========================================


function InitAjax(){
var ajax=false; 
try { ajax = new ActiveXObject("Msxml2.XMLHTTP"); } 
catch (e) { try { ajax = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { ajax = false; } }
if (!ajax && typeof XMLHttpRequest!='undefined') { ajax = new XMLHttpRequest(); } 
return ajax;}

//公用ajax
function ToAjax(url,Post){
	if (url!=""){
		var getinfo = "";
		var ajax = InitAjax();
		ajax.open("POST", url, true); 
		ajax.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded; charset=GB2312"); 
		ajax.send(Post);
	    ajax.onreadystatechange = function(){
		  if (ajax.readyState == 4){getinfo = ajax.responseText;}
	      AjaxShow.innerHTML = getinfo;
		  }
	}
}

// -->
