$(document).ready(function(){
	$('a[href="#"]').each(function(){
		$(this).attr('href','javascript:void(0)')
	});
	$('.perform li').each(function(){
		var o=$(this);
		$(this).find('.s').click(function(){
			var j=$(this).index();
			o.find('.s').removeClass('on').eq(j).addClass('on');
			o.find('.info').hide().eq(j).fadeIn(500)
		})
	});
	$('.artist_l li').each(function(m){
		$(this).find('a').css('top',-$(this).height());
		$(this).hover(function(){
			$(this).find('a').animate({'top':'0'},200)
			},
			function(){
				$(this).find('a').animate({'top':$(this).height()},{duration:200,complete:function(){
					$(this).css('top',-$(this).parent('li').height()
				)}
			})
		})
	});
	$('#calendar td').live('mouseover',function(){
		$('#calendar td').removeClass('hover');
		$(this).addClass('hover')
	});
	$('.category_list .item').each(function(i){
		$(this).hover(function(){
			$('.category_list .item').removeClass('on').eq(i).addClass('on');
			$('.category_list ol').hide().eq(i).show()
		},
		function(){
			$(this).find('ol').hide();
			$(this).removeClass('on')
		})
	});
	$('.u_city_a li').each(function(i){
		$(this).click(function(){
			if(i==10)return false;
			$('.u_city_nav li').removeClass('on').eq(i).addClass('on');
			$('.u_city_nav p').hide().eq(i).show()
		})
	});
	var intIndexCity=0;
	var intHoverCity=0;
	$('.u_city_nav .more').click(function(){
		if(intIndexCity==1){
			$(this).removeClass('on');
			$('.s_citys').hide(200);intIndexCity=0
		}else{
			$(this).addClass('on');
			$('.s_citys').show(200);
			intIndexCity=1
		}
		return false
	});
	$('.s_citys').hover(function(){intHoverCity=1},function(){intHoverCity=0});
	$('body').bind('click',function(){
		if(intIndexCity==1&&intHoverCity==0){
			$('.s_citys').hide(200);
			$('.u_city_nav .more').removeClass('on');intIndexCity=0}
	});
	function scrollList(){
		if($('.scroll_txt li').length<=1)return;
		var temp=$('.scroll_txt li:last');
		temp.hide();$('.scroll_txt li:last').remove();
		$('.scroll_txt li:first').before(temp);
		temp.slideDown(500)}window.setInterval(scrollList,5000);
		$('.live_top li').each(function(i){
			$(this).hover(function(){
				$('.live_top li').removeClass('on').eq(i).addClass('on')
			})
		});
		$('.list_1 li').each(function(i){
			$(this).hover(function(){
				$('.list_1 li').removeClass('on').eq(i).addClass('on')
			})
		});
		$('.vote_m dd').each(function(i){
			$(this).click(function(){
				$('.vote_m dd').removeClass('on').eq(i).addClass('on')
			})
		});
		$('.tr_commend dl').each(function(i){
			$(this).hover(function(){
				$('.tr_commend dl').removeClass('on').eq(i).addClass('on')
			})
		});
		$('.ticketInfo .help').hover(function(){$('.minTips').fadeIn('fast')},function(){$('.minTips').fadeOut('fast')});
		$('.videoList li').hover(function(){$(this).addClass('on')},function(){$(this).removeClass('on')});
		$('.min_tip .tab_min_b a').each(function(i){$(this).click(function(){$('.tab_min_b a').removeClass('on').eq(i).addClass('on')})});
		$('.news_list li').hover(function(){$(this).addClass('on')},function(){$(this).removeClass('on')});
		$('.tr_pic_list li').hover(function(){$(this).addClass('on')},function(){$(this).removeClass('on')});
		$('.sift .expand').toggle(function(){$('#city').height(24);$(this).html('\u5c55\u5f00')},function(){$('#city').height('auto');$(this).html('\u6536\u7f29')});
		$('.buy_caption .tab_t a').each(function(i){
			$(this).click(function(){
				$('.buy_caption .tab_t a').removeClass('on').eq(i).addClass('on');
				$('.buy_caption dl').hide().eq(i).show()
			})
		});
		$('.vocal_list li .t .c7').click(function(){$(this).parent().parent().find('.t').show();$(this).parent().hide()})
	});


