﻿var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
function HZW_callServer(obj,url,strv)//加载对象
{
  xmlHttp.open("post", url, true);
  xmlHttp.onreadystatechange = function (){HZW_updatePage(obj,strv);};
  xmlHttp.send(null);  
}
function HZW_updatePage(obj,strv) {
  if (xmlHttp.readyState < 4) {
	document.getElementById(obj).innerHTML=" "+strv;
  }
  if (xmlHttp.readyState == 4) {
  
    var response = xmlHttp.responseText;
		document.getElementById(obj).innerHTML=response;
  }
}




<!-- 
var flag=false; 
function DrawImage(ImgD){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= 490/110){ 
  if(image.width>490){
   ImgD.width=490; 
   ImgD.height=(image.height*110)/image.width; 
  }else{ 
   ImgD.width=image.width;
   ImgD.height=image.height; 
  } 
  /*ImgD.alt="bigpic" */
} 
else{ 
  if(image.height>420){
   ImgD.height=420; 
   ImgD.width=(image.width*420)/image.height; 
  }else{ 
   ImgD.width=image.width;
   ImgD.height=image.height; 
  } 
   /*ImgD.alt="bigpic" */ 
} 
}
} 
//--> 
//---------------------------------------用于设置对象背景----------------------------------------------------------------
function HZW_BgColor(obj,rtype,strv)//对象,类别(1背景图,2颜色),值
{
	alert('dd');
if(rtype==1){document.getElementById(obj).background=strv;}
else
{document.getElementById(obj).bgColor=strv}
}

//---------------------------------------用于显示对象------------------------------------------------------------------
function HZW_show(obj)
{
document.getElementById(obj).style.display='block';
}
//---------------------------------------用于隐藏对象------------------------------------------------------------------
function HZW_hidden(obj)
{
document.getElementById(obj).style.display='none';
}
//---------------------------------------用于判断记录有没有选中的函数----------------------------------------------
function HZW_obj_del(obj,url,str)
{ 
var flag=true; 
var temp=""; 
var tmp; 
if((document.getElementById(obj).length+"")=="undefined") {tmp=1}else{tmp=document.getElementById(obj).length} 
if (tmp==1){ 
if (document.getElementById(obj).checked){ 
flag=false; 
temp=document.getElementById(obj).value 
} 
}else{ 
for (i=0;i<document.getElementById(obj).length;i++) { 
if (document.getElementById(obj[i]).checked){ 
if (temp==""){ 
flag=false; 
temp="'"+document.getElementById(obj[i]).value+"'"
}else{ 
flag=false; 
temp = temp +","+ "'"+document.getElementById(obj[i]).value+"'"
} 
} 
} 
} 
if (flag){ alert("对不起，你还没有选择！")} 
else{
//alert(name) 
if (confirm("确实要删除？")){ 
window.location=url+"?str="+temp; 
} 
} 
return !flag; 
} 
//---------------------------------------用于判断全选记录的函数--------------------------------------------
function HZW_checkall(all,obj) 
{
var a = document.getElementsByName(obj); 
for (var i=0; i<a.length; i++) a[i].checked = all.checked; 
}

//---------------------------------------图片缩放百份比------------------------------------------





function resize_img(obj){
    var objImg = obj;//pictureID是图片ID号
    if( objImg ){
    var img_w = objImg.width;
    var img_h = objImg.height;
    var maxW = 550;
    var maxH = 600;
    var pW,pH;
    var w=parseInt(img_w);var h=parseInt(img_h);
    //alert('dd');
    if( w>maxW ){
    //按比例
    pW = maxW/w;
    pH = parseInt(h * pW);
    //alert( pW +":" + pH );
    objImg.style.width = maxW+"px";
    objImg.style.height = pH+"px";
    h = pH;
    w = maxW;
    }
    if( h>maxH ){
    //按比例
    pH = maxH/h;
    pW = parseInt(w * pH);
    //alert( pW +":" + pH );
    objImg.style.height = maxH+"px";
    objImg.style.width = pW+"px";
    }
    }
}








function  HZW_SetPicSize(obj,maxWidth,maxHeight)
 {
	 alert('dd');
     var img = document.getElementById(obj);
     if(maxWidth < 1)
     {
         if(img.height > maxHeight)
         {
             img.height = maxHeight;
         }
         return true;
     }
     if(maxHeight < 1)
     {
       if(img.width > maxWidth)
        {
             img.width = maxWidth;
         }
         return true;
     }
     if(img.height > maxHeight || img.width > maxWidth)
     {
         if((img.height / maxHeight) > (img.width / maxWidth))
         {
             img.height = maxHeight;
        }
        else
       {
           img.width = maxWidth;
       }
        return true;
    }
 } 
