﻿function AddFavorite(sURL, sTitle) 
{     
    try 
    { 
        window.external.addFavorite(sURL, sTitle); 
    } 
    catch (e) 
    { 
        try 
        { 
            window.sidebar.addPanel(sTitle, sURL, ""); 
        } 
        catch (e) 
        { 
            alert("加入收藏失败，请使用Ctrl+D进行添加"); 
        } 
    } 
} 
function SetHome(obj,vrl)
{
    
    try
    { 
        obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl); 
    } 
    catch(e)
    { 
        if(window.netscape) 
        { 
            try 
            { 
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
            } 
            catch (e) 
            { 
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。"); 
            } 
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); 
            prefs.setCharPref('browser.startup.homepage',vrl); 
        }
    } 
} 

//function addLoadEvent(func){
//    var oldonload = window.onload;
//    if (typeof window.onload != 'function'){
//        window.onload = func;
//    }else{
//        window.onload = function(){
//            oldonload();
//            func();
//        }
//    }
//}

//function checkText(){
//    var textId = document.getElementById('SearchName');
//        //设置文本框中的字体颜色为灰色
//        document.getElementById('SearchName').style.color='#C0C0C0';
//    var textDefault = '选择楼盘名称……';
//    function cls(){
//        if (this.value == textDefault){
//            this.value = '';
//        }
//    }
//    function res(){
//        if (this.value == ''){
//            this.value = textDefault;
//        }
//    }
//    textId.onfocus = cls;
//    textId.onblur = res;
//}
//addLoadEvent (checkText);

function cls()
{ 
    
    if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
        with(event.target) 
        {           
            if(value==defaultValue)
            { 
                value="";
            }
        } 
             
    } 
    else
    {
        with(event.srcElement)
        {             
            if(value==defaultValue)
            {
                value="";
            }
        } 
    }

    
} 
function res()
{ 
    
    if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)
    { 
        with(event.target) 
        {
            if(value=="")
            {                 
                value=defaultValue;
            }
        } 
             
    } 
    else
    {
        with(event.srcElement) 
        {
            if(value=="")
            {
                value=defaultValue;
            } 
        }
    }
    
} 


//焦点新闻切换脚本
$(function(){
    $("#KinSlideshow").KinSlideshow({
		    moveStyle:"down",
		    intervalTime:5,
		    mouseEvent:"mouseover",
		    isHasTitleBar:true,
		    isHasTitleFont:true,
		    titleBar:{titleBar_height:18,titleBar_bgColor:"#000000",titleBar_alpha:0.6,titleBar_lineHeight:18},
		    titleFont:{TitleFont_size:12,TitleFont_color:"#FFFFFF",TitleFont_family:"宋体",TitleFont_weight:"100"}, 
		    isHasBtn:true,	
		    btn:{btn_bgColor:"000000",btn_bgHoverColor:"f82b2b",btn_fontColor:"#CCCCCC",btn_fontHoverColor:"#CCCCCC",btn_fontFamily:"Verdana",btn_borderColor:"#FFFFFF",btn_borderHoverColor:"#FF0000",btn_borderWidth:0,btn_bgAlpha:0.7}	
    });
}) 
////看房板块选项卡
//function setTab03Syn ( i )
//{
//	selectTab03Syn(i);
//}

//function selectTab03Syn ( i )
//{
//	switch(i)
//	{
//		case 1:
//		document.getElementById("kanfagnzhuanxian").style.display="block";
//		    document.getElementById("kanfangdongtai").style.display="none";
//		    document.getElementById("font1").style.color="#000000";
//		    document.getElementById("font2").style.color="#ffffff";
//		break;
//		case 2:
//		    document.getElementById("kanfagnzhuanxian").style.display="none";
//		    document.getElementById("kanfangdongtai").style.display="block";
//		    document.getElementById("font1").style.color="#ffffff";
//		    document.getElementById("font2").style.color="#000000";
//		break;
//	}
//}
////会员板块选项卡

//function setTab03Syn2 ( i )
//{
//	selectTab03Syn2(i);
//}

