﻿////js about the projects column
//$(document).ready(function(){
//    //the table events
//    $(".listTable td").hover(function(){
//        $(this).parent().children().css("background-color","#e6f3fb");
//    },function(){
//        $(this).parent().children().css("background-color","#ffffff");
//    });
//    //load the rightcolumn data
//    $(".rightColumn").load("RightColumn.htm");
//    
//    //the tab info
//    $("#tabItemPre").tabs({
//			event: 'mouseover'
//		});
//});

////search and pagination
//function Search(currect_page){
//    
//    var keyword = $("#hd-keyword").val();
//    
//    var area = $("#hd-area").val();
//    if(currect_page!="0")
//    {
//        $("#keyword").val(keyword);
//        $("#area").val(area);
//        $("#page").val(currect_page);
//    }else{
//        $("#page").val("1");
//    }
//    $("#myform").submit();
//}


//js about the bidding column
$(document).ready(function() {
    //关键词输入框的提示
    if($("#keyword").val()==""){
        $("#keyword").val("请输入关键词");
        $("#keyword").css("color","#727272");
    }
    
    $("#keyword").click(function(){
        var word = $(this).val();
        if(word=="请输入关键词"){
            $(this).val("");
            $(this).css("color","#000000");
        }
    });
    
    $("#keyword").blur(function(){
        var word = $(this).val();
        if(word==""){
            $(this).val("请输入关键词");
            $(this).css("color","#727272");
        }
    });

    //地区选择部分 
   $("#menuArea").click(function(){
        var top = $("#menuArea").position().top + 22;
        var left = $("#menuArea").position().left;
        $("#areapicker").css("top",top).css("left",left);
        $("#industrypicker").hide();
        $("#phasepicker").hide();
        $("#datepicker").hide();
        $("#areapicker").show();
        return false;
    });
    //行业选择部分
    $("#menuIndustry").click(function(){
        var top = $("#menuIndustry").position().top + 22;
        var left = $("#menuIndustry").position().left;
        $("#industrypicker").css("top",top).css("left",left);
        $("#areapicker").hide();
        $("#phasepicker").hide();
        $("#datepicker").hide();
        $("#industrypicker").show();
        return false;
    });
    
    //进展阶段选择
    $("#menuPhase").click(function(){
        var top = $(this).position().top + 22;
        var left = $(this).position().left;
        $("#phasepicker").css("top",top).css("left",left);
        $("#areapicker").hide();
        $("#industrypicker").hide();
        $("#datepicker").hide();
        $("#phasepicker").show();
        return false;
    
    });
    
    $("#areapicker").click(function(eventObj){
        eventObj.stopPropagation();
    });
    $("#industrypicker").click(function(eventObj){
        eventObj.stopPropagation();
    });
    $("#phasepicker").click(function(eventObj){
        eventObj.stopPropagation();
    });
    
    //load the rightcolumn data
    if(location.href.indexOf("ConstructionList")>0){
    var arr = new Array("tags","projects-pre","bidding-pre","specialtopic-pre");
    LoadRightColumns(arr);
    }else{
    var arr = new Array("tags","bidding-pre","investment-pre", "projects-pre", "specialtopic-pre","reporting-pre");
    LoadRightColumns(arr);
    }
    //the tab info
    $("#tabItemPre").tabs({
        event: 'mouseover'
    });
    //the css of the content of the main table
//    $(".listTable td").hover(function() {
//        $(this).parent().children().css("background-color", "#F9E1C5");
//    }, function() {
//        $(this).parent().children().css("background-color", "#ffffff");
//    });
    //the css of the content of the tab
    $(".tabTable td").hover(function() {
        $(this).parent().children().css("background-color", "#F9E1C5");
    }, function() {
        $(this).parent().children().css("background-color", "#ffffff");
    });
    $(".td_title").hover(function() {
        $(this).css("text-decoration", "underline");
    }, function() {
        $(this).css("text-decoration", "none");
    });
});
//search column
function SearchColumn(id) {
    $("#column").val(id); 
    Search(0)
}
//search and pagination
function Search(currect_page) {
    if ($("#title_content").val() == "1") {
        if ($("#keyword").val() == "请输入关键词") {
            $("#keyword").val("");
        }
        var date = $("#menuDatePicker").val();
        $("#hd-datepicker").val(date);
        var column = $("#hd-column").val();
        if (currect_page != "0") {
            $("#page").val(currect_page);
            $("#column").val(column);
        } else {
            $("#page").val("1");
        }
        $("#myform").submit();
    } else {
        window.open("http://search.bhi.com.cn/default.aspx?keyword=" + escape($("#keyword").val()) + "&cbcolumns=" + escape("项目快讯"), "_blank");
    }
}
function SearchKeyword(word){
    $("#keyword").val(word);
    Search(1);
}
function output() {
    var infoid = "";
    $("input[name='selectedID']:checked").each(function() {
        infoid += $(this).val() + ",";
    });
    if (infoid.length > 0) {
        infoid = infoid.substring(0, infoid.length - 1);
    }
    window.open("/Generate/Generate_Construction.aspx?id=" + infoid);
}
function printlist() {
    var infoid = "";
    $("input[name='selectedID']:checked").each(function() {
        infoid += $(this).val() + ",";
    });
    if (infoid.length > 0) {
        infoid = infoid.substring(0, infoid.length - 1);
    }
    window.open("printlist.aspx?id=" + infoid);
}
//查看所选.
function LookSelected(){
    var infoid = "";
    $("input[name='selectedID']:checked").each(function(){ 
        infoid += $(this).val()+",";
    });
    if(infoid.length>0){
        infoid=infoid.substring(0,infoid.length-1);
         window.open("ShowConstruction.aspx?id="+infoid);
    }
    else{
        alert("请先选择要查看的信息...");
    }
}
