
	/*导航*/
$(function() {
    $("#mainNav li .nav").hover(function(){
		$(this).addClass("hover").siblings('div').show();
	},function(){
		$(this).removeClass("hover").siblings('div').hide();
	});
	$(".subNav").hover(function(){
		$(this).show().siblings('a').addClass("hover");
	},
	function(){
		$(this).hide().siblings('a').removeClass("hover");
	});
/*购物车*/
	$("#buyBike").hover(function(){
		showShopcartId();
		$(this).siblings('.buyList').show();
	},function(){
		//$(this).siblings('.buyList').hide();
		$("#buyList").hover(function(){
			$(this).show();
		},function(){
			$(this).slideUp();
		});
	});
	

	/*域名展开*/
$(function(){
	$("#yuming_open").toggle(function(){
			$(this).css({'background-position':'-41px top'});
	
			$(".content_m>ul").css({"height":"90px","z-index":"10"}).parents(".content_m").addClass("content_m_1");
		
		},function(){
			$(this).removeAttr('style');
			$(".content_m>ul").removeAttr('style').parents(".content_m").removeClass("content_m_1")
			})
})
$(function(){
	$("#yuming_open2").toggle(function(){
			$(this).css({'background-position':'-41px top'});
			$(".content_m2>ul").css({"height":"60px","z-index":"10"}).parents(".content_m2").addClass("content_m2_1")
		},function(){
			$(this).removeAttr('style');
			$(".content_m2>ul").removeAttr('style').parents(".content_m2").removeClass("content_m2_1")
			})
})
$(function(){
	$("#yuming_open3").toggle(function(){
			$(this).css({'background-position':'-41px top'});
			$(".content_m3>ul").css({"height":"60px","z-index":"10"}).parents(".content_m3").addClass("content_m3_1")
		},function(){
			$(this).removeAttr('style');
			$(".content_m3>ul").removeAttr('style').parents(".content_m3").removeClass("content_m3_1")
			})
})

/*选项卡公用*/
function scrollDoor(menus,divs,current,notCurrent,show,hide){
	  for(var i = 0 ; i < menus.length ; i++)
	  { 
			if(document.getElementById(menus[i]) == null){
				break;
			}
		   document.getElementById(menus[i]).value = i; 
		   document.getElementById(menus[i]).href = "javascript:;";    
		   document.getElementById(menus[i]).onclick = function(){			 
				for(var j = 0 ; j < menus.length ; j++)
				{      
					 document.getElementById(menus[j]).className = notCurrent;
					 document.getElementById(divs[j]).className = hide;
				}
				document.getElementById(menus[this.value]).className = current; 
				document.getElementById(divs[this.value]).className = show;  
		   }
	  }
 }

$(function(){
	scrollDoor(["yingwen","zhongwen","tongyong"],["yingwenText","zhongwenText","tongyongText"],"current","","","hide");
	//scrollDoor(["yingwen","zhongwen","tongyong"],["yingwenText","zhongwenText","tongyongText"],"current","","content","hide");
	scrollDoor(["yingwen2","zhongwen2"],["yingwenText2","zhongwenText2"],"current","","content","hide");
	scrollDoor(["con16t","con17t","con18t"],["con16","con17","con18"],"current","","content","hide");
	//scrollDoor(["geren","gongsi"],["gerenUl","gongsiUl"],"current","","infonForm_s","hide");
})


	})	

	/*栏目页左侧菜单* 马晓静*/
	$(function() {
 //menu内页左侧菜单悬浮效果12.12更改效果maxiaojing
 var timeOutId = -1;
 var timeOutId2 = -1;
$(".listContent_m a").hover( function() {
		clearTimeout( timeOutId );
		$(".sideMenue01_pop_m").css('top',65);
		var current = $(this);
		var alist = $(".listContent_m").find("a"); 
		var index = alist.index(current); 
		$(".listContent_m").find("a").removeClass("hover").css('color','#393834');
		$(this).addClass("hover").css('color','#FFF');
		$(".sideMenue01_pop_m").find("div.sideMenue01_popList_m").hide();
		$(".sideMenue01_pop_m").find(".popMen0"+index+"_ma").show();
		$(".sideMenue01_pop_m").css('top',function(i,c) { return parseFloat(c)+index*30;}).css({visibility:'visible'}); 
	}, function() {
		var target = $(this);		
		timeOutId = setTimeout(function() {
			//debugger;
			//alert($(".sideMenue01_pop_m").hasClass("hovered"));
			if (!$(".sideMenue01_pop_m").hasClass("hovered")) {
				$(target).removeClass("hover").css('color','#393834');	
				$(".sideMenue01_pop_m").css({visibility:'hidden'});
			} else {
				$(target).addClass("hover").css('color','#FFF');
			}
		},100);		
});
$(".sideMenue01_pop_m").hover(function() {
		$(this).addClass("hovered");
	},function() {
		$(this).removeClass("hovered").css({visibility:'hidden'});
		$(".listContent_m a").removeClass("hover").css('color','#393834');
		$(".sideMenue01_content_ul_m li").css('background-color','#FFF');
});
$(".sideMenue01_content_ul_m li").hover(function() {
		clearTimeout( timeOutId2 );
		$(this).css('background-color','#ce0909');											 
	}, function() {
		var target = $(this);
		target.css('background-color','#FFF');
		timeOutId2 = setTimeout(function() {
			if ($(".sideMenue01_pop_m").hasClass("hovered")){
				target.css('background-color','#ce0909');
			}else{
				target.css('background-color','#FFF');
			}
		},1);
});		
					
				//服务流程浮动效果
$(".position_ul_m .seeMore_ma").hover(function() {
	$(".position_pop_ma").css('visibility','visible');	
	},
	function() {
		setTimeout(function() {
			if (!$(".position_pop_ma").hasClass("on_ma")) {
				$(".position_pop_ma").css('visibility','hidden');
			}
		},200);
		});
$(".position_pop_ma").hover(function() {
	$(this).addClass("on_ma");
	}, function() {
		$(this).removeClass("on_ma").css('visibility','hidden');
});
//虚机浮动层
$(".hover_pop_ma").hover(function() {
		var current = $(this);
		var lis = $(".maninRight_style01Product_m").find(".hover_pop_ma");
		var index = lis.index(current);
		//alert(index);
		if( index +1 == lis.length) {
			$(".hotPop_m").find(".hotPop_Arror_m").hide();
			$(".hotPop_m").find(".hotPop_Arror_01_m").show();
			$(".hotPop_m").css("left",function(i,c) { return parseFloat(c)+(220)*index-430;}).css('visibility','visible');
		} else {
			$(".hotPop_m").css("left",function(i,c) { return parseFloat(c)+(220)*index;}).css('visibility','visible');
		}
	},
	function() {
			$(".hotPop_m").find(".hotPop_Arror_m").show();
			$(".hotPop_m").find(".hotPop_Arror_01_m").hide();		
		$(".hotPop_m").css("left",160).css('visibility','hidden');
	});

//主机服务页签切换
$(".topEffect_tiele_m ul li a").click(function() {
	var current = $(this); 
	var aList = current.parents(".topEffect_tiele_m").find("a");;//$(".topEffect_tiele_m").find("a");
	var index = aList.index(current);
	aList.removeClass("on");
	$(aList[index]).addClass("on"); 
	var divList = current.parents(".topEffect_tiele_m").next().find(".topEffect_con_m");//$(".topEffect_box_m").find(".topEffect_con_m"); 
	divList.hide();
	$(divList[index]).show();
});
})

