var url="";
function php_ajax(url,id){
	var req_id="";
	var xmlhttp;
	try{
		xmlhttp=new ActiveXObject("MsXml2.XMLHTTP");
	}catch(e){
		try{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e){
			try{
				xmlhttp=new XMLHttpRequest();
			}catch(e){
				alert("无法建立 Ajax 请求对象，你的浏览器版本太低，建议升级你的浏览器。");
			}
		}
	}
	xmlhttp.open("GET",url,true);
	req_id=id;
	xmlhttp.onreadystatechange=function(){
		//if(xmlhttp.readyState==200){
		if(xmlhttp.readyState==4){
			document.getElementById(req_id).innerHTML=xmlhttp.responseText;
		}else{
			document.getElementById(req_id).innerHTML="Loading...";
		}
	}
	xmlhttp.send(null);
}
function php_jq(url,id){
	/*关闭AJAX相应的缓存*/
	$.ajaxSetup ({
		cache: false 
	});
	$.ajax({
		url:url,
		success:function(data){
			$(id).html(data);
		}
	});
}

//鼠标滑动［开始］
function mouseover(tit_str,div_str1,div_str2,no,sort_i){
	for(var i=0;i<sort_i;i++){
		document.getElementById(div_str1+i).style.display="none";
		document.getElementById(div_str2+i).style.display="none";
	}
	document.getElementById(div_str1+no).style.display="inline";
	document.getElementById(div_str2+no).style.display="inline";
}
function mouseout(tit_str,div_str1,div_str2,no,sort_i){
	for(var i=0;i<sort_i;i++){
		document.getElementById(div_str1+i).style.display="none";
		document.getElementById(div_str2+i).style.display="none";
	}
	document.getElementById(div_str1+no).style.display="inline";
	document.getElementById(div_str2+no).style.display="inline";
}
//鼠标滑动［结束］
//图像放大缩小［开始］
function jpg_set_small(img_id,img_bl){
	var img_height=document.getElementById(img_id).height;
	var img_width=document.getElementById(img_id).width;
	document.getElementById(img_id).height=img_height/img_bl;
	document.getElementById(img_id).width=img_width/img_bl;
}
function jpg_set_big(img_id,img_bl){
	var img_height=document.getElementById(img_id).height;
	var img_width=document.getElementById(img_id).width;
	document.getElementById(img_id).height=img_height*img_bl;
	document.getElementById(img_id).width=img_width*img_bl;
}
//图像放大缩小［结束］

function printset(){
// 打印页面设置
	openwindows=window.open("");
	openwindows.document.write("<body topmargin='0' leftmargin='0'><link rel='stylesheet' type='text/css' href='../css/css.css'>"+document.getElementById("print_page").innerHTML+"<object id='object_print_page' name='object_print_page' height='0' width='0' classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object><script language='javascript'>var object_print_page=new Object();object_print_page.execwb(8,1);window.close();</script></body>");
}
function printit(){
// 开始打印
	if (confirm('确定打印吗？')) {
		if(document.execCommand){
			openwindows=window.open("");
			openwindows.document.write("<script language='javascript'>function printit(){document.execCommand('Print');}</script><body topmargin='0' leftmargin='0'><link rel='stylesheet' type='text/css' href='../css/css.css'>"+document.getElementById("print_page").innerHTML+"<script language='javascript'>printit();window.close();</script></body>");
		}else{
			alert("打印功能，仅支持Internet Exlorer 4.0 及以上版本。");
		}
	}
}
function printpreview(){
//打印预览
	openwindows=window.open("");
	openwindows.document.write("<body topmargin='0' leftmargin='0'><link rel='stylesheet' type='text/css' href='../css/css.css'>"+document.getElementById("print_page").innerHTML+"<object id='object_print_page' name='object_print_page' height='0' width='0' classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object><script language='javascript'>var object_print_page=new Object();object_print_page.execwb(7,1);window.close();</script></body>");
}
function doSaveAs(){
	if(document.execCommand){
		document.execCommand("SaveAs");
	}else{
		alert("下载到本地功能，仅支持Internet Exlorer 4.0 及以上版本。");
	}
}
function sel(ygy){ 
	ygya=document.getElementsByName(ygy);
	for(i=0;i<ygya.length;i++){
		ygya[i].checked=event.srcElement.checked;
	}
}
function return_check_value(ygy){
	var no="";
	ygya=document.getElementsByName(ygy);
	for(i=0;i<ygya.length;i++){
		if(ygya[i].checked){
			no+=ygya[i].value+",";
		}
	}
	no=no.substring(0,no.length-1)
	return no;
}

function add_data(){
	if(!confirm('您确认要添加本信息吗？')){
		return false;
	}
}
function edit_data(){
	if(!confirm('您确认要修改本信息吗？')){
		return false;
	}
}
function del_data(){
	if(!confirm('您确认要删除本信息吗？')){
		return false;
	}
}
function mail_send(){
	if(!confirm('您确认要群发电子邮件吗？')){
		return false;
	}
}
function clear_data(r,s){
	if(confirm('您确认要清理信息吗？')){
		window.location="manage.php?t=info&r=clear_"+r+"&s="+s;
	}
}
function set_times(list_span,val){
	if(val==0){
		document.getElementById(list_span).style.display="none";
	}else{
		document.getElementById(list_span).style.display="";
	}
}
function select_all(id){
	select_id=document.getElementById(id);
	for(var i=0;i<select_id.length;i++){
		select_id.options[i].selected=true;
	}
}
function un_select_all(id){
	select_id=document.getElementById(id);
	for(var i=0;i<select_id.length;i++){
		select_id.options[i].selected=false;
	}
}

