$(function(){
	//去掉A链接虚线框
	$("a").bind("focus",function(){if(this.blur)this.blur();});
		   
	$("#tabBoxA").uetab();
	$("#tabBoxB").uetab();
	
	//按钮点击跳转(需要跳转的按钮请添加title属性并赋值为需跳转页面的URL)
	$(".loca").click(function(){								
		if ($(this).attr("title")){
			window.location = $(this).attr("title");
		}
	})
	
	//弹出窗口
	$(".openNew").click(function(){
		window.open($(this).attr("href"),"payDet","height=250,width=500");
		return false;
	})

	//左侧导航
	$(".secondNav h4 span.secHeadTit").toggle(function(){
		$(this).removeClass("secHeadTit");
		$(this).parent().parent().find("ul").slideUp("fast");
	},function(){
		$(this).addClass("secHeadTit");
		$(this).parent().parent().find("ul").slideDown("fast");
	})

	$("div.dateTable table tr:even td").css("background","#f6f6f6");
	$("div.tableListB table tr:even td").css("background","#f2f5f8");
	$("div.content .hostTable tr:odd td").css("background","url(../style/skin2/img/host_bg.png) 0 -206px repeat-x");
	

	$("input[name=fp]").click(function(){
		if ($("input[name=fp]").eq(0).attr("checked")){
			$("#hideArea").show();
			$("#showArea").hide();
		} else {
			$("#hideArea").hide();
			$("#showArea").show();
		}
	})
	$("input[name=zffs]").click(function(){
		if ($("input[name=zffs]").eq(1).attr("checked")){
			$("#hideArea").show();
			$("#showArea").hide();
		} else {
			$("#hideArea").hide();
			$("#showArea").show();
		}
	})
	
	$(".qtip").hover(function(e){
		$("#quickTip").show();
		$("#quickTip").css({top:e.pageY+5,left:e.pageX+5});
	},function(){
		$("#quickTip").hide();
	})
	
	$("input[name=dnsType]").click(function(){
		if ($("input[name=dnsType]").eq(0).attr("checked")){
			$("#xindns").show();
			$("#othdns").hide();
		} else {
			$("#xindns").hide();
			$("#othdns").show();
		}
	})
	
	$("p.payTypeTip").eq(1).hide();
	$("input[name=payType]").click(function(){
	if($("input[name=payType]").eq(0).attr("checked")){
		$("p.payTypeTip").eq(0).show();
		$("p.payTypeTip").eq(1).hide();
	} else {
		$("p.payTypeTip").eq(1).show();
		$("p.payTypeTip").eq(0).hide();
	}
	})
	
	//显示隐藏
	$(".showHide").click(function(){
		var showTag = "#" + $(this).attr("showHide");
		$(showTag).show();
		return false;
	})

	
	//弹出层
//	//成功弹出层1
//	$(".right").click(function(){
//		var str = "<div class='popLay'><h4>正确<span class='ca'>&nbsp;</span><span class='cb'>&nbsp;</span></h4><div class='cont'><p class='tit right'>您已成功购买：<span class='fontFE8400'>abc.com</span>！您已成功购买：<span class='fontFE8400'>abc.com</span>！您已成功购买：<span class='fontFE8400'>abc.com</span>！您已成功购买：<span class='fontFE8400'>abc.com</span>！您已成功购买：<span class='fontFE8400'>abc.com</span>！您已成功购买：<span class='fontFE8400'>abc.com</span>！</p><div class='opArea'><a href='domreg_buy.html' class='btnBuy1 closePop'><span>确认</span></a></div></div></div><div class='maskLay'>&nbsp;</div>";
//		$("body","html").css({height: "100%", width: "100%"});
//		$("body").append(str);
//		$("select").hide(); 
//		
//		clientWi = (document.compatMode == 'CSS1Compat') ? document.documentElement.clientWidth : document.body.clientWidth;
//		$(".popLay").css("left",(clientWi-500)/2); 
//		return false;
//	})
//	//成功弹出层2
//	$(".right2").click(function(){
//		var str = "<div class='popLay'><h4>正确<span class='ca'>&nbsp;</span><span class='cb'>&nbsp;</span></h4><div class='cont'><p class='tit right'>您选择的商品<span class='fontFE8400'>abc.com</span> 已经放入结算中心，您可以到<a href='cent_acc_blance.html'>结算中心</a>结算。</p><div class='opArea'><p>如果该业务15天内未结算，将被自动删除！</p><a href='domreg_buy.html' class='btnBuy1 closePop'><span>确认</span></a></div></div></div><div class='maskLay'>&nbsp;</div>";
//		$("body","html").css({height: "100%", width: "100%"});
//		$("body").append(str);
//		$("select").hide(); 
//		
//		clientWi = (document.compatMode == 'CSS1Compat') ? document.documentElement.clientWidth : document.body.clientWidth;
//		$(".popLay").css("left",(clientWi-500)/2); 
//		return false;
//	})
//	//未成功弹出层
//	$(".error").click(function(){
//		var str = "<div class='popLay'><h4>错误<span class='ca'>&nbsp;</span><span class='cb'>&nbsp;</span></h4><div class='cont'><p class='tit err'>您购买的域名：<span class='fontFE8400'>abc.com</span>未能购买成功！</p><div class='opArea'><a href='domreg_buy.html' class='btnBuy1 closePop'><span>确认</span></a></div></div></div><div class='maskLay'>&nbsp;</div>";
//		$("body").append(str);
//		$("select").hide(); 
//		
//		clientWi = (document.compatMode == 'CSS1Compat') ? document.documentElement.clientWidth : document.body.clientWidth;
//		$(".popLay").css("left",(clientWi-500)/2); 
//		return false;
//	})
	
		//关闭弹出层
	$(".closePop").live("click",function(){
		$(".popLay,.maskLay").remove();
		$("select").show(); 
		var O_input = $(this).attr("info1");
		$("#"+O_input).focus();
		if ($(this).attr("title")){
			window.location = $(this).attr("title");
		}
		return false;
	})
	
	//
	$(".tableTab li").each(function(i){
		$(this).click(function(){
			$(".tableTab li.now").removeClass("now");
			$(this).addClass("now");
			$(".listTable").hide();
			$(".listTable").eq(i).show();
		})
	})
})

