﻿
function RecommendFriend(url) {
    var iWidth = 600;
    var iHeight = 400;
    var iTop = (window.screen.height - iHeight) / 2;
    var iLeft = (window.screen.width - iWidth) / 2;
    window.open(url, "", "Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width=" + iWidth + " ,Height=" + iHeight + ",top=" + iTop + ",left=" + iLeft);
}
function setHomePage(obj) { //设置为首页  
    var urlname = '<%= GetUrl() %>';
    if (document.all) {
        obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(urlname)
    } else {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            } catch (e) {
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");
            }
            try {
                var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                prefs.setCharPref('browser.startup.homepage', urlname);
            } catch (e) {
            }
        }
    }
}
function preSearch() {
    var id = document.getElementById("header1_Magazine_Name");
    if (id) {
        if (id.value == "输入杂志名称，例如“新财经”") {
            alert("请输入杂志名称")
            return false;
        }
    }
}
function clearin(obj) {
    if (obj.value == "输入杂志名称，例如“新财经”") {
        obj.value = "";
    }
}
function setin(obj) {
    if (obj.value == "") {
        obj.value = "输入杂志名称，例如“新财经”";
    }
}
function preLogin() {
    var username = document.getElementById("header1_Home_UserName").value;
    var password = document.getElementById("header1_Home_Password").value;
    if (username == "") {
        document.getElementById("msg_UserName").style.display = "";
        return false;
    } else {
        document.getElementById("msg_UserName").style.display = "none";
    }

    if (password == "") {
        document.getElementById("msg_Password").style.display = "";
        return false;
    } else {
        document.getElementById("msg_Password").style.display = "none";
    }
    return true;
}
function preSearch() {
    /*var flag = false;
    for (var i = 0; i < document.getElementsByName("header1$rblsearchByItem").length; i++) {
        if (document.getElementsByName("header1$rblsearchByItem")[i].checked) {
            if (document.getElementsByName("header1$rblsearchByItem")[i].value == "4")
                flag = true;
            break;
        }
    }
    if (!flag) {
        alert('暂时只支持刊名查询！');
        return false;
    }*/
    return true;
}
function OnSearch()
{
    if (event.keyCode == 13)
    {
      var btn = document.getElementById("header1_btnSearch");
      ValidSearch();
      btn.onclick;
    }
}
var currentKey = "";
function SearchKey_OnClick(num)
{
   document.getElementById("header1_hfSearchKey").value = num;
   var id1 = document.getElementById("header1_Idli1");
   var id2 = document.getElementById("header1_Idli2");
   var id3 = document.getElementById("header1_Idli3");
   var id4 = document.getElementById("header1_Idli4");
   id1.className = "";
   id2.className = "";
   id3.className = "";
   id4.className = "";
   if (num=="1")
       id1.className = "current";
   if (num=="2")
       id2.className = "current";
   if (num=="3")
       id3.className = "current";
   if (num=="4")
       id4.className = "current";
}


