/*function killErrors() {return true;}window.onerror = killErrors;*/
var root="/";
var lan="";
$(function(){
var $body;
var $select;
var messageIdNumber=0;
var messageId;
$.message=function(settings){
if(settings.content==null){settings.content="";}
if($body==null){$body=$("body");}
if(!window.XMLHttpRequest&&$select==null){$select=$("select");}
if($select!=null){$select.css("visibility","hidden");}
if(settings.type==null){settings.type="warn";}
if(settings.time==null){settings.time=1500;}
if(settings.id==null){messageId="message"+messageIdNumber;}
else{messageId=settings.id}
messageIdNumber++;
var messageHtml;
messageHtml='
'+settings.content+'
';
$body.append(messageHtml);
var $message=$("#"+messageId);
$message.css({"margin-left":"-"+parseInt($message.width()/2)+"px"}).slideToggle();
setTimeout(function(){
$message.animate({width:0,height:0},"toggle",function(){
$message.remove();
if ($select!=null){
$select.css("visibility","visible");
}
});
},settings.time);
return messageId;
}
});
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0 && image.height>0){
if(image.width/image.height>= w/h){
if(image.width>w){
ImgD.width=w;
ImgD.height=(image.height*w)/image.width;
}
else{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt= "点击查看"+image.width+"x"+image.height+"原始图片...";
}
else{
if(image.height>h){
ImgD.height=h;
ImgD.width=(image.width*h)/image.height;
}
else{
ImgD.width=image.width;
ImgD.height=image.height;
}
//ImgD.alt= "点击查看"+image.width+"x"+image.height+"原始图片...";
}
}
}
function trim(s){return s.replace(/(^\s*)|(\s*$)/g, "");}
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=$('#'+name+i);
var con=$("#con_"+name+"_"+i);
menu[0].className=i==cursel?"hover":"";
con[0].style.display=i==cursel?"block":"none";
}
}
function checksearch(the)
{
if (trim(the.key.value)=='')
{ alert('请输入关键字');
the.key.focus();
the.key.value='';
return false
}
if (trim(the.key.value)=='请输入关键字')
{ alert('请输入关键字');
the.key.focus();
the.key.value='';
return false
}
}
$(function(){
$.Tipmsg.r=null;
$(".form_book").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=book",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="?"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
$(".form_comment").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=comment&id=<%=id%>",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="?"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
$(".form_login").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=login",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="vtfs.btq"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
$(".form_reg").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=reg",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="mphjo.btq"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
$(".form_editpass").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=editpass",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="vtfs.btq"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
$(".form_editbase").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=editbase",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="vtfs.btq"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
$(".form_order").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=order",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="?"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
$(".form_resume").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=resume",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="?"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
$(".form_vote").Validform({
tiptype:function(msg){$.message({content:msg});},
ajaxPost:true,
tipSweep:true,
url:root+"inc/ajax"+lan+".asp?act=vote",
beforeSubmit:function(curform){
$(".bnt",curform).attr("disabled","disabled")
},
callback:function(data){
if(data.status=="y")
{
$.message({type:'ok',content:data.info});
setTimeout(function(){location.href="vtfs.btq"},3000)
}
else
{
$.message({type:'error',content:data.info,time:3000});
$(".bnt").attr("disabled",false)
}
}
});
//
})