//---------------------------------------mail邮箱校检-------------------------------------------- 
function HZW_Mailcheck(obj)
{
var strm = document.getElementById(obj).value;  
 var regm = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;//验证Mail的正则表达式,^[a-zA-Z0-9_-]:开头必须为字母,下划线,数字,
 if (!strm.match(regm) && strm!="")
   {
     alert("邮箱地址格式错误或含有非法字符!\n请检查！");

  return false;
    }  
}
//---------------------------------------弹出窗体-------------------------------------------- 
function HZW_ShowModal(Url,MaxWidth,MaxHeight)
{
window.showModalDialog(Url,window,'dialogWidth:'+MaxWidth+'px;status:no;dialogHeight:'+MaxHeight+'px'); 
}
//---------------------------------------返回值到主窗体-------------------------------------------- 
function HZW_DialogArg(Obj,Rtype,Obj1)
{
if(Rtype==0){window.dialogArguments.document.getElementById(Obj).value=Obj1;}
if(Rtype==1){window.dialogArguments.document.getElementById(Obj).innerHTML=Obj1;}
}

//---------------------------------------判断日期格式为:####-##-##--------------------------------------------
function HZW_CheckThisday(a)
{
var dat=a.split("-");
if(dat.length<3){return true;}
if(dat[1].length==1){return true;}
if(dat[2].length==1){return true;}
}
//---------------------------------------判断日期--------------------------------------------
function HZW_smalCheckDate(DateA,DateB,Rtype)//DateA去日期 DateB回日期  Rtype 类型1对比今天 2AB对比
{
 var Today = new Date();
 var y,m,d,t;
 y = Today.getFullYear();
 m = Today.getMonth() + 1;
 if(m<10) m = "0"+m;
 d = Today.getDate();
 if(d<10) d = "0"+d;
 t = y + "-" + m + "-" + d;//今天
 if(Rtype==1)
  {return(t>DateA)}
else
  {return(DateA>DateB)}
}
function HZW_FinshBooking(msg,url)
{  alert(msg);
	aa=confirm('是否购买旅行保险~？');
if(aa==true)
  {location.href='../safe/Safe_List.asp';}
  else
  {location.href=url;}
}


function HZW_CanelBookNo(url)
{aa=confirm('是否真的要申请取消该订单?');
if(aa==true)
  {location.href=url;}
}


function HZW_Alert(str,msgw,msgh,titleheight,bordercolor,titlecolor){  
//提示内容,窗口宽度,高度,标语高度,窗口边框颜色,标题颜色 
        var msgw,msgh,bordercolor;   
           
        var sWidth,sHeight;   
        sWidth=screen.width;   
        sHeight=screen.height;   
  
        var bgObj=document.createElement("div");   
        bgObj.setAttribute('id','bgDiv');   
        bgObj.style.position="absolute";   
        bgObj.style.top="0";   
        bgObj.style.background="#cccccc";   
        bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";   
        bgObj.style.opacity="0.6";   
        bgObj.style.left="0";   
        bgObj.style.width=sWidth + "px";   
        bgObj.style.height=sHeight + "px";   
        bgObj.style.zIndex = "10000";   
        document.body.appendChild(bgObj);   
           
        var msgObj=document.createElement("div")   
        msgObj.setAttribute("id","msgDiv");   
        msgObj.setAttribute("align","center");   
        msgObj.style.background="white";   
        msgObj.style.border="1px solid " + bordercolor;   
        msgObj.style.position = "absolute";   
        msgObj.style.left = "50%";   
        msgObj.style.top = "50%";   
        msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";   
        msgObj.style.marginLeft = "-225px" ;   
        msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";   
        msgObj.style.width = msgw + "px";   
        msgObj.style.height =msgh + "px";   
        msgObj.style.textAlign = "center";   
        msgObj.style.lineHeight ="25px";   
        msgObj.style.zIndex = "10001";   
  
       var title=document.createElement("h4");   
       title.setAttribute("id","msgTitle");   
       title.setAttribute("align","right");   
       title.style.margin="0";   
       title.style.padding="3px";   
       title.style.background=bordercolor;   
       title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";   
       title.style.opacity="0.75";   
       title.style.border="1px solid " + bordercolor;   
       title.style.height="18px";   
       title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";   
       title.style.color="white";   
       title.style.cursor="pointer";   
       title.innerHTML="关闭";   
       title.onclick=function(){   
    document.body.removeChild(bgObj);   
    document.getElementById("msgDiv").removeChild(title);   
document.body.removeChild(msgObj);   
            }   
       document.body.appendChild(msgObj);   
       document.getElementById("msgDiv").appendChild(title);   
       var txt=document.createElement("p");   
       txt.style.margin="1em 0"  
       txt.setAttribute("id","msgTxt");   
       txt.innerHTML=str;   
       document.getElementById("msgDiv").appendChild(txt);   
        }  