   $("#affi_li > a").click(function (e,ui) {
   	                $("select").hide();//隐藏select标签
                $("object").hide();//隐藏flash控件
   	        $("#affidiv").show();    
                $("#affidiv").dialog({ modal: true, 
                                        overlay: { opacity: 0.5, background: "black" },
                                        width:550,
                                        height:350,
                                        dialogClass:'dialog'
                });

     })
            //点击布局选择框右上角关闭按钮
       $("#affix_close_button").click(function(e,ui){
            window.location.reload();
        }) 
        
        
        
        
         $("#afsave").click(function(e,ui){         	
      var   formObj=document.getElementsByName('affixDis');    
      var tempSel="";
      var checkboxidstr="";
      var checkturn="";
      var checkSel="";
	  for (i=0; i< formObj.length;i++)
	  {	  
	  	 
		if (formObj.item(i).checked == true)
			{
			tempSel = tempSel +formObj.item(i).value+",";				    
			checkboxidstr=tempSel.substring(0,tempSel.length-1);			 						
			}else{
			checkSel = checkSel +formObj.item(i).value+",";				    
			checkturn=checkSel.substring(0,checkSel.length-1);	
			}
	 }	
   
		 if(checkboxidstr!=""){
         		$.ajax({
                type: "POST",
                url: "/advertising/adcouplet/editturn",
                data: "turndown=1&&id="+checkboxidstr,
                success: function(msg){                    
                    $("#affidiv").dialog("close");
                    window.location.reload();
                }
            });        	
		 }
	   if(checkturn!=""){
		$.ajax({
                type: "POST",
                url: "/advertising/adcouplet/editturn",
                data: "turndown=0&&id="+checkturn,
                success: function(msg){                    
                    $("#affidiv").dialog("close");
                    window.location.reload();
                }
            });     
	      }
	    }           
         
        
        )
