﻿//document.writeln("<link href='http://style.ch.gongchang.com/cn/css/service.css' rel='stylesheet' type='text/css' />");
//document.writeln("<link href='service.css' rel='stylesheet' type='text/css' />");
document.writeln("<script language=\"javascript\" type=\"text/javascript\" src=\"http://style.ch.gongchang.com/list/online/gongchang_ali.js\"></script>");
/* 
 * pop-window.js v0.1
 */
var style_url='http://style.ch.gongchang.com/list/online/';
function show_ali_online(is_online){
	document.write("<img src='"+style_url+OnLine+".gif' border=0>" );
}
var ip='amos.im.alisoft.com';
var ali_url='http://'+ip+'/userstatus3.aw?uid=';

//var ali_user="lmlq";

document.writeln("<scr"+"ipt src="+ali_url+ali_user+"></"+"script>");
var qqsite = document.URL;

//上面为阿里旺旺设置
function popWindow() {
	var popwindow = '<div class="msg-top">' +
						//'<h2>黎明重工科技dddddddddddddddddddddddddddddddddd</h2>' +
						'<h2>'+title+'</h2>' +

						'<span class="close" onclick="closePopWindow()">X</span>' +
					'</div>' +
					'<div class="content">' +
						'<ul class="link-box">'+				
					(qq==''?'':	'<li class="qq"><a href="http://wpa.qq.com/msgrd?V=1&Uin='+qq+'&Site='+qqsite+'&Menu=yes" target="_blank"><img src="http://wpa.qq.com/pa?p=1:'+qq+':17" />'+qq+'</a></li>') +
							(msn == '' ? '' : '<li class="msn"><a href="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=' + msn + '&mkt=zh-cn" target="_blank"><img src="http://messenger.services.live.com/users/' + msn + '/presenceimage?mkt=zh-cn" />' + msn + '</a></li>') +
							(ali_user == '' ? '' : '<li class="wangwang"><a href="javascript:gongchang_ali(\'' + ali_user + '\');"><img src="' + style_url + OnLine + '.gif">' + ali_user + '</a></li>') +
							//(ali_user == '' ? '' : '<li class="wangwang"><a href="http://www.taobao.com/webww/ww.php?ver=3&touid=' + ali_user + '&siteid=cntaobao&status=2&charset=utf-8"><img src="http://amos.alicdn.com/online.aw?v=2&uid=' + ali_user + '&site=cntaobao&s=2&charset=utf-8">' + ali_user + '</a></li>') +
									'</ul>' +
						'<div class="bottom">'+
//							'<a href="http://bbs.ch.gongchang.com/do_polls.php?account=lmlq" target="_blank" class="bottom-link">企业评价</a>'+
//							'<a href="http://lmlq.cn.gongchang.com/certificate.html" target="_blank" class="bottom-link2">企业证书</a>'+
						'</div>' +
					'</div>';
	var popWin = document.createElement("div");
	popWin.id = "serviceSkin-1";
	popWin.className = "service-msg skin-2";//修改skin-*  来改变模板颜色
	popWin.style.position = "absolute";
	popWin.style.right = "10px";
	popWin.innerHTML = popwindow;
	document.body.appendChild(popWin);
	setTop();
	//setRight(popWin);
}

function closePopWindow() {
	var elem = document.getElementById("serviceSkin-1");
	elem.style.display = "none";
}

function setTop() {
	var elem = document.getElementById("serviceSkin-1");
	elem.style.top = (new pos().y + windowHeight()/5) + "px";
	setTimeout("setTop()", 100);
}

//滚卷区域宽高
var pos = function() {
	var posX,posY;
	if (window.innerHeight) {
		posX = window.pageXOffset;
		posY = window.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop) {
		posX = document.documentElement.scrollLeft;
		posY = document.documentElement.scrollTop;
	}
	else if (document.body) {
		posX = document.body.scrollLeft;
		posY = document.body.scrollTop;
	}
	this.x = posX;
	this.y = posY;
	return this;
};

//获取浏览器可见区域的宽高
function windowHeight() {
	//最后传出的值
	var windowHeight;
	// 除了IE以外的浏览器
	if (self.innerHeight) {
		windowHeight = self.innerHeight;
	}
	/* IE6 浏览器 */
	else if (document.documentElement && document.documentElement.clientHeight) {
		windowHeight = document.documentElement.clientHeight;
	}
	//其他版本的IE浏览器
	else if (document.body) {
		windowHeight = document.body.clientHeight;
	}
	return windowHeight;
}

function windowWidth() {
	//最后传出的值
	var windowWidth;

	// 除了IE以外的浏览器
	if (self.innerWidth) {
		windowWidth = self.innerWidth;
	}
	/* IE6 浏览器 */
	else if (document.documentElement && document.documentElement.clientWidth) {
		windowWidth = document.documentElement.clientWidth;
	}
	// 其他版本的IE浏览器
	else if (document.body) {
		windowWidth = document.body.clientWidth;
	}
	return windowWidth;
};

if (window.addEventListener) {
    window.addEventListener("load", popWindow, false)
} else {
    if (window.attachEvent) {
        window.attachEvent("onload", popWindow)
    }
};