$(function() {
	$(".topEffect_tiele_m ul li a").click(function() {
		var current = $(this); 
		var aList = current.parents(".topEffect_tiele_m").find("a");//  $(".topEffect_tiele_m").find("a");
		var index = aList.index(current);
		aList.removeClass("on01");
		$(aList[index]).addClass("on01"); 
		var divList = current.parents(".topEffect_tiele_m").next().find(".topEffect_con_m");//$(".topEffect_box_m").find(".topEffect_con_m"); 
		divList.hide();
		$(divList[index]).show();
	});
})

				
				//购买组合
/*2013-01-10 白羽注释
$(function() {
$(".processLeft_font01_m input[name='buyGroup']").click(function() {
	var value = $(this).val();
	var pdiv = $(this).parents('.processLeft_font01_m').get(0);
	if ( $(this).attr('checked') ) { 
		$(pdiv).siblings().children("div").addClass("on"); 
		$(".processRight_con_m .totol_mktprice_ma").text(  parseFloat(value) +  parseFloat( $(".processRight_con_m .totol_mktprice_ma").text() )  );
		$(".processRight_con_m .totol_saleprice_ma").text(  parseFloat(value) +  parseFloat( $(".processRight_con_m .totol_saleprice_ma").text() )  );
	} else {
		$(pdiv).siblings().children("div").removeClass("on"); 
		$(".processRight_con_m .totol_mktprice_ma").text( $(".processRight_con_m .totol_mktprice_ma").text() - value );
		$(".processRight_con_m .totol_saleprice_ma").text( $(".processRight_con_m .totol_saleprice_ma").text() - value );
	}
	var length = $(".processLeft_font01_m input[name='buyGroup']:checked").length + 1;
	$(".processRight_con_m .totol_num_ma").text(length);
	//alert($(this).attr('checked'));

});
})
*/
//域名增值
$(".DomainCon01RightInput_m input[name='serviceGroup']").click(function() {
	var value = $(this).val();
	var pdiv = $(this).parents('.DomainCon01RightInput_m').get(0);
	if ( $(this).attr('checked') ) { 
		$(pdiv).siblings().children("div").addClass("on"); 
		$(".DomainCon01Right_price_m .totol_mktprice_ma").text(  parseFloat(value) +  parseFloat( $(".DomainCon01Right_price_m .totol_mktprice_ma").text() )  );
		$(".DomainCon01Right_price_m .totol_saleprice_ma").text(  parseFloat(value) +  parseFloat( $(".DomainCon01Right_price_m .totol_saleprice_ma").text() )  );
	} else {
		$(pdiv).siblings().children("div").removeClass("on"); 
		$(".DomainCon01Right_price_m .totol_mktprice_ma").text( $(".DomainCon01Right_price_m .totol_mktprice_ma").text() - value );
		$(".DomainCon01Right_price_m .totol_saleprice_ma").text( $(".DomainCon01Right_price_m .totol_saleprice_ma").text() - value );
	}
});

