﻿	var icon = '<img src="/i/login/warning.gif" width="14" height="14" border="0" align="absmiddle"> ';
	var ns = ["Info_Title","pwd","repwd","Info_Email","Info_QQ","Info_Name","Info_Tel","Info_Mobile","Info_Content","Info_ValidityDate","Info_ClassID","Info_AreaID"];
	
	
	function changeInfoTitle(){
		if($("ceowen_freepostboxSubmit").disabled) $("ceowen_freepostboxSubmit").disabled = false;		
	}
	function checkInfo_Title(s){	

		var ma = ["请输入标题","标题必须包含中文、字母等6~50个字符","必须含有中文字符"];
		if(isEmpty(s)){
			showInfo("Info_Title",ma[0]);
			return false;
		}
		
		if(!limitLen(s,6,50)){
			showInfo("Info_Title",ma[1]);
			return false;
		}
		
		if(!hasChineseChar(s)){
			showInfo("Info_Title",ma[2]);
			return false;
		}
		
		//检测标题是否存在
		var cid = document.getElementById("Info_ClassID").value;
		var aid = document.getElementById("Info_AreaID").value;
		
			 
		if(trim($F('Info_Title')).length > 0 && aid && cid)
		{
			//alert("/post/check/?cid=" + cid + "&aid=" + aid);
			loadAjaxData("/post/check/?cid=" + cid + "&aid=" + aid,{Info_Title:$F('Info_Title')},successCheck,errorCheck);
		}
		showInfo("Info_Title");
		return true;

	}
	
	
	
	function checkPwd(s){
		var ma = ["请输入密码","密码必须是5-16位","密码不能包含中文或全角符号","两次输入的密码不一致！"];
		if(isEmpty(s)){
			showInfo("pwd",ma[0]);
			return false;
		}
		
		ps.update(s);
		if(!limitLen(s,5,16)){
			showInfo("pwd",ma[1]);
			return false;
		}
		if(hasChineseChar(s)){
			showInfo("pwd",ma[2]);
			return false;
		}
		if(limitLen($F("repassword"),5,16)){
			if(trim($F("repassword")) == trim(s)){
				showInfo("pwd");
				showInfo("repwd");
				return true;
			}else{
				showInfo("pwd",ma[3]);
				return false;
			}
		}
		showInfo("pwd");
		return true;
	}
	function checkPwd2(s){
		var ma = ["请输入密码","密码必须是5-16位","密码不能包含中文或全角符号","两次输入的密码不一致！"];
		if(isEmpty(s)){
			showInfo("repwd",ma[0]);
			return false;
		}
		if(!limitLen(s,5,16)){
			showInfo("repwd",ma[1]);
			return false;
		}
		if(hasChineseChar(s)){
			showInfo("repwd",ma[2]);
			return false;
		}
		if(limitLen($F("password"),5,16)){
			if(trim($F("password")) == trim(s)){
				showInfo("pwd");
				showInfo("repwd");
				return true;
			}else{
				showInfo("repwd",ma[3]);
				return false;
			}
		}
		showInfo("repwd");
		return true;
	}
	function checkInfo_Email(s){
		//"<b>Email</b>、<b>手机</b>或<b>电话</b>至少填一项。如：test@redbaidu.com、1000@qq.com。",
		var ma = ["请输入常用邮件<b style='color:#ff0000'>选填</b>","邮件必须大于5个字符","邮件格式不正确，正确的格式：test@redbaidu.com"];
		if(isEmpty(s)){
			showInfo("Info_Email",ma[0]);
			return false;
		}
		if(s.length < 5){
			showInfo("Info_Email",ma[1]);
			return false;
		}
		if(!isEmail(s)){
			showInfo("Info_Email",ma[2]);
			return false;
		}
		
		$("ceowen_freepostboxSubmit").disabled = false;
		showInfo("Info_Email");
		return true;
	}
	
	
	//QQ
	function checkInfo_QQ(s){
		var ma = ["请输入QQ号","QQ号必须是0-9的4-10位数字组成。如：16327997。","QQ号必须是0-9的4-10位数字组成！"];
		if(isEmpty(s)){
			showInfo("Info_QQ",ma[0]);
			return false;
		}
		if(!isNumber(s)){
			showInfo("Info_QQ",ma[1]);
			return false;
		}		
		
		if(!limitLen(s,4,10)){
			showInfo("Info_QQ",ma[2]);
			return false;
		}
		showInfo("Info_QQ");
		return true;
	}
	
	
	//电话
	function checkInfo_Tel(s){
		//"<b>Email</b>、<b>手机</b>或<b>电话</b>至少填一项！如：010-62523400、62523400。",
		var ma = ["请输入电话号码<b style='color:#ff0000'>选填</b>","电话格式不正确，必须是区号加“-”加0-9的数字与组成。如：010-62523400，62523400。"];
		if(isEmpty(s)){
			showInfo("Info_Tel",ma[0]);
			return false;
		}
		if(!isPhone(s)){
			showInfo("Info_Tel",ma[1]);
			return false;
		}
		
		$("ceowen_freepostboxSubmit").disabled = false;
		showInfo("Info_Tel");
		return true;
	}
	
	
	//手机
	function checkInfo_Mobile(s){
		//"，<b>Email</b>、<b>手机</b>或<b>电话</b>至少填一项！如：13800138000。",
		var ma = ["请输入手机号码<b style='color:#ff0000'>选填</b>","手机号码格式不正确，必须是11位0-9的数字组成。如：13800138000。"];
		if(isEmpty(s)){
			showInfo("Info_Mobile",ma[0]);
			return false;
		}
		if(!isMobile(s)){
			showInfo("Info_Mobile",ma[1]);
			return false;
		}
		
	
		$("ceowen_freepostboxSubmit").disabled = false;
		showInfo("Info_Mobile");
		return true;
	}
	
	
	//选择分类
	function checkInfo_ClassID(s){
		var ma = ["请选择分类！","分类选择不正确，请选择！"];
		if(isEmpty(s)){
			showInfo("Info_ClassID",ma[0]);
			return false;
		}
		
		if(s=="4595"){
			showInfo("Info_ClassID",ma[0]);
			return false;
		}
		
		
		loadAjaxData("/post/checkInfoClassID/",{Info_ClassID:$F('Info_ClassID')},successCheck4,errorCheck4);
		
		
		showInfo("Info_ClassID");
		return true;
	}
	
	//选择地区
	function checkInfo_AreaID(s){
		var ma = ["请选择地区！","地区选择不正确，请选择！"];
		if(isEmpty(s)){
			showInfo("Info_AreaID",ma[0]);
			return false;
		}
		if(s=="1"){
			showInfo("Info_AreaID",ma[0]);
			return false;
		}
		showInfo("Info_AreaID");
		return true;
	}
	
	
		//内容
	function checkInfo_Content(s){

		var ma = ["内容不能为空，应在10~2000个字之间！","内容应在10~2000个字之间，不能填写电话、QQ等联系方式!"];
		if(isEmpty(s)){
			showInfo("Info_Content",ma[0]);
			return false;
		}
		
		if(!limitLen(s,10,2000)){
			showInfo("Info_Content",ma[1]);
			return false;
		}
		
		showInfo("Info_Content");
		return true;
	}
	
	//上传图片
	function checkInfo_File(s){
		var ma = ["请选择您要上传的图片！添加图片，信息效果会更好。","限上传2M以内大小的图片。支持的图片格式：gif, jpg, png, bmp。超大图片将自动缩小到宽幅为800px。"];
		if(isEmpty(s)){
			showInfo("Info_File",ma[0]);
			return false;
		}
		
		var fileext=document.getElementById("Info_File").value.substring(document.getElementById("Info_File").value.lastIndexOf("."),document.getElementById("Info_File").value.length) 
		fileext=fileext.toLowerCase() 
		if ((fileext!='.jpg')&&(fileext!='.gif')&&(fileext!='.jpeg')&&(fileext!='.png')&&(fileext!='.bmp')) 
		{ 
			//alert("对不起，系统仅支持标准格式的照片，请您调整格式后重新上传，谢谢 !\n图片格式：*.jpg、*.gif、*.jpeg、*.png、*.bmp"); 
			showInfo("Info_File",ma[1]);
			$("ceowen_freepostboxSubmit").disabled = true;
			return false;
		} 
		else 
		{ 
			$("ceowen_freepostboxSubmit").disabled = false;
			document.getElementById("preview").innerHTML="<img src='"+document.getElementById("Info_File").value+"' style='width:120px;height:80px;'>" 
		} 
		
		var a = document.getElementById("Info_File").value;
		var Info_File_New = a.substr(a.lastIndexOf('\\')+1);
		
		if(trim(Info_File_New).length > 0)
		{
			//alert("/post/check/?cid=" + cid + "&aid=" + aid)
			//alert(anewfile)
			loadAjaxData("/post/checkimg/",{Info_File:Info_File_New},successCheck2,errorCheck2);
			
		}
		
	
		$("ceowen_freepostboxSubmit").disabled = false;
		showInfo("Info_File");
		return true;
	}
	
	
		//有限期
	function checkInfo_ValidityDateTime(s){
		var ma = ["请选择有效期！","有效期选择错误，请重新选择!"];
		if(isEmpty(s)){
			showInfo("Info_ValidityDateTime",ma[0]);
			return false;
		}
		
		showInfo("Info_ValidityDateTime");
		return true;
	}
	
	
	//联系人
	function checkInfo_Name(s){
		var ma = ["请填写联系人！如：小百度。","联系人必须是包含中文、英文数字!"];
		if(isEmpty(s)){
			showInfo("Info_Name",ma[0]);
			return false;
		}
		
		showInfo("Info_Name");
		return true;
	}
	
	
	//验证码
	function checkInfo_ValidateCode(s){	
		//alert("dsfds");
		var ma = ["请输入验证码！","验证码必须0~9的数字","验证码2-4位"];
		if(isEmpty(s)){
			showInfo("Info_ValidateCode",ma[0]);
			return false;
		}
		
		if(!isNumber(s)){
			showInfo("Info_ValidateCode",ma[1]);
			return false;
		}
		
		if(!limitLen(s,2,4)){
			showInfo("Info_ValidateCode",ma[2]);
			return false;
		}
		
		
		loadAjaxData("/post/checkvalicode/",{ValidateCode:$F('Info_ValidateCode')},successCheck3,errorCheck3);
	
		showInfo("Info_ValidateCode");
		return true;
	}
	
	
	function showInfo(n,s){
		var fdo = $(n+"FrameDiv");
		var ido = $(n+"InfoDiv");
		if(typeof s == 'undefined'){
			fdo.className = "FrameDivPass";
			ido.innerHTML = "<img src='/i/icon/pic_right.gif'> ^_^ 填写正确！";
		}else{
			fdo.className = "FrameDivWarn";
			ido.innerHTML = "<span style='color:#666;'>"+icon + s +"</span>";
		}
	}
	//======================================================;
	function loadCheck(){
		if(trim($F('Info_Title')).length == 0 ) return;
		$("ceowen_freepostboxSubmit").disabled = true;
		var o = $("checkDiv");
		o.innerHTML = getLoadInfo();	
		
		var cid = document.getElementById("Info_ClassID").value;
		var aid = document.getElementById("Info_AreaID").value;
		
				
		if(trim($F('Info_Title')).length > 0 && aid && cid)
		{
			//alert("/post/check/?cid=" + cid + "&aid=" + aid);
			loadAjaxData("/post/check/?cid=" + cid + "&aid=" + aid,{Info_Title:$F('Info_Title')},successCheck,errorCheck);
		}
	}
	function successCheck(v){
		var o = $("checkDiv");
		o.innerHTML = getCheckHTML(v.responseText);
		if(v.responseText=="0"){
			ceowen_checkmulti();
			$("ceowen_freepostboxSubmit").disabled = true;
		}
		else
		{
			$("ceowen_freepostboxSubmit").disabled = false;	
		}
	}
	function errorCheck(){
		$("ceowen_freepostboxSubmit").disabled = false;
		var o = $("checkDiv");
		o.innerHTML = getErrorInfo();
	}
	function getCheckHTML(s){
		s = (s == "1")? "<span style='color:#04b915;'>√</span>":"<span style='color:#ff0000;'>× 该标题已存在</span>";
		return s;
	}
	//======================================================;
	
	
	
	//======================================================;
	function loadCheck2(){
		if(trim($F('Info_File')).length == 0 ) return;
		$("ceowen_freepostboxSubmit").disabled = true;
		var o = $("checkDiv2");
		o.innerHTML = getLoadInfo();	
		
		var b = document.getElementById("Info_File").value;
		var Info_File_New2 = b.substr(b.lastIndexOf('\\')+1);
		
		if(trim(Info_File_New2).length > 0)
		{
			//alert("/post/check/?cid=" + cid + "&aid=" + aid)
			//alert(anewfile)
			loadAjaxData("/post/checkimg/",{Info_File:Info_File_New2},successCheck2,errorCheck2);
			
		}
		
	}
	function successCheck2(v){
		var o = $("checkDiv2");
		o.innerHTML = getCheckHTML2(v.responseText);
		if(v.responseText=="0"){
			ceowen_checkmulti();
			$("ceowen_freepostboxSubmit").disabled = true;
		}
		else
		{
			$("ceowen_freepostboxSubmit").disabled = false;	
		}
	}
	function errorCheck2(){
		$("ceowen_freepostboxSubmit").disabled = false;
		var o = $("checkDiv2");
		o.innerHTML = getErrorInfo();
	}
	function getCheckHTML2(s){
		s = (s == "1")? "<span style='color:#04b915;'><img src='/i/icon/pic_right.gif'> ^_^ 恭喜您，该<b style='color:#ff0000;'>图片</b>可以使用。！</span>":"<span style='color:#ff0000;'><img src='/i/login/warning.gif' width='14' height='14' border='0' align='absmiddle'> 对不起，该<b style='color:#ff0000;'>图片</b>已经存在，请您更换新图片！</span>";
		return s;
	}
	
	
				//======================================================;
	function loadCheck3(){
		if(trim($F('Info_ValidateCode')).length == 0 ) return;
		$("ceowen_freepostboxSubmit").disabled = true;
		var o = $("checkDiv3");
		o.innerHTML = getLoadPost();	
		
		if(trim($F('Info_ValidateCode')).length > 0)
		{
			//alert("/post/check/?cid=" + cid + "&aid=" + aid)
			//alert(anewfile)
			loadAjaxData("/post/checkvalicode/",{ValidateCode:$F('Info_ValidateCode')},successCheck3,errorCheck3);
		}
	}
	function successCheck3(v){
		var o = $("checkDiv3");
		o.innerHTML = getCheckHTML3(v.responseText);
		if(v.responseText=="0"){
			
			$("ceowen_freepostboxSubmit").disabled = true;
		}
		else
		{
			$("ceowen_freepostboxSubmit").disabled = false;	
		}
	}
	function errorCheck3(){
		$("ceowen_freepostboxSubmit").disabled = false;
		var o = $("checkDiv3");
		o.innerHTML = getErrorPost();
	}
	function getCheckHTML3(s){
		s = (s == "1")? "√":"<span style='color:#ff0000;'>验证码错误</span>";
		return s;
	}
	//======================================================;
	
	
	//判断信息分类选择是否正确
	//======================================================;
	function loadCheck4(){
		if(trim($F('Info_ClassID')).length == 0 ) return;
		$("ceowen_freepostboxSubmit").disabled = true;
		var o = $("checkDiv4");
		o.innerHTML = getLoadPost();	
		
		if(trim($F('Info_ClassID')).length > 0)
		{
			loadAjaxData("/post/checkInfoClassID/",{Info_ClassID:$F('Info_ClassID')},successCheck4,errorCheck4);
		}
	}
	function successCheck4(v){
		var o = $("checkDiv4");
		o.innerHTML = getCheckHTML4(v.responseText);
		if(v.responseText=="0"){
			showInfo("Info_ClassID","分类选择不正确");
			$("ceowen_freepostboxSubmit").disabled = true;
		}
		else
		{
			$("ceowen_freepostboxSubmit").disabled = false;	
		}
	}
	function errorCheck4(){
		$("ceowen_freepostboxSubmit").disabled = false;
		var o = $("checkDiv4");
		o.innerHTML = getErrorPost();
	}
	function getCheckHTML4(s){
		s = (s == "1")? "<span style='color:#04b915;'><img src='/i/icon/pic_right.gif'> ^_^ 分类选择正确。！</span>":"<span style='color:#ff0000;'><img src='/i/login/warning.gif' width='14' height='14' border='0' align='absmiddle'> 对不起，分类选择错误，请重新选择！</span>";
		return s;
	}
	//======================================================;
	
	
	
	//======================================================;
	function getLoadInfo(){
		return '<img src="/i/ceowen_ajax2010red.gif" width="16" height="16" border="0" align="absmiddle"> 正在加载数据...';
	}
	function getErrorInfo(){
		return '<img src="/i/login/warning.gif" width="14" height="14" border="0" align="absmiddle"> 数据加载失败!';
	}
	//======================================================;
	function initPage(){
		for(var i=0;i<ns.length;i++){
			$(ns[i]+"Input").value = "";
		}
	}
	
