function showlay_zzdt(num)
{
	for (var i=1;i<= 2;i++)
	{
		if (num==i)
		{
			document.getElementById("zzdt_"+i).style.background="url(images/kuangmenu1.gif) no-repeat center";
			document.getElementById("zzdt_"+i).style.color="#fff";
			document.getElementById("zzdt_c_"+i).style.display="block";
			document.getElementById("zzdt_m_"+i).style.display="block";
		}
		else
		{
			document.getElementById("zzdt_"+i).style.background="url(images/kuangmenu2.gif) no-repeat center";
			document.getElementById("zzdt_"+i).style.color="#39c";
			document.getElementById("zzdt_c_"+i).style.display="none";
			document.getElementById("zzdt_m_"+i).style.display="none";
		}
	}
}
function showlayer_comm_nav(num)
{
	for (var i=1;i<= 2;i++)
	{
		if (num==i)
		{
			document.getElementById("nav"+i).style.background="url(images/comm_menu_bg1.gif) no-repeat center";
			document.getElementById("comm_nav"+i).style.display="block";
		}
		else
		{
			document.getElementById("nav"+i).style.background="url(images/comm_menu_bg2.gif) no-repeat center";
			document.getElementById("comm_nav"+i).style.display="none";
		}
	}
}
function nav1_bs(num)
{
	for (var i=1;i<= 10;i++)
	{
		if (num==i)
		{
			document.getElementById("nav1_"+i+"_s").style.display="none";
			document.getElementById("nav1_"+i+"_b").style.display="block";
			document.getElementById("nav1_"+i+"_b").style.background="url(images/comm_listbg_b_1.gif) 0px -"+67*(i-1)+"px no-repeat";
		}
		else
		{
			document.getElementById("nav1_"+i+"_s").style.display="block";
			document.getElementById("nav1_"+i+"_b").style.display="none";
		}
	}
}
function nav2_bs(num)
{
	for (var i=1;i<= 10;i++)
	{
		if (num==i)
		{
			document.getElementById("nav2_"+i+"_s").style.display="none";
			document.getElementById("nav2_"+i+"_b").style.display="block";
			document.getElementById("nav2_"+i+"_b").style.background="url(images/comm_listbg_b_1.gif) 0px -"+67*(i-1)+"px no-repeat";
		}
		else
		{
			document.getElementById("nav2_"+i+"_s").style.display="block";
			document.getElementById("nav2_"+i+"_b").style.display="none";
		}
	}
}

function showlayer_getccindexab(num)
{
	for (var i=1;i<= 2;i++)
	{
		if (num==i)
		{
			document.getElementById("ccnav"+i).style.background="url(/images/ccnav_bg1.gif) no-repeat center";
			document.getElementById("comm_nav"+i).style.display="block";
		}
		else
		{
			document.getElementById("ccnav"+i).style.background="url(/images/ccnav_bg2.gif) no-repeat center";
			document.getElementById("comm_nav"+i).style.display="none";
		}
	}
}

function setHome(){try{window.external.AddFavorite(window.document.location,window.document.title)}catch(e){};}

var dialogFirst=true;
function dialog(title,content,width,height,cssName){

if(dialogFirst==true){
  var temp_float=new String;
  temp_float="<div id=\"floatBoxBg\" style=\"height:"+$(document).height()+"px;filter:alpha(opacity=0);opacity:0;\"></div>";
  temp_float+="<div id=\"floatBox\" class=\"floatBox\">";
  temp_float+="<div class=\"title\"><h4></h4><span>关闭</span></div>";
  temp_float+="<div class=\"content\"></div>";
  temp_float+="<div id=\"testcc\"></div><div id=\"testdd\"></div>";
  temp_float+="</div>";
  $("body").append(temp_float);
  dialogFirst=false;
}

//点击关闭退出层
$("#floatBox .title span").click(function(){
  //$("#floatBoxBg").animate({opacity:"0"},"normal",function(){$(this).hide();});
  //$("#floatBox").animate({top:($(document).scrollTop()-(height=="auto"?300:parseInt(height)))+"px"},"normal",function(){$(this).hide();}); 

  var _dialogIframe = document.getElementById("_dialogIframe");
  if(_dialogIframe){
      _dialogIframe.src = "";
  }
  
  var floatBox = document.getElementById("floatBox");
  window.document.body.removeChild(floatBox); 

  var floatBoxBg = document.getElementById("floatBoxBg");
  window.document.body.removeChild(floatBoxBg); 

  //document.getElementById("testcc").style.display="none"; 


  dialogFirst=true;

  if(isIe){
	setSelectState('');
	}


});

$("#floatBox .title h4").html(title);
contentType=content.substring(0,content.indexOf(":"));
content=content.substring(content.indexOf(":")+1,content.length);
switch(contentType){
  case "url":
		  var content_array=content.split("?");
		  $("#floatBox .content").ajaxStart(function(){
			$(this).html("loading...");
		  });
		  $.ajax({
			type:content_array[0],
			url:content_array[1],
			data:content_array[2],
			error:function(){
			  $("#floatBox .content").html("登录页面错误，请联系管理员。");
			},
			success:function(html){
			  $("#floatBox .content").html(html);
			}
		  });
		break;
  case "text":
		$("#floatBox .content").html(content);
		break;
  case "id":
		$("#floatBox .content").html($("#"+content+"").html());
		break;
  case "iframe":
		//$("#floatBox .content").html("<iframe src=\""+content+"\" width=\"100%\" height=\""+(parseInt(height)-30)+"px"+"\" scrolling=\"auto\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");
		$("#floatBox .content").html("<iframe id=\"_dialogIframe\" src=\""+content+"\" width=\"100%\" height=\""+(parseInt(height)-30)+"px"+"\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\"></iframe>");
}

$("#floatBoxBg").show();
$("#floatBoxBg").animate({opacity:"0.8"},"normal");
$("#floatBox").attr("class","floatBox "+cssName);
$("#floatBox").css({display:"block",left:(($(document).width())/2-(parseInt(width)/2))+"px",top:($(document).scrollTop()-(height=="auto"?300:parseInt(height)))+"px",width:width,height:height});
//$("#floatBox").css({display:"block", left:"50%", top:"50%", "margin-top":-(parseInt(height)/2)+"px", "margin-left":-(parseInt(width)/2)+"px", width:width, height:height}); //从下边出来
$("#floatBox").animate({top:($(document).scrollTop()+50)+"px"},"normal"); 
if(isIe){
	setSelectState('hidden');
	}
}

