﻿// JavaScript Document
function scrollDoor2() {
}
scrollDoor2.prototype = {
    sd: function (menus, divs, openClass, closeClass) {
        var _this = this;
        if (menus.length != divs.length) {
            alert("菜单层数量和内容层数量不一样!");
            return false;
        }
        for (var i = 0; i < menus.length; i++) {
            _this.$(menus[i]).value = i;
            _this.$(menus[i]).onmouseover = function () {

                for (var j = 0; j < menus.length; j++) {
                    _this.$(menus[j]).className = closeClass;
                    _this.$(divs[j]).style.display = "none";
                }
                _this.$(menus[this.value]).className = openClass;
                _this.$(divs[this.value]).style.display = "block";
            }
        }
    },
    $: function (oid) {
        if (typeof (oid) == "string")
            return document.getElementById(oid);
        return oid;
    }
}
window.onload = function () {
    var SDmodel2 = new scrollDoor2();
    SDmodel2.sd(["n01", "n02"], ["s01", "s02"], "sn01", "sn02");
    SDmodel2.sd(["n03", "n04"], ["s03", "s04"], "sn01", "sn02");
    SDmodel2.sd(["n05", "n06"], ["s05", "s06"], "sn01", "sn02");
    SDmodel2.sd(["n07", "n08"], ["s07", "s08"], "sn01", "sn02");
    SDmodel2.sd(["yhwlptop1", "yhwlptop2"], ["yhwlptops1", "yhwlptops2"], "index-h-top-1", "index-h-top-2");
    SDmodel2.sd(["yhwlp1", "yhwlp2", "yhwlp3", "yhwlp4", "yhwlp5", "yhwlp6"], ["yhwlps1", "yhwlps2", "yhwlps3", "yhwlps4", "yhwlps5", "yhwlps6"], "yhw_lpquyu_li2", "yhw_lpquyu_li3");
}

function YCFCWSearch() {
    var indexkey = encodeURIComponent(document.getElementById("search_key").value);
    var indexsort = encodeURIComponent(document.getElementById("mySle").value);
    if (indexkey == "") { alert("请输入您要查找的关键字..."); return; }
    if (indexkey == "%E8%AF%B7%E8%BE%93%E5%85%A5%E6%82%A8%E8%A6%81%E6%9F%A5%E6%89%BE%E7%9A%84%E5%85%B3%E9%94%AE%E5%AD%97...") { alert("请输入您要查找的关键字！"); return; }
    var indexurl = "www.ycfcw.cn";
    switch (indexsort) {
        case "1":
            {
                indexurl = "Houses/10-0-0-0-0-" + indexkey + ".html";
                break;
            }
        case "2":
            {
                indexurl = "Sell/0-0-0-0-0-0-0-0-1-1-0-0-0-0-0-0-0-0-1-" + indexkey + ".html";
                break;
            }
        case "3":
            {
                indexurl = "Sell/0-0-0-0-0-0-0-0-1-1-0-0-0-0-0-1-0-0-1-" + indexkey + ".html";
                break;
            }
        case "4":
            {
                indexurl = "Search/SearchNews.aspx?sort=0&key=" + indexkey;
                break;
            }
        case "5":
            {
                indexurl = "Search/SearchCompany.aspx?key=" + indexkey;
                break;
            }
        default:
            {
                break;
            }
    }
    var winname = window.open(indexurl, '_blank');
}