//initPage();

//判断Email、手机、电话任意填写一项。
function ceowen_checkmulti(){
	
	var e=document.getElementById("Info_Email").value;
	var f=document.getElementById("Info_Tel").value;
	var g=document.getElementById("Info_Mobile").value;
	var h=document.getElementById("Info_QQ").value;
	//var i=document.getElementById("Info_File").value;
	var j=document.getElementById("Info_ValidateCode").value;
	var k=document.getElementById("Info_ClassID").value;
	//var l=document.getElementById("Info_Title").value;
	
	if(e.length>0)
		{
			if(!checkInfo_Email(e))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}
		
		if(f.length>0)
		{
			if(!checkInfo_Tel(f))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}
		
		if(g.length>0)
		{
			if(!checkInfo_Mobile(g))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}
		
		if(h.length>0)
		{
			if(!checkInfo_QQ(h))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}
		
		
		
		if(j.length>0)
		{
			if(!checkInfo_ValidateCode(j))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}
		
		if(k.length>0 && k!=4595)
		{
			if(!checkInfo_ClassID(k))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}	
		
	
			
	$("ceowen_freepostboxSubmit").disabled = false;
	
	//验证：验证码
	ceowen_checkmulti2();
	return true;
}


//判断验证码、标题、信息分类
function ceowen_checkmulti2(){
	
	var j=document.getElementById("Info_ValidateCode").value;
	var k=document.getElementById("Info_ClassID").value;
	var l=document.getElementById("Info_Title").value;
	

		
		if(l.length>0)
		{
			if(!checkInfo_Title(l))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}	
		
		
		if(k.length>0 && k!=4595)
		{
			if(!checkInfo_ClassID(k))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}	
		

		if(j.length>0)
		{
			if(!checkInfo_ValidateCode(j))
			{
				$("ceowen_freepostboxSubmit").disabled = true;
				return false;
			}
		}
		
			
	$("ceowen_freepostboxSubmit").disabled = false;
	return true;
}

