﻿
function tabChange(id)
{
   for(i = 1;i <= 3; i++)
   {
    if(i == id)
    {
        document.getElementById("li" + i).className = "bj";
        document.getElementById("div" + i).style.display = "block";
    }
    else
    {
        document.getElementById("li" + i).className = "";
        document.getElementById("div" + i).style.display = "none";
    }
   }
}

function tabChange2(id)
{
   for(i = 1;i <= 3; i++)
   {
    if(i == id)
    {
        document.getElementById("seli" + i).className = "current";
        $("#seTxt").val(id);
    }
    else
    {
       document.getElementById("seli" + i).className = "border";
    }
   }
}

function seOnChange(v)
{
   $("#seTxt").val(v);
   for(i = 1;i <= 3; i++)
   {
        document.getElementById("seli" + i).className = "border";
   }
}

function Search()
{
    var seArr = GetSeArr();
    var seId = $("#seTxt").val();
    var key = $("#Input").val();
    
    var url = seArr[seId];    
    window.location.href = "/Home/ConvertUrl?url="+ escape(url)+"&key="+escape(key);

}

function GetSeArr()
{
    var seArr = new Array();
    
    // 有啊ok
    seArr[1] ="http://youa.baidu.com/search/s?keyword=";
    // 卓越网ok
    seArr[2] = "http://www.amazon.cn/mn/searchApp?ix=sunray&pageletid=headsearch&searchType=1&searchKind=keyword&bestSaleNum=3&Go.x=14&Go.y=13&keywords=";
    // 逛街网ok
    seArr[3] = "http://www.togj.com/search.html?tadd=1&class=com&key=";
    // google
    seArr[4] = "http://www.google.cn/search?hl=zh-CN&q=";
    // 淘宝
    seArr[5] = "http://search1.taobao.com/browse/0/n-g,ytglpwy-------2-------b--40--commend-0-all-0.htm?at_topsearch=1&ssid=e-s1";
    // 拍拍
    seArr[6] = "http://sse1.paipai.com/s-2wjosz2--1-40-13---1-4-1----2-2--128-0.html";
    // 易趣  
    seArr[7] = "http://search.eachnet.com/search/5aW257KJ--0-2.html";
    // 当当网　
    seArr[8] = "http://search.dangdang.com/search.aspx?selectcatalog=&&catalog=&SearchFromTop=1&search=%CB%D1+%CB%F7key=";
    // 红孩子
    seArr[9] = "http://www.redbaby.com.cn/Product/Product_Search.aspx?Site=01&BranchId=-1&OrderField=b.SaleNum&ordertype=1&seartype=1&ProductName=";
    // 京东商城
    seArr[10] = "http://search.360buy.com/Search?keyword=";
    // 阿里巴巴
    seArr[11] = "http://search.china.alibaba.com/search/offer_search.htm?keywords=";
    // 丽家宝贝
    seArr[12] = "http://www.lijiababy.com.cn/Largest_category_milk.aspx?uid=1";
    // 橡果国际
    seArr[13] = "http://www.chinadrtv.com/vs/xggj.jsp?startflag=1%89&x=35&y=9&qtext=";
    
    return seArr;
}

function SearchFoot()
{
    var key = $("#footKey").val();
    var url = GetFootUrl();    

    window.location.href = "/Home/ConvertUrl?url="+ escape(url)+"&key="+escape(key);
}
function GetFootUrl()
{
    var seArr = GetSeArrFoot();
    var items = document.getElementsByName("abc");

    for(i=1;i <= items.length; i++)
    {
        if(items[i].checked)
        {
            return seArr[items[i].value];
        }
    }
}
function GetSeArrFoot()
{
    var seArr = new Array();
    
    // 百度
    seArr[1] ="http://www.baidu.com/s?wd=";
    // google
    seArr[2] = "http://www.google.cn/search?hl=zh-CN&btnG=Google+%E6%90%9C%E7%B4%A2&meta=&aq=f&oq=&q=";
    // MP3ok
    seArr[3] = "http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&lm=-1&word=";
    // 歌词ok
    seArr[4] = "http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&lm=-1&word=";
    // 图片
    seArr[5] = "http://image.baidu.com/i?ct=201326592&cl=2&lm=-1&tn=baiduimage&pv=&z=0&word=";
    // 帖吧
    seArr[6] = "http://tieba.baidu.com/f?ct=&tn=&rn=&pn=&lm=&kw=%C4%B8%D3%A4&rs2=0&myselectvalue=1&submit=%B0%D9%B6%C8%D2%BB%CF%C2&tb=on&word=";
    // 知道 
    seArr[7] = "http://zhidao.baidu.com/q?ct=17&pn=0&tn=ikaslist&rn=10&lm=0&fr=search&word=";
    // 新闻　
    seArr[8] = "http://news.baidu.com/ns?tn=news&from=news&cl=2&rn=20&ct=1&word=";
    // 站内
    seArr[9] = "http://search.hao123.com/search.php?query=";
    // 视频
    seArr[10] = "http://video.baidu.com/v?ct=301989888&rn=20&pn=0&db=0&s=0&fbl=1024&word=";
    // 地图
    seArr[11] = "http://map.baidu.com/#ct=10&bs=010&word=";
    // 文档
    seArr[12] = "http://www.baidu.com/baidu?ft=all&q1=";
    // 百科
    seArr[13] = "http://baike.baidu.com/notexists?word=";
    // 词典
    seArr[14] = "http://dict.baidu.com/s?wd=";
    // 雅虎 
    seArr[15] = "http://one.cn.yahoo.com/s?pid=hp&v=web&p=";
    // 狗狗
    seArr[16] = "http://www.gougou.com/search?id=1&search=";
    
    return seArr;
}
