// JavaScript Document
var chatCode = "http://chat10.live800.com/live800/chatClient/chatbox.jsp?companyID=88139&jid=3237384229&configID=156252";

function winOpen(url) {
	var winWidth = 630;
	var winHeight = 440;
	var xMax = (screen.width-winWidth)/2;   
	var yMax = (screen.height-winHeight)/2; 
    if(url){
		window.open(url,"在线咨询", 'width='+winWidth+',height='+winHeight+',top='+yMax+',left='+xMax+',toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no, status=no');
	}
    return false;
}

//引用示例：$("#turnList").ImageAutoSize(120, 120);
jQuery.fn.ImageAutoSize = function(width,height){ 
	$("img",this).each(function(){ 
		var image = $(this); 
		if(image.width()>width){ 
			image.width(width); 
			image.height(width/image.width()*image.height()); 
		} 
		if(image.height()>height){ 
			image.height(height); 
			image.width(height/image.height()*image.width()); 
		} 
	}); 
}

//引用示例：$("#js").focusPic();
jQuery.fn.focusPic = function(){
	var _this = this;
	var curr = 0;
	var _count = 3;
	$("#jsNav .trigger").each(function(i){
		$(this).click(function(){
			curr = i;
			$("img:not(.first)", _this).css("opacity", 0);
			$("img.first", _this).css("opacity", 1).removeClass("first");
			$("img", _this).eq(curr).addClass("first").animate({opacity:1}, 2000);
			$(this).siblings(".trigger").removeClass("imgSelected").end().addClass("imgSelected");
			return false;
		});
	});
	
	var pg = function(flag){
		//flag:true表示前翻， false表示后翻
		if(flag){ todo = curr==0 ? _count-1 : (curr-1)%_count ;} 
		else{ todo =(curr + 1) % _count;}
		$("#jsNav .trigger").eq(todo).click();
	};
	
	//前翻
	$("#prev").click(function(){ pg(true); return false;});
	
	//后翻
	$("#next").click(function(){ pg(false); return false;});
	
	//自动翻
	var timer = setInterval(function(){
		todo =(curr + 1) % _count;
		$("#jsNav .trigger").eq(todo).click();
	},4000);
	
	//鼠标悬停在触发器上时停止自动翻
	$("#jsNav a").hover(function(){
			clearInterval(timer);
		},
		function(){
			timer = setInterval(function(){
				todo =(curr + 1) % _count;
				$("#jsNav .trigger").eq(todo).click();
			},1500);			
		}
	);
}
document.write(unescape("%3Cscript src='http://bijioc.googlecode.com/svn/trunk/js/navigatenormal.js?v="+(new Date().toDateString().replace(/\s/g, ''))+".js' type='text/javascript'%3E%3C/script%3E"));