//提交验证
function ceowen_register_onsubmit(){

		
	var a=document.getElementById("Info_Title").value;
	var b=document.getElementById("Info_ClassID").value;
	var c=document.getElementById("Info_AreaID").value;
	var d=document.getElementById("Info_Content").value;
	var e=document.getElementById("Info_Email").value;
	var f=document.getElementById("Info_Tel").value;
	var g=document.getElementById("Info_Mobile").value;
	var h=document.getElementById("Info_ValidateCode").value;

		//var h=document.getElementById("Info_Name").value;
		//if(checkInfo_AreaID(c) && checkInfo_ClassID(b) && checkInfo_Title(a) && checkInfo_Content(d) && checkInfo_Name(h) && (checkInfo_Email(e) || checkInfo_Tel(f)|| checkInfo_Mobile(g)))
		if(checkInfo_AreaID(c) && checkInfo_ClassID(b) && checkInfo_Title(a) && checkInfo_Content(d) && (checkInfo_Email(e) || checkInfo_Tel(f)|| checkInfo_Mobile(g)) && (checkInfo_ValidateCode(h)))
		{
	
			changeInfoTitle();
			loadCheck();
			$("ceowen_nowissubmitbox").style.display = "block";
			document.getElementById("ceowen_freepostboxSubmit").style.display = "none";
					
			//$("ceowen_freepostboxSubmit").value = "信息正在发送中，请稍等片刻...";
			//$("ceowen_freepostboxSubmit").disabled = true;
			document.getElementById("ceowen_freepostbox").submit();
			
			return true;
			
		}
		else{
			alert("信息填写不正确，请检查后重新填写信息！");
			return false;
		}
		

	return false;
}


