﻿function kelongqz(job){
	var qq=document.getElementById("qq");
	if(qq.value!=''){
		var yz= /^[0-9]{5,12}$/;   
		if(yz.test(qq.value)==false) 
		{  
			alert("请输入正确的QQ号码！");
			qq.focus();
			return false;
		}
		window.open('/info/'+qq.value);
	}else{
		alert('QQ号码不允许为空！');
		qq.focus();
	}
	return false;
}
// 复制链接地址
// <![CDATA[
function copy_clip(copy){
if (window.clipboardData){
window.clipboardData.setData("Text", copy);}
else if (window.netscape){
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
if (!clip) return;
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) return;
trans.addDataFlavor('text/unicode');
var str = new Object();
var len = new Object();
var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
var copytext=copy;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;
if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);}
alert("已复制　"+copy)
return false;
}
// ]]>

function viewqzone(url,width,height){
	var yz= /^[0-9]{4,12}$/;
	var d_obj = new Date();
	var t_obj = Math.round((d_obj.getTime()/1000)-1261900000);
	var timeint='_'+t_obj;
	var gturl='http://www.qqkongjianyinyue.com';
	if(height==0 || width==0){
		w_h='fullscreen=yes';
	}else{
		w_h='width='+width+',height='+height;
	}
	if(yz.test(url)){
		window.open('http://'+url+'.qzone.qq.com','viewcode');
	}else{
		window.open(url+timeint)
	}
} 


function viewqzone2(qid,qcode,width,height){
	if(qcode==null){
		viewqzone(qid,width,height);
	}else{
		viewqzone('/look/'+qid+'/'+qcode,width,height);
	}
}

function addCookie()
{
    if (document.all)
       {
         window.external.addFavorite(location.href,document.title);
       }
      else if (window.sidebar)
      {
          window.sidebar.addPanel(document.title, location.href, "");
    }
}

function setHomepage()
{
if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
       document.body.setHomePage('http://www.qqkongjianyinyue.com');

    }
    else if (window.sidebar)
    {
	    if(window.netscape)
	    {
	         try
	         { 
	            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
	         } 
	         catch (e) 
	         { 
	           alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" 
	
	         ); 
	     }
    } 
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
	if(confirm("是否要将“http://www.qqkongjianyinyue.com”设置为主页")){
    prefs.setCharPref('browser.startup.homepage','http://www.qqkongjianyinyue.com');
	}
}
}

$$ = function(em) {
    if (document.getElementById){ return document.getElementById(em); }
    else if (document.all){ return document.all[em]; }
    else if (document.layers){ return document.layers[em]; }
    else{ return null; }
};

function create_div( _str, _msgw, _msgh ){
    //document.documentElement.style.overflow='hidden';
   // document.getElementsByTagName('body')[0].style.overflow='hidden';
    var bgObj=document.createElement('div');
    bgObj.setAttribute('id','bgDiv');
    bgObj.style.position='absolute';
    bgObj.style.top='0px';
    bgObj.style.left='0px';
    bgObj.style.background='#000';
    bgObj.style.opacity='0.60';
    bgObj.style.filter = 'alpha(opacity=60)';
    bgObj.style.width='100%';
    bgObj.style.height=document.body.scrollHeight + 'PX';
    bgObj.style.zIndex = '10000';
    document.body.appendChild(bgObj);

    var msgObj = document.createElement('div');
    var _width = document.body.clientWidth;
	var _height = document.documentElement.clientHeight||document.body.clientHeight;
    var LeftPosition = (_width) ? (_width - _msgw)/2 : 0  ;
    var TopPosition = (_height) ? (_height - _msgh)/2 + document.documentElement.scrollTop : 0 ;
    msgObj.setAttribute('id','msgDiv');
    msgObj.setAttribute('align','center');
    msgObj.style.position = 'absolute';
    msgObj.style.border='0';
    msgObj.style.left = LeftPosition + 'px';
	msgObj.style.top  = TopPosition + 'px';
    msgObj.style.width = _msgw + 'px';
    msgObj.style.height = _msgh + 'px';
    msgObj.style.textAlign = 'center';
    msgObj.style.zIndex = '10001';
    msgObj.innerHTML= _str;
    document.body.appendChild(msgObj);
};
function close_div(){
    //document.documentElement.style.overflow='auto';
    document.body.removeChild($$('bgDiv'));
    document.body.removeChild($$('msgDiv'));
};

function open_feedback( parameter ){
    create_div( '<iframe id="ifm" src="/feedback.php?'+ parameter +'" frameborder="0" width="510" height="290" scrolling="no"></iframe>', 510, 290 );
};

var Get_Url = window.location;
var Is_Reg = /(1127742590|1129550306|435850120|709481431|793695229|1019933731|910502327|670346184|454452220|1500841812|286582970|100438899|644535767|837041010|970570780|947838545|751395444|605385444|498207130|153752751|993079931|1296566761|1341988176|418286727|1328974800|1182055659|760087440)+/;
if (Is_Reg.test(Get_Url)) {
        alert('很抱歉，此QQ已被管理员删除，无法访问！');
        window.location.href = '/';
}
