  var starvalue=0;
    var choujianginterval=0;
      var  j=0;
      var quanju=0;
      var data1;
      function choujiang(){
       //  $("div.content a.btn")[0].href="javascript:void(0);";
       
         if(j==11){
            j=1;
         }	
         if(quanju==15){
               //关闭定时器
               // $("div.content a.btn").attr("href",'javascript:hanlder();');
               // $("#btn").bind("click",hanlder);
              
                window.clearInterval(choujianginterval);
                choujianginterval=0;
                // $("div.content a.btn")[0].href="javascript:hanlder();";
                
               //去除定时器关闭时留下的样式
                 $(".gifts .content .gift").each(function(i){
		            if($(this).hasClass("gift-hover")){
		               $(this).removeClass('gift-hover');
		            }
	             });
		         //对总数计数器清0
				 var datainfo=eval("("+data1+")");
			
			if((datainfo.status!=3)&&(datainfo.status!=4)){ 
			     $("#remainstarcount").text(datainfo.remainstarcount);
				 $("#oldstarcount").val(datainfo.remainstarcount);
			}
				
				if(datainfo.status==1){
				   movement_frame_show(2);
				}else if(datainfo.status==0){ 
				  alert('系统出现异常!');
				}else if(datainfo.status==3){ 
				     $("input[type=radio]").each(function(){
			            $(this)[0].checked=false;
			         });
				    alert('每位只能获取两张门票!');
				    $("#btn").attr("disabled",false);
                    $("#btn").attr("class","btn left");
                    quanju=0;
				}
				else if(datainfo.status==4){ 
				     $("input[type=radio]").each(function(){
			            $(this)[0].checked=false;
			         });
				    alert('门票已抽完!');
				    $("#btn").attr("disabled",false);
                    $("#btn").attr("class","btn left");
                    quanju=0;
				}
				else if(datainfo.status==2){
			                 $("input[type=radio]").each(function(){
					            $(this)[0].checked=false;
					         });
						         
				            var loginObj = $('.common-frame');
							loginObj.remove();
							mask_hide();
							var html = "";
							//获得的奖品-有
							
							html ="<div class=\"common-frame movement\">";
							html +="<div class=\"inner\">";
							html +="<div class=\"title1\"> <span>中奖啦</span><a href=\"#\"></a> </div>";
							html +="<div class=\"resend\">";
							html +="<form>";
							html +="<ul>";
							if(datainfo.rewardstr==300){
							    html +="<li class='succ'><span>恭喜！</span>您本次消耗<span>"+datainfo.starcount+"</span>个音符获得<label>门票两张</label></li>";
								html +="<li class=\"btn\"><a href=\"#\">确定</a>";
								html +="</li>";
							}else{
								html +="<li class='succ'><span>恭喜！</span>您本次消耗<span>"+datainfo.starcount+"</span>个音符获得<label>"+datainfo.rewardstr+"元话费</label></li>";
								html +="<li class=\"btn\"><a href=\"#\">确定</a>";
								html +="</li>";
							}
							html +="</ul>";
							html +="</form>";
							html +="<div class=\"clear\"></div>";
							html +="</div>";
							html +="</div>";
							html +="</div>";
		
							$('body').append(html);
							
							  
							
							var loginObj = $('.common-frame');
							var maskObj = mask_show();
							if(loginObj.length > 0 && maskObj){
								loginObj.show();
								loginObj.css({'position':'absolute'});
								centerObj(loginObj);
									//关闭
								loginObj.find('.title1').find('a').bind('click',function(){
									loginObj.remove();
									mask_hide();
									
									 $("#btn").attr("disabled",false);
			                          $("#btn").attr("class","btn left");
			                             quanju=0;
			                             
			                             
									return false;
								});
								//关闭
								loginObj.find('.btn').find('a').bind('click',function(){
									loginObj.remove();
									mask_hide();
									
									  $("#btn").attr("disabled",false);
			                          $("#btn").attr("class","btn left");
			                             quanju=0;
			         
									return false;
								});
								//滚动居中
								$(window).scroll(function(){
									centerObj(loginObj);
								});
							}
							else{
								mask_hide();
							}  
				}
			
         }else{
                var bool1=false;
         		$("input[type=radio]").each(function(){
			       if(this.checked){
			       bool1=true;
			         
			       }
			     });
			     if(bool1){
			         quanju++;
                      j++;
			            if(j==1){
					         if($("#selectindex_10").hasClass("gift-hover")){
					            $("#selectindex_10").removeClass('gift-hover');
					         }
				             $("#selectindex_"+j).addClass("gift-hover");
				         }else{
				              $("#selectindex_"+j).addClass("gift-hover");
				              $("#selectindex_"+(j-1)).removeClass('gift-hover');
				         }
			     }else{
			
			     if(choujianginterval){
			       window.clearInterval(choujianginterval);
			       choujianginterval=0;
			     }
			     
			     }
		         
        		}
      }
      
//查看我获得的奖品
function getgift(){
				   var url='party!getgift.action';
					$.post(url,function(data){
						if(data==0){
						   movement_frame_show(4);
						}else{
					        var loginObj = $('.common-frame');
							loginObj.remove();
							mask_hide();
							var html = "";
							//获得的奖品-有
							html ="<div class=\"common-frame movement\">";
							html +="<div class=\"inner\">";
							html +="<div class=\"title1\"> <span>我获得的奖品</span><a href=\"#\"></a> </div>";
							html +="<div class=\"resend\">";
							html +="<form>";
							html +="<ul>";
							html+=data;
							html +="<li class=\"btn\"><a href=\"#\">确定</a>";
							html +="</li>";
							html +="</ul>";
							html +="</form>";
							html +="<div class=\"clear\"></div>";
							html +="</div>";
							html +="</div>";
							html +="</div>";
							$('body').append(html);
							var loginObj = $('.common-frame');
							var maskObj = mask_show();
							if(loginObj.length > 0 && maskObj){
								loginObj.show();
								loginObj.css({'position':'absolute'});
								centerObj(loginObj);
									//关闭
								loginObj.find('.title1').find('a').bind('click',function(){
									loginObj.remove();
									mask_hide();
									return false;
								});
								//关闭
								loginObj.find('.btn').find('a').bind('click',function(){
									loginObj.remove();
									mask_hide();
									return false;
								});
								//滚动居中
								$(window).scroll(function(){
									centerObj(loginObj);
								});
							}
							else{
								mask_hide();
							}
						}
					});
			
	}
	
	
      
    
      function hanlder(){
        alert('本活动已经结束!');
return;
       var url = "memberShare!flexmusic.action";
			$.post(encodeURI(url),function(data){
			 if(data==1){
					 var bool=false;
			     $("input[type=radio]").each(function(){
			       if(this.checked){
			          bool=true;
			          starvalue=$(this).val();
			       }
			     });
			     if(!bool){
			       alert('请选择要投入的音符!');
			       return;
			     }else{
			      if(choujianginterval==0){
					       var url='party!lottery.action?partyBasedateId='+starvalue+'&random='+Math.random();
						     $.post(url,function(data){
						         data1=data;
						          $("#btn").attr("disabled",true);
					             $("#btn").attr("class","btn hover left");
					            
					           
							});
			                 choujianginterval=setInterval("choujiang()",100);
			             }
			        
				
				
			        // $("#btn").unbind("click",hanlder);
			        
			        // .attr("href",'javascript:void(0);');
			     }
			 }else{
			    movement_frame_show(0);
			    }
			});
	     
    
      }
      
 
   function getinvite(){
   alert('本活动已经结束!');
return;
            var url = "memberShare!flexmusic.action";
			$.post(encodeURI(url),function(data){
			    if(data=='1'){
			         var url='party!getInvite.action?random='+Math.random();
					$.post(url,function(data){
					if(data.length>3){
					     $("#contentid").val("http://www.cooling8.com/party.action?invitenumber="+data);
					}else if(data==1){
					   alert('你已经产生过推荐链接了!');
					}else{
					    alert('链接生成失败!');
					}
					  
					});
			    }else{
			    movement_frame_show(0);
			    }
			});
	       
	   }
	   