/*宋义无缝滚动*/
window.onload=function ()
{
	var oDiv=document.getElementById('they');
	if(oDiv == null){
		return;
	}
	var oUl=oDiv.getElementsByTagName('ul')[0];
	
	var aLi=oUl.getElementsByTagName('li');
	var oA=document.getElementById('rolling');
	var aA=oA.getElementsByTagName('a');
	var timer=null;
	var iSpeed=-3;
	oUl.innerHTML+=oUl.innerHTML;
	oUl.style.width=aLi.length*aLi[0].offsetWidth+'px';
	function fnMove()
	{
		if(oUl.offsetLeft<-oUl.offsetWidth/2)
		{
			oUl.style.left=0;
		}
		else if(oUl.offsetLeft>0)
		{
			oUl.style.left=-oUl.offsetWidth/2+'px';
		}
		oUl.style.left=oUl.offsetLeft+iSpeed+'px';
	}
	timer=setInterval(fnMove, 90);
	aA[0].onclick=function ()
	{
		iSpeed=-3;
	};
	aA[1].onclick=function ()
	{
		iSpeed=3;
	};
	oDiv.onmouseover=function ()
	{
		clearInterval(timer);
	};
	oDiv.onmouseout=function ()
	{
		timer=setInterval(fnMove, 90);
	};
}


$(function(){
	$('.mail_B_customer .tit a').click(function(){
		$('.mail_B_customer .con').hide();
		$('.mail_B_customer .tit .on').removeClass('on');
		$(this).addClass('on');
		var ids = $(this).attr('id');
		$(ids).show();
		return false;
	});	
	$('.mail_standard .tit a').click(function(){
		$('.mail_standard .con').hide();
		$('.mail_standard .tit .on').removeClass('on');
		$(this).addClass('on');
		var ids = $(this).attr('id');
		$(ids).show();
		return false;
	});
		})

	$(function(){
	$('.mail_they .tit a').click(function(){
		$('.mail_they .con').hide();
		$('.mail_they .tit .on').removeClass('on');
		$(this).addClass('on');
		var ids = $(this).attr('id');
		$(ids).show();
		return false;sumPriceSpan
	});
	//$(".mail_they2 .con3").hide();
	$('.mail_they2 .tit2 a').click(function(){
		$('.mail_they2 .con3').hide();
		$('.mail_they2 .tit2 .on').removeClass('on');
		$(this).addClass('on');
		var ids = $(this).attr('id');
		$(ids).show();
		return false;
	});
	//$(".mail_they2 .con3").hide();
	$('.mail_they3 .tit3 a').click(function(){
		$('.mail_they3 .con3').hide();
		$('.mail_they3 .tit3 .on').removeClass('on');
		$(this).addClass('on');
		var ids = $(this).attr('id');
		$(ids).show();
		return false;
	});
	})
	


