var SiteUrl_www="http://www.czfcw.com";

/*----------JS容错------------*/
<!-- Hide
function killErrors() {return true;}
window.onerror = killErrors;
// -->
/*----------JS容错------------*/


/*---------切换------------*/
var i;
var nGroups = 6;//有多少组带帧切换的区域:::
var nFrames = new Array(nGroups);//每组分别有多少帧要切换:::
nFrames[0] = 6;//第0组有多少帧:::
nFrames[1] = 2;//第1组有多少帧:::
nFrames[2] = 2;//第2组有多少帧:::
nFrames[3] = 3;//第3组有多少帧:::
nFrames[4] = 3;//第4组有多少帧:::
nFrames[5] = 3;//第5组有多少帧:::
nFrames[6] = 3;//第6组有多少帧:::
nFrames[7] = 5;//第7组有多少帧:::
nFrames[8] = 3;//第8组有多少帧:::
nFrames[9] = 2;//第9组有多少帧:::
nFrames[10]= 26;//第10组有多少帧:::
nFrames[11]= 3;//第11组有多少帧:::
nFrames[12]= 3;//第12组有多少帧:::
nFrames[13]= 2;//第12组有多少帧:::
nFrames[14]= 11;//第14组有多少帧:::
nFrames[15]= 2;//第12组有多少帧:::
nFrames[16]= 6;//第14组有多少帧:::
nFrames[17]= 2;//第14组有多少帧:::

//组帧
nFrames[22]	= 2;//组名22的组 有2帧
nFrames[32]	= 2;//组名32的组 有2帧
nFrames[42]	= 2;//组名42的组 有2帧
nFrames[52]	= 2;//组名52的组 有2帧:
nFrames[62]	= 2;//组名62的组 有2帧
nFrames[72]	= 2;//组名72的组 有2帧
nFrames[82]	= 2;//组名82的组 有2帧
nFrames[92]	= 2;//组名92的组 有2帧

nFrames[23]= 3;//组名23的组 有3帧
nFrames[33]= 3;//组名33的组 有3帧
nFrames[43]= 3;//组名43的组 有3帧
nFrames[53]= 3;//组名53的组 有3帧
nFrames[63]= 3;//组名63的组 有3帧
nFrames[73]= 3;//组名73的组 有3帧
nFrames[83]= 3;//组名83的组 有3帧
nFrames[93]= 3;//组名93的组 有3帧

nFrames[24]= 4;//组名24的组 有4帧
nFrames[34]= 4;//组名34的组 有4帧
nFrames[44]= 4;//组名44的组 有4帧
nFrames[54]= 4;//组名54的组 有4帧
nFrames[64]= 4;//组名64的组 有4帧
nFrames[74]= 4;//组名74的组 有4帧
nFrames[84]= 4;//组名84的组 有4帧
nFrames[94]= 4;//组名94的组 有4帧

//组帧
nFrames[102]= 2;//组名102的组 有2帧
nFrames[202]= 2;//组名202的组 有2帧
nFrames[302]= 2;//组名302的组 有2帧
nFrames[1102]= 2;//组名1102的组 有2帧
nFrames[1126]= 2;//组名1126的组 有26帧

nFrames[103]= 3;//组名103的组 有3帧
nFrames[203]= 3;//组名203的组 有3帧
nFrames[303]= 3;//组名303的组 有3帧
nFrames[1103]= 3;//组名1103的组 有3帧
nFrames[1126]= 3;//组名1126的组 有26帧


function ShowHideSub(nG, nF)
{
	for (i=0; i<nFrames[nG]; ++i)
	//for (i=0; i<100; i++)
	{
		if (i == nF)
		{
			document.getElementById("submenu_"  + nG + "_" + i).style.display="";
			document.getElementById("subtitle_" + nG + "_" + i).className="menu_" + nG + "_1";
		}
		else
		{
			document.getElementById("submenu_"  + nG + "_" + i).style.display="none";
			document.getElementById("subtitle_" + nG + "_" + i).className="menu_" + nG + "_0";
		}
	}
}
/*---------切换------------*/


<!--搜索滑动-->
function show_menuz(num){
for(i=0;i<100;i++){
	if(document.getElementById('zbf0'+i)){
	document.getElementById('zbf0'+i).className='search_off';
	document.getElementById('zbli0'+i).style.display='none';
	}
	}
	document.getElementById('zbf0'+num).className='search_on';
	document.getElementById('zbli0'+num).style.display='block';
	}

<!--搜索滑动-->


/*----------房源信息fanginfo_tc.js-----------*/
function newpage(htmlurl)
{
var newwin=window.open(htmlurl,"newWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=2,left=2,width=600,height=530");
newwin.focus();
return false;
}

