// JavaScript Document
function shadowboxSetup(){
    Shadowbox.setup("a.plan-gallery", {
        gallery:        "mustang",
        continuous:     true,
        counterType:    "skip"
    });
}


function gotoPlan(id){
	window.location.href='about.php?cid='+id;
}

function goReport(id,cid){
	window.location.href='report_detail.php?id='+id+"&cid="+cid;
}


var planpage = 1;

function getPrevPlan(){
	if(planpage !=1){
		planpage--;
		$.ajax({
			type: "get",
			url: "actGetplan.php",
			data: "p="+planpage,
			success: function(data) {
				if(data != 'nodata'){
					$('#plan-list').html(data);				
				}
			},
			error: function(data) { }
		});
	}
}

function getNextPlan(){
	planpage++;
    $.ajax({
        type: "get",
        url: "actGetplan.php",
        data: "p="+planpage,
        success: function(data) {
			if(data != 'nodata'){
	        	$('#plan-list').html(data);				
			}else{
				planpage--;
			}
        },
        error: function(data) { }
    });
}



function getPrevHero(){
	if(hero != 0){
		$('#hero-disp-'+hero).hide();
		hero--;
		$('#hero-disp-'+hero).show();
	}
}

function getNextHero(cid){
	if(hero < totalhero){
		$('#hero-disp-'+hero).hide();
		hero++;
		$('#hero-disp-'+hero).show();
	}
}


function changeAboutPhotos(id){
	$('#photosbox'+appage).hide();
	$('#dot'+appage).removeClass('on');
	$('#photosbox'+id).show();
	$('#dot'+id).addClass('on');
	appage = id;
}

function submitReg(){
	$('#error_msg').html('');
	$('#avatar_msg').html('');
	$('#username_msg').html('');
	$('#pass_msg').html('');
	$('#rtpass_msg').html('');
	$('#truename_msg').html('');
	$('#sex_msg').html('');
	$('#age_msg').html('');
	$('#email_msg').html('');
	$('#tel_msg').html('');
	$('#all_msg').html('');
}

function submitPass(){
	$('#oldpass_msg').html('');
	$('#pass_msg').html('');
	$('#rtpass_msg').html('');
	$('#all_msg').html('');
}

function submitProfile(){
	$('#truename_msg').html('');
	$('#sex_msg').html('');
	$('#age_msg').html('');
	$('#email_msg').html('');
	$('#tel_msg').html('');
	$('#all_msg').html('');
}

function submitAvatar(){
	$('#avatar_msg').html('');
	$('#all_msg').html('');
}

function setMember(){
	$('#memberBox').load('setMember.php?t=1');
}

function setAvatar(){
	$('#memberBox').load('setMember.php?t=2');
}

function setPass(){
	$('#memberBox').load('setMember.php?t=3');
}

function talkRefresh(){
	$('#talk-list').load('actGettalk.php');
	$('#talk-list').scrollTop(0);
}
