//滚动
 	if (document.getElementById('slider')) {
    console=window.console || {dir:new Function(),log:new Function()};
    var active=0,as=document.getElementById('pagenavi').getElementsByTagName('a');
    for(var i=0;i<as.length;i++){
      (function(){
        var j=i;
        as[i].onclick=function(){
          t4.slide(j);
          return false;
        }
      })();
    }
    var t4=new TouchSlider({id:'slider', speed:600, timeout:6000, before:function(index){
      as[active].className='';
      active=index;
      as[active].className='active';
    }});
  };
//搜索
$( function() {
	var searchTxt = $("#search input:text[name='SeaStr']").val();
	$("#search").submit( function() {
		var s_searchTxt = $(this).find("input:text[name='SeaStr']").val();
		if ( s_searchTxt == "" || s_searchTxt == searchTxt || s_searchTxt == "请输入搜索关键词" ) {
			$(this).find("input:text[name='SeaStr']").val("请输入搜索关键词");
			alert('请输入搜索关键词');
			return false;
		}
	} ).find("input:text[name='SeaStr']").focus( function() {
		var s_searchTxt = $(this).val();
		if ( s_searchTxt == searchTxt || s_searchTxt == "请输入搜索关键词" ) {
			$(this).val("");
		}
	} ).blur( function() {
		var s_searchTxt = $(this).val();
		if ( s_searchTxt == "" || s_searchTxt == "请输入搜索关键词" ) {
			$(this).val(searchTxt);
		}
	} );
} );

function checkForm()
{
	var SeaStr = $("#SeaStr").val();
	var defVal = $("#SeaStr").attr("defval");
	var r = '';
	if (defVal == SeaStr || SeaStr=="" || SeaStr==undefined)
	{
		return false;
	}
	$.ajax({
		type: "GET",
		url: "/seastr.asp?r=" + Math.random(),
		data:"SeaStr="+SeaStr, 
		dataType: "text",
		async: false,
		error: function(err) {
			alert("搜索失败");
			r = "ERR";
			return false;
		},
		success: function(msg) {
			r = msg;
		}
	});
	if (r == "TRUE")
		return true;
	else if (r == "EMT")
	{
		alert("请输入搜索关键字");
		return false;
	}
	else
	{
		alert("搜索失败");
		return false;
	}
		
}

//导航
$(function(){function a(){var b=$(".wrap");if(parseInt(b.css("right"))=="0"){b.animate({right:"220"},400)}else{b.animate({right:"0"},400)}}$(".menu_btn").click(function(){a()});$(".menu_btn").click(function(){$("#sliderbar").slideToggle()})});

/*下滑列表*/
$(document).ready(function () {
    $('span.classbtn').click(function () {
	$('.the_menu').slideToggle('medium');
    });
});