 function swit(con)
{
// alert(tag);
// alert(content);
for(i=1; i <9; i++)
{

if ("con"+i==con)
{
	if ("con1"==con)
    {
      document.getElementById("con"+i).className="";
      document.getElementById("dh1").className="current2";
	}
	else
	{
		document.getElementById("con"+i).className="";
       document.getElementById("dh"+i).className="current";
	   document.getElementById("dh1").className="firstTab";
	}

}
else
{
document.getElementById("con"+i).className="hid";
document.getElementById("dh"+i).className="tabSplitLineRight";

}
document.getElementById("con").className=con;
}
}

function switt(cont)
{
// alert(tag);
// alert(content);
for(i=1; i <8; i++)
{

if ("cont"+i==cont)
{
document.getElementById(cont).className="";
document.getElementById("cont1"+i).className="on";
}else{
document.getElementById("cont"+i).className="hid";
document.getElementById("cont1"+i).className="";
}
document.getElementById("cont").className=cont;
}
}



function switchTaga(contenta)
{
// alert(tag);
// alert(content);
for(i=1; i <8; i++)
{

if ("contenta"+i==contenta)
{
document.getElementById(contenta).className="";
document.getElementById("contenta1"+i).className="on";
}else{
document.getElementById("contenta"+i).className="hidecontenta";
document.getElementById("contenta1"+i).className="";
}
document.getElementById("contenta").className=contenta;
}
}



function switchTagb(contentb)
{
// alert(tag);
// alert(content);
for(i=1; i <4; i++)
{

if ("contentb"+i==contentb)
{
document.getElementById(contentb).className="";
document.getElementById("contentb1"+i).className="on";
}else{
document.getElementById("contentb"+i).className="hidecontent";
document.getElementById("contentb1"+i).className="";
}
document.getElementById("contentb").className=contentb;
}
}

function switchTagc(contentc)
{
// alert(tag);
// alert(content);
for(i=1; i <8; i++)
{

if ("contentc"+i==contentc)
{
document.getElementById(contentc).className="";
document.getElementById("contentc1"+i).className="on";
}else{
document.getElementById("contentc"+i).className="hidecontent";
document.getElementById("contentc1"+i).className="";
}
document.getElementById("contentc").className=contentc;
}
}

function switchTagd(contentd)
{
// alert(tag);
// alert(content);
for(i=1; i <6; i++)
{

if ("contentd"+i==contentd)
{
document.getElementById(contentd).className="";
document.getElementById("contentd1"+i).className="on";
}else{
document.getElementById("contentd"+i).className="hidecontent";
document.getElementById("contentd1"+i).className="";
}
document.getElementById("contentd").className=contentd;
}
}





// 设置轮番显示速度 Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000;
// 匀滑转换时间 Duration of crossfade (seconds)
var crossFadeDuration = 3;
// 指定图像文件 Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below


Pic[0] = '../images/front/UploadFiles/01.jpg'		
Pic[1] = '../images/front/UploadFiles/02.jpg'		
Pic[2] = '../images/front/UploadFiles/03.jpg'	
Pic[3] = '../images/front/UploadFiles/04.jpg'		
// do not edit anything below this line
var j = 0;
var preLoad = new Array();
for (i = 0; i < Pic.length; i++) {
 preLoad[i] = new Image();
 preLoad[i].src = Pic[i];
}
function runSlideShow() {
 var SlideShow =document.getElementById("SlideShow");
 SlideShow.style.filter="blendTrans(duration=2)";
 SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
 
 if(SlideShow.filters){SlideShow.filters.blendTrans.Apply();}
 
 SlideShow.src = preLoad[j].src;
 
 if(SlideShow.filters){SlideShow.filters.blendTrans.Play();}
 
 j = j + 1;
 if (j > (Pic.length - 1)) j = 0;
 setTimeout('runSlideShow()', slideShowSpeed);
}