function select_values(id){
	var ret="";
	select_id=document.getElementById(id);
	for(var i=0;i<select_id.length;i++){
		if(select_id.options[i].selected==true){
			ret=select_id.options[i].value;
		}
	}
	return ret;
}

function opendiv(id){
	pagewidth=800;
	pagetop=0;
	obj=document.getElementById(id);
	if (obj.style) { obj=obj.style;}
	if (document.body.clientWidth > pagewidth)	obj.left=parseInt((document.body.clientWidth-pagewidth)/2)+objleft[id];
	else obj.left=objleft[id];
	obj.visibility="visible";

}
function closediv(id){
	obj=document.getElementById(id);
	if (obj.style) { obj=obj.style;}
	obj.visibility="hidden";
}

function show_menu(sid){
	whichEl = eval("submenu" + sid);
	imgmenu = eval("imgmenu" + sid);
	if(whichEl.style.display == "none"){
		eval("submenu" + sid + ".style.display=\"\";");
		imgmenu.background="../img/_admin/m_r.gif";
	}else{
		eval("submenu" + sid + ".style.display=\"none\";");
		imgmenu.background="../img/_admin/m_d.gif";
	}
}
function show_users_menu(menuid,no,count,classname){
	for(var i=0;i<=count;i++){
		menu_obj=document.getElementById(menuid+i);
		if(menu_obj!=null){
			menu_obj.style.display="none";
		}
	}
	menu_obj=document.getElementById(menuid+no);
	if(menu_obj!=null){
		menu_obj.style.display="inline";
		menu_obj.className=classname;
	}
}
function esyj_div_sort_list(name_id,num_id,num_count){
	for(var i=0;i<num_count;i++){
		var onclick_obj=document.getElementById(name_id+i);
		if(onclick_obj){
			if(i==num_id){
				onclick_obj.style.display="inline";
			}else{
				onclick_obj.style.display="none";
			}
		}
	}
} 

function switchMenu(curr_id,total_num){
	for(var i=0;i<total_num; i++){
		var el=document.getElementById('menu_sub_'+i);
		if(!el) return;
		var span=document.getElementById('menu_master_'+i);
		if(i == curr_id){
			el.style.display = "inline";
		}else{
			el.style.display = "none"; 
		}
	}
}

function return_keywords(id,ret_id){
	var info=FCKeditorAPI.GetInstance(id).GetXHTML();
	info=info.replace(/\</g,"");
	info=info.replace(/\>/g,"");
	info=info.replace(/\&nbsp;/g,"");
	info=info.replace(/\&/g,"");
	info=info.replace(/\P/g,"");
	info=info.replace(/\p/g,"");
	info=info.replace(/\//g,"");
	window.frames["ifto_info"].document.getElementById(id).value=info;
	document.getElementById("div_rkw").style.visibility="visible";
}
function return_keywords_close(){
	document.getElementById("div_rkw").style.visibility="hidden";
}

//DIV+CSS的滑动门[开始]
function YGYhdm_Box_obj(obj){return document.getElementById(obj);}
function YGYhdm_Box(now_num,count_num,byid_str,byinfo_str){
	for(var i=1;i<=count_num;i++){
		YGYhdm_Box_obj("YGYhdm_Box_"+byid_str+"_"+i).className="YGYhdm_Box_"+byid_str+"_false";
		YGYhdm_Box_obj("YGYhdm_Box_"+byinfo_str+"_"+i).style.display="none";
	}
	YGYhdm_Box_obj("YGYhdm_Box_"+byid_str+"_"+now_num).className="YGYhdm_Box_"+byid_str+"_true";
	YGYhdm_Box_obj("YGYhdm_Box_"+byinfo_str+"_"+now_num).style.display="block";
}
//DIV+CSS的滑动门[结束]

function jsimgupdata_add(byid,js_byid){
	var arrays=new Array(100);
	for(var j=0;j<100;j++){
		arrays[j]="";
	}
	var HTML="";
	var count_for=document.getElementById(byid+"_count").value;
	var values_for=document.getElementById(byid+"_values").value;
	values_array=values_for.split("|");
	values_array=values_array.concat(arrays);
	for(var i=0;i<count_for;i++){
		HTML+='<div id="'+byid+(i+1)+'_div" name="'+byid+(i+1)+'_div" style="float:none;height:25px;line-height:25px;">';
		HTML+='　上传图像'+(i+1)+'：<input id="'+byid+(i+1)+'" name="'+byid+'[]" type="text" size="100" value="'+values_array[i]+'">';
		HTML+='<input type="button" value=".上传文件." onClick="javascript:return YGY_UpData_js(\'../img/updata/\',\''+byid+(i+1)+'\',\'YGY_UpData\');">';
		HTML+='　[<a style="color:#0000FF;cursor:hand;" onclick="javascript:jsimgupdata_del(\''+byid+(i+1)+'_div\',\''+byid+'\');">删除</a>]';
		HTML+='</div>';
	}
	document.getElementById(byid+"_count").value=i+1;
	document.getElementById(js_byid).innerHTML=HTML;
}
function jsimgupdata_del(byid_div,byid){
	var div=document.getElementById(byid_div);
	var byid_value=document.getElementById(byid+"_count");
	byid_value.value=byid_value.value-1;
	div.parentNode.removeChild(div);
}