$(document).ready(function(){
	var isshowcity=false;
	var ishovercitys=false;
	$('.s_city .s').click(function(){
		if(isshowcity==false){
			$('.s_c_links').show(200);
			$(this).addClass('on');
			isshowcity=true
		}else{
			$('.s_c_links').hide(200);
			$(this).removeClass('on');
			isshowcity=false
		}
		return false
	});
	$('.s_c_links').hover(function(){ishovercitys=true},function(){ishovercitys=false});
	$('body').bind('click',function(){
		if(isshowcity==true&&ishovercitys==false){
			$('.s_c_links').hide(200);
			$('.s_city .s').removeClass('on');isshowcity=false
		}
	})
});
$(document).ready(function(){
	$('.sd').each(function(i){
		$(this).find('.hztitle').click(function(){
			$('.sd').eq(i).find('p').toggle()
		})
	});
	$(".hztitle").toggle(function(){$(this).addClass("hztitle-2")},function(){$(this).removeClass("hztitle-2")})
});
function artHeight(){
	var rh=$('.artists_r').height();
	var lh=$('.artists_l').height();
	var list=$('.artists_l .tab_min_in').height();
	var dh=rh-lh;
	if(dh>0){var h=lh+dh-12;$('.artists_l').height(h)}
	if(rh-list<90){$('.artists_l').height('auto')}
}
function show(imgPlayid,actorid,numInnerid,sType,fColor,bColor){
var t=false;var str='';
	var speed=500;
    var imgPlaystr="";
    var actorstr="";
    var numInnerstr="";	
	
	imgPlaystr='#'+imgPlayid;
	actorstr='#'+actorid;
	numInnerstr='#'+numInnerid;
	var w=$(imgPlaystr).width();//document.getElementById(imgPlayid).offsetWidth;
	var h=$(imgPlaystr).height();//document.getElementById(imgPlayid).offsetWidth;
	
	var n=$(actorstr+' li').length;
	var numWidth=n*18;
	var _desLeft=0;//(w/2.5-(numWidth+26))/2;
	var _numLeft=0;
	var _desTop=0;
	var _numTop=0;
	var _desBottom=0;
	var c=0;$(actorstr).width(w*n);
	var _imgWidth=w;
	var _numMargin=2.5;

	switch (sType) {
	    case 1:
	        _imgWidth = w;
	        _desLeft = w - 300 - 10;
	        _desBottom = 90;
	        _desTop = h - 130;
	        _numLeft = w - 13;
	        _numTop = h - 80;
	        numWidth = numWidth + 10;
	        _numMargin = 10;
	        if (fColor == "") fColor = "#FFFFFF";
	        if (bColor == "") bColor = "#808080";
	        $(imgPlaystr + ' .num').css('display', 'none');
	        $(numInnerstr).css('height', 35);
	        $(numInnerstr).css('background-color', bColor);
	        $(numInnerstr).css({ opacity: 0.8 });
	        $(actorstr + ' span').css('text-align', 'center');
	        break;
	    case 2:
	        _desTop = h / 3 * 2;
	        _numLeft = 8;
	        _desBottom = 60;
	        _numTop = h - 45;
	        if (fColor == "") fColor = "#FFFFFF";
	        if (bColor == "") bColor = "#0A8CFA";
	        $(actorstr + ' span').css('width', 280);
	        break;
	    case 3:
	        _desTop = h / 5 * 3;
	        _desBottom = h / 7 * 2;
	        _numTop = h - _desBottom + 10;
	        _desLeft = w - 300 - 10;
	        _numLeft = (w / 3) * 2 + (w / 3 - numWidth) / 2;
	        if (fColor == "") fColor = "#FFFFFF";
	        if (bColor == "") bColor = "#808080";

	        break;
	    case 4:
	        _desTop = h - 36;
	        _desLeft = 0;
	        _numLeft = w - 10;
	        _numTop = h;
	        if (fColor == "") fColor = "#FFFFFF";
	        if (bColor == "") bColor = "#3D7CC3";
	        $(actorstr + ' span').css('width', w - 10);
	        $(actorstr + ' span').css('opacity', 1);
	        bColor = 'url("/Content/swapping/images/title.jpg") no-repeat scroll right bottom ' + bColor;
	        $(actorstr + ' span').css('background', bColor);
	        $(actorstr + ' span').css('font', '16px/36px Verdana,Arial');
	        $(numInnerstr).css('display', 'none');
	        break;
	    case 7:
	    case 8:
	        _imgWidth = w;
	        _desLeft = w - 300 - 10;
	        _desTop = h - 130;
	        _numLeft = w - 13;
	        _numTop = h - 80;
	        _desBottom = h - _numTop - 31;
	        numWidth = numWidth + 10;
	        _numMargin = 10;
	        if (fColor == "") fColor = "#FFFFFF";
	        if (bColor == "") bColor = "#9BCC4F";
	        $(imgPlaystr + ' .num').css('display', 'none');
	        $(numInnerstr).css('height', 35);
	        $(numInnerstr).css('background-color', bColor);
	        $(numInnerstr).css({ opacity: 0.8 });
	        $(actorstr + ' span').css('text-align', 'center');
	        $(actorstr + ' span').css('font-weight', 'bold');
	        break;
	    case 5:
	        _desLeft = 60;
	        _desBottom = 67;
	        $(actorstr + ' span').css('font', 'italic 23px/27px Myriad Pro,Arial');
	        $(actorstr + ' span').css('padding', '3px 10px 5px 25px');
	        $(actorstr + ' span').css('word-spacing', '2px');
	        $(imgPlaystr + ' .num').css('display', 'none');
	        $(numInnerstr).css('display', 'none');
	        break;
	    case 6:
	        $(actorstr + ' span').css('display', 'none');
	        $(imgPlaystr + ' .num').css('display', 'none');
	        $(numInnerstr).css('display', 'none');
	        break;
	    case 9:
	        _imgWidth = w;
	        _desLeft = w - 220 - 10;
	        _desTop = h - 130;
	        _numLeft = w - 13;
	        _numTop = 110;
	        _desBottom = h - _numTop - 31;
	        numWidth = numWidth + 10;
	        _numMargin = 10;
	        if (fColor == "") fColor = "#FFFFFF";
	        if (bColor == "") bColor = "#333";
	        $(imgPlaystr + ' .num').css('display', 'none');
	        $(numInnerstr).css('display', 'none');
	        /*$(numInnerstr).css('height', 35);
	        $(numInnerstr).css('background-color', bColor);
	        $(numInnerstr).css({ opacity: 0.8 });*/
	        $(actorstr + ' span').css('text-align', 'center');
	        $(actorstr + ' span').css('width', 220);
	        $(actorstr + ' span').css('font-weight', 'bold');
	        $(imgPlaystr + ' .num').css('z-index', 1);
	        break;
	    default:
	        _desTop = h / 5 * 2;
	        _numLeft = (w / 2 - (numWidth + 26) / 2);
	        _numTop = h / 5 * 4;
	        break;
	}
	    
	$(actorstr+' IMG').width(_imgWidth);
	$(actorstr+' object').width(_imgWidth);
	$(actorstr+' embed').width(_imgWidth);

	$(actorstr+' IMG').height(h);
	$(actorstr+' object').height(h);
	$(actorstr+' embed').height(h);

	$(actorstr+' li').each(function(i){str+='<span></span>'});
	$(numInnerstr).width(numWidth).html(str);
	$(imgPlaystr+' .mc').width(numWidth);
	$(imgPlaystr+' .num').css('left',_numLeft);
	$(numInnerstr).css('left',_numLeft);
	$(imgPlaystr+' .num').css('top',_numTop);
	$(actorstr+' span').css('left',_desLeft);
	
	
	if(sType==9){
	    $(actorstr + ' span').css('top', _numTop);
	    $(numInnerstr + ' span').css('display', 'none');
	    $(numInnerstr).css('width', 80);
	}else if(sType==8){
	    $(actorstr+' span').css('top',_numTop);	    
	}else{
	    $(actorstr+' span').css('bottom',_desBottom);
	}
	
	$(actorstr+' span').css('background-color',bColor);
	$(actorstr+' span').css('color',fColor);
	$(numInnerstr).css('left',_numLeft+13);
	$(numInnerstr).css('top',_numTop);
	$(numInnerstr+' span:first').addClass('on');
	$(numInnerstr+' span').css('margin-top',_numMargin);
	if($(actorstr+' li').length<=1){
        $(imgPlaystr+' .num').css('display','none');
        if(sType!=9){ $(numInnerstr).css('display','none');}   
	    return;
	}
	
	function cur(ele,currentClass){ele=$(ele)?$(ele):ele;ele.addClass(currentClass).siblings().removeClass(currentClass)}
	$(imgPlaystr+' .next').click(function(){slide(1)});
	$(imgPlaystr+' .prev').click(function(){slide(-1)});
	function slide(j){
		if($(actorstr).is(':animated')==false){
			c+=j;
			if(c!=-1&&c!=n){
				$(actorstr).animate({'marginLeft':-c*w+'px'},speed)
			}else if(c==-1){
				c=n-1;$(actorstr).css({"marginLeft":-(w*(c-1))+"px"});
				$(actorstr).animate({"marginLeft":-(w*c)+"px"},speed)
			}else if(c==n){
				c=0;$(actorstr).css({"marginLeft":-w+"px"});
				$(actorstr).animate({"marginLeft":0+"px"},speed)
			}
			cur($(numInnerstr+' span').eq(c),'on')
		}
	}
	$(numInnerstr+' span').click(function(){c=$(this).index();fade(c);cur($(numInnerstr+' span').eq(c),'on')});
	function fade(i){
		if($(actorstr).css('marginLeft')!=-i*w+'px'){
			$(actorstr).css('marginLeft',-i*w+'px');
			$(actorstr).fadeOut(0,function(){$(actorstr).fadeIn(500)})
		}
	}
	function start(){t=setInterval(function(){slide(1)},5000)}
	function stopt(){if(t)clearInterval(t)}
	$(imgPlaystr).hover(function(){stopt()},function(){start()});
	start();
}
	