/*文本框下拉*/
  function showAndHide(obj,types){
    var Layer=window.document.getElementById(obj);
    switch(types){
  case "show":
    Layer.style.display="block";
	Layer.style.position="absolute";
  break;
  case "hide":
    Layer.style.display="none";
  break;
}
  }
  function getValue(obj,str){
    var input=window.document.getElementById(obj);
input.value=str;
  }
  


  
  // --列头全选框被单击---
function ChkAllClick(sonName, cbAllId){
    var arrSon = document.getElementsByName(sonName);
 var cbAll = document.getElementById(cbAllId);
 var tempState=cbAll.checked;
 for(i=0;i<arrSon.length;i++) {
  if(arrSon[i].checked!=tempState)
           arrSon[i].click();
 }
}

// --子项复选框被单击---
function ChkSonClick(sonName, cbAllId) {
 var arrSon = document.getElementsByName(sonName);
 var cbAll = document.getElementById(cbAllId);
 for(var i=0; i<arrSon.length; i++) {
     if(!arrSon[i].checked) {
     cbAll.checked = false;
     return;
     }
 }
 cbAll.checked = true;
}

// --反选被单击---
function ChkOppClick(sonName){
 var arrSon = document.getElementsByName(sonName);
 for(i=0;i<arrSon.length;i++) {
  arrSon[i].click();
 }
}


/*
* 功能：使表格每行随鼠标的移动改变颜色
*/
function DreamduColorRows()
{
var dreamdurows = document.getElementsByTagName('tr');
for ( var i = 0; i < dreamdurows.length; i++ )
{
if ( 'dreamdu' != dreamdurows[i].className.substr(0,7) )
{
continue;
}
if ( navigator.appName == 'Microsoft Internet Explorer' )
{
// ie不支持 :hover，所以...
dreamdurows[i].onmouseover = function()
{
this.className += ' hover';
}
dreamdurows[i].onmouseout = function()
{
this.className = this.className.replace( ' hover', '' );
}
}
}
}
window.onload=DreamduColorRows;


function w(vd)
{
  if(vd=="bm1")
  {
	  var bm1 = $('#bm1');
	  var bm2 = $('#bm2');
	  bm1.css('display','block');
	  bm2.css('display','none');
//	  bm1.style.display="block";
//	  bm2.style.display="none";
  }
  else
  {
	  var bm1 = $('#bm1');
	  var bm2 = $('#bm2');
	  bm1.css('display','none');
	  bm2.css('display','block');
//	  bm1.style.display="none";
//	  bm2.style.display="block";
  }
  
}

function calculate(vd)
  {
	var ob=document.getElementById(vd);
	if(ob.style.display=="block" || ob.style.display=="")
	{
	   ob.style.display="none";
	}
	else
	{
	  ob.style.display="block";
	}
  }


/*在线询价*/
function online(vd)
{
  if(vd=="onl1")
  {
	  $('#onl1').css('display','block');
	  $('#onl2').css('display','none');
	  $('#onl3').css('display','none');
  }
  else
  {   if(vd=="onl2")
      {
	  $('#onl1').css('display','none');
	  $('#onl2').css('display','block');
	  $('#onl3').css('display','none');
	  }
	  else
	  {
	  $('#onl1').css('display','none');
	  $('#onl2').css('display','none');
	  $('#onl3').css('display','block'); 
	  }
  }
  
}

	
/*登录弹出*/
/*
$(function(){
   $("#login_btnShow").click(function(){
      $("#login_BgDiv").css({ display:"block",height:$(document).height()});
      var yscroll=document.documentElement.scrollTop;
      $("#login_DialogDiv").css("top","100px");
      $("#login_DialogDiv").css("display","block");
      document.documentElement.scrollTop=0;
   });
   $("#login_btnClose").click(function(){
      $("#login_BgDiv").css("display","none");
      $("#login_DialogDiv").css("display","none");
   });
   $('input[type=radio]').click(function(){
		var val = $('input[type=radio][checked]').val();
		if(val!=3)
		{
			$('#com').hide();
		}
		alert($('input[type=radio][checked]').val());
   });
//	alert($('input[type=radio][checked]').val());
});	*/
	
	
$(function(){
   $("#btnShow").click(function(){
	   $("#comp").css("display","none");
	   $("#passw").css("display","block");
	   $("#cphone").css("display","none");
	   $("#cmail").css("display","none");
	   $("#btnShow").addClass("on");
	   $("#com1").removeClass("on");
	   $("#else").removeClass("on");
	   $("#explain").removeClass("on");
     /* $("#BgDiv").css({ display:"block",height:$(document).height()});
      var yscroll=document.documentElement.scrollTop;
      $("#DialogDiv").css("top","100px");
      $("#DialogDiv").css("display","block");
      document.documentElement.scrollTop=0;*/
   });
   /*
   $("#btnClose").click(function(){
      $("#BgDiv").css("display","none");
      $("#DialogDiv").css("display","none");
   });*/
});