$(function(){
	//传统云主机 云主机切换
	$(".cloudHostTab_y li a").click(function(){
		$(".cloudHostTab_y li a").removeClass("currTab");
		$(this).addClass("currTab");
		var cont_id="#"+$(this).attr("id")+"cont";
		$(".cloudHostCont_y").hide();
		$(cont_id).show();
		return false;
	});
	//传统云主机
	$(".chuantonghost_type div").mouseover(function(){
		$(".chuantonghost_type div").removeClass("currBtn");
		$(this).addClass("currBtn");
		var cont_id="#"+$(this).attr("id")+"cont";
		$(".chuantongcont").hide();
		$(cont_id).show();
	});
	//云主机配置设置
	//机型预设数据
	var recommends=[{},
		{cpu:"1",mem:"512M",disk:"30",band:"3"},
		{cpu:"2",mem:"1G",disk:"40",band:"4"},
		{cpu:"3",mem:"1_5G",disk:"50",band:"5"},
		{cpu:"4",mem:"2G",disk:"100",band:"6"}
	]
	//Button切换统一控制
	function toggleBtn(currbtn){
		currbtn.parent().children("a").removeClass("currBtn");
		currbtn.addClass("currBtn");
	}
	//设置CPU
	function setCPU(id){
		toggleBtn($("#c"+id));
	}
	
//	//设置服务器尺寸
//	function hosttuoguan_server(id){
//		toggleBtn($("#sv"+id));
//	}
	//设置内存
	function setMem(id){
		toggleBtn($("#m"+id));
	}
	function setDisk(val){
		$( "#slider_disk" ).slider({value:val});
		$( "#amount_disk" ).val( val );
	}
	function setBand(val){
		$( "#slider_band" ).slider({value:val});
		$( "#amount_band" ).val(val);
	}
	//机型配置判断
	function checkRecommend(){
		var cpu_id=$(".cpu_y .currBtn").attr("id").substr(1);
		var mem_id=$(".mem_y .currBtn").attr("id").substr(1);
		var disk=$( "#amount_disk" ).val();
		var band=$( "#amount_band" ).val();
		
		var is_match=false;
		for(var i=1;i<recommends.length;i++){
			var rec=recommends[i];
			if(rec.cpu==cpu_id && rec.mem==mem_id && rec.disk==disk && rec.band == band){
				toggleBtn($("#r"+i));
				is_match=true;
			}
		}
		if(is_match==false){
			$(".recommend_y a").removeClass("currBtn");
		}
	}
	//推荐配置
	$(".recommend_y a").click(function(){
		toggleBtn($(this));
		var id=$(this).attr("id").substr(1);
		var rec=recommends[id];
		setCPU(rec.cpu);
		setMem(rec.mem);
		setDisk(rec.disk);
		setBand(rec.band);
		changeAClassUnUse();
		getPrice();
		return false;
	});
	//cpu
	$(".cpu_y a").click(function(){
		var id=$(this).attr("id").substr(1);
		setCPU(id);
		checkRecommend();
		changeAClassUnUse();
		getPrice();
		return false;
	});
	//memory
	$(".mem_y a").click(function(){
		var id=$(this).attr("id").substr(1);
		setMem(id);
		checkRecommend();
		changeAClassUnUse();
		getPrice();
		return false;
	});
	//硬盘slider
	if($( "#slider_disk" ).size()>0){
		changeAClassUnUse();
		getPrice();
		$( "#slider_disk" ).slider({
			range: "min",
			value: 30,
			min: 30,
			max: 100,
			step: 10,
			slide: function( event, ui ) {
				var val=(ui.value==0)?1:ui.value;
				$( "#amount_disk" ).val( val );
				checkRecommend();
				changeAClassUnUse();
				getPrice();
			}
		});
		$( "#amount_disk" ).val( 30 );
	}
	//带宽slider
	if($( "#slider_band" ).size()>0){
		changeAClassUnUse();
		getPrice();
		$( "#slider_band" ).slider({
			range: "min",
			value: 3,
			min: 3,
			max: 6,
			slide: function( event, ui ) {
				$( "#amount_band" ).val( ui.value );
				checkRecommend();
				changeAClassUnUse();
				getPrice();
			}
		});
		$( "#amount_band" ).val( 3 );
	}
	
	
	//主机托管
	$(".hosttuoguancpu_y a,.hosttuoguanmem_y a,.hosttuoguandisk_y a,.hosttuoguannet_y a").click(function(){
		toggleBtn($(this));
		return false;
	});
	/*
	if($( "#slider_rent_band" ).size()>0){
		$( "#slider_hosttg_band" ).slider({
			range:"min",
			value:4,
			min:1,
			max:20,
			step:1,
			slide: function( event, ui ) {
				var val=(ui.value==0)?1:ui.value;
				$( "#slider_rent_band" ).val( val );
			}
		});
		$( "#amount_rent_band" ).val( 4 );
	}
	*/
	$("#hosttg_btn_y").click(function(){
		var cpu_val=$(".hosttuoguancpu_y .currBtn").html();
		var mem_val=$(".hosttuoguanmem_y .currBtn").html();
		var disk_val=$(".hosttuoguandisk_y .currBtn").html();
		var ip_val=$("#hosttg_ip").val();
		var band_val=$( "#amount_hosttg_band" ).val();
		var netcard_val=$(".hosttuoguannet_y .currBtn").html();
		$("#cloudtip_cpu").html(cpu_val);
		$("#cloudtip_mem").html(mem_val);
		$("#cloudtip_disk").html(disk_val);
		$("#cloudtip_ip").html(ip_val);
		$("#cloudtip_band").html(band_val);
		$("#cloudtip_netcard").html(netcard_val);
		return false;
	});
		
	//主机租用
	$(".hostrent_server_y a").click(function(){
		toggleBtn($(this));
		var totalChangeCpu = parseInt($(this).attr("name"))+ parseInt($("input:radio[name=radio2]:checked").val()) + parseInt($("input:radio[name=radio2daikuan]:checked").val());
		var yearCount = $("#year_y").val();
		$("#hostfontred_y_changeMoeny").text(totalChangeCpu*yearCount);
		return false;
	});
	if($( "#slider_rent_band" ).size()>0){
			$( "#slider_rent_band" ).slider({
				range: "min",
				value: 1,
				min: 1,
				max: 20,
				step: 1,
				slide: function( event, ui ) {
					//var val=(ui.value==0)?1:ui.value;
					var val=(ui.value==0)?1:ui.value;
				if(falgtemp=="1"){
					$( "#amount_rent_band" ).val( val );
					$("input:radio[name=radio2daikuan]:checked").val(parseInt(val * 450));
					var totalDaikuan22 = parseInt($(".hostrent_server_y").find("a[class=currBtn]").attr("name"))+ parseInt($("input:radio[name=radio2]:checked").val()) + parseInt($("input:radio[name=radio2daikuan]:checked").val());
					var yearCount = $("#year_y").val();
					daikuanSubmiShow = $( "#amount_rent_band" ).val()+"M";
					$("#hostfontred_y_changeMoeny").text(totalDaikuan22*yearCount);
					}
				}
			});

		$( "#amount_rent_band" ).val( 1 );
	}
	$("#hostrent_btn_y").click(function(){
		var cpu_val=$(".hostrent_server_y .currBtn").html();
		var ip_val=$("#hostrent_ip").val();
		var band_val=$( "#amount_rent_band" ).val();
		var year_val=$("#year_y").val();
		$("#cloudtip_server").html(cpu_val);
		$("#serverroom_server").html("苏州机房");
		$(".addcar_y_huise").attr("class","addcar_y");
		addshopcarFlag="true";
		$("#serverRoomhidden").val("苏州机房");
		$("#customCpuhidden").val(cpu_val);
		$("#customIpNumhidden").val(ipSubmiShow);
		$("#dandwidthSizehidden").val(daikuanSubmiShow);
		$("#purchaseYearshidden").val(year_val);
		//updateOline
		if(cpu_val=="1U"){
			$("#goodsCodehidden").val("52149527828972");
		}else if (cpu_val=="2U"){
			$("#goodsCodehidden").val("88738382059238");
		}else if (cpu_val=="4U"){
			$("#goodsCodehidden").val("93433780837434");
		}
		if(cpu_val=="1U" && year_val=="1"){
			$("#priceCodehidden").val("88279704242399");
		}else if (cpu_val=="1U" && year_val=="2"){
			$("#priceCodehidden").val("88502744811314");
		}else if (cpu_val=="2U" && year_val=="1"){
			$("#priceCodehidden").val("79961536089407");
		}else if (cpu_val=="2U" && year_val=="2"){
			$("#priceCodehidden").val("59221054964268");
		}else if (cpu_val=="4U" && year_val=="1"){
			$("#priceCodehidden").val("99198144664763");
		}else if (cpu_val=="4U" && year_val=="2"){
			$("#priceCodehidden").val("99428777251910");
		}
		//alert(cpu_val);
		//alert(year_val);
		//endupdateOline
		$("#cloudtip_ip2").html(ipSubmiShow);
		$("#cloudtip_band2").html(daikuanSubmiShow);
		$("#cloudtip_year2").html(year_val+"年");
		var totalSubmitMoney = parseInt($(".hostrent_server_y").find("a[class=currBtn]").attr("name"))+ parseInt($("input:radio[name=radio2]:checked").val()) + parseInt($("input:radio[name=radio2daikuan]:checked").val());
		var yearCount = $("#year_y").val();
		$("#purchaseSumhidden").val(totalSubmitMoney);
		$("#hostfontred_y_id").html(totalSubmitMoney*yearCount);
		
		return false;
	});
	/*搜索下拉菜单              新添*/
	$(function(){
		$("#search_select1").click(function(){
			$("#search_menu1").toggle();
			this.blur();
		});
		$("#search_select2").click(function(){
			$("#search_menu2").toggle();
			this.blur();
		});
		$("#search_select3").click(function(){
			$("#search_menu3").toggle();
			this.blur();
		});
		$("#search_menu1 li").click(function(){
			$("#search_select1").attr("value",$(this).text());
			$(this).parent().hide();
		})
		$("#search_menu2 li").click(function(){
			$("#search_select2").attr("value",$(this).text());
			$(this).parent().hide();
		})
		$("#search_menu3 li").click(function(){
			$("#search_select3").attr("value",$(this).text());
			$(this).parent().hide();
		})
		$(".search_menu li").hover(function(){
			$(".search_menu li").removeClass("on");
			$(this).addClass("on");
		})
	})
	/*虚拟主机弹出层*/
	//虚拟主机 加入购物车 按钮弹出层
		$('.addCart').click(function(){
		//$(this).next('.tipCen').show();
		$(this).parent().children('.tipCen_y').show();
		return false;
	});
	$('.tipCen_y .tit_y a,.tipCen_y .tit2 a').click(function(){
		var className=$(this).attr("class");
		if(className == "son"){
			$(this).parent().parent('.tipCen_y').hide();
		}else{
			//getNearParent($(this), '.tipCen');
			$(this).parents('.tipCen_y').hide();
		}
		return false;
	});

	$('.buyCentipCen_y .tipCen_y .con_y .btns a.fontRed2').click(function(){
		$(this).parent('.btns').parent('.con_y').parent('.tipCen_y').hide();
		return false;
	});
	
	
})



