﻿//////////////////***************************lazyload***********************************//////////////////////////
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.J.L=5(r){8 1={d:0,A:0,b:"h",v:"N",3:4};6(r){$.D(1,r)}8 m=9;6("h"==1.b){$(1.3).p("h",5(b){8 C=0;m.t(5(){6(!$.k(9,1)&&!$.l(9,1)){$(9).z("o")}j{6(C++>1.A){g B}}});8 w=$.M(m,5(f){g!f.e});m=$(w)})}g 9.t(5(){8 2=9;$(2).c("s",$(2).c("i"));6("h"!=1.b||$.k(2,1)||$.l(2,1)){6(1.u){$(2).c("i",1.u)}j{$(2).K("i")}2.e=B}j{2.e=x}$(2).T("o",5(){6(!9.e){$("<V />").p("X",5(){$(2).Y().c("i",$(2).c("s"))[1.v](1.Z);2.e=x}).c("i",$(2).c("s"))}});6("h"!=1.b){$(2).p(1.b,5(b){6(!2.e){$(2).z("o")}})}})};$.k=5(f,1){6(1.3===E||1.3===4){8 7=$(4).F()+$(4).O()}j{8 7=$(1.3).n().G+$(1.3).F()}g 7<=$(f).n().G-1.d};$.l=5(f,1){6(1.3===E||1.3===4){8 7=$(4).I()+$(4).U()}j{8 7=$(1.3).n().q+$(1.3).I()}g 7<=$(f).n().q-1.d};$.D($.P[\':\'],{"Q-H-7":"$.k(a, {d : 0, 3: 4})","R-H-7":"!$.k(a, {d : 0, 3: 4})","S-y-7":"$.l(a, {d : 0, 3: 4})","q-y-7":"!$.l(a, {d : 0, 3: 4})"})})(W);',62,62,'|settings|self|container|window|function|if|fold|var|this||event|attr|threshold|loaded|element|return|scroll|src|else|belowthefold|rightoffold|elements|offset|appear|bind|left|options|original|each|placeholder|effect|temp|true|of|trigger|failurelimit|false|counter|extend|undefined|height|top|the|width|fn|removeAttr|lazyload|grep|show|scrollTop|expr|below|above|right|one|scrollLeft|img|jQuery|load|hide|effectspeed'.split('|'),0,{}))

jQuery(document).ready(
function(jQuery){
jQuery(".lazyload img").lazyload({
   placeholder : "/images/grey.gif",
   effect      : "fadeIn"
});
});

///头部商标轮换
jQuery(document).ready(function(){
var o = { speed: 1000, timeout: 4000 };
var jQueryli = jQuery("#Topslider ul li");
jQueryli.hide();
jQuery(jQueryli[0]).show();
setTimeout(function(){ showNext(1, 0); }, o.timeout);
function showNext(n, c){
jQuery(jQueryli[c]).fadeOut(o.speed);
jQuery(jQueryli[n]).fadeIn(o.speed);
c = n;
n = (n >= jQueryli.length - 1) ? 0 : n+1;
setTimeout(function(){ showNext(n, c); }, o.timeout);
}
});


///////////////****************首页banner*********************///////////////
var t = n = 0, count;
jQuery(document).ready(function(){	
	count=jQuery("#banner_list a").length;
	jQuery("#banner_list a:not(:first-child)").hide();
	jQuery("#banner_info").html(jQuery("#banner_list a:first-child").find("img").attr('alt'));
	jQuery("#banner_info").click(function(){window.open(jQuery("#banner_list a:first-child").attr('href'), "_blank")});
	jQuery("#banner li").click(function() {
		var i = jQuery(this).text() - 1;//获取Li元素内的值，即1，2，3，4
		n = i;
		if (i >= count) return;
		jQuery("#banner_info").html(jQuery("#banner_list a").eq(i).find("img").attr('alt'));
		jQuery("#banner_info").unbind().click(function(){window.open(jQuery("#banner_list a").eq(i).attr('href'), "_blank")})
		jQuery("#banner_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
		document.getElementById("banner").style.background="";
		jQuery(this).toggleClass("on");
		jQuery(this).siblings().removeAttr("class");
	});
	t = setInterval("showAuto()", 4000);
	jQuery("#banner").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 4000);});
})

