   var buffaloPath = "/BUFFALO";
   
   function getBuffaloPath(){
   		return buffaloPath;
   }
   
   var isOnline = isLogin();//是否登录
   
   function getIsOnline(){
   		return isOnline;
   }
   
  //脚本取根
  	function getRootPath(){
		var strFullPath=window.document.location.href;
		var strPath=window.document.location.pathname;
		var pos=strFullPath.indexOf(strPath);
		var prePath=strFullPath.substring(0,pos);
		var postPath=strPath.substring(0,strPath.substr(1).indexOf('/')+1);
		return(prePath+postPath);
	}

   //判断是否登录
   function isLogin(){
		var buffalo = new Buffalo(buffaloPath,false);
		var isLogin = false;
		buffalo.remoteCall("OrderFormDelegate.isLogin",{},function(reply){
			var replyResult = reply.getResult();
			if(replyResult != undefined){
				isLogin = replyResult;
			}
		}); 
		return isLogin;
   }
   
   //获取登陆欢迎词
   function getWelcomeMsgToLogin(){
   		var buffalo = new Buffalo(buffaloPath,false);
		var msg = "";
		buffalo.remoteCall("OrderFormDelegate.getWelcomeMsgToLogin",{},function(reply){
			var replyResult = reply.getResult();
			if(replyResult != undefined){
				msg = replyResult;
			}
		}); 
		return msg;
   }
   
   //获取登录信息
   function getLeftLoginMsg(){
   		var buffalo = new Buffalo(buffaloPath,false);
		var msg = "";
		buffalo.remoteCall("OrderFormDelegate.getLeftLoginMsg",{},function(reply){
			var replyResult = reply.getResult();
			if(replyResult != undefined){
				msg = replyResult;
			}
		}); 
		return msg;
   }
   
   //取在线客服所需的参数
   function getOnlineKfParam(){
   		var buffalo = new Buffalo(buffaloPath,false);
		var url = "";
		buffalo.remoteCall("OrderFormDelegate.getOnlineKfParam",{},function(reply){
			var replyResult = reply.getResult();
			if(replyResult != undefined){
				url = replyResult;
			}
		}); 
		return url;
   }
   
   //获取userid
   function getUserid(){
   		var buffalo = new Buffalo(buffaloPath,false);
		var userid = "";
		buffalo.remoteCall("OrderFormDelegate.getUserid",{},function(reply){
			var replyResult = reply.getResult();
			if(replyResult != undefined){
				userid = replyResult;
			}
		}); 
		return userid;
   }
   
    //在线客服
   function open_wskf(){
  	    var userid = getUserid();
        var winid="im"+userid;
        var url = window.location.href;
        url = url.split('?')[0];
        var title = window.document.title;
        window.open('/common/towskf.jsp?openUrl='+url+"&openUrlName="+title,winid,'toolbar=0,scrollbars=0,location=0,menubar=0,resizable=0,width=530,height=435');
   }
    