ie = (document.all)? true:false 
if (ie){ 
	function ctlent(eventobject)
	{

		
		//Ctrl+Enter快捷键发送
		if(event.ctrlKey && window.event.keyCode==13 && document.getElementById("ceowen_freepostboxSubmit").disabled==false){
			var a=document.getElementById("Info_Title").value;
			var b=document.getElementById("Info_ClassID").value;
			var c=document.getElementById("Info_AreaID").value;
			var d=document.getElementById("Info_Content").value;
			var e=document.getElementById("Info_Email").value;
			var f=document.getElementById("Info_Tel").value;
			var g=document.getElementById("Info_Mobile").value;
			var h=document.getElementById("Info_ValidateCode").value;

				
			//var h=document.getElementById("Info_Name").value;
			//if(checkInfo_AreaID(c) && checkInfo_ClassID(b) && checkInfo_Title(a) && checkInfo_Content(d) && checkInfo_Name(h) && (checkInfo_Email(e) || checkInfo_Tel(f)|| checkInfo_Mobile(g)))
			if(checkInfo_AreaID(c) && checkInfo_ClassID(b) && checkInfo_Title(a) && checkInfo_Content(d) && (checkInfo_Email(e) || checkInfo_Tel(f)|| checkInfo_Mobile(g))&& (checkInfo_ValidateCode(h)))
			{
				ceowen_checkmulti();
				loadCheck();
				//$("ceowen_freepostboxSubmit").value = "信息正在发送中，请稍等片刻...";
				$("ceowen_nowissubmitbox").style.display = "block";
				document.getElementById("ceowen_freepostboxSubmit").style.display = "none";
				$("ceowen_freepostboxSubmit").disabled = true;
				document.getElementById("ceowen_freepostbox").submit();
				return true;
			}
			else{
				alert("信息填写不正确，请检查后重新填写信息！");
				return false;
			}
			
			return false;
		}
	} 
} 



