  
    //var passit_src = "localhost:8080/passit";
    //var passit_src ="192.168.1.100:8080/passit";
	 var passit_src = "www.passit.cn";
    var is_first_load_passit_float_js=true;
	var is_close_passit=false;
	windowBindOnloadEvent_float();
   function windowBindOnloadEvent_float(){
   	document.writeln("<script type=\"text/javascript\" src=\"http://"+passit_src+"/js/passit_object.js\" charset=\"UTF-8\"></script>");
	document.writeln("<link href=\"http://"+passit_src+"/css/passit_right.css\" rel=\"stylesheet\" type=\"text/css\"/>");
   	if (document.addEventListener) {
   		document.addEventListener("DOMContentLoaded", function(){
   			document.removeEventListener("DOMContentLoaded", arguments.callee, false);
   		}, false)
   	}
   	else if (document.attachEvent) {
   			document.attachEvent("onreadystatechange", function(){
   				if (document.readyState === "complete") {
   					document.detachEvent("onreadystatechange", arguments.callee);		
   				}
   			});
			 if (document.documentElement.doScroll && window == window.top)(function() {
                    try {
                        document.documentElement.doScroll("left");
                    } catch(error) {
                        setTimeout(arguments.callee, 0);
                        return
                    }
                    passit_onload_float();
              })();
   		}
   	if (window.addEventListener) {
   		window.addEventListener("load", passit_onload_float, false);
   	}
   	else 
   		if (window.attachEvent) {
   			window.attachEvent("onload", passit_onload_float, false);
   		}
		
   }
   

 function passit_onload_float(){	
   	var isIE = false,isIE6=false;
	var isIE7=false;
	var isIE8=false;
   	var ua = navigator.userAgent.toLowerCase();
	var container_color="";//container边框的颜色;
	var title_bgColor="";//标题的背景颜色;
	var passit_service;
	
    if (typeof(bookmark_service) != "undefined") {
        passit_service = bookmark_service;
    }
	
   	if(ua.indexOf("msie 6.0")!=-1)
		isIE6=true;//判断是否为ie6.0；
	if(ua.indexOf("msie 7.0")!=-1||ua.indexOf("msie 8.0")!=-1){
		isIE7=true;//判断是否为ie7.0；
	}
	if(is_first_load_passit_float_js)
	createStyleAndScript();
	else
	return;
    function createStyleAndScript() {
		is_first_load_passit_float_js=false;
		initWidgetDivArray();
    };
	
   	if (window.ActiveXObject)
    isIE= true;
   	else if (document.getBoxObjectFor)
    isIE = false;

	var dist_arr;
    var bookmark_service_arr = new Array();
	initWidgetDivArray();	
	function initWidgetDivArray(){
		dist_arr= new Array();
		if (passit_service != null) {
		if (passit_service.indexOf(",") != -1) {
			bookmark_service_arr = passit_service.split(',');
		}
		else {
			bookmark_service_arr[0] = passit_service;
		}
	
		if (bookmark_service_arr != null && bookmark_service_arr.length > 0) {
			var count = 0;
			for (var i = 0; i < bookmark_service_arr.length; i++) {
				for (var j = 0; j < original_arr.length; j++) {
					if (bookmark_service_arr[i] != null && original_arr[j].name == bookmark_service_arr[i]) {
						dist_arr.push(original_arr[j]);
						break;
					}
				}
			}
		}
	}
	}
   	var mouse_event = "";
   	var passit_type2 = "";//如果是email,则全部变成email	
 
   	var div_node1=null;
   	var passit_img_src2='btn1';
	var pub;
	var passit_simple=1;
	var y = 0,b,x,h = 0;
	var isOk_moveLeft = false;
	var heiFrame = 262;
	var widthPic = 22;
	var history_tag = document.URL;
	var history_title = document.title;
	var scripts = document.getElementsByTagName("script");
	for (var i = 0; i < scripts.length; i++) {
		var url = scripts[i].src;
		if (url.indexOf("passit_float.js")!=-1) {
			if (url.indexOf("?") != -1) {
				var args = url.split("?")[1];
				pub=passit_getQueryString2(args,'pub');
				passit_img_src2 = passit_getQueryString2(args,'img_src');
				passit_simple = passit_getQueryString2(args,'simple');
				container_color = passit_getQueryString2(args,'container_color');
				title_bgColor = passit_getQueryString2(args,'title_bgColor');
			}
		}
	}
	
	function passit_getQueryString2(value,name){
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = value.match(reg);
        if (r != null) 
			return decodeURI(r[2]);
        return null;
    }

	if (pub == 'undefined' || pub == null) 
		pub = 0;

	if (passit_img_src2 == null) 
		passit_img_src2 = 'btn1';

	var isOk_moveLeft_stop=false;
	function passit_moveLeftEvent(){
		isOk_moveLeft=true;
		isOk_moveLeft_stop=false;
			if(x!=null){
				clearTimeout(x);
			}		
			if (isOk_moveLeft) {
				if (y < 230) {
					y += 115;
					div_node1.style.width=22+y+"px";
					document.getElementById("passit_float_div_move").style.left=-230+y + "px";
				}
				if (y >= 230) {
					window.clearTimeout(b);
					return;
				}
				b = window.setTimeout(passit_moveLeftEvent,isIE?10:30);
			}
	}
	var delay_handle;
	function delayMvoeStop(){
		if(delay_handle!=null){
			clearTimeout(delay_handle);
		}
		isOk_moveLeft_stop=true;
		delay_handle=window.setTimeout(function(){
		if(isOk_moveLeft_stop){
			moveEvent_stop();
			clearTimeout(delay_handle);
			delay_handle=null;
		}
	},100);
	}
	function moveEvent_stop(){
		if(b!=null){
			clearTimeout(b);
		}		
		if(isOk_moveLeft_stop){
				var num = 22;
				if (y > num) {
					y -= 115;
					div_node1.style.width=22+y+"px";
					document.getElementById("passit_float_div_move").style.left=-230+y + "px";
			}
			if (y <= num) {
				div_node1.style.width="22px";
				window.clearTimeout(x);
				return;
			}
			x = window.setTimeout(moveEvent_stop,isIE?10:30);
			}	
	}

	var div_node2 = null;
	passit_inint_float();//初始化
	function passit_inint_float(){
		try {
              document.execCommand("BackgroundImageCache", false, true)
         } catch(e) 
		 {
		 	
		 }
		
		div_node1 = document.createElement("div");
		div_node1.setAttribute("id", "passit_floatDiv_total");
		var clientY;
		if(isIE){
			clientY=document.documentElement.offsetHeight || document.body.offsetHeight || 0;
		}else{
			clientY=window.innerHeight;
		}
		var top=(clientY-260)/2;
		if(!(top>0&&top<500)){
			top=150;
		}
		
		
	
		div_node1.style.top=top+"px";
		div_node1.style.position = (isIE?"absolute":"fixed");
		div_node3 = document.createElement("span");
		//div_node1.style.top="150px";
		div_node1.style.right="0px";
		div_node3.setAttribute("id","passit_float_div_move");
		div_node1.appendChild(div_node3);
		document.body.appendChild(div_node1);

		
		pasImg = document.createElement("img");
		pasImg.setAttribute("id", "passit_float_image");
		pasImg.setAttribute("src", "http://" + passit_src + "/images/float_" + passit_img_src2 + ".gif");
		if(isIE){
			div_node3.style.cssFloat="relative";
		}
		div_node3.appendChild(pasImg);

		div_node2 = document.createElement("span");
		div_node2.innerHTML='<span id="bookmark_page_default_float"><input type="hidden" id="passit_def_val_float" value="0">' + 
        '<span id="bookmark_page_def_head_float"><label class="bookmark_page_def_head_l_float">转帖分享.如此简单</label></span>' + 
        '<span id="passit_def_bookmark_float"><ul id="passit_def_bookmark_ul_float" style="list-style:none;"></ul></span><span id="passit_default_footer_float" ><img src="http://' + passit_src + '/images/foot_bg.gif" /><a href="http://www.passit.cn/" target="_blank">这是什么工具？</a></span></span></span>';
        ;
		div_node2.setAttribute("id","passit_float_div");
		div_node3.appendChild(div_node2);
		if(isIE6){
			var iframe_mask = document.createElement("iframe");
      		iframe_mask.setAttribute("id", "passit_div_mask");
			iframe_mask.className="passit_div_mask";
			div_node1.appendChild(iframe_mask);
		}
	
		
		if (pasImg.addEventListener) {//FF
			pasImg.addEventListener("mouseover",function(){passit_moveLeftEvent();}, false);
			pasImg.addEventListener("mouseout",function(){delayMvoeStop();}, false);
		}
		else {//
			if (pasImg.attachEvent) {//IE
				pasImg.attachEvent("onmouseover", function(){passit_moveLeftEvent();}, false);
				pasImg.attachEvent("onmouseout", function(){delayMvoeStop();}, false);
			}
		}
		 	
 		if (div_node2.addEventListener) {//FF
			div_node2.addEventListener("mouseover", function(){passit_moveLeftEvent();}, false);
			div_node2.addEventListener("mouseout", function(){delayMvoeStop();}, false);
		}
		else {
			if (div_node2.attachEvent) {//IE
				div_node2.attachEvent("onmouseover", function(){ passit_moveLeftEvent();}, false);
				div_node2.attachEvent("onmouseout", function(){delayMvoeStop();}, false);
				if(isIE){
					window.attachEvent("onscroll", passit_window_scroll_event);
    				window.attachEvent("onresize", passit_window_resize_event);
				}
			}
		}
		passit_displayBookmark();
	}
	
	function passit_createMoreBtn(){
		    var liNode = document.createElement("li");
		    var spanNode = document.createElement("span");
			var aNode = document.createElement("a");
		    var str = "0px -{0}px";
		    liNode.style.cursor="pointer";
		    var obj_more=original_arr[original_arr.length-1];
		    aNode.style.backgroundPosition = str.replace("{0}", obj_more.pos * 16);
		    spanNode.innerHTML=obj_more.alias;
		    spanNode.style.color="#626262";
            liNode.style.cursor = "pointer";
            liNode.onclick = function() {
                    passit_onClickEvent();
            };
			liNode.onmouseover=function(e){
				this.style.backgroundColor = "#F2f2f2";
				this.style.borderColor="#e5e5e5";
				is_close_passit=false;
			};
			liNode.onmouseout=function(e){
				this.style.backgroundColor = "white";
				this.style.borderColor="white";
				is_close_passit=true;
			};
			aNode.appendChild(spanNode);
			liNode.appendChild(aNode);
			document.getElementById("passit_def_bookmark_ul_float").appendChild(liNode);
	}
	
 	function passit_displayBookmark(){//初始化书签数组;
		var obj_ul=document.getElementById("passit_def_bookmark_ul_float");
		if(obj_ul==null){
			return;
		}
		var str = "0px -{0}px";
        var count = 0;
		var array;
		if(dist_arr!=null&&dist_arr.length>0){
			array=dist_arr;
		}else{
			array=original_arr;
		}
		var count=0;
        for (var i = 0; i < array.length; i++) {
            var obj = array[i];
            if (obj.name == "share" || obj.name == "email" || obj.name == "more") {
                continue;
            }
         	count++;
            var liNode = document.createElement("li");
			liNode.onmousemove =  function() {
                this.style.backgroundColor = "#F2f2f2";
				this.style.borderColor="#e5e5e5";
            };
            liNode.onmouseout =  function() {
                this.style.backgroundColor = "white";
				this.style.borderColor="white";
            };
            var str_url;
            var aNode = document.createElement("a");
			aNode.style.backgroundPosition = str.replace("{0}", obj.pos * 16);
            if ("51com" == obj.name) {
                //51com的编码为gbk,此地不能用JS编码
                str_url = (history_title + " - Passit分享");
            } else if ("poco" == obj.name || "vivi" == obj.name || "hexun" == obj.name) {
                str_url = escape(history_title + " - Passit分享");
            } else {
                str_url = encodeURIComponent(history_title + " - Passit分享");
            }
            liNode.appendChild(aNode);
            var spanNode = document.createElement("span");
			aNode.appendChild(spanNode);
            var url = obj.url.replace("{0}", encodeURIComponent(history_tag)).replace("{1}", (str_url)).replace("{2}", encodeURIComponent(history_title + "  " + history_tag));
            if (obj.name == "whois") {
                    url = obj.url.replace("{0}", encodeURIComponent(getWhoIsString()));
             }
			 if (count>15) {
				break;
             }
			
			 collectBookmarkId(aNode, obj.id);
             spanNode.innerHTML = obj.alias;
			 if(obj.name=="bookmark"){
				aNode.onclick=function(e){
                     addFavor();
                };
			    aNode.href = "javascript:void(0);";
			 }else{
			 	aNode.setAttribute("target", "_blank");
			 	aNode.href = url;
			 }
             obj_ul.appendChild(liNode);
        }
		passit_createMoreBtn();
		if(!loop_locked&&isIE){
			loop_locked=true;
			loop_moveTop(130,0);
		}
		
	}
	function showPassit(){
		var diffX = document.documentElement.scrollLeft || document.body.scrollLeft || 0;
		var diffY = document.documentElement.scrollTop || document.body.scrollTop || 0;
		var clientX=window.screen.width;
		var clientY=window.screen.height;
		passit_div1=document.getElementById("passit_piwrapper");
		passit_div1.style.top = ((clientY - parseInt(500)) / 2) +diffY + "px";
		passit_div1.style.left = ((clientX - parseInt(359)) / 2) +diffX + "px";
		passit_div1.style.display="block";
	}
	
	function passit_onClickEvent(){
		passit_div1=document.getElementById("passit_piwrapper");
		if(passit_div1==null){
			passit_initIframe();
		}
		showPassit();
	}

	
	function passit_initIframe(){
			var broType=1;
			var jsp="/passit_nonav.htm";
			if(passit_simple==1){
				jsp="/passit_nonav.html";
				broType=11;
			}
			var params = "?title=" + encodeURIComponent(history_title) + "&tag=" + encodeURIComponent(history_tag) + "&bookmark_service=&passit_type=&pub=" + pub+'&broType='+broType+"&container_color="+container_color+"&title_bgColor="+title_bgColor;
			var clientX = document.documentElement.clientWidth || document.body.clientWidth || 0;
			var clientY = document.documentElement.clientHeight || document.body.clientHeight || 0;
			var diffX = document.documentElement.scrollLeft || document.body.scrollLeft || 0;
			var diffY = document.documentElement.scrollTop || document.body.scrollTop || 0;
			
			passit_div1 = document.createElement("div");
			passit_div1.setAttribute("id", "passit_piwrapper");
			passit_div1.style.position = "absolute";
			passit_div1.style.top = ((clientY - parseInt(500)) / 2) + diffY + "px";
			passit_div1.style.left =((clientX - parseInt(359)) / 2) + diffX + "px";
			passit_div1.style.zIndex = 100000000;
			passit_div1.style.display="none";
			document.body.appendChild(passit_div1);
			if(isIE6){//在IE6里遮盖select
				var iframe_mask = document.createElement("iframe");
        		iframe_mask.setAttribute("id", "passit_iframe_mask");
				iframe_mask.className="passit_iframe_mask";
				passit_div1.appendChild(iframe_mask);
			}
			
			passit_iframe1 = document.createElement("iframe");
			passit_iframe1.setAttribute("width", "359px");
			passit_iframe1.setAttribute("name","frame1");
			passit_iframe1.setAttribute("id","passit_iframe1");
			passit_iframe1.setAttribute("height", "410px");
			if(passit_simple==1)passit_iframe1.setAttribute("height", "335px");
			passit_iframe1.setAttribute("frameBorder", 0);
			passit_iframe1.setAttribute("allowTransparency", true);
			passit_iframe1.setAttribute("scrolling", "no");
			passit_iframe1.setAttribute("src", "http://"+passit_src+jsp+ params.replace('#', ''));
			passit_div1.appendChild(passit_iframe1);
			
			passit_closeButton1 = document.createElement("div");
			passit_closeButton1.style.position = "absolute";
			passit_closeButton1.style.top = "10px";
			passit_closeButton1.style.left = "330px";
			passit_closeButton1.style.zIndex = 100000000;
			
			piimg = document.createElement("img");
			piimg.src = "http://"+passit_src+"/images/transparent_close.gif";
			piimg.style.cursor="pointer";
			piimg.alt="关闭";
			passit_closeButton1.appendChild(piimg);
			passit_div1.appendChild(passit_closeButton1);
			
			if (passit_closeButton1.addEventListener) {//FF
				passit_closeButton1.addEventListener("click", closePassit, false);
			}else {
				if (passit_closeButton1.attachEvent) {//IE
					passit_closeButton1.attachEvent("onclick", closePassit);
				}
			}
		
		
	}
	document.onclick=function(e){
		if(is_close_passit){
			closePassit();
		}
		
	};
	function closePassit(){
	var o = document.getElementById('passit_piwrapper');
		if(o != null){
		o.style.display = "none";
		}
	}
	function addFavor() {
		if(isIE6){
			div_node1.focus();
		}
        if (window.sidebar) {
            window.sidebar.addPanel(history_title, history_tag, "");
        }
        else if (document.all) {
			try {
				window.external.AddFavorite(history_tag, history_title);
			}catch(err){
				if(confirm("您的浏览器暂不支持javascript添加收藏夹，确定是否修复！\n同时您也可以使用CTRL+D进行添加.")){
					window.open("http://www.passit.cn/ieframe.shtml");
				};
			}
        }
        else
        if (window.opera && window.print) {
            return true;
        }
    };
	function getWhoIsString(){
		var loc=history_tag.substring(history_tag.indexOf("//")+2);
		return decodeURI(loc.substring(0,loc.indexOf("/")));
	}
	 function collectBookmarkId(obj, id) {
        if (obj.addEventListener) {//FF
            obj.addEventListener("click", 
            function() {collectStatistics(id);},false);
        }else {
            if (obj.attachEvent) { //IE
                obj.attachEvent("onclick", 
                function() {collectStatistics(id);},false);}
        } 
    };
	function collectStatistics(id) {
	
        var uri = "&userid=" + pub + "&bookmarkid=" + id + "&title=" + encodeURIComponent(document.title) + "&type=" + (passit_simple == 1 ? 11: 1) + "&url=" + document.URL;
        var url = "http://" + passit_src + "/saveBarService.action?callback=saveStatistic_callback" + uri;
        passit_crossFiled(url, "passit_saveService");
    };
	function passit_crossFiled(url,id){
		var element ;
		var obj=document.getElementById(id);
		if (obj != null) {
			document.getElementsByTagName("head")[0].removeChild(obj);
		}
		element= document.createElement("script");
		element.setAttribute("type",'text/javascript');
		element.setAttribute("charset","utf-8");
		element.setAttribute("id",id);
        element.src = url+"&time="+Math.random();
		document.getElementsByTagName("head")[0].appendChild(element);
		element.onload=//firefox
		element.onreadystatechange=//ie
		function(){
			
		}
	};
	var loop_locked=false;
	function passit_window_scroll_event(){
		div_node1=document.getElementById("passit_floatDiv_total");
		if(div_node1==null){
			return;
		}
		var diffX = document.documentElement.scrollLeft || document.body.scrollLeft || 0;
		if (isIE6) {
			div_node1.style.right = "-1px";
		}
		else {
			div_node1.style.right = "0px";
		}

	}

	function loop_moveTop(b,c){
			var d = document.getElementById("passit_floatDiv_total");
            var e = 1;
            var f = document.documentElement.scrollTop || document.body.scrollTop || 0;
			var g = parseInt(d.style.top);
            f = f - g + b;
			f = g + f/10;
            if (f < b) f = b;
            if (f != c) {
				if(f-c>=1||f-c<=-1)
                d.style.top = f + "px";
            }
            c = f;
            setTimeout(function() {
                loop_moveTop(b, c)
            },
            e);
            d = e = f = null;
	}
	function passit_window_resize_event(){
		div_node1=document.getElementById("passit_floatDiv_total");
		if(div_node1==null){
			return;
		}
		var clientY;
		if(isIE){
			clientY=document.documentElement.offsetHeight || document.body.offsetHeight || 0;
		}else{
			clientY=window.innerHeight;
		}
		var top=(clientY-260)/2;
		if(!(top>0&&top<500)){
			top=150;
		}
		div_node1.style.top=top+"px";
		if(isIE6)
		div_node1.style.right ="-1px";
		else
		div_node1.style.right ="0px";
	}
}	
	
	
	function AttachEvent(target, eventName, handler, argsObject){
		var eventHandler = handler;
		if (argsObject) {
			eventHander = function(e){
				handler.call(argsObject, e);
			}
		}
		if (window.attachEvent)//IE
			target.attachEvent("on" + eventName, eventHander);
		else//FF
 			target.addEventListener(eventName, eventHander, false);
	}
	function saveStatistic_callback(data){
		
	};