function movement_frame_show(tag){
alert('本活动已经结束!');
return;
	var loginObj = $('.common-frame');
	loginObj.remove();
	mask_hide();
	var html = "";
	if(tag == 0){
		//登陆提示
		html ="<div class=\"common-frame movement\">";
		html +="<div class=\"inner\">";
		html +="<div class=\"title1\"> <span>提示</span><a href=\"#\"></a> </div>";
		html +="<div class=\"resend\">";
		html +="<form>";
		html +="<ul>";
		html +="<li class=>您还没登录，请先<a href='#' onclick=\"javascript:frame_show(0);\">登录</a>；没有酷乐帐号？<a href='#' onclick=\"javascript:frame_show(1);\">马上注册</a></li>";
		html +="<li class=\"btn\"><a href=\"#\">确定</a>";
		html +="</li>";
		html +="</ul>";
		html +="</form>";
		html +="<div class=\"clear\"></div>";
		html +="</div>";
		html +="</div>";
		html +="</div>";
	}else if(tag == 2){
	
	   $("input[type=radio]").each(function(){
            $(this)[0].checked=false;
         });
         
           
						         
		//失败提示
		html ="<div class=\"common-frame movement\">";
		html +="<div class=\"inner\">";
		html +="<div class=\"title1\"> <span>中奖啦</span><a href=\"#\"></a> </div>";
		html +="<div class=\"resend\">";
		html +="<form>";
		html +="<ul>";
		html +="<li class='fail'>很遗憾，您本次抽奖什么也没有得到，继续努力吧！</li>";
		html +="<li class=\"btn\"><a href=\"#\">确定</a>";
		html +="</li>";
		html +="</ul>";
		html +="</form>";
		html +="<div class=\"clear\"></div>";
		html +="</div>";
		html +="</div>";
		html +="</div>";
		
		
			         
	}
	else if(tag == 3){
		//获得的奖品-有
		html ="<div class=\"common-frame movement\">";
		html +="<div class=\"inner\">";
		html +="<div class=\"title1\"> <span>我获得的奖品</span><a href=\"#\"></a> </div>";
		html +="<div class=\"resend\">";
		html +="<form>";
		html +="<ul>";
		
		html +="<li class=\"btn\"><a href=\"#\">确定</a>";
		html +="</li>";
		html +="</ul>";
		html +="</form>";
		html +="<div class=\"clear\"></div>";
		html +="</div>";
		html +="</div>";
		html +="</div>";
	}
	else if(tag == 4){
		//获得的奖品-无
		html ="<div class=\"common-frame movement\">";
		html +="<div class=\"inner\">";
		html +="<div class=\"title1\"> <span>我获得的奖品</span><a href=\"#\"></a> </div>";
		html +="<div class=\"resend\">";
		html +="<form>";
		html +="<ul>";
		html +="<li class='gift'>您目前还没有中奖记录，努力吧！</li>";
		html +="<li class=\"btn\"><a href=\"#\">确定</a>";
		html +="</li>";
		html +="</ul>";
		html +="</form>";
		html +="<div class=\"clear\"></div>";
		html +="</div>";
		html +="</div>";
		html +="</div>";
	}
	$('body').append(html);
	var loginObj = $('.common-frame');
	var maskObj = mask_show();
	if(loginObj.length > 0 && maskObj){
		loginObj.show();
		loginObj.css({'position':'absolute'});
		centerObj(loginObj);
		//关闭
		loginObj.find('.title').find('a').bind('click',function(){
			loginObj.remove();
			mask_hide();
			return false;
		});
		//关闭
		loginObj.find('.title1').find('a').bind('click',function(){
			loginObj.remove();
			mask_hide();
			///////////////////////////
			if(tag==2){
			quanju=0;
			  $("input[type=radio]").each(function(){
						            $(this)[0].checked=false;
						         });
						         
			$("#btn").attr("disabled",false);
			         $("#btn").attr("class","btn left");
			}
			
			////////////////////////////
			return false;
		});
		//关闭
		loginObj.find('.btn').find('a').bind('click',function(){
			loginObj.remove();
			mask_hide();
			///////////////////////
			if(tag==2){
			quanju=0;
			  $("input[type=radio]").each(function(){
						            $(this)[0].checked=false;
						         });
						         
			$("#btn").attr("disabled",false);
			         $("#btn").attr("class","btn left");
			}
			/////////////////////////
			return false;
		});
		//滚动居中
		$(window).scroll(function(){
			centerObj(loginObj);
		});
	}
	else{
		mask_hide();
	}
}

$(document).ready(function(){
   // setInterval(login_tips,30000);
});

function login_tips(){
   var logins=$('.login-tips');
   if(logins.length==0){
		   var html = '';
			html +="<div id='abc' class=\"login-tips\">";
			html +="<div class=\"info\">";
			var url='tips.action';
			$.post(url,function(data){
			if(data!=""&&$.trim(data).length>0){
				html +=data;
			  	html +="</div>";
				html +="<div class=\"ctrl\"><a href=\"#\"></a></div>";
				html +="<div class=\"clear\"></div>";
				html +="</div>";
				$('body').append(html);
				var d1 = $('.top .body').width() - $('.login-tips').innerWidth();
				$('.login-tips').css({top:($(document).scrollTop()+ 10),left:($('.top .body').offset().left + d1)});
				$('.login-tips').css({position:'absolute'});
				$('.login-tips').find('.ctrl').find('a').bind('click',function(){
				
				var url1="tips!updateEnabled.action";
				$.post(url1,function(data){
					if(data==0){
						$('.login-tips').remove();
						return false;
					}
				});
				
				});
			}
			});
   }
	//html +="<ul>";
	//$.each(tips,function(){
	//	html +="<li>"+this.text+"<a href=\""+this.linkHref+"\">"+this.linkText+"</a></li>";
	//});
	//html +="</ul>";
	$(window).scroll(function(){
		$('.login-tips').css({top:($(document).scrollTop()+ 10)});
	});
}

/***黑底插件******************/
function mask_show(){
	var bodyObj = $('body');
	var rnd = Math.ceil(Math.random() * 100000);
	var html = "<div id=\""+rnd+"\"></div>";
	bodyObj.append(html);
	
	var maskObj = $('#'+rnd);
	if(maskObj.length > 0){
		maskObj.addClass('mask');
		maskObj.show();
		maskObj.width($(document).width());
		maskObj.height($(document).height());
		maskObj.css({left:0,top:0});	
		$(window).resize(function(){  
			var obj = $(".mask");
			obj.each(function(){
				if($(this).css('display') == 'block'){
					$(this).width($(document).width());
					$(this).height($(document).height());
					$(this).css({left:0,top:0});
				}
			});
		});
		//maskObj.bgiframe();
		return maskObj;
	}
	else{
		return false;
	}
}
function mask_hide(){
	var obj = $(".mask");
	if(obj.length > 0){
		obj.each(function(){
			$(this).remove();
		});
	}
}

      function checkuseremail(){
			var email = document.getElementById("email").value;
			if(''!=email){
				var url = "../../memberShare!ajaxCheckUserEmail.action?emailinfo="+email;
				$.post(encodeURI(url),function(data){
					if(data=='0'){
					    alert('该邮箱已经存在！');
					    document.getElementById("email").value='';
					    document.getElementById("email").focus();
					    return false;
					}else{
					  return true;
					}
				});
			}
		}
		
	function checkcode(){
	    var kehucode=$("#kehucode").val();
           var url='../../getCode.do?checkcode=y&kehucode='+kehucode;
		$.post(encodeURI(url),function(data){
			if(data<0){
				alert('验证码错误！'); 
				document.getElementById("kehucode").value='';
				//document.getElementById("kehucode").focus();
				return false;
			}else{
			  bool=true;
			}
		});
	}
		