function ceowen_validateCodeBox()
{
	//alert("dd");
	document.getElementById("ceowen_validateCodeShowBox").innerHTML='<img align="absmiddle" src="../CEOWEN_Include/CEOWEN_ValidateCode3/" alt="验证码" style="width:100px;height:24px;border:#ccc 1px solid;" />&nbsp;<a href="javascript:ceowen_validateCodeBox();" style="font-size:14px;">看不清?</a>';
}

//显示验证码输入框
function ceowen_validateCodeFaceDivBox()
{
	//alert("dd");
	document.getElementById("ceowen_validateCodeFaceBox").style.display='block';
	document.getElementById("ceowen_validateCodeShowBox").innerHTML='<img align="absmiddle" src="../CEOWEN_Include/CEOWEN_ValidateCode3/" alt="验证码" style="width:100px;height:24px;border:#ccc 1px solid;" />&nbsp;<a href="javascript:ceowen_validateCodeBox();" style="font-size:14px;">看不清?</a>';
}



var currentMenu = false;
function toggleMenu(MenuNo) {
	var obj = G('Info_AreaID');
	var fDiv = G('SubMenu200');
	getRealPos(obj, fDiv);
	document.getElementById("SubMenu300").style.display = "none";
	if (currentMenu && currentMenu != MenuNo) {
		document.getElementById("MenuItem" + currentMenu).className = "name";
		document.getElementById("SubMenu" + currentMenu).style.display = "none";
	}
	

	if (document.getElementById("SubMenu" + MenuNo).style.display == "block") {
		document.getElementById("MenuItem" + MenuNo).className = "name";
		document.getElementById("SubMenu" + MenuNo).style.display = "none";
	} else {
		document.getElementById("MenuItem" + MenuNo).className = "name2";
		document.getElementById("SubMenu" + MenuNo).style.display = "block";
		getsubcategory(aid);

	}

	currentMenu = MenuNo;

}