//页面计算价格
function getPrice(){
	var sumPrice=0;
	var cpuNumber=0;
	var memoryNumber=0;
	var disk=$("#amount_disk").val();
	var diskNumber=parseFloat(disk)/10;
	var bwNumber=$("#amount_band").val();
	var serviceRoom=$("#year_y2").val();
	$(".currBtn").each(function (){
		var ids=$(this).attr("id")
		if(ids.indexOf("c")==0&&ids.length==2){
			cpuNumber=ids.substring(1);
		} 
		if(ids.indexOf("m")==0){
			memoryNumber=ids.substring(1);
			if(memoryNumber=="1_5G"){
				memoryNumber=3;
			}
			if(memoryNumber=="512M"){
				memoryNumber=1;
			}
			if(memoryNumber=="1G"){
				memoryNumber=2;
			}
			if(memoryNumber=="2G"){
				memoryNumber=4;
			}
		}
	});
	var buyTime=$("#year_y").val();
	var yearPriceArray=buyTime.split("_");
	var years=yearPriceArray[0];
	var timeUnit="";
	if(years.indexOf("M")>0){
		timeUnit="M";
		years=years.replace("M","");
	}else{
		timeUnit="Y";
		years=years.replace("Y","");
	}
	var mainPrice=yearPriceArray[1];
	var cpuPrice=$("#cpuPrice").val();
	var memoryPrice=$("#memoryPrice").val();
	var storagePrice=$("#storagePrice").val();
	var bandWidthPrice=$("#bandWidthPrice").val();
	var serviceRoomPrice=0;
	if(serviceRoom=="ZW"){
		serviceRoomPrice=$("#ZWPrice").val();
	}else if(serviceRoom=="SZ"){
		serviceRoomPrice=$("#SZPrice").val();
	}else if(serviceRoom=="GH"){
		serviceRoomPrice=$("#GHPrice").val();
	}
	var zdyPrice=$("#zdyPrice").val();
	//alert("cpu的数量是:"+cpuNumber+",内存的数量是:"+memoryNumber+",硬盘的数量是:"+diskNumber+",带宽的数量是:"+bwNumber);
	//alert("cpu的价格是:"+parseFloat(cpuPrice)*parseFloat(cpuNumber));
	//alert("内存的价格是:"+parseFloat(memoryPrice)*parseFloat(memoryNumber));
	//alert("硬盘的数量是:"+parseFloat(storagePrice)*parseFloat(diskNumber));
	//alert("带宽的价格是:"+parseFloat(bandWidthPrice)*parseFloat(bwNumber));
	var cpuCountPrice=0;
	var memoryCountPrice=0;
	var diskCountPrice=0;
	var bwCountPrice=0;
	var serviceRoomCountPrice=0;
	if(timeUnit=="M"){
		cpuCountPrice=parseFloat(cpuPrice)*parseFloat(cpuNumber);
		memoryCountPrice=parseFloat(memoryPrice)*parseFloat(memoryNumber);
		diskCountPrice=parseFloat(storagePrice)*parseFloat(diskNumber);
		bwCountPrice=parseFloat(bandWidthPrice)*parseFloat(bwNumber);
		sumPrice=parseFloat(cpuCountPrice)+parseFloat(memoryCountPrice)+parseFloat(diskCountPrice)+parseFloat(bwCountPrice)+parseFloat(serviceRoomPrice);
		sumPrice=parseFloat(sumPrice)*parseFloat(years);
		sumPrice=parseFloat(sumPrice)+parseFloat(mainPrice);
		$("#sumPriceSpanView").html(sumPrice+"元/"+years+"月");
	}else{
		cpuCountPrice=parseFloat(cpuPrice)*parseFloat(cpuNumber);
		memoryCountPrice=parseFloat(memoryPrice)*parseFloat(memoryNumber);
		diskCountPrice=parseFloat(storagePrice)*parseFloat(diskNumber);
		bwCountPrice=parseFloat(bandWidthPrice)*parseFloat(bwNumber);
		sumPrice=parseFloat(cpuCountPrice)+parseFloat(memoryCountPrice)+parseFloat(diskCountPrice)+parseFloat(bwCountPrice)+parseFloat(serviceRoomPrice);
		sumPrice=parseFloat(sumPrice)*parseFloat(years)*parseFloat(12);
		sumPrice=parseFloat(sumPrice)+parseFloat(mainPrice);
		$("#sumPriceSpanView").html(sumPrice+"元/"+years+"年");
	}
	
	
}



