$(document).ready(function(){
	$(".jsph").mouseover(function() {
		$(".jsph .jsphdiv").hide();
		$(this).children(".jsphdiv").show();
	}); 
	$(".dzph").mouseover(function() {
		$(".dzph .dzphdiv").hide();
		$(this).children(".dzphdiv").show();
	}); 
	$(".yzph").mouseover(function() {
		$(".yzph .yzphdiv").hide();
		$(this).children(".yzphdiv").show();
	});
	//首页机型
	$(".indexbd").mouseover(function() {
		var modelid = $(this).attr("id");
		var modelidtemp = modelid.split("_")[1];
		$(".c980 #mobile .model").hide();
		$("#indexmdl" + modelidtemp).show();
		$(".c980 #mobile .indexbd").removeClass("current");
		$(this).addClass("current");
	}); 
	//网游切换
	$("#netzxli").mouseover(function() {
		$("#netzxli").addClass("current");
		$("#netglli").removeClass("current");
		$("#strNetGameGLText").hide();
		$("#strNetGameZXText").show();
	});
	$("#netglli").mouseover(function() {
		$("#netglli").addClass("current");
		$("#netzxli").removeClass("current");
		$("#strNetGameZXText").hide();
		$("#strNetGameGLText").show();
	});
});

function loadjinpbytag2(id) {
	$.post('ajax.php?act=loadjinpbytag2',{tag2:id},function(data) {
		$("#goldtuijian1").empty();
		$("#goldtuijian1").append(data.goldgameappsstr1);
		$("#goldtuijian2").empty();
		$("#goldtuijian2").append(data.goldgameappsstr2);
    	return;
    },'json');
    $(".r3-2 .bd .list2 p a").attr("href",webaddr + "/gamelist/t" + id + "/sdownload_times/st/m/s_/l/p.html");
}

function selectModel() {
    var html='<div style="margin-left:40px">' +
		'<form action="'+webaddr+'/ajax.php?act=modelgamelist&' + new Date() + '" method="post">' +
		'<p>选择品牌：</p>' +
		'<p><select name="mp_brand_id" id="mp_brand_id" style="width:220px"></select></p>' +
		'<p>选择机型：</p>' +
		'<p><select name="mp_model_id" id="mp_model_id" style="width:220px"></select></p>' +
		'<p><input name="action" value="share" type="hidden">' +
		'<input type="submit" class="formbutton" value="选择" ' +
		'onclick="" />&nbsp;&nbsp;' +
		'<input class="formbutton" type="button" value="关闭" onclick="ye_dialog.close()"/></p></form></div>';
	ye_dialog.openHtml(html,'请选择您的手机型号','300','230');
	for (var index = 0; index < models.length; index++) {
		if(index == 0) {
			for (var index1 = 0; index1 < models[index].models.length; index1++) {
				$("<option value='" + models[index].models[index1].mp_model_id + "_" + models[index].models[index1].mp_model_name + "'>" + models[index].models[index1].mp_model_name + "</option>").appendTo("#mp_model_id");
			}
		}
		$("<option value='" + models[index].mp_brand_id + "_" + models[index].mp_brand_name + "'>" + models[index].mp_brand_name + "</option>").appendTo("#mp_brand_id");
	}
	$("#mp_brand_id").change(function(){
		$("#mp_model_id").empty();
		for (var index = 0; index < models.length; index++) {
			if(models[index].mp_brand_id == $(this).val().split("_")[0]) {
				if(typeof(models[index].models) != "undefined" && models[index].models.length != 0) {
					for (var index1 = 0; index1 < models[index].models.length; index1++) {
						$("<option value='" + models[index].models[index1].mp_model_id + "_" + models[index].models[index1].mp_model_name + "'>" + models[index].models[index1].mp_model_name + "</option>").appendTo("#mp_model_id");
					}
				}
			}
		}
	});
}