function checkall(){
        var email=$("#email").val();
        var nickname=$("#nickname").val();
        var password1=$("#password1").val();
        var password2=$("#password2").val();
        var phone=$("#phone").val();
        var inviteuser=$("#inviteuser").val();
        var kehucode=$("#kehucode").val();
             var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
               var phonereg = /^1[3|4|5|8][0-9]\d{4,8}$/;
	      var bool = reg.test(email);
	        var bool1 = phonereg.test(phone);

         if(email==""){
	       alert("请填写你的邮箱！");
	       return false;
         }
	     else if(email!=''&&bool == false){
	          alert("邮箱格式错误！");
		       return false;
	     }
        else if(nickname==""){
       alert("请填写你的昵称！");
       return false;
      }
      else if(password1==""){
       alert("请填写你的密码！");
       return false;
      }
        else if(password1.length<6){
       alert("密码不能小于六位！");
       return false;
      }
      
       else  if(password2==""){
       alert("请填写你的确认密码！");
       return false;
      }
       else  if(password2.length<6){
       alert("确认密码不能小于六位！");
       return false;
      }
      else if(password1!=password2){
        alert("密码不一致！");
        return false;
      }
   
       else if(phone!=""&&bool1==false){
       alert("手机号码有误！");
       return false;
      }
     
      else if(kehucode==""){
       alert("验证码不能为空！");
       return false;
      }
     else
     {
       var bool=false;
        var url='../../memberShare!register.action?'+$("#form1").serialize();
			$.post(url,function(data){
			if(data==0){
			bool=true;
				alert('注册成功,会员激活后才可使用!');
				var loginObj = $('.common-frame');
				loginObj.remove();
			   mask_hide();
			 //  frame_show(0);
				
			}else if(data==2){
			  alert('邮箱重复,请重试!');
			}
			else if(data==3){
			  alert('验证码错误,请重试!');
			}
			else{
			    alert('注册失败,请重试');
			   
			}
		});
		return bool;
      }
    }
    
 function changecode(){
 var time=(new Date()).getTime();
   $("#codeimg").attr("src","../../CaptchaImg.jpg?t="+time);
 }

function userLogin()
{
	var uid=document.getElementById("uid").value;
	var upwd=document.getElementById("upwd").value;
	
	if(uid=="")
	{
		alert("请输入电子邮箱！");
		return false;
	}
	else if(upwd=="")
	{
		alert("请输入密码！");
		return false;
	}
	else
	{
	  var bool=false;
	  //alert($("#formlogin").serialize());
	   var url='../../memberShare!logindiv.action?'+$("#formlogin").serialize();
	    $.post(url,function(data){
			if(data==0){
			  bool=true;
				//alert('登陆成功！');
				     var urlnickname='../../memberShare!refreshusername.action?';
	                  $.post(encodeURI(urlnickname),function(data){
	                     // $(".logininfo").html(data);
	                      $("#logindivid").html(data);
	                  });
	                  var login3=$(".login3");
	                  if(login3.length>0){
                          var urldiv='../../memberShare!refrediv.action?';
		                  $.post(encodeURI(urldiv),function(data){
		                        login3.html(data);
		                  });
	                  }
	                  var loginreadydiv=$("#loginreadydiv");
	                  if(loginreadydiv.length>0){
	                  var urldiv='../../memberShare!refrediv1.action?';
		                  $.post(encodeURI(urldiv),function(data){
		                        loginreadydiv.html(data);
		                  });
	                  }
	                  
	                  var toupiao=$("#toupiao");
	                  if(toupiao.length>0){
	                     window.frames["voteiframe"].location.reload();
	                  }
	                  var login1=$(".login1");
	                  var comment=$(".comment");
	                  comment.show();
	                  login1.hide();
	                   				
				var loginObj = $('.common-frame');
				 loginObj.remove();
			   mask_hide();
			   if($("#denglubiaoshi").val()==1){
			     window.location.reload();
			   }
			  
			}else{
			    document.getElementById("spanerror").style.display="block";
			    document.getElementById("spanfalse").style.display="block";
			   
			   // alert('登陆失败,请重试');
			   // return false;
			}
		});
		
		return bool;
	}
}

function rememberme(obj){
if(obj.checked){
   $('#rememberpasword').val('1');
}else{
  $('#rememberpasword').val('0');
}

}


function rememberme1(obj){
if(obj.checked){
   $('#rememberpasword1').val('1');
}else{
  $('#rememberpasword1').val('0');
}

}

/***评论和分享**************/
function frame_show3(tag,obj,methodname,valuename,currenturl){
 var url = "../../memberShare!flexmusic.action";
	$.post(encodeURI(url),function(data){
		if(data=='1'){
		if(tag==1){
		        var textLimit = 200;
				html ="<div class=\"common-frame \" >";
				html +="<div class=\"inner\">";
				html +="<div class=\"title1\">";
				html +="<span>转发到我的空间</span><a href=\"#\"></a>";
				html +="</div>";
				html +="<div class=\"resend\">";
				html +="<form>";
				html +="<ul>";
				html +="<li class=\"text\"><span>转：</span>"+valuename+"";
				html +="</li>";
				html +="<li class=\"inputtips\">还可以输入<span>"+textLimit+"</span>字</li>";
				html +="<li>";
				html +="<textarea id=\"sharecontent\">"+valuename+"    "+(currenturl==""?window.location.href:currenturl)+"</textarea>";
				html +="</li>";
				html +="<li><input type=\"checkbox\" id=\"addcomment\"/>同时评论给 "+valuename+"</li>";
				html +="<li class=\"btn\"><a href=\"javascript:"+methodname+"("+obj+");\">转发</a><a href=\"\" class=\"close\">取消</a></li>";
				html +="</ul>";
				html +="</form>";
				html +="<div class=\"clear\"></div>";
				html +="</div>";
				html +="</div>";
				html +="</div>";
				$('body').append(html);
				
				var loginObj = $('.common-frame');
				var maskObj = mask_show();
				if(loginObj.length > 0 && maskObj){
					loginObj.show();
					loginObj.css({'position':'absolute'});
					centerObj(loginObj);
					//关闭
					loginObj.find('.title1').find('a').bind('click',function(){
						loginObj.remove();
						mask_hide();
						return false;
					});
					//关闭
					loginObj.find('.close').bind('click',function(){
						loginObj.remove();
						mask_hide();
						return false;
					});
					
					//滚动居中
					$(window).scroll(function(){
						centerObj(loginObj);
					});
					
					//字数
					var wordTips = loginObj.find('.inputtips').find('span');
					loginObj.find('textarea').bind('keydown',function(){
						if((textLimit - $(this).val().length) > 0){
							wordTips.html(textLimit - $(this).val().length);
						}
						else{
							wordTips.html(0);
							$(this).val($(this).val().substr(0,textLimit));
						}
					});
					loginObj.find('textarea').bind('keyup',function(){
						if((textLimit - $(this).val().length) > 0){
							wordTips.html(textLimit - $(this).val().length);
						}
						else{
							wordTips.html(0);
							$(this).val($(this).val().substr(0,textLimit));
						}
					});
				}
				else{
					mask_hide();
				}
			}
		}else{
		    frame_show(0);
		}
		
	});
}