function openwin(page,winWidth,winHeight)
{
var  newwin=window.open(page,"newWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+winWidth+",height="+winHeight);
newwin.focus();
return false;
} 

function research_onsubmit() {
 if(document.research.Options[0].checked==false &&document.research.Options[1].checked==false&&document.research.Options[2].checked==false&&document.research.Options[3].checked==false)
  {
    alert("错误:没有选择！")
    return false
   }
 }
/*----------房源信息fanginfo_tc.js-----------*/


/*----------上传前预览-----------*/
function upBefore_preview(objname,upBefore_preview)
{
	var x = document.getElementById(objname);
	//var y = document.getElementById(upBefore_preview);   		//上传文件页面
	var y = parent.document.getElementById(upBefore_preview);	//上传文件父页面
	if(!x || !x.value || !y) return;	
	var patn = /\.jpg$|\.jpeg$|\.gif$/i;

	if(patn.test(x.value)){		
	y.src = "file://localhost/" + x.value; }
	else{ alert("您选择的似乎不是图像文件。"); }
}
/*----------上传预览-----------*/


/*----------上传后预览-----------*/
function upAfter_preview(objname,upAfter_preview)
{
	var x = document.getElementById(objname);
	var y = document.getElementById(upAfter_preview);
	
	if(!x || !x.value || !y) return;	
	var patn = /\.jpg$|\.jpeg$|\.gif$/i;
	
	if(patn.test(x.value)){ y.src = x.value; }
}
/*----------上传预览-----------*/


/*-------------------------------------------------*/
//显示或隐藏提示内容
function showTips(TipPosition,TipContent){
	//TipContent -提示显示的内容
	//TipPosition-提示显示的位置
	var TipContent=document.getElementById(TipContent);
	TipContent.style.display=TipContent.style.display=='none'?'':'none';
	var relPos=getRealPos(document.getElementById(TipPosition));
	if(TipContent.style.display!='none'){TipContent.style.left=(relPos[0]+5)+'px';TipContent.style.top=(relPos[1]+10)+'px'}
};
function getRealPos(obj){
	var x=0,y=0,w,h;
	var el=obj;
	w=el.offsetWidth;
	h=el.offsetHeight;
	do{x+=el.offsetLeft||0;y+=el.offsetTop||0;el=el.offsetParent}
	while(el);
	return [x,y,w,h]
};
document.write("<style type=\"text/css\">");
document.write("/* Tips */");
document.write(".Tips     {  position: absolute;}/*width: 400px;*/");
document.write(".Tips td  { font: 400 12px/20px arial}");
document.write(".Tips .tl {background: url("+ SiteUrl_www +"/images/TipsPic/tl.gif) no-repeat 0px 50%; width: 12px; height: 40px}");
document.write(".Tips .tc {padding-left: 5px; background: url("+ SiteUrl_www +"/images/TipsPic/tc.gif) repeat-x; vertical-align: top}");
document.write(".Tips .tr {background: url("+ SiteUrl_www +"/images/TipsPic/tr.gif) no-repeat 0px 50%; width: 25px; text-align: center}");
document.write(".Tips .tr img {margin-top: 10px; border:0px;}");
document.write(".Tips .ml {background: url("+ SiteUrl_www +"/images/TipsPic/mlline.gif) repeat-y}");
document.write(".Tips .mr {background: url("+ SiteUrl_www +"/images/TipsPic/mrline.gif) repeat-y}");
document.write(".Tips .mc {background-color: #effdfd}");
document.write(".Tips .bl {background: url("+ SiteUrl_www +"/images/TipsPic/bl.gif) no-repeat; height: 13px}");
document.write(".Tips .bc {background: url("+ SiteUrl_www +"/images/TipsPic/bc.gif) repeat-x}");
document.write(".Tips .br {background: url("+ SiteUrl_www +"/images/TipsPic/br.gif) no-repeat}");
document.write("/* Tips */");
document.write("</style>");
/*-------------------------------------------------*/


/*-------------------------------------------------*/
//var web_url="/";
var web_url="";

function Trim(){
	return this.replace(/\s+$|^\s+/g,"");
}
String.prototype.Trim=Trim;

function getObjValues(id){
    if(getObjects(id).value!=undefined)
    return getObjects(id).value.Trim();
    else
    return "";
}

function getObjects(id) { 	
    if (document.getElementById) { 
       return document.getElementById(id); 
    } else if (document.all) { 
       return document.all[id]; 
    } else if (document.layers) { 
       return document.layers[id]; 
    } 
}

function changeStyle(id){	
    var stylesheet=getObjects("skincolor").href=web_url+id;
    document.cookie="stylesheet="+escape(stylesheet);	
}
function cookieStyle(){	
    if(/stylesheet=([^;]+)/.test(document.cookie))
    getObjects("skincolor").href=unescape(RegExp.$1);
}
cookieStyle();
/*-------------------------------------------------*/





//根据varValue的值选中option 
function selectedOption(varObj,varValue)
{
	var Obj=document.getElementById(varObj)
	if(typeof(Obj)=="object")
	{
		for(var i=0;i<Obj.length;i++)
		{
			if(Obj.options[i].value==varValue)
			{
				//varObj.selectedIndex=i;
				Obj.selectedIndex=i;

				break;	
			}	
		}
	}
}
function js_set_sel(obj, val)
{
    for (i=0; i<obj.length; i++)
    {
        if (obj.options[i].value == val)
        {
            obj.options[i].selected = true;
            break;
        }
    }
}

//输出数字式下拉菜单项 
function writeOption(varFrom,varTo)
{
	for(var i=varFrom;i<=varTo;i++)
	{
		document.write("<option VALUE="+i+">"+i+"</option>");
	}
}

/**输出连续的下拉列表并选中其中一项*/
function writeOptionAndSelected(varFrom,varTo,varSel)
{
	var strSel;
	for(var i=varFrom;i<=varTo;i++)
	{
		if(i==varSel) strSel="selected";
		document.write("<option "+strSel+" VALUE="+i+">"+i+"</option>");
		strSel="";
	}
}

//more:obj1.value>obj2.value;less:obj1.value<obj2.value
function setSelected(obj1,obj2,oprate)
{
	//alert(obj1.name+obj1.value+"========"+obj2.name+obj2.value+"+++++++"+oprate);
	if(typeof(obj1)=="object" && typeof(obj2)=="object")
	{
		switch(oprate)
		{
			case "more":				
				if(parseInt(obj1.value)<parseInt(obj2.value))
				{
					//obj1.selectedIndex=obj2.selectedIndex+1;
					obj2.selectedIndex=obj2.defaultSelected;
					return false;	
				}		
				break;
			case "less":				
				if(parseInt(obj1.value)>parseInt(obj2.value))
				{
					//obj1.selectedIndex=obj2.selectedIndex-1;
					obj1.selectedIndex=obj1.defaultSelected;
					return false;
				}
				break;	
		}	
	}
}


/**
*obj1:
*obj2:
*/

function selectOnChange(obj1, obj2)
{
	var m=document.thisForm;
	if(typeof(obj1.options[obj1.selectedIndex])=="unknown" ||typeof(obj2.options[obj2.selectedIndex])=="unknown")
	{
		retrun ;
	}
	var idx1 = obj1.selectedIndex;
	var idx2 = obj2.selectedIndex;

	if (idx1 > idx2)
	{
		obj2.selectedIndex = idx1;
	}
}

function selectCheck(obj1, obj2)
{
	var m=document.thisForm;
	if(typeof(obj1.options[obj1.selectedIndex])=="unknown" || typeof(obj2.options[obj2.selectedIndex])=="unknown")
	{
		retrun ;
	}
	var idx1 = obj1.selectedIndex;
	var idx2 = obj2.selectedIndex;
	if (parseInt(obj1.value) > parseInt(obj2.value))
	{
		obj2.selectedIndex = idx1;
	}
}





function ToValue(type,objname,strvalue)
{ 
	var obj=document.getElementById(objname)
	if (type=="add"){
		obj.value='|||'+obj.value
		obj.value=obj.value.replace(strvalue,'');
		obj.value=obj.value+strvalue;
		obj.value=obj.value.replace('|||','');
		obj.value=obj.value.replace('||','');
		}
	else if (type=="+"){obj.value=parseInt(obj.value)+parseInt(strvalue);}
	else{obj.value=strvalue;}
	obj.focus(); 
 return;
}


//得到两个日期的差值 
//if (GetDateDiff("d","2008-9-22","2008-9-26")<5)
function GetDateDiff(IntervalUnit, dStart, dEnd) {
	arrdStart=dStart.split("-");
	dStart = new Date(arrdStart[0],arrdStart[1]-1,arrdStart[2]);
	if (dStart == "NaN") dStart = new Date();

	arrdEnd=dEnd.split("-");
	dEnd = new Date(arrdEnd[0],arrdEnd[1]-1,arrdEnd[2]);
	if (dEnd == "NaN") dEnd = new Date();
	
	switch (IntervalUnit) {
		case "s" :
			return parseInt((Date.parse(dEnd) - Date.parse(dStart)) / 1000);
		case "n" :
			return parseInt((Date.parse(dEnd) - Date.parse(dStart)) / 60000);
		case "h" :
			return parseInt((Date.parse(dEnd) - Date.parse(dStart)) / 3600000);
		case "d" :
			iScrap = (Date.parse(dEnd) - Date.parse(dStart)) / 86400000
			//iScrap = iScrap + .1
			return parseInt(iScrap);
		case "w" :
			return parseInt((Date.parse(dEnd) - Date.parse(dStart)) / (86400000 * 7));
		case "m" :
			return (dEnd.getMonth() - dStart.getMonth());
		case "y" :
			return (dEnd.getFullYear() - dStart.getFullYear());

	}
}