//tab 插件
;(function($){
	$.fn.extend({
		"uetab":function(opt){
			//默认配置
			opt = $.extend({
				tabId:"uetab",  //tab的默认容器ID
				switchWay:"click",    //切换方式
				firstOpen:0,    //默认打开的页签		
				auto:false,     //是否自动切换
				delay:2000,     //自动切换速度(ms)
				ajaxLoad:false, //是否异步加载内容
				ajaxURI:"#"     //异步加载内容的地址
			},opt);
			
			var tabId = this;
			//默认打开页签
			$(".tabNav a",tabId).eq(opt.firstOpen).addClass("active");
			$(".tabCont",tabId).not($(".tabCont",tabId).eq(opt.firstOpen)).hide();
			
			if(opt.switchWay=="click"){
				//鼠标点击切换
				$(".tabNav a",tabId).each(function(i){
					$(this).bind("click",function(){
						$(".tabNav a.now",tabId).removeClass("now");
						$(this).addClass("now");
						
						$(".tabCont:visible",tabId).hide();
						$(".tabCont",tabId).eq(i).show();
						
						return false;
					})
				})
			} else if (opt.switchWay=="hover") {
				//鼠标划过切换
				$(".tabNav a",tabId).each(function(i){
					$(this).bind("hover",function(){
						$(".tabNav a.now",tabId).removeClass("now");
						$(this).addClass("now");
						
						$(".tabCont:visible",tabId).hide();
						$(".tabCont",tabId).eq(i).show();
					},function(){
							
					})
				})
			}
			
			
			
		}
	})
})(jQuery)