function changeAuthCode() {
	var num = 	new Date().getTime();
	var rand = Math.round(Math.random() * 10000);
	num = num + rand;
	if ($("#vdimgck")[0]) {
		$("#vdimgck")[0].src = "/include/vdimgck.php?tag=" + num;
	}
	return false;	
}

var isIe=(document.all)?true:false;
//设置select的可见状态
function setSelectState(state)
{
	var objl=document.getElementsByTagName('select');
	for(var i=0;i<objl.length;i++)
	{
	objl[i].style.visibility=state;
	}
}

function CheckStatus(){
	var taget_obj = document.getElementById('ajax_login');
	myajax = new DedeAjax(taget_obj,false,false,'','','');
	myajax.SendGet2("/member/ajax_checkstatus.php");
	DedeXHTTP = null;
}

function showMessageBox(wTitle,content,wWidth)
{
	closeWindow();
	var bWidth=parseInt(document.documentElement.scrollWidth);
	var bHeight=parseInt(document.documentElement.scrollHeight);
	var tm=parseInt(document.documentElement.scrollTop)+100;
	if(isIe){
		setSelectState('hidden');
	}
	var lp=(bWidth-wWidth)/2
	var back=document.createElement("div");
	back.id="back";
	var styleStr="top:0px;left:0px;position:absolute;background:#000;width:"+bWidth+"px;height:"+bHeight+"px;";
	styleStr+=(isIe)?"filter:alpha(opacity=80);":"opacity:0.80;";
	back.style.cssText=styleStr;
	document.body.appendChild(back);
	var mesW=document.createElement("div");
	mesW.id="mesWindow";
	mesW.className="mesWindow";
	mesW.innerHTML="<div class='mesWindowTop'><table width='100%' height='100%'><tr><td>"+wTitle+"</td><td style='width:1px;'><input type='button' onclick='closeWindow();' title='关闭窗口' class='close' value='关闭' /></td></tr></table></div><div class='mesWindowContent' id='mesWindowContent'>"+content+"</div><div class='mesWindowBottom'></div>";
	//styleStr="left:"+(((pos.x-wWidth)>0)?(pos.x-wWidth):pos.x)+"px;top:"+(pos.y)+"px;position:absolute;width:"+wWidth+"px;";
	styleStr="left:"+lp+"px;top:"+tm+"px;position:absolute;width:"+wWidth+"px;";
	mesW.style.cssText=styleStr;
	document.body.appendChild(mesW);
}

function showBackground(obj,endInt)
{
	obj.filters.alpha.opacity+=1;
	if(obj.filters.alpha.opacity<endInt)
	{
	setTimeout(function(){showBackground(obj,endInt)},8);
	}
}
//关闭窗口
function closeWindow()
{
if(document.getElementById('back')!=null)
{
document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
}
if(document.getElementById('mesWindow')!=null)
{
document.getElementById('mesWindow').parentNode.removeChild(document.getElementById('mesWindow'));
}
if(isIe){
	setSelectState('');
}
}
//测试弹出
function MessageBox(t,c)
{
	messContent="<div style='line-height:160%; padding-left:6px; color:#666; text-indent:2em;'>"+c+"</div>";
	showMessageBox(t,messContent,550);
}

function checkfabiao(){
 if(document.feedback.notuser.checked==true){
  document.getElementById("fabiao").style.display="none";
 }else{
  document.getElementById("fabiao").style.display="block";
 }
}


function checkregform(form)
	{
		if (form.userid.value=="")
		{
			alert("您必须输入用户名！");
			return false;
		}
		if (form.userpwd.value=="")
		{
			alert("您必须输入密码！");
			return false;
		}
		if (form.userpwd.value!=form.userpwdok.value)
			{
				alert("两次密码输入不一致！");
				return false;
			}
		if (form.email.value=="")
		{
			alert("您必须输入电子邮箱！");
			return false;
		}
		if (form.vdcode.value=="")
		{
			alert("您必须输入验证码！");
			return false;
		}
		return true;	
}

