$(function() {
// carousel
$('.loopedCarousel').loopedCarousel();
});

function ResumeError()  
{ 
    return true; 
} 
window.onerror = ResumeError; 
function check()
{
if(document.search.keyword.value.length==0){
     alert("请输入查询信息！");
     document.search.keyword.focus();
     return false;
    }

}


// 导航下拉菜单

$(function(){
nav_curr();	   
   
//下拉菜单
$("#menu > li:has(.subMenu)").hover(function(){
//$("#menu > li > a").removeClass("hover");	
$(this).find("a").eq(0).addClass("hover");
$(this).find(".subMenu").stop(true,true).fadeIn(300);
},function(){
$(this).find("a").eq(0).removeClass("hover");
$(this).find(".subMenu").stop(true,true).fadeOut(300);
nav_curr();
});		

//导航当前项
function nav_curr(){
for(var i=0;i<5;i++){
navText=$("#menu > li > a").eq(i).attr("title");	
if(navText==navCurrent){
$("#menu > li > a").eq(i).addClass("hover");
}
}
}

});

var navCurrent="首页";




function XiaoboPrintFlash(FlashUrl,width,height,files,links)
{
var swf_width=width
var swf_height=height
var files=files
var links=links
var texts=''
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=Response.Write "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value='+FlashUrl+'><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'">');
document.write('<embed src='+FlashUrl+' wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); 
document.write('</object>');
}

var prev;
function showCon(obj) {
    if (prev != null) {
        document.getElementById("con" + prev).style.display = "none";
        document.getElementById("m" + prev).className = "pa";
    }
    document.getElementById("con" + obj).style.display = "block";
    document.getElementById("m" + obj).className = "paA";
    prev = obj;
}

function DrawImage(MyPic,W,H){
  var flag=false;
  var image=new Image();
  image.src=MyPic.src;
  if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= W/H){
      if(image.width>W){
        MyPic.width=W;
        MyPic.height=(image.height*W)/image.width;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
    else{
      if(image.height>H){
        MyPic.height=H;
        MyPic.width=(image.width*H)/image.height;
      }
	  else{
        MyPic.width=image.width;
        MyPic.height=image.height;
      }
    }
  }
}
function refreshimg()
{
	
document.getElementById("checkcodes").src="Include/CheckCode/CheckCode.Asp?seed="+Math.random();
}

function refreshimgs()
{
	
document.getElementById("checkcodes").src="../Include/CheckCode/CheckCode.Asp?seed="+Math.random();
}

function winopen()
{
window.open("http://www.liangjing.org/Copyright.html","search","dialogWidth:680px; dialogHeight:500px; status:0");
}
/* 更换显示样式*/
function setTab(m,n){
 var tli=document.getElementById("menu"+m).getElementsByTagName("li");
 var mli=document.getElementById("main"+m).getElementsByTagName("ul");
 for(i=0;i<tli.length;i++){
  tli[i].className=i==n?"hover":"";
  mli[i].style.display=i==n?"block":"none";
 }
}