//function selectTab03Syn2 ( i )
//{
//	switch(i)
//	{
//		case 1:
//		document.getElementById("hydt").style.display="block";
//		    document.getElementById("hyjf").style.display="none";
//		    document.getElementById("font3").style.color="#ffffff";
//		    document.getElementById("font4").style.color="#000000";
//		break;
//		case 2:
//		    document.getElementById("hydt").style.display="none";
//		    document.getElementById("hyjf").style.display="block";
//		    document.getElementById("font3").style.color="#000000";
//		    document.getElementById("font4").style.color="#ffffff";
//		break;
//	}
//}
//
function getcurrent(string)
{
    switch (string)
    {
        case "1" :
        { 
            document.getElementById("dongtai").className = "list";
            document.getElementById("zhuanxian").className = "list5";
            document.getElementById("paihang").className = "list5";
            break;
        }
        case "2" :
        { 
            document.getElementById("dongtai").className = "list5";
            document.getElementById("zhuanxian").className = "list";
            document.getElementById("paihang").className = "list5";
            break;
        }
        case "3" :
        { 
            document.getElementById("dongtai").className = "list5";
            document.getElementById("zhuanxian").className = "list5";
            document.getElementById("paihang").className = "list";
            break;
        }
        case "4" :
        { 
            document.getElementById("zhuantijujiao").className = "list";
            document.getElementById("xiangyuehainan").className = "list5";
            document.getElementById("dujiayangsheng").className = "list5";
            break;
        }
        case "5" :
        { 
            document.getElementById("zhuantijujiao").className = "list5";
            document.getElementById("xiangyuehainan").className = "list";
            document.getElementById("dujiayangsheng").className = "list5";
            break;
        }
        case "6" :
        { 
            document.getElementById("zhuantijujiao").className = "list5";
            document.getElementById("xiangyuehainan").className = "list5";
            document.getElementById("dujiayangsheng").className = "list";
            break;
        }
        
        case "7" :
        { 
            document.getElementById("goufangxinsheng").className = "list";
            document.getElementById("jifenchaxun").className = "list5";
            document.getElementById("huiyuanfuwudongtai").className = "list5";
            break;
        }
        case "8" :
        { 
            document.getElementById("goufangxinsheng").className = "list5";
            document.getElementById("jifenchaxun").className = "list";
            document.getElementById("huiyuanfuwudongtai").className = "list5";
            break;
        }
        case "9" :
        { 
            document.getElementById("goufangxinsheng").className = "list5";
            document.getElementById("jifenchaxun").className = "list5";
            document.getElementById("huiyuanfuwudongtai").className = "list";
            break;
        }  
        
        default:
        { 
            document.getElementById("dongtai").className = "list";
            document.getElementById("zhuanxian").className = "list5";
            document.getElementById("paihang").className = "list5";
            
            document.getElementById("zhuantijujiao").className = "list";
            document.getElementById("xiangyuehainan").className = "list5";
            document.getElementById("dujiayangsheng").className = "list5";
            
            document.getElementById("goufangxinsheng").className = "list";
            document.getElementById("jifenchaxun").className = "list5";
            document.getElementById("huiyuanfuwudongtai").className = "list5";            
            
            break;
        }

    }
}

function gettitlebarcurrent(string)
{
    switch (string)
    {
        case "1" :
        { 
            document.getElementById("indexpage").className = "liston";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        }
        case "2" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "liston";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        }
        case "3" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "liston";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        }
        case "4" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "liston";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";;
            break;
        }
        case "5" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "liston";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        }
        case "6" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "liston";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        }
        
        case "7" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "liston";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        }
        case "8" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "liston";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        }
        case "9" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "liston";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        }  
        case "10" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "liston";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "listoff";
            break;
        } 
        case "11" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "liston";
            document.getElementById("intropage").className = "listoff";
            break;
        } 
        case "12" :
        { 
            document.getElementById("indexpage").className = "listoff";
            document.getElementById("housepage").className = "listoff";
            document.getElementById("groupbypage").className = "listoff";
            
            document.getElementById("houseonlinepage").className = "listoff";
            document.getElementById("newspage").className = "listoff";
            document.getElementById("bbspage").className = "listoff";
            
            document.getElementById("memberpage").className = "listoff";
            document.getElementById("twohousepage").className = "listoff";
            document.getElementById("cityintropage").className = "listoff";
            
            document.getElementById("housemap").className = "listoff";
            document.getElementById("housepicpage").className = "listoff";
            document.getElementById("intropage").className = "liston";
            break;
        } 
        default:
        { 
            break;
        }

    }
}

var s,s2,s3,timer;
function init()
{
    s=getid("div1");
    s2=getid("div2");
    s3=getid("div3");
    s3.innerHTML=s2.innerHTML;
    timer=setInterval(mar,30)
}
function mar()
{
    if(s2.offsetWidth<=s.scrollLeft){
    s.scrollLeft-=s2.offsetWidth;
    }
    else
    {
    s.scrollLeft++;
    }
}
function getid(id)
{
    return document.getElementById(id);
}
window.onload=init;
//候鸟人群在海南板块 
$(document).ready(function()
{   
    $("#hounniaorenquanzaihainan").tab({
	tabId:"#tags",
	tabTag:"li",
	conId:"#tabcon",
	conTag:".pane",
	act:"mouseover",	
	effact: "fast"	
	})    
})
//看房专线板块
$(document).ready(function()
{   
    $("#kanfangbankuai").tab({
	tabId:"#kanfangtitle",
	tabTag:"li",
	conId:"#kanfangbox",
	conTag:".pane",
	act:"mouseover",	
	effact: "fast"	
	})    
})
//会员板块
$(document).ready(function()
{   
    $("#huiyuanbankuai").tab({
	tabId:"#huiyuanbankuaiTitle",
	tabTag:"li",
	conId:"#huiyuanbox",
	conTag:".pane",
	act:"mouseover",	
	effact: "fast"	
	})    
})
function gethousedetail(tmpid)
{
   $("ShowHouseDetail").css("visibility","visible");
   
   $("#houseimg").html($("#houseimg" + tmpid).html());   
   $("#housename").html($("#houseTitle" + tmpid).html());
   
   $("#kdata").html($("#kdata" + tmpid).val());
   $("#Fitment").html($("#Fitment" + tmpid).val());
   $("#PriceAverage").html("价格：" + $("#PriceAverage" + tmpid).val() + "元/平米");
   $("#HouseClass").html($("#HouseClass" + tmpid).val());
   $("#Address").html($("#Address" + tmpid).val());
   $("#Mj").html($("#Mj" + tmpid).val());
   $("#ContainArea").html($("#ContainArea" + tmpid).val());  
   
   $("#Vrate").html($("#Vrate" + tmpid).val() + "%");
   $("#Crate").html($("#Crate" + tmpid).val());
   $("#qqqdd").html("<a href=/NewHouse/HouseDetailShow.aspx?id=" + tmpid +  " target=_blank>" + "[查看详情]" + "</a>");
   
}




