
function updateQQImg(obj,newobj)
{
	//if(newobj.width>0)
	//{
		obj.src=newobj.src;
	//}
}


function qqChat(obj,qq)
{
	obj.onload=null;
	var img = new Image();
	//img.src="http://wpa.paipai.com/pa?p=1:"+qq+":17";	
	img.src="http://wpa.qq.com/pa?p=1:"+qq+":4";
	img.onload=updateQQImg(obj,img);
}

function msnChat(Msn,Att) {
	if (window.navigator.userAgent.indexOf("MSIE")>=1) {
		var url="";	
		if(Att=="1")url+="/CN";
		else url+="/EN";
		url+="/HTML";
		url+="/MSN.aspx?Msn="+Msn.replace("#","@")+"&Att="+Att;
		showModalDialog(url, 'msn', "dialogWidth:320px; dialogHeight:240px; help: no; scroll: no; status: no");
	} else {		
		alert(MsnWord(Att));
	}
}


function MsnWord(Att)
{
	this.MSN_OnlyIE="";
	if(Att=="1")
	{
		this.MSN_OnlyIE="MSN CHAT功能仅在使用IE浏览器时有效";
	}else{
		this.MSN_OnlyIE="MSN CHAT功能仅在使用IE浏览器时有效";
	}
	return MSN_OnlyIE;
}


/* Skype Begin*/
var activex = ((navigator.userAgent.indexOf('Win')  != -1) && (navigator.userAgent.indexOf('MSIE') != -1) && (parseInt(navigator.appVersion) >= 4 ));
var CantDetect = ((navigator.userAgent.indexOf('Safari')  != -1) || (navigator.userAgent.indexOf('Opera')  != -1));
var isMacFirefox = ((navigator.userAgent.indexOf('Firefox') != -1) && (navigator.platform.indexOf('Mac') != -1));
function oopsPopup() {
	document.location="/cn/about/skype.html";
	return false;
}

if(typeof(detected) == "undefined" && activex) {
    document.write(
        ['<script language="VBscript">',
        'Function isSkypeInstalled()',
        'on error resume next',
        'Set oSkype = CreateObject("Skype.Detection")',
        'isSkypeInstalled = IsObject(oSkype)',
        'Set oSkype = nothing',
        'End Function',
        '</script>'].join("\n")
    );
}

function skypeCheck(obj) {
    if(CantDetect) {
        return true;
    } else if(!activex) {
        var skypeMime = navigator.mimeTypes["application/x-skype"];
        detected = true;
        if(typeof(skypeMime) == "object") {
            return true;
        } else {
		  if (isMacFirefox) {
			return true;
		  } else {
			return oopsPopup();
		  }
        }
    } else {
        if(isSkypeInstalled()) {
            detected = true;
            return true;
        }
    }
    detected = true;
    return oopsPopup();
}
/* Skype End*/