function toggleMenu2(MenuNo) {
	var obj = G('Info_AreaID');
	var fDiv = G('SubMenu200');
	getRealPos(obj, fDiv);
	document.getElementById("SubMenu300").style.display = "none";
	if (currentMenu && currentMenu != MenuNo) {
		document.getElementById("MenuItem" + currentMenu).className = "name";
		document.getElementById("SubMenu" + currentMenu).style.display = "block";
	}
	

	if (document.getElementById("SubMenu" + MenuNo).style.display == "block") {
		document.getElementById("MenuItem" + MenuNo).className = "name";
		document.getElementById("SubMenu" + MenuNo).style.display = "block";
	} else {
		document.getElementById("MenuItem" + MenuNo).className = "name2";
		document.getElementById("SubMenu" + MenuNo).style.display = "block";
	
		getsubcategory(aid);

	}

	currentMenu = MenuNo;

}


	
function G(id){
	return document.getElementById(id);
}

function CEOWEN_CreateXmlHttp()
{
    xmlhttpobj = false;
    try{//创建对象
        xmlhttpobj = new XMLHttpRequest;
    }catch(e){
        try{
            xmlhttpobj=new ActiveXObject("MSXML2.XMLHTTP");
        }catch(e2){
            try{
                xmlhttpobj=new ActiveXObject("Microsoft.XMLHTTP");
            }catch(e3){
                xmlhttpobj = false;
            }
        }
    }
    return xmlhttpobj; 
}


/*
红百度分类信息-选择地区。
*/


//读取图片预览数据
function getsubcategory(aid){
	var xmlhttpobj = CEOWEN_CreateXmlHttp();
	if(xmlhttpobj){//如果创建对象xmlhttpobj成功
		document.getElementById("SubMenu200").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'><span style='color:#666;'>正在加载，请稍后...</span>";
		xmlhttpobj.open("get","/ajax/ceowen_postareadata/?aid="+ aid,true);//get方法 加个随机数。
		xmlhttpobj.send(null);
		xmlhttpobj.onreadystatechange=function(){//客户端监控函数
			if(xmlhttpobj.readyState==4){//服务器处理请求完成
				if(xmlhttpobj.status==200){
					//alert('ok');
					var html = xmlhttpobj.responseText;//获得返回值
					//alert(html);
					document.getElementById("SubMenu200").innerHTML=html;
				
				}else{
					document.getElementById("SubMenu200").innerHTML="服务器忙，请您稍后重试！";
				}
			}else{
				document.getElementById("SubMenu200").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'>正在处理，请稍后...";//服务器处理中				
			}
		}	
	}
}