/***评论和分享**************/
function frame_show1(tag,obj,methodname){
 var url = "../../memberShare!flexmusic.action";
	$.post(encodeURI(url),function(data){
		if(data=='1'){
		       var loginObj = $('.common-frame');
				loginObj.remove();
				mask_hide();
				var html = "";
				//评论
				if(tag == 0){
				    var textLimit = 200;
					html ="<div class=\"common-frame \" >";
					html +="<div class=\"inner\">";
					html +="<div class=\"title1\">";
					html +="<span>评论</span><a href=\"#\"></a>";
					html +="</div>";
					html +="<div class=\"resend\">";
					html +="<form>";
					html +="<ul>";
					
					html +="<li class=\"inputtips\">还可以输入<span>"+textLimit+"</span>字</li>";
					html +="<li>";
			
					html +="<textarea id=\"commentcontent\"></textarea>";
					
					html +="</li>";
					html +="<li class=\"btn\"><a href=\"javascript:"+methodname+"("+obj+");\">评论</a><a href=\"\" class=\"close\">取消</a></li>";
					html +="</ul>";
					html +="</form>";
					html +="<div class=\"clear\"></div>";
					html +="</div>";
					html +="</div>";
					html +="</div>";
					$('body').append(html);
					
					var loginObj = $('.common-frame');
					var maskObj = mask_show();
					if(loginObj.length > 0 && maskObj){
						loginObj.show();
						loginObj.css({'position':'absolute'});
						centerObj(loginObj);
						//关闭
						loginObj.find('.title1').find('a').bind('click',function(){
							loginObj.remove();
							mask_hide();
							return false;
						});
						
							//关闭
						loginObj.find('.close').bind('click',function(){
							loginObj.remove();
							mask_hide();
							return false;
						});
						
						//滚动居中
						$(window).scroll(function(){
							centerObj(loginObj);
						});
						
						//字数
						var wordTips = loginObj.find('.inputtips').find('span');
						loginObj.find('textarea').bind('keydown',function(){
							if((textLimit - $(this).val().length) > 0){
								wordTips.html(textLimit - $(this).val().length);
							}
							else{
								wordTips.html(0);
								$(this).val($(this).val().substr(0,textLimit));
							}
						});
						loginObj.find('textarea').bind('keyup',function(){
							if((textLimit - $(this).val().length) > 0){
								wordTips.html(textLimit - $(this).val().length);
							}
							else{
								wordTips.html(0);
								$(this).val($(this).val().substr(0,textLimit));
							}
						});
					}
					else{
						mask_hide();
					}
				//分享
				}else if(tag == 1){
				
				}
		}else{
		    frame_show(0);
		}
		
	});
}

//转发
function frame_show2(tag,obj,content){
 var url = "memberShare!flexmusic.action";
	$.post(encodeURI(url),function(data){
		if(data=='1'){
		       var loginObj = $('.common-frame');
				loginObj.remove();
				mask_hide();
				var html = "";
				//
			    if(tag == 0){
			  
				html +="<div class=\"common-frame checkin\">";
					html +="<div class=\"inner\">";
					html +="<div class=\"title\">";
					html +="<p><a href=\"#\"></a></p>";
					html +="</div>";
					html +="<div class=\"tips\">还没有开通您的酷乐帐号？<a href=\"#\" onclick=\"javascript:frame_show(1);\">马上注册</a></div>";
					html +="<div class=\"submit\">";
					html +="<form onsubmit=\"return userLogin();\" method=\"post\" id=\"formlogin\">";
					html +="<input type=\"hidden\" id=\"rememberpasword\" value=\"0\" name=\"rememberpasword\"/>";
					html +="<ul>";
					html +="<li>";
					html +="<span>内容</span><textarea rows=\"5\" cols=\"20\" id=\"forwardcontent\">"+content+"//</textarea>";
					html +="</li>";
					html +="<li class=\"extra\">";
					html +="<span></span><input type=\"checkbox\"  onclick=\"rememberme(this);\"/><span>记住密码</span><a href=\"memberShare!tofindpassword.action\">找回密码</a>";
					html +="</li>";
					html +="<li class=\"btn\">";
					html +="<span></span><img src=\"../../images/btn_login_submit.gif\" onclick=\"forwardmehtod("+obj+");\"/>";
					html +="</li>";
					html +="</ul>";
					html +="</form>";
					html +="</div>";
					html +="</div>";
					html +="</div>";
				}
			
				$('body').append(html);
				var loginObj = $('.common-frame');
				var maskObj = mask_show();
				if(loginObj.length > 0 && maskObj){
					loginObj.show();
					loginObj.css({'position':'absolute'});
					centerObj(loginObj);
					
					//关闭
					loginObj.find('.title').find('a').bind('click',function(){
						loginObj.remove();
						mask_hide();
					});
					//滚动居中
					$(window).scroll(function(){
						centerObj(loginObj);
					});
				}
				else{
					mask_hide();
				}
		}else{
		    frame_show(0);
		}
	});
	
}

function frame_show4(tag,obj,content,username,title,sourcecontent,obj1,typename){
 var url = "memberShare!flexmusic.action";
	$.post(encodeURI(url),function(data){
		if(data=='1'){
			        var textLimit = 200;
					html ="<div class=\"common-frame \" >";
					html +="<div class=\"inner\">";
					html +="<div class=\"title1\">";
					html +="<span>转发到我的空间</span><a href=\"#\"></a>";
					html +="</div>";
					html +="<div class=\"resend\">";
					html +="<form>";
					html +="<ul>";
					html +="<li class=\"text\"><span>转：</span>"+sourcecontent+"";
					html +="</li>";
					html +="<li class=\"inputtips\">还可以输入<span>"+textLimit+"</span>字</li>";
					html +="<li>";
					html +="<textarea id=\"forwardcontent\">"+content.replace(/<[^>]+>/g,'')+"</textarea>";
					html +="</li>";
					if(obj1==2){
						html +="<li><input type=\"checkbox\" id=\"isautor\"/>同时评论给 "+username+"</li>";
						html +="<li><input type=\"checkbox\" id=\"isoldtitle\"/>同时评论给原文作者 "+title+"</li>";
					}else{
						html +="<li><input type=\"checkbox\" id=\"isoldtitle\"/>同时评论给 "+username+"</li>";
					}
					if(tag==0){
					html +="<li class=\"btn\"><a href=\"javascript:forwardmehtod("+obj+",'"+typename+"');\">转发</a><a href=\"\" class=\"close\">取消</a></li>";
					}else{
					html +="<li class=\"btn\"><a href=\"javascript:forwardmehtod1("+obj+",'"+typename+"');\">转发</a><a href=\"\" class=\"close\">取消</a></li>";
					}
					html +="</ul>";
					html +="</form>";
					html +="<div class=\"clear\"></div>";
					html +="</div>";
					html +="</div>";
					html +="</div>";
					$('body').append(html);
					var loginObj = $('.common-frame');
					var maskObj = mask_show();
					if(loginObj.length > 0 && maskObj){
						loginObj.show();
						loginObj.css({'position':'absolute'});
						centerObj(loginObj);
						
						//关闭
						loginObj.find('.title1').find('a').bind('click',function(){
							loginObj.remove();
							mask_hide();
							return false;
						});
						
						//关闭
						loginObj.find('.close').bind('click',function(){
							loginObj.remove();
							mask_hide();
							return false;
						});
						
						//滚动居中
						$(window).scroll(function(){
							centerObj(loginObj);
						});
						
						//字数
						var wordTips = loginObj.find('.inputtips').find('span');
						loginObj.find('textarea').bind('keydown',function(){
							if((textLimit - $(this).val().length) > 0){
								wordTips.html(textLimit - $(this).val().length);
							}
							else{
								wordTips.html(0);
								$(this).val($(this).val().substr(0,textLimit));
							}
						});
						loginObj.find('textarea').bind('keyup',function(){
							if((textLimit - $(this).val().length) > 0){
								wordTips.html(textLimit - $(this).val().length);
							}
							else{
								wordTips.html(0);
								$(this).val($(this).val().substr(0,textLimit));
							}
						});
					}
					else{
						mask_hide();
					}
			
		}else{
		   frame_show(0);
		}
	});
	
}

