﻿
var stmnLEFT = 1185; // 
var stmnGAP1 = 55; // 
var stmnGAP2 = 70; // 
var stmnBASE = 414; // 
var stmnActivateSpeed = 200; // 
var stmnScrollSpeed = 10; // 
var stmnTimer;


function RefreshStaticMenu(){

	var mytop=getTop(document.getElementById("STATICMENU").style.top);
	var top=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;

	mytop+=(top+stmnGAP1-mytop)/10;
	document.getElementById("STATICMENU").style.top =mytop+"px"; 
	stmnTimer = setTimeout ("RefreshStaticMenu();", 20);
}

function InitializeStaticMenu(){
	var top=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;

	document.getElementById("STATICMENU").style.top = stmnGAP1+"px"; 
	//
	document.getElementById("STATICMENU").style.left = stmnLEFT+"px"; 

	RefreshStaticMenu(); 
}

function getTop(s){
	return parseInt(s, 10);
}

$(function () {
    $("#aright").mouseover(function () {
        $("#maq").attr("direction", "right");
    });
    $("#aleft").mouseover(function () {
        $("#maq").attr("direction", "left");
    });
});

$(document).ready(function () {
    $("#btntest").click(function () {
        if ($("#father").val() == "") {
            alert("请填写父亲身高！");
            return false;
        }
        if ($("#mother").val() == "") {
            alert("请填写母亲身高！");
            return false;
        }
        if (isNaN($("#father").val()) || isNaN($("#mother").val())) {
            alert("请填写数字！");
            return false;
        }

        var maxh = 0;
        var minh = 0;
        var h1 = parseInt($("#father").val());
        var h2 = parseInt($("#mother").val());
        var s = $("#sex").val();

        if ($("#sex")[0].checked) {
            maxh = (parseInt(h1) + parseInt(h2) + 13) / 2 + 5;
            minh = (parseInt(h1) + parseInt(h2) + 13) / 2 - 5;
        } else {
            maxh = (parseInt(h1) + parseInt(h2) - 13) / 2 + 5;
            minh = (parseInt(h1) + parseInt(h2) - 13) / 2 - 5;
        }

        $("#maxheight").html("<font color='#FF0000'>" + maxh + "&nbsp;cm</font>");
        $("#minheight").html("<font color='#FF0000'>" + minh + "&nbsp;cm</font>");
        return false;
    });
});


$(document).ready(function () {
    var maleshow = true;
    $("#btnmale").click(function () {
        if (maleshow == false) {
            $(this).attr("src", "./Images/bt_ga_02.jpg");
            $("#btnfemale").attr("src", "./Images/bt_ga_03_b.jpg");
            $("#listmale").show();
            $("#listfemale").hide();
            maleshow = true;
        }
        return false;
    });
    $("#btnfemale").click(function () {
        if (maleshow == true) {
            $(this).attr("src", "./Images/bt_ga_03.jpg");
            $("#btnmale").attr("src", "./Images/bt_ga_02_b.jpg");
            $("#listmale").hide();
            $("#listfemale").show();
            maleshow = false;
        }
        return false;
    });

});	