function showAuto()
{
	n = n >=(count - 1) ? 0 : ++n;
	jQuery("#banner li").eq(n).trigger('click');
}

////////////////*************itabs*********************//////////////////////////////
(function(){var dep={"jQuery":"scripts/jquery.min.js"};var init=function(){(function($){$.fn.idTabs=function(){var s={};for(var i=0;i<arguments.length;++i){var a=arguments[i];switch(a.constructor){case Object:$.extend(s,a);break;case Boolean:s.change=a;break;case Number:s.start=a;break;case Function:s.click=a;break;case String:if(a.charAt(0)=='.')s.selected=a;else if(a.charAt(0)=='!')s.event=a;else s.start=a;break;}}
if(typeof s['return']=="function")
s.change=s['return'];return this.each(function(){$.idTabs(this,s);});}
$.idTabs=function(tabs,options){var meta=($.metadata)?$(tabs).metadata():{};var s=$.extend({},$.idTabs.settings,meta,options);if(s.selected.charAt(0)=='.')s.selected=s.selected.substr(1);if(s.event.charAt(0)=='!')s.event=s.event.substr(1);if(s.start==null)s.start=-1;var showId=function(){if($(this).is('.'+s.selected))
return s.change;var id="#"+this.href.split('#')[1];var aList=[];var idList=[];$("a",tabs).each(function(){if(this.href.match(/#/)){aList.push(this);idList.push("#"+this.href.split('#')[1]);}});if(s.click&&!s.click.apply(this,[id,idList,tabs,s]))return s.change;for(i in aList)$(aList[i]).removeClass(s.selected);for(i in idList)$(idList[i]).hide();$(this).addClass(s.selected);$(id).show();return s.change;}
var list=$("a[href*='#']",tabs).unbind(s.event,showId).bind(s.event,showId);list.each(function(){$("#"+this.href.split('#')[1]).hide();});var test=false;if((test=list.filter('.'+s.selected)).length);else if(typeof s.start=="number"&&(test=list.eq(s.start)).length);else if(typeof s.start=="string"&&(test=list.filter("[href*='#"+s.start+"']")).length);if(test){test.removeClass(s.selected);test.trigger(s.event);}
return s;}
$.idTabs.settings={start:0,change:false,click:null,selected:".selected",event:"!click"};$.idTabs.version="2.2";$(function(){$(".idTabs").idTabs();});})(jQuery);}
var check=function(o,s){s=s.split('.');while(o&&s.length)o=o[s.shift()];return o;}
var head=document.getElementsByTagName("head")[0];var add=function(url){var s=document.createElement("script");s.type="text/javascript";s.src=url;head.appendChild(s);}
var s=document.getElementsByTagName('script');var src=s[s.length-1].src;var ok=true;for(d in dep){if(check(this,d))continue;ok=false;add(dep[d]);}if(ok)return init();add(src);})();


//////////首页显示全部类别////////////////
jQuery(function(){
	var jQuerytitle=jQuery('div.h_wjj');//找到要显示/隐藏的元素
	jQuerytitle.hide();   //如果你想默认是隐藏状态,可取消此行注释,下面两个切换函数换位
	jQuerytitle.prev().toggle(function(){//为显示/隐藏元素的前一个元素(取出标题元素)设置点击切换事件
		jQuerytitle.show().prev().find('span').text('> 隐藏类别');//第一次点击时,隐藏div元素,并找到标题元素中的span,切换按钮
	},function(){
		jQuerytitle.hide().prev().find('span').text('> 显示全部类别');//第二次点击时,显示div元素,并找到标题元素中的span,切换按钮
	});
});
jQuery(function(){
	var jQuerytitle=jQuery('div.h_zzj');
	jQuerytitle.hide();
	jQuerytitle.prev().toggle(function(){
		jQuerytitle.show().prev().find('span').text('> 隐藏类别');
	},function(){
		jQuerytitle.hide().prev().find('span').text('> 显示全部类别');
	});
});
jQuery(function(){
	var jQuerytitle=jQuery('div.h_qzj');
	jQuerytitle.hide(); 
	jQuerytitle.prev().toggle(function(){
		jQuerytitle.show().prev().find('span').text('> 隐藏类别');
	},function(){
		jQuerytitle.hide().prev().find('span').text('> 显示全部类别');
	});
});
jQuery(function(){
	var jQuerytitle=jQuery('div.h_ylj');
	jQuerytitle.hide(); 
	jQuerytitle.prev().toggle(function(){
		jQuerytitle.show().prev().find('span').text('> 隐藏类别');
	},function(){
		jQuerytitle.hide().prev().find('span').text('> 显示全部类别');
	});
});

//////下层左侧隐藏导航弹出层//////
var n = 1;
function displaySubMenudiv(id) {
	document.getElementById(id).style.display = "block";
}
function hideSubMenudiv(id) {
	document.getElementById(id).style.display = "none";
}

///////////大图列表切换//////////////////
jQuery(document).ready(function(){
    jQuery("a.switch_thumb").toggle(function(){
        jQuery(this).addClass("swap");
        jQuery("div.list_content").fadeOut("fast", function() {
            jQuery(this).fadeIn("fast").addClass("picmod");
        });
        $("#listtype").val("1");
        $(".saled").css("display","none");
    	var s = $(".paging a");
    	for(i=0;i<s.length;i++){
    		$(s[i]).attr("href",$(s[i]).attr("href").replace("listtype=1&",""));
    		$(s[i]).attr("href",$(s[i]).attr("href").replace("listtype=0&",""));
    		$(s[i]).attr("href",$(s[i]).attr("href")+"listtype="+$("#listtype").val()+"&");
    	}
    }, function () {
        jQuery(this).removeClass("swap");
        jQuery("div.list_content").fadeOut("fast", function() {
            jQuery(this).fadeIn("fast").removeClass("picmod");
        });
        $("#listtype").val("0");
        $(".saled").css("display","block");
    	var s = $(".paging a");
    	for(i=0;i<s.length;i++){
    		$(s[i]).attr("href",$(s[i]).attr("href").replace("listtype=1&",""));
    		$(s[i]).attr("href",$(s[i]).attr("href").replace("listtype=0&",""));
    		$(s[i]).attr("href",$(s[i]).attr("href")+"listtype="+$("#listtype").val()+"&");
    	}
    }); 
});

//////////列表背景切换////////////////////
jQuery(function(){
	jQuery(".bs").hover(function(){
		jQuery(this).attr("class","bg1");
	},function(){
		jQuery(this).attr("class","bg2");
	});
})

//////////特殊商家名录////////////////////
function goSpecial(no,obj){
	if(no=="gordon.zhang"){
		window.open("/catused/metro.jsp?no=WesTrac&find_category="+obj);
		return true;
	}else if(no=="aaron.zeng.pingrong"||no=="steven.fu.chao"){
		window.open("/catused/metro.jsp?no=SimeDarby&find_category="+obj);
		return true;
	}else if(no=="hanqiang"){
		window.open("/catused/metro.jsp?no=EciMetro&find_category="+obj);
		return true;
	}else if(no=="james.hii"){
		window.open("/catused/metro.jsp?no=LishingHang&find_category="+obj);
		return true;
	}else if(no=="lgused"){
		if(obj=='1'){
			window.open("http://used.sdlg.cn/used/?sblx=1");
		}else if(obj=='2'){
			window.open("http://used.sdlg.cn/used/?sblx=2");}
		return true;
	}else if(no=='liugongused'){
		if(obj=='1'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("挖掘机"));
			return true;
		}else if(obj=='2'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("装载机"));
			return true;
		}else if(obj=='3'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("起重机"));
			return true;
		}else if(obj=='4'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("压路机"));
			return true;
		}else if(obj=='5'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("推土机"));
			return true;
		}else if(obj=='6'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("摊铺机"));
			return true;
		}else if(obj=='7'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("平地机"));
			return true;
		}else if(obj=='8'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("混凝土"));
			return true;
		}else if(obj=='9'){
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("叉车"));
			return true;
		}else{
			window.open("http://www.liugong-os.com/used/index.jsp?find_type="+encodeURI("其它设备"));return true;}
	}else{return false;}
}