/*往内容页面里加上当前二级导航项的class*/
$(function(){

if(document.getElementById('navSecNow') != null){
	//$('.nav .cur').hide();
	var num1 = parseInt($('#navSecNow .f').text());
	var num2 = parseInt($('#navSecNow .s').text());
	$('#mainNav li .nav').eq(num1).addClass('hover');
	//$('.nav .navFir ul .on .navSec li').eq(num2).addClass('on1');
}

$('#mainNav li .nav').hover(function(){
	//$('.nav .navFir ul .on .navSec').hide();									
	$('#mainNav li .nav').removeClass('hover');									
	$(this).addClass('hover');
	//$('.nav .navFir ul .on .navSec').show();
	//$('.nav .cur').hide();
})
});
/*结束*/
/*2012-12-31新增*/
$(function(){
	$(".server_menu_y").click(function(){
		var txt=$(this).text();
		var current = $(".topEffect_tiele_m a:contains('"+txt+"')");
		var aList = current.parents(".topEffect_tiele_m").find("a");;//$(".topEffect_tiele_m").find("a");
		var index = aList.index(current);
		aList.removeClass("on");
		$(aList[index]).addClass("on"); 
		var divList = current.parents(".topEffect_tiele_m").next().find(".topEffect_con_m");//$(".topEffect_box_m").find(".topEffect_con_m"); 
		divList.hide();
		$(divList[index]).show();
		return false;
	});
});

