
function getRecFile(f){
  
  var path = "DownLoadFile?filename="+f+"&filepath="+ "\\\\192.168.0.111"; //"D:\\shCB\\shCBCC2005\\";

  window.open(path);
}

String.prototype.ReplaceAll = stringReplaceAll;

function  stringReplaceAll(AFindText,ARepText){
  raRegExp = new RegExp(AFindText,"g");
  return this.replace(raRegExp,ARepText)
}

//到产品详细信息
function productDetails(pno){
    if (pno == "") {
        alert("产品空！连接错误！");
        return false;
    }
        
    //location.href = "productAction.ui?method=product&pno=" + pno;
	open("productAction.ui?method=product&pno=" + pno);
}

//购物车
function toshop(type, pno){
    if (pno == "") {
        alert("产品空！连接错误！");
        return false;
    }
    
    //type=add---添加后跳回原来的界面, type=buy--添加后跳到购物车界面
    if (type=="add"){
		alert("添加产品成功");
        location.href = "shoppingcartAction.ui?method=add&pno=" + pno;
     } else {
        location.href = "shoppingcartAction.ui?method=buy&pno=" + pno;
     } 
    
    return true;
}

//共同购买
function toshopgroup(type, pno, progroupid){
    if (pno == "") {
        alert("产品空！连接错误！");
        return false;
    }
    
    //type=add---添加后跳回原来的界面, type=buy--添加后跳到购物车界面
    if (type=="add"){
		alert("添加产品成功");
        location.href = "shoppingcartAction.ui?method=add&pno=" + pno+"&progroupid="+progroupid;
     } else {
        location.href = "shoppingcartAction.ui?method=buy&pno=" + pno+"&progroupid="+progroupid;
     } 
    
    return true;
}

//到店铺首页
function shop(shopid){
   if (shopid == ""){
       alert("编号出错");
       return false;
   }
   //location.href = "shopAction.ui?method=shop&coid="+shopid;
   window.open("shopAction.ui?method=shop&coid="+shopid);

}

//添加收藏夹，页面中需要包含js/xmlhead.js和js/ajax/addFav.js
function addfav(path, scoid, pno, title){
   ajaxinit(path, scoid, pno, title);
}

//添加好友，页面中需要包含js/xmlhead.js和js/ajax/addFriend.js
function addfriend(path, fcoid){
   ajaxinitAddFriend(path, fcoid);   
}

//删除好友，页面中需要包含js/xmlhead.js和js/ajax/delFriend.js
function delfriend(path, fcoid){
   ajaxinitDelFriend(path, fcoid);
}

//加入部落，页面中需要包含js/xmlhead.js和js/ajax/joinTribe.js
function joinTribe(path, tcode){
   ajaxinitJoinTribe(path, tcode);
}

//关键字转换查询
function searchByKeyword(){
  try{
	var objs=document.getElementsByTagName("a");
	var idname = "";
	for(var i=0;i<objs.length;i++)
	{
	   var obj = objs[i];
	   if (obj.id=="searchkeywordid"){
	       //idname = decodeURI(encodeURI(obj.innerText));
		   idname = encodeURI(obj.innerText);
	       obj.href = "productAction.ui?method=searchui&keyword2="+idname;
		   obj.target = "_blank";
	   }
	}
} catch(e) {
	//e;
}
}


//静态页面文字搜索--ff add
function htmlKeyword(obj){
	var idname = "";
	idname = encodeURI(obj);
	var myurl= "http://www.wiselife.net/productAction.ui?method=searchui&keyword2="+idname;
	window.open(myurl);
}

//关键字转换查询部落
function searchTribeByKeyword(){

	var objs=document.getElementsByTagName("t");
	var idname = "";
	for(var i=0;i<objs.length;i++)
	{
	   var obj = objs[i];
	   if (obj.id=="searchkeywordid"){
	       //idname = decodeURI(encodeURI(obj.innerText));
		   idname = encodeURI(obj.innerText);
	       obj.href = "tribeAction.ui?method=list&keyword2="+idname;
		   obj.target = "_blank";
	   }
	}
}

//到部落首页
function totribe(tcode) {
	window.open("tribeAction.ui?method=tribe&tcode=" + tcode);
}

//到部落文章页面
function toarticle(artid) {
	location.href="tribeAction.ui?method=article&id=" + artid;
}

//发送站内消息
function sendMsg(fcoid){
    window.open("http://www.wiselife.net/custSelfAction.ui?method=sznxsent&fcoid="+fcoid,null,"width=450, height=400");
}

//显示个人信息
function custinfo(coid){
    window.open("custSelfAction.ui?method=custinfo&coid="+coid,null,"width=400, height=450");
}

//读取站内消息
function readMsg(id){
    window.open("http://www.wiselife.net/custSelfAction.ui?method=sznxrec&id="+id,null,"width=450, height=400");
}

//回复站内消息
function replyMsg(fcoid, id){
   window.open("custSelfAction.ui?method=sznxsent&fcoid="+fcoid+"&type=reply"+"&id="+id,null,"width=450, height=400");
}

//转发站内消息
function ccMsg(id){
   window.open("custSelfAction.ui?method=sznxsent&type=cc"+"&id="+id,null,"width=450, height=400");
}

//转到个人空间自动判断是否是个人用户,是否是商铺用户
function toSpaceOrShop(fcoid){
   if (fcoid == ""){
       alert("编号出错");
       return false;
   }
    window.open("custSelfAction.ui?method=gospaceorshop&fcoid="+fcoid);    
}

//设置帖子置顶或者取消
function setTop(path, artid, c) {
	ajaxinitArticleSetTop(path, artid, c);
}

//设置帖子普通热贴精华关闭
function setState(path, artid, state) {
	ajaxinitArticleSetState(path, artid, state);
}

//土瓦网
function tuwa(){
    window.open("customerAction.ui?method=sms");   
}