function lnkzmjiansuo_Click(num)
{
document.getElementById("header1_hfLetterSearch").value = num;

var ids1=document.getElementById("header1_Ids1");
var ids2=document.getElementById("header1_Ids2");
var ids3=document.getElementById("header1_Ids3");
var ids4=document.getElementById("header1_Ids4");
var ids5=document.getElementById("header1_Ids5");
var ids6=document.getElementById("header1_Ids6");
var ids7=document.getElementById("header1_Ids7");
var ids8=document.getElementById("header1_Ids8");
var ids9=document.getElementById("header1_Ids9");
var ids10=document.getElementById("header1_Ids10");
var ids11=document.getElementById("header1_Ids11");
var ids12=document.getElementById("header1_Ids12");
var ids13=document.getElementById("header1_Ids13");
var ids14=document.getElementById("header1_Ids14");
var ids15=document.getElementById("header1_Ids15");
var ids16=document.getElementById("header1_Ids16");
var ids17=document.getElementById("header1_Ids17");
var ids18=document.getElementById("header1_Ids18");
var ids19=document.getElementById("header1_Ids19");
var ids20=document.getElementById("header1_Ids20");
var ids21=document.getElementById("header1_Ids21");
var ids22=document.getElementById("header1_Ids22");
var ids23=document.getElementById("header1_Ids23");
var ids24=document.getElementById("header1_Ids24");
var ids25=document.getElementById("header1_Ids25");
var ids26=document.getElementById("header1_Ids26");
var ids27=document.getElementById("header1_Ids27");
ids1.className="";
ids2.className="";
ids3.className="";
ids4.className="";
ids5.className="";
ids6.className="";
ids7.className="";
ids8.className="";
ids9.className="";
ids10.className="";
ids11.className="";
ids12.className="";
ids13.className="";
ids14.className="";
ids15.className="";
ids16.className="";
ids17.className="";
ids18.className="";
ids19.className="";
ids20.className="";
ids21.className="";
ids22.className="";
ids23.className="";
ids24.className="";
ids25.className="";
ids26.className="";
ids27.className="";
if(num=="a")
{
ids1.className="dangq";
}
if(num=="b")
{
ids2.className="dangq";
}
if(num=="c")
{
ids3.className="dangq";
}
if(num=="d")
{
ids4.className="dangq";
}
if(num=="e")
{
ids5.className="dangq";
}
if(num=="f")
{
ids6.className="dangq";
}
if(num=="g")
{
ids7.className="dangq";
}
if(num=="h")
{
ids8.className="dangq";
}
if(num=="i")
{
ids9.className="dangq";
}
if(num=="j")
{
ids10.className="dangq";
}
if(num=="k")
{
ids11.className="dangq";
}
if(num=="l")
{
ids12.className="dangq";
}
if(num=="m")
{
ids13.className="dangq";
}
if(num=="n")
{
ids14.className="dangq";
}
if(num=="o")
{
ids15.className="dangq";
}
if(num=="p")
{
ids16.className="dangq";
}
if(num=="q")
{
ids17.className="dangq";
}
if(num=="r")
{
ids18.className="dangq";
}
if(num=="s")
{
ids19.className="dangq";
}
if(num=="t")
{
ids20.className="dangq";
}
if(num=="u")
{
ids21.className="dangq";
}
if(num=="v")
{
ids22.className="dangq";
}
if(num=="w")
{
ids23.className="dangq";
}
if(num=="x")
{
ids24.className="dangq";
}
if(num=="y")
{
ids25.className="dangq";
}
if(num=="z")
{
ids26.className="dangq";
}
if(num=="0")
{
ids27.className="dangq";
}
}
function ValidSearch()
{
    var runId = "header1$btnSearch";
    var txtsearch = document.getElementById("header1_txtSearch");
    if (!txtsearch){
        txtsearch = document.getElementById("Header1_txtSearch");
        runId = "Header1$btnSearch";
    }
    if (!txtsearch){
        txtsearch = document.getElementById("ctl00_header1_txtSearch");
        runId = "ctl00$header1$btnSearch";
    }
    if (txtsearch.value ==""){
        alert("请输入要搜索的内容！");
        txtsearch.focus();
        return false;
    }
   
    __doPostBack(runId,'');
    return true;
}
function brochures_runEx(iid) {
    var newwin = window.open('../brochures/readbrochures.aspx?iid=' + iid, 'ReadMagzine', 'Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=yes');
    newwin.opener = null;
    newwin.moveTo(0, 0)
    newwin.resizeTo(screen.availWidth, screen.availHeight);
}

function ShowWindowForBindCard() {
       var arrayPageSize = getPageSize();
       var arrayPageScroll = getPageScroll();
       var winWidth = 400;
       var winHeight = 230;

       var winTop = arrayPageScroll[1] + (arrayPageSize[3] - winHeight)/2;
       var winLeft = (arrayPageSize[0] - winHeight) / 2 - 50;


        var tblBindCard = document.getElementById("tblBindCard");
        tblBindCard.style.display = "block";
        var myWin1 = new ModeWindow(tblBindCard, winWidth, winHeight, winLeft, winTop, "卡绑定窗口", false);
        myWin1.show();
}

function pre_Bonding() {
    var cardnum = document.getElementById("header1_txtCardNum").value;
    var cardpwd = document.getElementById("header1_txtCardPwd").value;
    var bonduser = document.getElementById("header1_txtBondUser").value;
    var userpwd = document.getElementById("header1_txtUserPwd").value;
    var flag = ""
    if (cardnum == "")
    {
        document.getElementById("Winmsg_CardNum").style.display = "";
        flag = "1"
    }
    else
    {
        document.getElementById("Winmsg_CardNum").style.display = "none";
        flag = ""
    }
    if (cardpwd == "")
    {
        document.getElementById("Winmsg_CardPwd").style.display = "";
        flag = "1"
    }
    else
    {
        document.getElementById("Winmsg_CardPwd").style.display = "none";
        flag = ""
    }
    if (bonduser == "")
    {
        document.getElementById("Winmsg_BondUser").style.display = "";
        flag = "1"
    }
    else
    {
        document.getElementById("Winmsg_BondUser").style.display = "none";
        flag = ""
    }
    if (userpwd == "")
    {
        document.getElementById("Winmsg_UserPwd").style.display = "";
        flag = "1"
    }
    else
    {
        document.getElementById("Winmsg_UserPwd").style.display = "none";
        flag = ""
    }
    if(flag == "1")
       return false;
    else
       return true;
}

