﻿function addListener(el,eventType,fn){
if(el.addEventListener){
el.addEventListener(eventType,fn,false);
}else if(el.attachEvent){
el.attachEvent("on" + eventType,fn);
}else{
el["on"+eventType] = fn;
}
}
var currslid = 0;
var slidint;
function setfoc(id){
document.getElementById("focpic").src = picarry[id];
document.getElementById("foclnk").href = lnkarry[id];
document.getElementById("fttltxt").innerHTML = "<a href=\""+lnkarry[id]+"\" target=_blank>"+ttlarry[id]+"</a>";
currslid = id;
for(i=0;i<4;i++){document.getElementById("tmb"+i).className = "thubpic";};
document.getElementById("tmb"+id).className ="thubpiccur";
focpic.style.visibility = "hidden";
focpic.filters[0].Apply();
if (focpic.style.visibility == "visible"){
focpic.style.visibility = "hidden";
focpic.filters.revealTrans.transition=12;
}else {
focpic.style.visibility = "visible";
focpic.filters[0].transition=12;
}
focpic.filters[0].Play();
}
function playnext(){
if(currslid==3){
currslid = 0;
}else{
currslid++;
}
setfoc(currslid);
}
function playit(){
slidint = setInterval('playnext()',6000);
}
function stopit(){
clearInterval(slidint);
}
addListener(window,"load",playit);
function tabit(btn){
var idname = new String(btn.id);
var s = idname.indexOf("_");
var e = idname.lastIndexOf("_")+1;
var tabName = idname.substr(0, s);
var id = parseInt(idname.substr(e, 1));
//var tabNumber = btn.parentNode.childNodes.length;
//var tabNumber = document.getElementsByTagName("li").length;
//alert(tabNumber);
for(i=0;i<2;i++){
document.getElementById(tabName+"_div_"+i).style.display = "none";
document.getElementById(tabName+"_btn_"+i).style.backgroundColor = "#EBF3FB";
document.getElementById(tabName+"_btn_"+i).style.color = "#07519A";
document.getElementById(tabName+"_btn_"+i).style.borderBottomColor = "#ace";
document.getElementById(tabName+"_btn_"+i).style.cursor = "pointer";
}
document.getElementById(tabName+"_div_"+id).style.display = "block";
//btn.style.display = "block";
btn.style.backgroundColor = "#fff";
btn.style.color = "#000";
btn.style.borderBottomColor = "#fff";
btn.style.cursor = "default";
}
function expit(id){
for(i=0;i<7;i++){
document.getElementById("expcon"+i).style.display = "none";
document.getElementById("exbtn"+i).className = "block";
}
document.getElementById("expcon"+id).style.display = "block";
document.getElementById("exbtn"+id).className = "cur";
}
function submit_form()
{
var f = document.getElementById('quote_form')
var s = document.getElementById('s')
var ss = document.getElementById('ss')
var base = 'http://cn.finance.yahoo.com/le'
var url = new Array('','ta','h','gsgg','cwbg','mb')
var sv = ss.value.replace(/^s+$/, '')
f.action = base
if((ss.value == "请输入股票或基金的代码、简称")||(ss.value == "")){
window.open("http://info.china.alibaba.com/news/subject/v5003495-s5024381.html");
}
else{
s.value = ss.value
f.submit()
}
}
function addBookmark()
{
if (document.all)
{
window.external.addFavorite(document.location.href,document.title);
}
else if (window.sidebar)
{
window.sidebar.addPanel(document.title,document.location.href,'');
}
}
//根据元素id得到值
function getElementValueById(id){
var element = document.getElementById(id);
var elementValue = "";
if(null != element)
{
elementValue = element.value;
}
return elementValue;
}
//设置元素的值
function setElementValue(id,resultValue){
var element = document.getElementById(id);
if(null != element)
{
element.value = resultValue;
return true;
}
return false;
}
//显示或隐藏该元素
function showTheElement(id,status){
var element = document.getElementById(id);
if(null != element){
if("none" == status || "" == status){
element.style.display = status;
return true;
}
}
return false;
}
function boxShowHide(box1, box2){
var boxNode1 = document.getElementById(box1+"_body");
var boxNode2 = document.getElementById(box2+"_body");
if(null != boxNode1 && null != boxNode2){
boxNode1.style.display="";
boxNode2.style.display="none";
}
var titleNode1 = document.getElementById(box1+"_title");
var titleNode2 = document.getElementById(box2+"_title");
if(null != titleNode1 && null != titleNode2){
titleNode1.style.display="";
titleNode2.style.display="none";
}
}
var TAOBAO_URL = "";
var TAOBAO_QRY = "";
// 连接URL参数
function appendUrl(url, param, value){
if(""!=value && null!=value){
url += url.length>0? "&": "?";
url += param+"="+value;
}
return url;
}
// 提交查询请求
function formSearch1OnSubmit(form){
form.action = getElementValueById("searchFangType1");
if(getElementValueById("fang.keyword1")=="请输入地段关键字"){
setElementValue("fang.keyword1", "");
}
url = "";
url = appendUrl(url, "option.key", getElementValueById("fang.keyword1"));
url = appendUrl(url, "city", getElementValueById("city1"));
url=getElementValueById("searchFangType1")+url;
window.open(url);
return false;
}
//********************************************
//				 餐饮代码
//********************************************
var CATE_QUERY_URL="http://alibaba.koubei.com/search/searchstore.html?option.category=4";
//餐饮提交1
function cateformSubmit(formtag){
var url = CATE_QUERY_URL;
if (formtag==1){
if(getElementValueById("search_key1")=="店名、菜系、菜名"){
url = appendUrl(url, "option.key", "");
}else{
url = appendUrl(url, "option.key", (getElementValueById("search_key1") ) );
}
url = appendUrl(url, "city", getElementValueById("search_select_cityname1"));
}else if (formtag==2){
if(getElementValueById("search_key2")=="店名、菜系、菜名"){
url = appendUrl(url, "option.key", "");
}else{
url = appendUrl(url, "option.key", (getElementValueById("search_key2")));
}
url = appendUrl(url, "city", getElementValueById("search_select_cityname2"));
}
window.open(url);
return false;
}
