// JavaScript Document
function addBookmark(title,url) 
{
    if (window.sidebar) { 
        window.sidebar.addPanel(title, url,""); 
    }else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
        return true;
    }
}

function doSubmit(){
    var toUtl
    var f1 = document.getElementsByName("f1");
    var keywords = document.getElementById("search_keywords2").value
    var search_zj = document.getElementById("search_zj").value
    var search_qy = document.getElementById("search_qy").value
    var search_hx = document.getElementById("search_hx").value
    var search_lx = document.getElementById("search_lx").value
						
    for(i = 0; i < f1.length; i++){
        if(f1[i].checked){
            toUtl = f1[i].value
        }
    }
											
    if(keywords == "请输入关键字"){
        actionUrl = toUtl + "?y=1" + search_qy + search_hx + search_lx + search_zj
    }
    else{
        actionUrl = toUtl + "?y=1" + search_qy + search_hx + search_lx + search_zj + "&search_keywords="+keywords
    }
    //alert(toUtl);
    document.search1.action = actionUrl;
    document.search1.submit();
}

function checkLogin(){
	
    var username = document.getElementById("userId").value
    var pwd = document.getElementById("pwdId").value
											
    if(username == ""){
        return false;
    }
    else if(pwd == ""){
        return false;
    }else{
	    return true;
	}

}


function setWeather(objJson)   
{   
    var imgHtml = "";   
    var cityname = objJson.weatherinfo.city;        //上海   
    var id = objJson.weatherinfo.cityid;            //101020100    
    var cityinfo1 = objJson.weatherinfo.weather1;   //晴转多云   
    var wd1 = objJson.weatherinfo.wind1;            //北风3-4级   
    var fl1 = objJson.weatherinfo.fl1;          //3-4级   
    var temp1 = objJson.weatherinfo.temp1;      //4℃~-1℃   
  
    //注释里面为更详细的信息,您可以根据自己需要使用   
    /*var cityinfo2=objJson.weatherinfo.weather2;   
    var wd2=objJson.weatherinfo.wind2;   
    var fl2=objJson.weatherinfo.fl2;   
    var temp2=objJson.weatherinfo.temp2;   
    var img1=objJson.weatherinfo.img1;   
    var img2=objJson.weatherinfo.img2;   
    var img3=objJson.weatherinfo.img3;   
    var img4=objJson.weatherinfo.img4;   
    var index=objJson.weatherinfo.index;   
    var index_d=objJson.weatherinfo.index_d;   
    var index_xc=objJson.weatherinfo.index_xc;   
    var index_uv=objJson.weatherinfo.index_uv;   
    var date=objJson.weatherinfo.date;   
    var date_y=objJson.weatherinfo.date_y;   
    var imgtitle1=objJson.weatherinfo.img_title1;   
    var imgtitle2=objJson.weatherinfo.img_title2;   
    var imgsingle=objJson.weatherinfo.img_single;   
    var imgtitlesingle=objJson.weatherinfo.img_title_single;   
    */   
  
    document.all.weather_city.innerHTML = cityname  
    document.all.weather_cityinfo.innerHTML = cityinfo1  
    document.all.weather_temp.innerHTML = temp1  
    document.all.weather_wind.innerHTML = wd1  
}
