function SaveSort_Ok()
{
  alert('保存成功！');
}

function DelSort_Ok()
{
  alert('删除成功！');
}

function UpdateSort_Ok()
{
  alert('修改成功！');
}
//打开产品管理
function OnPro_M()
{
   window.parent.frames("Index_Bottom").location="pro_sort_addedit.aspx";
}
//打开用户信息管理
function OnCustomerInfo_M()
{
   window.parent.frames("Index_Bottom").location="customerinfo_list.aspx";5
}
//打开产品类别管理
function OnPro_Sort_M()
{
   window.parent.frames("Index_Bottom").location="pro_m_main.aspx";
}
//打开favorite产品管理
function OnPro_Favorite_M()
{
   window.parent.frames("Index_Bottom").location="pro_favorite_m.aspx";
}
//打开favorite产品
function OnPro_Favorite()
{
   window.parent.frames("Index_Bottom").location="pro_favorite.aspx";
}

//关于我们
function OnAboutUs()
{
   window.parent.frames("Index_Bottom").location="aboutus.aspx";
}
//联系我们
function OnContactUs()
{
   window.parent.frames("Index_Bottom").location="contactus.aspx";
}
//打开某个栏目
function OnTab(mName)
{
   window.parent.frames("Index_Bottom").location="tab_content_list.aspx?Tab_Name=" + escape(mName);
}

//打开编辑用户名和密码
function OnEditUserPW()
{
   window.parent.frames("Index_Bottom").location="edit_userpw.aspx";
}

//刷新
function OnRefresh()
{
   window.parent.location.reload();
}
//退出
function OnExit()
{
   window.parent.close();
}


//打开新增产品
function OnAddPro(mSort_ID,mProduct_ID)
{
   window.location='pro_addedit.aspx?sort_id=' + mSort_ID + '&product_id=' + mProduct_ID;
}

//**************************js通用库******************************
/*
字符串操作
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

/*
==================================================================
LTrim(string):去除左边的空格
==================================================================
*/
function LTrim(str)
{
    var whitespace = new String(" \t\n\r");
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(0)) != -1)
    {
        var j=0, i = s.length;
        while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
        {
            j++;
        }
        s = s.substring(j, i);
    }
    return s;
}
 
/*
==================================================================
RTrim(string):去除右边的空格
==================================================================
*/
function RTrim(str)
{
    var whitespace = new String(" \t\n\r");
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(s.length-1)) != -1)
    {
        var i = s.length - 1;
        while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)

        {
            i--;
        }
        s = s.substring(0, i+1);
    }
    return s;
}

/*
==================================================================
Trim(string):去除前后空格
==================================================================
*/
function Trim(str)

{
    return RTrim(LTrim(str));
}

/*
==================================================================
strReplace(string):替换字符
==================================================================
*/
function strReplace(str)
{
   var s=new String(str);
   s=s.replace(" ","").replace("'","");
   return s;
}


//客户端检查上传文件的大小，超过指定大小进行提醒	
/*	
function  check_size()
{ 
	var fso, f, s;
	fso = new ActiveXObject("Scripting.FileSystemObject");
	var yfileName=document.Form1.all("File1").value;
	yfileName=yfileName.replace(' ','');
	if (yfileName!='')
	{
		if (fso.FileExists(document.Form1.all("File1").value))
		{
			f = fso.GetFile(document.Form1.all("File1").value);
			//alert(f.Size);
			if (f.Size>4194304)
			{
				document.Form1.all("File1").value='';
				alert("对不起，你的文件大于4M,请处理后再传 ！");
			}
			
			if (f.Size==0)
			{
				document.Form1.all("File1").value='';
				alert("对不起，你的文件为0K，不允许上传 ！");
			}
		}
		else
			alert("对不起，文件不存在 ！");
	}
}
*/
