curPage = 1;
curNewsListId = 0;
$(document).ready(function() {
	if(isValid == 1) {
		if(regValid == 1) {
			regFull();
		} else {
			alert("验证失败");
		}
	}

	if(reg == '1') {
		register();
	}
	if(bind == '1') {
		bindmail();
	}
	if(islogin == '1') {
		login();
	}
	if(setPassword == '1') {
		setPassword(spuid, spchecksum);
	}
});

function regFull() {
	$.blockUI({
    	message: '<iframe src="/user/register_full.php?uId='+encodeURIComponent(uId)+'" width="548px" height="525px" scrolling="yes" frameborder="0"></iframe>', 
        fadeIn: 300, 
        fadeOut: 300,
        showOverlay: true, 
        overlayCSS: {opacity: .8},
        css: { 
        	top:  ($(window).height() - 525) /2 + 'px', 
            left: ($(window).width() - 548) /2 + 'px',
        	width: '548px',
        	height: '525px',
        	border: 0
        }
    });
}

function register() {
	$.blockUI({
    	message: '<iframe src="/user/register.php" width="550px" height="530px" scrolling="no" frameborder="0"></iframe>', 
        fadeIn: 300, 
        fadeOut: 300,
        showOverlay: true, 
        overlayCSS: {opacity: .8},
        css: { 
        	top:  ($(window).height() - 530) /2 + 'px', 
            left: ($(window).width() - 550) /2 + 'px',
        	width: '550px',
        	height: '530px',
        	border: 0
        }
    });
}

function bindmail() {
	$.blockUI({
    	message: '<iframe src="/user/bindmail.php" width="500px" height="260px" scrolling="no" frameborder="0"></iframe>', 
        fadeIn: 300, 
        fadeOut: 300,
        showOverlay: true, 
        overlayCSS: {opacity: .8},
        css: { 
        	top:  ($(window).height() - 260) /2 + 'px', 
            left: ($(window).width() - 500) /2 + 'px',
        	width: '500px',
        	height: '260px',
        	border: 0
        }
    });
}

//自动播放相关内容
var news_list_auto_run=1;
var now_news=0;
function newsListAutoRun(){
	if(news_list_auto_run!=1){
		return;
	}

	if(now_news>0){
		shousuo(now_news);
	}
	now_news++;
	if(now_news>10){
		now_news=1;
	}
	append(now_news, news_id[now_news],news_type[now_news]);
	$("#top_content_close").click(function() {
		news_list_auto_run=0;
		shousuo(now_news);
	});
	setTimeout('newsListAutoRun()',8000);

}
