﻿function addCookie() {　 // 加入收藏
	if (document.all) {
		window.external.addFavorite("http://www.131uu.com","131UU -儿童虚拟社区");
	} else if (window.sidebar) {
		window.sidebar.addPanel("131UU -儿童虚拟社区","http://www.131uu.com", "");
	}
}　　　　　　　 
function setHomepage() {　 // 设为首页
	if (document.all) {
		document.body.style.behavior = "url(#default#homepage)";
		document.body.setHomePage("http://www.131uu.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);
		prefs.setCharPref("browser.startup.homepage","http://www.131uu.com");
	}　　　　　　　 
}
/**
var vars = "";
var loginid = getparmByUrl("loginid");
var pwd = getparmByUrl("pwd");
if(loginid != ""){
	vars = 'loginid=' + loginid;
	if(pwd != ""){
		vars += '&pwd=' + pwd;
	}
}
*/
function getparmByUrl(parmName){
    var url = document.location.href;
    var result = '';
    if(url.indexOf('?') != -1){
        var arr = url.split('?');
        var arr_temp = arr[1].split('&');
        for(var i=0;i<arr_temp.length;i++){
            var str = arr_temp[i].indexOf(parmName);
            if(str != -1){
                result = arr_temp[i].substring(arr_temp[i].indexOf('=')+1,arr_temp[i].length);
				break;
            }
        }
    }
    return result;
} 

function GuardianAngle(){
	window.open("http://www.131uu.com/web/angel/index.php?action=login");
}

function reloadWin(loginid, pwd){
	//window.location.reload();
	var vars = '';
	if(loginid){
		vars = '?loginid=' + loginid;
		if(pwd){
			vars += '&pwd=' + pwd;
		}
	}
	window.location.href='index.html'+vars;
}

var initCount = 0;
var paddingCount = 16;
var marginCount = 0;

function effectOut(){
	paddingCount -=4;
	if(paddingCount<0){
		paddingCount = 16;
		document.getElementById("effect").style.paddingTop = "0";
		update();
		return;
	}
	document.getElementById("effect").style.paddingTop = paddingCount + "px";
	updateHTML();
	setTimeout(effectOut,100);
}

function effectIn(){
	marginCount +=4;
	if(marginCount>16){
		marginCount = 0;
		document.getElementById("effect").style.marginTop = "0";
		effectOut();
		return;
	}
	document.getElementById("effect").style.marginTop = -marginCount + "px";
	setTimeout(effectIn,100);
}

function updateHTML(){
	if(typeof(updateContent[initCount]["href"])!="undefined" && updateContent[initCount]["href"]!=""){
		document.getElementById("effect").innerHTML = "<a target='_blank' href='"+updateContent[initCount]["href"]+"'>"+updateContent[initCount]["title"]+"</a>";
	}else{
		document.getElementById("effect").innerHTML = updateContent[initCount]["title"];
	}
}

function update(){
	updateHTML();
	initCount ++ ;
	if(initCount>updateContent.length-1){
		initCount=0;
	}
	setTimeout(effectIn,10000);
}

var updateContent2bak = [
	{"title":"5253（131UU）专区","href":"http://www.5253.com/131uu/"},
	{"title":"QQ网址导航","href":"http://hao.qq.com"},
	{"title":"HAO123网址导航","href":"http://www.2345.com"},
	{"title":"2345网址导航","href":"http://hao.qq.com"},
	{"title":"265网址导航","href":"http://www.265.com"},
	{"title":"360网址导航","href":"http://www.360.cn"},
	{"title":"114啦网址导航","href":"http://www.114.com.cn"},
	{"title":"搜狗网址导航","href":"http://123.sogou.com/"},
	{"title":"酷酷123网址导航","href":"http://www.kuku123.com"},
	{"title":"9223网址导航","href":"http://www.9223.com"},
	{"title":"亲亲宝宝网","href":"http://www.qqbaobao.com"}
];

var updateContent2 = new Array();

var initCount2 = 0;
var paddingCount2 = 16;
var marginCount2 = 0;

function effectOut2(){
	paddingCount2 -=4;
	if(paddingCount2<0){
		paddingCount2 = 16;
		document.getElementById("effect2").style.paddingTop = "0";
		update2();
		return;
	}
	document.getElementById("effect2").style.paddingTop = paddingCount2 + "px";
	updateHTML2();
	setTimeout(effectOut2,100);
}

function effectIn2(){
	marginCount2 +=4;
	if(marginCount2>16){
		marginCount2 = 0;
		document.getElementById("effect2").style.marginTop = "0";
		effectOut2();
		return;
	}
	document.getElementById("effect2").style.marginTop = -marginCount2 + "px";
	setTimeout(effectIn2,100);
}

function updateHTML2(){
	/*if(typeof(updateContent2[initCount2]["href"])!="undefined" && updateContent2[initCount2]["href"]!=""){
		document.getElementById("effect2").innerHTML = "<a target='_blank' href='"+updateContent2[initCount2]["href"]+"'>"+updateContent2[initCount2]["title"]+"</a>";
	}else{
		document.getElementById("effect2").innerHTML = updateContent2[initCount2]["title"];
	}*/
	$('#effect2').html(updateContent2[initCount2]);
}

function init2(){
	$('#effect2').find('li').each(function(){
		updateContent2[updateContent2.length] = $(this).html();
	});
	$('#effect2').html('');
	update2();
}

function update2(){
	updateHTML2();
	initCount2 ++ ;
	if(initCount2>updateContent2.length-1){
		initCount2=0;
	}
	setTimeout(effectIn2,6000);
}