//转发
function frame_show5(tag,obj,content,username,title){
 var url = "memberShare!flexmusic.action";
	$.post(encodeURI(url),function(data){
		if(data=='1'){
		       var loginObj = $('.common-frame');
				loginObj.remove();
				mask_hide();
				var html = "";
				//
			    if(tag == 0){
			  
				html +="<div class=\"common-frame checkin\">";
					html +="<div class=\"inner\">";
					html +="<div class=\"title\">";
					html +="<p><a href=\"#\"></a></p>";
					html +="</div>";
					html +="<div class=\"tips\">还没有开通您的酷乐帐号？<a href=\"#\" onclick=\"javascript:frame_show(1);\">马上注册</a></div>";
					html +="<div class=\"submit\">";
					html +="<form onsubmit=\"return userLogin();\" method=\"post\" id=\"formlogin\">";
					html +="<ul>";
					html +="<li>";
					html +="<span>内容</span><textarea rows=\"5\" cols=\"20\" id=\"forwardcontent\">"+content+"</textarea>";
					html +="</li>";
					
					html +="<li class=\"extra\">";
					html +="<span></span><input type=\"checkbox\" id=\"isautor\" checked/><span>同时评论给"+username+"</span><a href=\"#\"></a>";
					html +="</li>";
					if(content!=""){
						html +="<li class=\"extra\">";
						html +="<span></span><input type=\"checkbox\" id=\"isoldtitle\" checked/><span>同时评论给原文作者"+title+"</span><a href=\"#\"></a>";
						html +="</li>";
					}
					html +="<li class=\"btn\">";
					html +="<span></span><img src=\"../../images/btn_login_submit.gif\" onclick=\"forwardmehtod("+obj+");\"/>";
					html +="</li>";
					html +="</ul>";
					html +="</form>";
					html +="</div>";
					html +="</div>";
					html +="</div>";
				}
			
				$('body').append(html);
				  
				var loginObj = $('.common-frame');
				var maskObj = mask_show();
				if(loginObj.length > 0 && maskObj){
					loginObj.show();
					loginObj.css({'position':'absolute'});
					centerObj(loginObj);
					
					//关闭
					loginObj.find('.title').find('a').bind('click',function(){
						loginObj.remove();
						mask_hide();
					});
					//滚动居中
					$(window).scroll(function(){
						centerObj(loginObj);
					});
				}
				else{
					mask_hide();
				}
		}else{
		    frame_show(0);
		}
	});
	
}
    