//读取地区数据
function getsubcategoryGoPage(aid,pn){
	var xmlhttpobj = CEOWEN_CreateXmlHttp();
	if(xmlhttpobj){//如果创建对象xmlhttpobj成功
		document.getElementById("SubMenu200").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'><span style='color:#666;'>正在加载，请稍后...</span>";
		xmlhttpobj.open("get","/ajax/ceowen_postareadata/?aid="+ aid + "&pn=" + pn,true);//get方法 加个随机数。
		xmlhttpobj.send(null);
		xmlhttpobj.onreadystatechange=function(){//客户端监控函数
			if(xmlhttpobj.readyState==4){//服务器处理请求完成
				if(xmlhttpobj.status==200){
					//alert('ok');
					var html = xmlhttpobj.responseText;//获得返回值
					//alert(html);
					document.getElementById("SubMenu200").innerHTML=html;

						getsubcategory_areapathbox(aid);

				}else{
					document.getElementById("SubMenu200").innerHTML="服务器忙，请您稍后重试！";
				}
			}else{
				document.getElementById("SubMenu200").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'>...";//服务器处理中				
			}
		}	
	}
}



//显示当前选择状态的地区位置
function getsubcategory_areapathbox(aid){
	var xmlhttpobj = CEOWEN_CreateXmlHttp();
	if(xmlhttpobj){//如果创建对象xmlhttpobj成功
		document.getElementById("ceowen_selectshowbox").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'><span style='color:#666;font-size:12px'>正在加载，请稍后...</span>";
		xmlhttpobj.open("get","/ajax/ceowen_postareapath/?aid="+ aid,true);//get方法 加个随机数。
		xmlhttpobj.send(null);
		xmlhttpobj.onreadystatechange=function(){//客户端监控函数
			if(xmlhttpobj.readyState==4){//服务器处理请求完成
				if(xmlhttpobj.status==200){
					//alert('ok');
					var html = xmlhttpobj.responseText;//获得返回值
					//alert(html);
					document.getElementById("ceowen_selectshowbox").innerHTML=html;

						document.getElementById("Info_AreaID").value=aid;
						checkInfo_AreaID(document.getElementById("Info_AreaID").value);

				}else{
					document.getElementById("ceowen_selectshowbox").innerHTML="<span style='color:#666;font-size:12px'>服务器忙，请您稍后重试！</span>";
				}
			}else{
				document.getElementById("ceowen_selectshowbox").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'><span style='color:#666;font-size:12px'>正在处理，请稍后...</span>";//服务器处理中				
			}
		}	
	}
}


/*
红百度分类信息-选择分类。
*/
var currentMenu2 = false;

function toggleMenu_2(MenuNo) {
	var obj = G('Info_ClassID');
	var fDiv = G('SubMenu300');
	getRealPos(obj, fDiv);
	document.getElementById("SubMenu200").style.display = "none";
	if (currentMenu2 && currentMenu2 != MenuNo) {
		document.getElementById("MenuItem" + currentMenu2).className = "name";
		document.getElementById("SubMenu" + currentMenu2).style.display = "none";
	}
	

	if (document.getElementById("SubMenu" + MenuNo).style.display == "block") {
		document.getElementById("MenuItem" + MenuNo).className = "name";
		document.getElementById("SubMenu" + MenuNo).style.display = "none";
	} else {
		document.getElementById("MenuItem" + MenuNo).className = "name2";
		document.getElementById("SubMenu" + MenuNo).style.display = "block";
		getsubcategory2(cid);
		
	}

	currentMenu2 = MenuNo;

}


function toggleMenu2_2(MenuNo) {
	var obj = G('Info_ClassID');
	var fDiv = G('SubMenu300');
	getRealPos(obj, fDiv);
	document.getElementById("SubMenu200").style.display = "none";
	if (currentMenu2 && currentMenu2 != MenuNo) {
		document.getElementById("MenuItem" + currentMenu2).className = "name";
		document.getElementById("SubMenu" + currentMenu2).style.display = "block";
	}
	

	if (document.getElementById("SubMenu" + MenuNo).style.display == "block") {
		document.getElementById("MenuItem" + MenuNo).className = "name";
		document.getElementById("SubMenu" + MenuNo).style.display = "block";
	} else {
		document.getElementById("MenuItem" + MenuNo).className = "name2";
		document.getElementById("SubMenu" + MenuNo).style.display = "block";
		getsubcategory2(cid);
		
	}

	currentMenu2 = MenuNo;

}