//手机号码
$(function(){
   $("#else").click(function(){
	   $("#comp").css("display","none");
	   $("#passw").css("display","none");
	   $("#cphone").css("display","block");
	   $("#cmail").css("display","none");
	   $("#btnShow").removeClass("on");
	   $("#com1").removeClass("on");
	   $("#else").addClass("on");
	   $("#explain").removeClass("on");
	   /*
      $("#ElseDiv").css({ display:"block",height:$(document).height()});
      var yscroll=document.documentElement.scrollTop;
      $("#DialogElse").css("top","100px");
      $("#DialogElse").css("display","block");
      document.documentElement.scrollTop=0;*/
   });
   /*
   $("#ElseClose").click(function(){
      $("#ElseDiv").css("display","none");
      $("#DialogElse").css("display","none");
   });*/
});

//电子邮件
$(function(){
   $("#explain").click(function(){
	   $("#comp").css("display","none");
	   $("#passw").css("display","none");
	   $("#cphone").css("display","none");
	   $("#cmail").css("display","block");
	   $("#btnShow").removeClass("on");
	   $("#com1").removeClass("on");
	   $("#else").removeClass("on");
	   $("#explain").addClass("on");
	   /*
      $("#BZDiv").css({ display:"block",height:$(document).height()});
      var yscroll=document.documentElement.scrollTop;
      $("#DialogBZ").css("top","100px");
      $("#DialogBZ").css("display","block");
      document.documentElement.scrollTop=0;*/
   });
   /*
   $("#BZClose").click(function(){
      $("#BZDiv").css("display","none");
      $("#DialogBZ").css("display","none");
   });*/
});

$(function(){
	function warning(obj,msg)
	{
		obj.show();
		obj.html(msg);
		obj.fadeOut(3000);
	}
	var mshow = $('#msg');
	$('#shift').click(function(){
		var oper = $('#oper option:selected');
		if(oper.val())
		{
			var opid = oper.val();
			var mem_id = $('#member_id').val();
//			alert(mem_id);
//			return false;
			 $.ajax({
				    type:"POST",
				    url:"/admin/walkthrough/handle/staffshift",
				    data:{"staff_id":opid,"mem_id":mem_id},
				    error:function(XMLResponse){
				    	alert(XMLResponse.responseText);
			   			return false;
				    },
				    success:function(data){
					    if(data==1){   
				 			warning(mshow,'分配成功');
							$('#shift').attr('disabled','disabled');
				 			window.setTimeout("location.href='/admin/walkthrough/handle/visit'",2000);
					    }
					    if(data==2){   
				 			warning(mshow,'分配修改成功');
							$('#shift').attr('disabled','disabled');
				 			window.setTimeout("location.href='/admin/walkthrough/handle/visit'",2000);
					    }
				    }
			 });
		}else{
			warning(mshow,'请选择操作人员');
			return false;
		}
	});
});

DD_belatedPNG.fix('.main_con,.main_top400');