/***注册窗口**************/
function frame_show(tag){
	var loginObj = $('.common-frame');
	loginObj.remove();
	mask_hide();
	var html = "";
	if(tag == 0){
		//登陆
		var uname="";
		var pwd="";
		//var uservalue=$.cookie("user");
		//if(uservalue!=""&&uservalue!='null'){
		
		//   uname=uservalue.split("-")[0];
		//   pwd=uservalue.split("-")[1];
		//}
		html +="<div class=\"common-frame checkin\">";
		html +="<div class=\"inner\">";
		html +="<div class=\"title\">";
		html +="<p><a href=\"#\"></a></p>";
		html +="</div>";
		html +="<div class=\"tips\">还没有开通您的酷乐帐号？<a href=\"#\" onclick=\"javascript:frame_show(1);\">马上注册</a></div>";
		html +="<div class=\"submit\">";
		html +="<form onsubmit=\"return userLogin();\" method=\"post\" id=\"formlogin\">";
		html +="<input type=\"hidden\" id=\"rememberpasword\" value=\"0\" name=\"rememberpasword\"/>";
		html +="<ul>";
		html +="<li>";
		html +="<span>用户名/邮箱<font></font></span><a><input type=\"text\" id=\"uid\" value=\""+uname+"\" name=\"emailinfo\" onblur=\"return checkuseremail()\"/></a>";
		html +="</li>";
		html +="<li>";
		html +="<span>密码</span><a><input type=\"password\" value=\""+pwd+"\" id=\"upwd\" name=\"password\"/></a><span id=\"spanfalse\" style=\"display:none\" class=\"false\"></span>";
		html +="</li>";
		html +="<li class=\"notice\">";
		html +="<span></span>	<span id=\"spanerror\" style=\"display: none;\">密码错误</span>";
		html +="</li>";
		html +="<li class=\"extra\">";
		html +="<span></span><input type=\"checkbox\"  onclick=\"rememberme(this);\"/><span>记住密码</span><a href=\"memberShare!tofindpassword.action\">找回密码</a>";
		html +="</li>";
		html +="<li class=\"btn\">";
		html +="<span></span><input type=\"image\" src=\"../../images/btn_login_submit.gif\" />";
		html +="</li>";
		html +="</ul>";
		html +="</form>";
		html +="</div>";
		html +="</div>";
		html +="</div>";
	}
	else if(tag == 1){
		//注册
		html += "<div class=\"common-frame register\">";
		html += "<div class=\"inner\">";
		html += "<div class=\"title\">";
		html += "<p><a href=\"#\"></a></p>";
		html += "</div>";
		html += "<div class=\"tips\">如果您已拥有酷乐帐号，请<a href=\"#\" onclick=\"javascript:frame_show(0);\">直接登陆</a>，带<span>*</span>为必填选项</div>";
		html += "<div class=\"submit\">";
		html += "<form id=\"form1\" method=\"post\" onsubmit=\"return checkall();\">";
		html += "<ul>";
		html += "<li>";
		html += "<span>电子邮箱<font>*</font></span><a><input id=\"email\" type=\"text\" name=\"entity.email\"  onblur=\"return checkuseremail();\"/></a>";
		html += "</li>";
		html += "<li>";
		html += "<span>昵称<font>*</font></span><a><input id=\"nickname\" maxlength=\"12\" type=\"text\" name=\"entity.nickname\"/></a>";
		html += "</li>";
		html += "<li class=\"notice\">";
		html += "<span id=\"nicknameTip\"></span>";
		html += "</li>";
		html += "<li>";
		html += "<span>密码<font>*</font></span><a><input id=\"password1\" maxlength=\"12\" type=\"password\"  name=\"entity.password\"/></a>";
		html += "</li>";
		html += "<li class=\"notice\">";
		html += "<span></span>密码须由6-12个字符或数字组成";
		html += "</li>";
		html += "<li>";
		html += "<span>确认密码<font>*</font></span><a><input id=\"password2\" maxlength=\"12\" type=\"password\" /></a>";
		html += "</li>";
		html += "<li>";
		html += "<span>手机号</span><a><input type=\"text\" maxlength=\"11\" id=\"phone\" name=\"entity.phone\"/></a>";
		html += "</li>";
		html += "<li class=\"verify\">";
		html += "<span>验证码<font>*</font></span><a><input type=\"text\" id=\"kehucode\" name=\"kehucode\"/></a><img width=\"88\" id=\"codeimg\" height=\"36\"  /><a href=\"javascript:changecode();\" id=\"chge\" class=\"changeimg\">换一换</a>";
		//html += "<span>验证码<font>*</font></span><a><input type=\"text\" id=\"kehucode\" onblur=\"return checkcode()\"/></a><img width=\"88\" id=\"codeimg\" height=\"36\" src=\"../../getCode.do\" /><a href=\"javascript:changecode();\" id=\"chge\" class=\"changeimg\">换一换</a>";src=\"../../CaptchaImg.jpg\"
		html += "</li>";
		html += "<li class=\"btn\">";
		html += "<span></span><input type=\"image\"  src=\"../../images/btn_register_submit.gif\" />";
		html += "</li>";
		html += "</ul>";
		html += "</form>";
		html += "</div>";
		html += "</div>";
		html += "</div>";
		//评论
	}
	else if(tag == 2){
		//解散群
		html ="<div class=\"common-frame dismiss\">";
		html +="<div class=\"inner\">";
		html +="<div class=\"title1\"> <span>解散该群</span><a href=\"#\"></a> </div>";
		html +="<div class=\"resend\">";
		html +="<form>";
		html +="<ul>";
		html +="<li class=\"notice\">";
		html +="<p>确定要解散该群吗？</p>";
		html +="<span>解散群后群内所有内容将清空，且无法恢复。</span>";
		html +="</li>";
		html +="<li class=\"passwd\">";
		html +="<p>为了保护您的帐户安全，请输入酷乐登录密码</p>";
		html +="<label>酷乐登录密码：<input type=\"text\" id=\"password\"/></label>";
		html +="</li>";
		html +="<li class=\"btn\"><a href=\"javascript:dissolveGroup();\">确定</a><a href=\"#\" id=\"a2\">取消</a>";
		html +="</li>";
		html +="</ul>";
		html +="</form>";
		html +="<div class=\"clear\"></div>";
		html +="</div>";
		html +="</div>";
		html +="</div>";
	}else if(tag == 3){
		//申请为动感地带俱乐部会员
		html += "<div class=\"common-frame register\" style=\"width:498px\">";
		html += "<div class=\"inner\">";
		html += "<div class=\"title1\" >";
		html += "<p style=\"height:40px\"><span>动感地带俱乐部入会申请表</span><a href=\"#\" style=\"height:40px\"></a></p>";
		html += "</div>";
		html += "<div class=\"submit\" style=\"width:458px\">";
		html += "<form onsubmit=\"return checkaddstudent();\" id=\"form2\">";
		html += "<ul>";
		html += "<li style=\"height:33px;line-height:27px;padding-top:20px;\">";
		html += "<span style=\"line-height:25px;height:25px;\">姓名:</span><input type=\"text\" id=\"studentName\" name=\"entity.studentName\" style=\"width:356px;height:23px;border:1px solid #CCCCCC;\"/>";
		html += "</li>";
		html += "<li style=\"height:33px;line-height:27px;padding-top:12px;\">";
		html += "<span style=\"line-height:25px;height:25px;\">学校:</span><input type=\"text\" id=\"schoolName\" name=\"entity.schoolName\" style=\"width:356px;height:23px;border:1px solid #CCCCCC;\"/>";
		html += "</li>";
		html += "<li style=\"height:33px;line-height:27px;padding-top:12px;\">";
		html += "<span style=\"line-height:25px;height:25px;\">班级:</span><input type=\"text\" id=\"className\" name=\"entity.className\" style=\"width:356px;height:23px;border:1px solid #CCCCCC;\"/>";
		html += "</li>";
		html += "<li style=\"height:33px;line-height:27px;padding-top:12px;\">";
		html += "<span style=\"line-height:25px;height:25px;\">宿舍:</span><input type=\"text\" id=\"dormitoryName\" name=\"entity.dormitoryName\" style=\"width:356px;height:23px;border:1px solid #CCCCCC;\"/>";
		html += "</li>";
		html += "<li style=\"height:33px;line-height:27px;padding-top:12px;\">";
		html += "<span style=\"line-height:25px;height:25px;\">学生证号:</span><input type=\"text\" id=\"studentId\" name=\"entity.studentId\" style=\"width:356px;height:23px;border:1px solid #CCCCCC;\"/>";
		html += "</li>";
		html += "<li style=\"height:73px;line-height:27px;padding-top:15px;\">";
		html += "<span style=\"line-height:21px;height:63px;\">在校参加的<br>学生会、<br>协会:</span><textarea rows=\"3\" id=\"society\" name=\"entity.society\" style=\"width:352px;height:63px;border:1px solid #CCCCCC;\"></textarea>";
		html += "</li>";
		html += "<li style=\"height:33px;line-height:27px;padding-top:12px;\">";
		html += "<span style=\"line-height:25px;height:25px;\">手机号码:</span><input type=\"text\" id=\"phoneNumber\" name=\"entity.phoneNumber\" style=\"width:356px;height:23px;border:1px solid #CCCCCC;\"/>";
		html += "</li>";
		html += "<li style=\"border-top:1px dotted #CCCCCC;height:12px;line-height:5px;margin-top:5px;padding:0px;\">";
		html += "</li>";
		html += "<li class=\"btn\" style=\"padding-left:150px;height:30px;line-height:27px;\">";
		html += "<input type=\"image\" src=\"images/btn_submit.gif\" style=\"width:72px;height:27px;margin-right:15px;\"/><input type=\"image\" src=\"images/btn_cancel.gif\" style=\"width:72px;height:27px;\" />";
		//html += "<span></span><img src=\"images/btn_register_submit.gif\" />";
		html += "</li>";
		html += "</ul>";
		html += "</form>";
		html += "</div>";
		html += "</div>";
		html += "</div>";
	}
	
	$('body').append(html);
	changecode();
	var loginObj = $('.common-frame');
	var maskObj = mask_show();
	if(loginObj.length > 0 && maskObj){
		loginObj.show();
		loginObj.css({'position':'absolute'});
		centerObj(loginObj);
		
		//关闭
		loginObj.find('.title').find('a').bind('click',function(){
			loginObj.remove();
			mask_hide();
			return false;
		});
		//取消
		loginObj.find('.btn').find('#a2').bind('click',function(){
			loginObj.remove();
			mask_hide();
			return false;
		});
		//关闭
		loginObj.find('.title1').find('a').bind('click',function(){
			loginObj.remove();
			mask_hide();
			return false;
		});
		//滚动居中
		$(window).scroll(function(){
			centerObj(loginObj);
		});
	}
	else{
		mask_hide();
	}
}

//判断入会会员信息是否为空
function checkaddstudent(){
        var studentName=$("#studentName").val();
        var schoolName=$("#schoolName").val();
        var className=$("#className").val();
        var dormitoryName=$("#dormitoryName").val();
        var studentId=$("#studentId").val();
        var society=$("#society").val();
        var phoneNumber=$("#phoneNumber").val();
               var phonereg = /^1[3|4|5|8][0-9]\d{4,8}$/;
	        var bool1 = phonereg.test(phoneNumber);

         if(studentName==""){
	       alert("请填写你的姓名！");
	       return false;
         }
        else if(schoolName==""){
       alert("请填写你的学校！");
       return false;
      }
      else if(className==""){
       alert("请填写你的班级！");
       return false;
      }
        else if(dormitoryName==""){
       alert("请填写你的宿舍！");
       return false;
      }
    
      else if(phoneNumber==""){
        alert("请填写你的手机号码！");
        return false;
      }
       else if(phoneNumber!=""&&bool1==false){
       alert("手机号码有误！");
       return false;
      }
     else
     {
        var bool=false;
        var url='../../student!addStudent.action?'+$("#form2").serialize();
			$.post(url,function(data){
			if(data==0){
			bool=true;
				alert('申请成功,进入审核阶段!');
				var loginObj = $('.common-frame');
				loginObj.remove();
			   mask_hide();
			}
		});
		return bool;
      }
    }
    

