$.fn.panescroll = function(options){
	var setting = $.extend({
		up   : null,
		down : null
	},options);
	var _this = this;
	if(_this.size()<=0) return ;
	var top       = 0;
	var _delay    = null;
	var paneHeight= _this[0].scrollHeight - _this.outerHeight(true);
	function delay(){
		if(top<=paneHeight){
			top += 5;
			_this.scrollTop(top);
		}
	}
	function delay1(){
		if(top>=0){
			top -= 5;
			_this.scrollTop(top);
		}
	}
	if(setting.up){
		$(setting.up).hover(function(){
			$(this).addClass('on');
		},function(){
			$(this).removeClass('on');
			clearInterval(_delay);
		}).mousedown(function(){
			_delay = setInterval(delay1,1);
		}).mouseup(function(){
			clearInterval(_delay);
		});
	}
	if(setting.down){
		$(setting.down).hover(function(){
			$(this).addClass('on');
		},function(){
			$(this).removeClass('on');
			clearInterval(_delay);
		}).mousedown(function(){
			_delay = setInterval(delay,1);
		}).mouseup(function(){
			clearInterval(_delay);
		});
	}
}
$(function(){
	$('#body').find('#left,#right>#content').layoutHeight({
		body    : true,
		data    : [
			{index:0,height:0},
			{index:1,id:'#right>#title'}
		]
	});
	$('#Slider ul').innerfade({
		speed           : 'slow',
		timeout         : 5000,
		type            : 'sequence',
		containerheight : '180px'
	});
	$('#container #body.products #right #info #remark #panecontent').panescroll({
		up   : '#panescroll #up',
		down : '#panescroll #down'
	});
	$.formValidator.initConfig({formid:"form1",onerror:function(msg){}});
	$("#feedback #company").formValidator({
		onshow    : "请输入公司名称",
		onfocus   : "公司名称不能为空",
		oncorrect : "输入正确"
	}).inputValidator({
		min       : 1,
		onerror   : "公司名称不能为空"
	});
	$("#feedback #linkman").formValidator({
		onshow    : "请输入联系人",
		onfocus   : "联系人不能为空",
		oncorrect : "输入正确"
	}).inputValidator({
		min       : 1,
		onerror   : "联系人不能为空"
	});
	$("#feedback #tel").formValidator({
		onshow    : "请输入电话号码",
		onfocus   : "电话号码不能为空",
		oncorrect : "输入正确"
	}).inputValidator({
		min       : 1,
		onerror   : "电话号码不能为空"
	});
	$("#feedback #email").formValidator({
		onshow    : "请输入电子邮箱",
		onfocus   : "电子邮箱不能为空",
		oncorrect : "输入正确"
	}).inputValidator({
		min       : 1,
		onerror   : "电子邮箱不能为空"
	});
	$("#feedback #address").formValidator({
		onshow    : "请输入详细地址",
		onfocus   : "详细地址不能为空",
		oncorrect : "输入正确"
	}).inputValidator({
		min       : 1,
		onerror   : "详细地址不能为空"
	});
	$("#feedback #country").formValidator({
		onshow    : "请输入国家",
		onfocus   : "国家不能为空",
		oncorrect : "输入正确"
	}).inputValidator({
		min       : 1,
		onerror   : "国家不能为空"
	});
	$("#feedback #remark").formValidator({
		onshow    : "请输入简述",
		onfocus   : "简述不能为空",
		oncorrect : "输入正确"
	}).inputValidator({
		min       : 1,
		onerror   : "简述不能为空"
	});
});
