﻿function HomepageLogon(){
	if(document.HPlogin.ItemType.value=="0"){
		alert("请先选择会员类别")
		return 
	}
	if(document.HPlogin.username.value=="" ){
	alert("您忘了填写会员名称，请输入会员名称。")
		return 
	}
	if(document.HPlogin.password.value=="" ){
	alert("您忘了填写密码，请输入密码。")
		return 
	}
	if(document.HPlogin.ItemType.value=="1"){
	document.HPlogin.action="/member/login.html?url=/index.asp"
	document.HPlogin.submit()
	}
	
	if(document.HPlogin.ItemType.value=="2"){
	
	document.HPlogin.action="http://my.maydeal.com/checkuser.aspx?url=http://www.maydeal.com"
	document.HPlogin.submit()
	}
}

var divs = document.getElementsByTagName("div");

function selectLayer1(id){
    var Showdiv = id.split("_");
    var pdiv = Showdiv[0];
    var pdivkey = Showdiv[1];
    for(i=0;i<divs.length;i++){
        var divArr = divs[i].id.split("_");
        
        if(divArr[0] == pdiv){
            
        if(divArr[1] == pdivkey){
            getbyid(id).style.display="block";
            
                }else{
            if(divArr[1] == "nav"){
                if(divArr[2] == pdivkey){
				   if (divs[i].id.indexOf('_a')!=-1)getbyid(divs[i].id).className = "currentnav0";
				   else if (divs[i].id.indexOf('_b')!=-1)getbyid(divs[i].id).className = "currentnav2";
                   else getbyid(divs[i].id).className = "currentnav";
                }else{
                   if (divs[i].id.indexOf('_a')!=-1)getbyid(divs[i].id).className = "subnav0";
				   else if (divs[i].id.indexOf('_b')!=-1)getbyid(divs[i].id).className = "subnav1";
                   else getbyid(divs[i].id).className = "subnav";
                }
            }else{
                getbyid(divs[i].id).style.display="none";
                
                    }
                }
        }   
    }
}
function getbyid(id) {
    if (document.getElementById) {
        return document.getElementById(id);
    } else if (document.all) {
        return document.all[id];
    } else if (document.layers) {
        return document.layers[id];
    } else {
        return null;
    }
}
function mostnewsN(obj)
{
    if(obj == "topnews_nav_1"){
        getbyid(obj).className = "div_52px_right_2";
        getbyid("topnews_nav_2").className = "div_52px_left_2";
        getbyid("topnews_1").style.display = "block";
        getbyid("topnews_2").style.display = "none";
    }
    if(obj == "topnews_nav_2"){
        getbyid(obj).className = "div_52px_left";
        getbyid("topnews_nav_1").className = "div_52px_right";
        getbyid("topnews_1").style.display = "none";
        getbyid("topnews_2").style.display = "block";
    }
}