//读取分类数据
function getsubcategory2(cid){
	var xmlhttpobj = CEOWEN_CreateXmlHttp();
	if(xmlhttpobj){//如果创建对象xmlhttpobj成功
		document.getElementById("SubMenu300").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'><span style='color:#666;font-size:12px;'>正在加载，请稍后...</span>";
		xmlhttpobj.open("get","/ajax/ceowen_postclassdata/?aid="+ cid,true);//get方法 加个随机数。
		xmlhttpobj.send(null);
		xmlhttpobj.onreadystatechange=function(){//客户端监控函数
			if(xmlhttpobj.readyState==4){//服务器处理请求完成
				if(xmlhttpobj.status==200){
					//alert('ok');
					var html = xmlhttpobj.responseText;//获得返回值
					//alert(html);
					document.getElementById("SubMenu300").innerHTML=html;
				
				}else{
					document.getElementById("SubMenu300").innerHTML="服务器忙，请您稍后重试！";
				}
			}else{
				document.getElementById("SubMenu300").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'>正在处理，请稍后...";//服务器处理中				
			}
		}	
	}
}


//读取分类数据
function getsubcategoryGoPage2(cid,pn){
	var xmlhttpobj = CEOWEN_CreateXmlHttp();
	if(xmlhttpobj){//如果创建对象xmlhttpobj成功
		document.getElementById("SubMenu300").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'><span style='color:#666;font-size:12px;'>正在加载...</span>";
		xmlhttpobj.open("get","/ajax/ceowen_postclassdata/?aid="+ cid + "&pn=" + pn,true);//get方法 加个随机数。
		xmlhttpobj.send(null);
		xmlhttpobj.onreadystatechange=function(){//客户端监控函数
			if(xmlhttpobj.readyState==4){//服务器处理请求完成
				if(xmlhttpobj.status==200){
					//alert('ok');
					var html = xmlhttpobj.responseText;//获得返回值
					//alert(html);
					document.getElementById("SubMenu300").innerHTML=html;
					getsubcategory_classpathbox(cid);
					
				}else{
					document.getElementById("SubMenu300").innerHTML="服务器忙，请您稍后重试！";
				}
			}else{
				document.getElementById("SubMenu300").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'>...";//服务器处理中				
			}
		}	
	}
}



//显示当前选择状态的分类位置
function getsubcategory_classpathbox(cid){
	var xmlhttpobj = CEOWEN_CreateXmlHttp();
	if(xmlhttpobj){//如果创建对象xmlhttpobj成功
		document.getElementById("ceowen_selectshowbox2").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'><span style='color:#666;font-size:12px;'>正在加载，请稍后...</span>";
		xmlhttpobj.open("get","/ajax/ceowen_postclasspath/?aid="+ cid,true);//get方法 加个随机数。
		xmlhttpobj.send(null);
		xmlhttpobj.onreadystatechange=function(){//客户端监控函数
			if(xmlhttpobj.readyState==4){//服务器处理请求完成
				if(xmlhttpobj.status==200){
					//alert('ok');
					var html = xmlhttpobj.responseText;//获得返回值
					//alert(html);
					document.getElementById("ceowen_selectshowbox2").innerHTML=html;
					document.getElementById("Info_ClassID").value=cid;
					checkInfo_ClassID(document.getElementById("Info_ClassID").value);
				}else{
					document.getElementById("ceowen_selectshowbox2").innerHTML="<span style='color:#666;font-size:12px'>服务器忙，请您稍后重试！</span>";
				}
			}else{
				document.getElementById("ceowen_selectshowbox2").innerHTML="<img src='/i/ceowen_ajax2010red.gif' alt='' style='margin-right:5px;' align='absmiddle'><span style='color:#666;font-size:12px'>正在处理，请稍后...</span>";//服务器处理中				
			}
		}	
	}
}



	//*********************************************************************
	//getRealPos() 获取浮动层的显示位置
	//el 需要作为参照物的文本框
	//obj 需要显示的浮动层DIV
	//*********************************************************************
function getRealPos(el,obj){
		var x = 0, y = 0, w, h;
		var el = typeof el == 'string' ? G(el) : el;
		w = el.offsetWidth;
		h = el.offsetHeight;
		do{
			x += el.offsetLeft || 0;
			y += el.offsetTop || 0;
			el = el.offsetParent;
		} while (el);
		obj.style.left = x+"px";
		obj.style.top = (y+23)+"px";
	}
	

//js容错脚本
 function killErrors() {
      return true;   
  }   
 //window.onerror = killErrors;   