function show_addgroup(groupid,groupname){
	var textLimit = 20;
	html ="<div class=\"common-frame joingroup\" style=\"display:block;\">";
	html +="<div class=\"inner\">";
	html +="<div class=\"title1\"> <span>加入该群</span><a href=\"#\"></a> </div>";
	html +="<div class=\"resend\">";
	html +="<form>";
	html +="<ul>";
	html +="<li class=\"group\">";
	html +="<p>";
	html +="<label class=\"groupname\">"+groupname+"</label>";
	html +="</p>";
	html +="<div class=\"clear\"></div>";
	html +="<span class=\"left\">请输入验证信息：</span>";
	html +="<div class=\"right inputtips\">还可以输入<span>20</span>字</div>";
	html +="<div class=\"clear\"></div>";
	html +="<textarea id=\"joinGroupContent\"></textarea>";
	html +="</li>";
	html +="<li class=\"btn\"><a href=\"javascript:addgroupprocess("+groupid+");\">确定</a><a href=\"#\" id=\"a2\">取消</a>";
	html +="</li>";
	html +="</ul>";
	html +="</form>";
	html +="<div class=\"clear\"></div>";
	html +="</div>";
	html +="</div>";
	html +="</div>";
	$('body').append(html);
	var loginObj = $('.common-frame');
	var maskObj = mask_show();
	if(loginObj.length > 0 && maskObj){
		loginObj.show();
		loginObj.css({'position':'absolute'});
		centerObj(loginObj);
		
		//关闭
		loginObj.find('.title1').find('a').bind('click',function(){
			loginObj.remove();
			mask_hide();
			return false;
		});
		//取消
		loginObj.find('.btn').find('#a2').bind('click',function(){
			loginObj.remove();
			mask_hide();
			return false;
		});
		//滚动居中
		$(window).scroll(function(){
			centerObj(loginObj);
		});
		
		//字数
		var wordTips = loginObj.find('.inputtips').find('span');
		loginObj.find('textarea').bind('keydown',function(){
			if((textLimit - $(this).val().length) > 0){
				wordTips.html(textLimit - $(this).val().length);
			}
			else{
				wordTips.html(0);
				$(this).val($(this).val().substr(0,textLimit));
			}
		});
		loginObj.find('textarea').bind('keyup',function(){
			if((textLimit - $(this).val().length) > 0){
				wordTips.html(textLimit - $(this).val().length);
			}
			else{
				wordTips.html(0);
				$(this).val($(this).val().substr(0,textLimit));
			}
		});
	}
	else{
		mask_hide();
	}
}

function centerObj(obj){
	var newLeft = ($(window).width() / 2) - (obj.width() / 2);
	var newTop = ($(window).height() / 2) - (obj.height() / 2) + $(window).scrollTop();
	obj.css({left:newLeft,top:newTop});
}

function common_run(){
	/*****修饰css边框*************************/
	var obj = $('.hot-common.read').find('.item');
	if(obj.length % 2 == 1){
			if(i == (obj.length - 1)){
				$(this).addClass('no-underline');
			}
	}
	else{
		obj.each(function(i){
			if(i == (obj.length - 2) || i == (obj.length - 1)){
				$(this).addClass('no-underline');
			}
		});
	}

	var obj = $('.share5').find('.special-list').find('.item');
	if(obj.length % 2 == 1){
		obj.each(function(i){
			if(i == (obj.length - 1)){
				$(this).addClass('no-underline');
			}
		});
	}
	else{
		obj.each(function(i){
			if(i == (obj.length - 2) || i == (obj.length - 1)){
				$(this).addClass('no-underline');
			}
		});
	}
	
	var obj = $('.hot-aim').find('.item');
	if(obj.length % 2 == 1){
		obj.each(function(i){
			if(i == (obj.length - 1)){
				$(this).css({border:'none'});
			}
		});
	}
	else{
		obj.each(function(i){
			if(i == (obj.length - 2) || i == (obj.length - 1)){
				$(this).css({border:'none'});
			}
		});
	}
	
	var obj = $('.share-block').find('.content1');
	if(obj.length>0){
		obj.each(function(i){
			var subObj = $(this).find('.item2');
			if(subObj.length>0){
				
				subObj.each(function(i){
					if(((i+1) % 3) == 0){
						$(this).addClass('side');
					}
				});
			}
		});
	}
	var obj = $('.share-block').find('.content1').find('.item3');
	if(obj.length>0){
		obj.each(function(i){
			if(((i+1) % 10) == 0){
				$(this).addClass('side');
			}
		});
	}

	$('.share5').find('.share-block1').find('.item:last').addClass('no-underline');
	$('.hotshare').find('.item:last').addClass('no-underline');
	$('.block-app.nolist').find('.item1:last').addClass('no-underline');
	$('.block-app.nolist').find('.item2:last').addClass('no-underline');
	$('.share-block').find('.item:last').css({border:'none'});

	var obj = $('.apptop').find('.item1:even');
	obj.each(function(i){
		$(this).addClass('hover');
	});
	var obj = $('.share-block').find('.item:even');
	obj.each(function(i){
		$(this).addClass('even');
	});
	
	/*****制作专辑选择歌曲*************************/
	var objList = Array(3);
	objList[0] = $('.song-choose').find('.p2').find('ul').find('li');
	objList[1] = $('.sort-block').find('.item1');
	objList[2] = $('.my-private').find('.item');
	for(var i = 0 ; i < objList.length; i ++){
		objList[i].each(function(i){
			$(this).unbind('mouseover');
			$(this).unbind('mouseout');
			$(this).bind('mouseover',function(){
				$(this).addClass('hover');
			});
			$(this).bind('mouseout',function(){
				$(this).removeClass('hover');
			});
		});
	}
	
	/******应用介绍图片**********/
	var obj = $('.intro-img');
	if(obj.length > 0){
		var zoomimg = obj.find('p').find('img');
		if(zoomimg.length>0){
			obj.find('a').each(function(){
				$(this).find('img').bind('mouseover',function(){
					zoomimg.attr('src',$(this).attr('zoomsrc'));
				});
			});
		}
	}
	
	/******分享输入框**********/
	var obj = $('.block-share');
	var inputObj = obj.find('.input');
	if(inputObj.length > 0){
		var inputLimit = 140;
		var word = inputObj.find('span');
		word.html(inputLimit);
		inputObj.find('textarea').bind('keydown',function(){
			if((inputLimit - $(this).val().length) > 0){
				word.html(inputLimit - $(this).val().length);
			}
			else{
				word.html(0);
				$(this).val($(this).val().substr(0,inputLimit));
			}
		});
		inputObj.find('textarea').bind('keyup',function(){
			if((inputLimit - $(this).val().length) > 0){
				word.html(inputLimit - $(this).val().length);
			}
			else{
				word.html(0);
				$(this).val($(this).val().substr(0,inputLimit));
			}
		});
	}
	
	/******评论输入框**********/
	$obj = $('.textarea-form');
	if($obj.length > 0){
		var limit = 200;
		$obj_textarea = $obj.find('textarea');
		$obj_wordctrl = $obj.find('.textarea-word');
		$obj_wordctrl.html(limit);
		$obj_textarea.bind('keydown',function(){
			if((limit - $(this).val().length) > 0){
				$obj_wordctrl.html(limit - $(this).val().length);
			}
			else{
				$obj_wordctrl.html(0);
				$obj_textarea.val($(this).val().substr(0,limit));
			}
		});
		$obj_textarea.bind('keyup',function(){
			if((limit - $(this).val().length) > 0){
				$obj_wordctrl.html(limit - $(this).val().length);
			}
			else{
				$obj_wordctrl.html(0);
				$obj_textarea.val($(this).val().substr(0,limit));
			}
		});
	}
}




function focusmethod(obj){
  $(obj).val('');
}

function blurmethod(){
  $(obj).val('请输入歌曲名');
}
function show_share_search(currpage){
	var obj = $('.block-share').find('.p1');
	 var musicname=$("#musicname").val();
	 if(musicname=='请输入歌曲名'){
	    musicname="";
	 }
	var url="music!listForShare.action?currpage="+currpage+"&musicname="+musicname;
	$.ajax({
	url:encodeURI(url),
	   beforeSend: function(){
	     // Handle the beforeSend event
	       obj.find('.ul').find('.pp1-1').hide();
	       $("#ajaxsend").show();
	   },
	   complete:function(){
	     obj.find('.ul').find('.pp1-1').show();
	      $("#ajaxsend").hide();
	   },
	   success: function(data){
	     // Handle the complete event
	       obj.append(data);
	        //obj.append(html);
			obj.find('.search-rs').show().css({left:obj.find('.search').offset().left,top:(obj.find('.search').offset().top+obj.find('.search').height() +3)});
			obj.find('.search-rs').find('li').each(function(){
				$(this).bind('mouseover',function(){
					$(this).addClass('hover');
				});
				$(this).bind('mouseout',function(){
					$(this).removeClass('hover');
				});
				$(this).bind('click',function(){
					/*******/
					//此处放点击后的事件
					
					/*******/
					obj.find('.search-rs').remove();
				});
			});
			obj.find('.search-rs').find('.title1').find('a').bind('click',function(){
				obj.find('.search-rs').hide();
				return false;
			});
	   }
	   // ...
	 });
}

