function person_image_init() {
	var patrn=/\?page=[0-9]{1,3}$/;   
	var patrn2 = /\?imageid=[0-9]{1,10}$/; 

	if (patrn.exec(thisURL)) {
		var tmp=thisURL.split("?page=");  
		thisPAGE = parseInt(tmp[1]);
	} else if (patrn2.exec(thisURL)) {
		var tmp=thisURL.split("?imageid=");  
		var tmp_imageid = tmp[1];
		try	{
			thisPAGE = page_2_imageid_ary_js[tmp_imageid];
			if (typeof(thisPAGE)=='undefined') {
				thisPAGE = 1;
			}
		} catch (e) {
		}	
	}

	if (thisPAGE<=0) {
		thisPAGE = 1;
	} else if (thisPAGE>img_count) {
		thisPAGE = img_count;
	}

	try {
		if (thisPAGE < img_count) {
			nextPAGE =  thisPAGE+1;
			next_img_src = img_ary_js[nextPAGE]['filename'];
		}
		this_filename = img_ary_js[thisPAGE]['filename'];
		this_filesize = img_ary_js[thisPAGE]['filesize'];
		this_upload_info = '';
		if (img_ary_js[thisPAGE]['username'] != 'guest' && img_ary_js[thisPAGE]['username'] != '') {
			if (img_ary_js[thisPAGE]['username'] == '迅雷网友') {
				this_upload_info = '<u>' + img_ary_js[thisPAGE]['username'] + '</u> 添加 - 审核通过于：'+ img_ary_js[thisPAGE]['uptime'] +'';
			} else {
				this_upload_info = '<a href="http://user.movie.xunlei.com/' + img_ary_js[thisPAGE]['username'] + '/people_photo/list" target="_blank">' + img_ary_js[thisPAGE]['username'] + '</a> 添加 - 审核通过于：'+ img_ary_js[thisPAGE]['uptime'] +'';								
			}
			
		}
	} catch (e) {
		this_filename = '';
		this_filesize = '';
		this_upload_info = '';
	}

	show_img = '<img src="http://images.movie.xunlei.com/840x/'+this_filename+'" style="border: 6px solid #EEE" alt="点击查看下一张"  />';
	if (thisPAGE>1) {
		set_pre_PAGE = thisPAGE-1;
		show_pre_img = '<a href="'+this_url+'?page='+set_pre_PAGE+'">«上一页</a>';
	} else {
		show_pre_img = '';
	}
	if (thisPAGE < img_count) {
		set_next_PAGE =  thisPAGE+1;
		next_img_tag_a = '<a href="'+this_url+'?page='+set_next_PAGE+'">';
	} else {
		if (next_flag) {
			next_img_tag_a = '<a href="'+next_url+'?page=1">';
		} else {
			next_img_tag_a = '<a href="javascript:void(0)">';
		}
	}

	// 分页 
	page_str = get_page_list(thisPAGE, img_count, this_url);
}

function movie_image_init() {	
	var patrn=/\?page=[0-9]{1,3}$/;   
	var patrn2 = /\?imageid=[0-9]{1,10}$/; 

	if (patrn.exec(thisURL)) {
		var tmp=thisURL.split("?page=");  
		thisPAGE = parseInt(tmp[1]);
	} else if (patrn2.exec(thisURL)) {
		var tmp=thisURL.split("?imageid=");  
		var tmp_imageid = tmp[1];
		try	{
			thisPAGE = page_2_imageid_ary_js[tmp_imageid];
			if (typeof(thisPAGE)=='undefined') {
				thisPAGE = 1;
			}
		} catch (e) {
		}	
	}

	if (thisPAGE<=0) {
		thisPAGE = 1;
	} else if (thisPAGE>img_count) {
		thisPAGE = img_count;
	}

	try {
		if (thisPAGE < img_count) {
			nextPAGE =  thisPAGE+1;
			next_img_src = img_ary_js[nextPAGE]['filename'];
		}
		this_filename = img_ary_js[thisPAGE]['filename'];
		this_filesize = img_ary_js[thisPAGE]['filesize'];
		this_upload_info = '';
		if (img_ary_js[thisPAGE]['username'] != 'guest' && img_ary_js[thisPAGE]['username'] != '') {
			if (img_ary_js[thisPAGE]['username'] == '迅雷网友') {
				this_upload_info = '<u>' + img_ary_js[thisPAGE]['username'] + '</u> 添加 - 审核通过于：'+ img_ary_js[thisPAGE]['uptime'] +'';
			} else {
				this_upload_info = '<a href="http://user.movie.xunlei.com/' + img_ary_js[thisPAGE]['username'] + '/movie_photo/list" target="_blank">' + img_ary_js[thisPAGE]['username'] + '</a> 添加 - 审核通过于：'+ img_ary_js[thisPAGE]['uptime'] +'';
			}
		}
		
	} catch (e) {
		this_filename = '';
		this_filesize = '';
		this_upload_info = '';
	}

	show_img = '<img src="http://images.movie.xunlei.com/840x/'+this_filename+'" style="border: 6px solid #EEE" alt="点击查看下一张"  />';
	if (thisPAGE>1) {
		set_pre_PAGE = thisPAGE-1;
		show_pre_img = '<a href="'+this_url+'?page='+set_pre_PAGE+'">«上一页</a>';
	} else {
		show_pre_img = '';
	}
	if (thisPAGE < img_count) {
		set_next_PAGE =  thisPAGE+1;
		next_img_tag_a = '<a href="'+this_url+'?page='+set_next_PAGE+'">';
	} else {
		if (next_flag) {
			next_img_tag_a = '<a href="'+next_url+'?page=1">';
		} else {
			next_img_tag_a = '<a href="javascript:void(0)">';
		}
	}

	// 分页 
	page_str = get_page_list(thisPAGE, img_count, this_url);
}

function show_jz(x) {
	var jz_container = document.getElementById("jz_pics_container") ;
	var lis = jz_container.getElementsByTagName('li');
	var max_screen = Math.ceil(lis.length / 6) ;
	if (x < 1) {
		x = max_screen;
	}
	if (x > max_screen) {
		x  = 1;
	}
	for (i=0;i<6;i++) {
	
		var hidden_cnt = (jz_cur_screen-1)*6+i ;
		var display_cnt = (x-1)*6+i ;
	
		if (hidden_cnt < lis.length) {
			lis[hidden_cnt].style.display = "none" ; //隐藏前面显示的
		}
		if (display_cnt < lis.length) {
			lis[display_cnt].style.display = "block" ; //显示当前
			document.getElementById("jz_img_"+display_cnt).src = jz_imgs[display_cnt] ;
		}
	}
	jz_cur_screen = x ;
	return false ;
}


function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}
            
function startRequest(div_name, template_name) {
	var ProvinceID=document.getElementById(div_name);           
	createXMLHttpRequest();
	xmlHttp.onreadystatechange = handleStateChange;
	//var url2 = 'http://'+document.location.host+'/'+template_name+'.html';
	var url2 = 'http://data.movie.xunlei.com/'+template_name+'.html';
	xmlHttp.open("GET", url2, true);
	xmlHttp.send(null);
}
	
function handleStateChange() {
	if(xmlHttp.readyState == 4) //0(未初始化);1(正在装载);2 (装载完毕);3 (交互中);4 (完成) 
	{
		if(xmlHttp.status == 200) //200(OK);404(not found)
		{
			document.getElementById("show_left").innerHTML=xmlHttp.responseText;
		}
	}
}