function showcontent(obj){
			var temp_id = obj.id;
			var tga_id = $('#'+temp_id).next().attr('id');			
			$('.content_div').each(function(){
					var t_id = $(this).attr('id');
					if( t_id!=tga_id) $(this).hide();
					else $(this).show();
			});
}
function getPassDoc(id,obj){
		var p_id = $('#'+obj.id).parent().attr('id');
		var test_id = parseInt(id,10);
		if( !(id==null || id=='') && test_id>0){
				var inp = prompt("請輸入密碼",'');
				if( !(inp=="" || inp==null ) ){
						$.ajax({
							   type: "POST",
							   url: "inic.php",
							   dataType: 'json',
							   data: "fun=getdoccontent&id="+test_id+'&passwd='+escape(inp),
							   success: function(ret){
									if(ret.stat!=1)alert(URLdecode(ret.message));
									else{
											$('#'+p_id).html(URLdecode(ret.message));	
									}
							   }
						});
				}
		}
}

function URLdecode(str) {
    var ret = "";
    for(var i=0;i<str.length;i++) {
        var chr = str.charAt(i);
        if(chr == "+") {
            ret += " ";
        }else if(chr=="%") {
            var asc = str.substring(i+1,i+3);
            if(parseInt("0x"+asc)>0x7f) {
                ret += decodeURI("%"+ str.substring(i+1,i+9));
                i += 8;
            }else {
                ret += String.fromCharCode(parseInt("0x"+asc));
                i += 2;
            }
        }else {
            ret += chr;
        }
    }
    return ret;
}