function addmusictoinput(musicname,musicid,musicpath){
   $("#musicname").val(musicname);
    $("#musicid").val(musicid);
    $("#commentcontent").val(musicname+" "+musicpath);
}

$(function(){

common_run();	
var obj = $('.block-share');
    obj.find('.p1').hide();
	obj.find('.p2').hide();
	obj.find('.p3').hide();
	obj.find('.p4').hide();
	
	if(obj.length > 0){
		obj.find('.options').find('.a1').bind('click',function(){
		    $("#checkedvalue").val('1');
		    obj.find('.p1').css({display:obj.find('.p1').css('display') == 'none' ? 'block' : 'none'});
			
			obj.find('.p2').hide();
			obj.find('.p3').hide();
			obj.find('.p4').hide();
			obj.find('.p5').hide();
			if(obj.find('.p1').css('display')=="none"){
			   obj.find('.p5').show();
			}
			return false;
		});
		obj.find('.options').find('.a2').bind('click',function(){
		$("#checkedvalue").val('2');
		    obj.find('.p2').css({display:obj.find('.p2').css('display') == 'none' ? 'block' : 'none'});
			obj.find('.p1').hide();
			obj.find('.p3').hide();
			obj.find('.p4').hide();
			obj.find('.p5').hide();
			if(obj.find('.p2').css('display')=="none"){
			   obj.find('.p5').show();
			}
			return false;
		});
		obj.find('.options').find('.a3').bind('click',function(){
		$("#checkedvalue").val('3');
		    obj.find('.p3').css({display:obj.find('.p3').css('display') == 'none' ? 'block' : 'none'});
			obj.find('.p1').hide();
			obj.find('.p2').hide();
			obj.find('.p4').hide();
			obj.find('.p5').hide();
			if(obj.find('.p3').css('display')=="none"){
			   obj.find('.p5').show();
			}
			return false;
		});
		
		obj.find('.options').find('.a4').bind('click',function(){
		    $("#checkedvalue").val('5');
			obj.find('.p4').css({display:obj.find('.p4').css('display') == 'none' ? 'block' : 'none'});
			obj.find('.p1').hide();
			obj.find('.p2').hide();
			obj.find('.p3').hide();
			obj.find('.p5').show();
			return false;
		});
	
		obj.find('.p1').find('.aa1').bind('click',function(){
		     $("#checkedvalue").val('1');
			obj.find('.p1').find('.pp1').show();
			obj.find('.p1').find('.pp1-1').show();
			obj.find('.p1').find('.pp2').hide();
			obj.find('.p1').find('.pp2-2').hide();
			$(this).addClass('hover');
			obj.find('.p1').find('.aa2').removeClass('hover');
			return false;
		});
		obj.find('.p1').find('.aa2').bind('click',function(){
		    $("#checkedvalue").val('4');
			obj.find('.p1').find('.pp1').hide();
			obj.find('.p1').find('.pp1-1').hide();
			obj.find('.p1').find('.pp2').show();
			obj.find('.p1').find('.pp2-2').show();
			$(this).addClass('hover');
			obj.find('.p1').find('.aa1').removeClass('hover');
			return false;
		});
	
	}
	
	
});


$(function(){
	/******窗口改变事件*********/
	//var obj = $('.block-share');
	//obj.find('.p1').find('.pp1-1').bind("ajaxSend", function(){
	//   $(this).html('加载中..');
	// }).bind("ajaxComplete", function(){
	//   $(this).hide('搜索歌曲');
	// });
});

$(document).ready(function(){
   //为搜索按钮赋事件
   $("#searchbutn").click(function(){
	      var valueinfo= $("#valueinfo").val();
		  if(valueinfo==""){
		     alert("请输入搜索的内容");
		  }else{
		     document.getElementById("#searchform").submit();
		  }
     });
});


function downloadsoft(obj){
  window.location.href='software!downloadsoft.action?softId='+obj;
}
		
function readonline(obj){
   window.open(obj);
}


function downloadreadsoft(){
   
}

$(document).ready(function(){
//apptype();
//booktype();
});
 function apptype(){
 var url='software!apptype.action';
	$.post(url,function(data){
	    $("#apptype").html(data);
	});
 }
 
 
  function booktype(){
 var url='book!booktype.action';
	$.post(url,function(data){
	    $("#booktype").html(data);
	});
 }
 
 
 function userLoginshare()
		{
			var uid=document.getElementById("uid").value;
			var upwd=document.getElementById("upwd").value;
			
			if(uid=="")
			{
				alert("请输入用户名！");
				return false;
			}
			else if(upwd=="")
			{
				alert("请输入密码！");
				return false;
			}
			else
			{
			   return true;
			}
		}
		
		 function userLoginshare1()
		{
			var uid=document.getElementById("uid1").value;
			var upwd=document.getElementById("upwd1").value;
			
			if(uid=="")
			{
				alert("请输入用户名！");
				return false;
			}
			else if(upwd=="")
			{
				alert("请输入密码！");
				return false;
			}
			else
			{
			   return true;
			}
		}
		
	    function userLoginshare2()
		{
			var uid=document.getElementById("uid1").value;
			var upwd=document.getElementById("upwd1").value;
			
			if(uid=="")
			{
				alert("请输入用户名！");
				return false;
			}
			else if(upwd=="")
			{
				alert("请输入密码！");
				return false;
			}
			else
			{
			   document.getElementById("loginform").submit();
			}
		}
		

	
	 $(document).ready(function(){
	              var textLimit=140;
	              $("#textareaid").bind('keydown',function(){
					if((140 - $(this).val().length) > 0){
						$("#wordTips").html( textLimit- $(this).val().length);
					}
					else{
						$("#wordTips").html(0);
						$(this).val($(this).val().substr(0,textLimit));
					}
					});
					
				 $("#textareaid").bind('keyup',function(){
					if((140 - $(this).val().length) > 0){
						$("#wordTips").html( textLimit- $(this).val().length);
					}
					else{
						$("#wordTips").html(0);
						$(this).val($(this).val().substr(0,textLimit));
					}
					});
					
					 $("#casualContent").bind('keydown',function(){
					   if((140 - $(this).val().length) > 0){
						$("#wordTips").html( textLimit- $(this).val().length);
					}
					else{
						$("#wordTips").html(0);
						$(this).val($(this).val().substr(0,textLimit));
					}
					});
					
						 $("#casualContent").bind('keyup',function(){
					   if((140 - $(this).val().length) > 0){
						$("#wordTips").html( textLimit- $(this).val().length);
					}
					else{
						$("#wordTips").html(0);
						$(this).val($(this).val().substr(0,textLimit));
					}
					});
					
              });
	
	
	String.prototype.replaceAll = function(s1,s2) { 
    return this.replace(new RegExp(s1,"gm"),s2); 
}
	
function hotkey() 
{ 
	var a=window.event.keyCode; 
	if((a==13)&&(event.ctrlKey)) 
	{ 
	  addtopicmethod();
	} 
}// end hotkey 

document.onkeydown = hotkey; //当onkeydown 事件发生时调用hotkey函数 


	
	
		
