// JavaScript Document
if (top.location!=self.location)
self.location.href=""
//-------------------------------------------图片的等比例缩放
function pimsize(ImgD,iwidth,iheight){ 
    var image=new Image();
     image.src=ImgD.src;
     if(image.width>0 && image.height>0){
        if(image.width/image.height>= iwidth/iheight){
           if(image.width>iwidth){
               ImgD.width=iwidth;
               ImgD.height=(image.height*iwidth)/image.width;
           }else{
                  ImgD.width=image.width;
                  ImgD.height=image.height;
                }
               ImgD.alt=image.width+"×"+image.height;
        }
        else{
                if(image.height>iheight){
                       ImgD.height=iheight;
                       ImgD.width=(image.width*iheight)/image.height;
                }else{
                        ImgD.width=image.width;
                        ImgD.height=image.height;
                     }
                ImgD.alt=image.width+"×"+image.height;
            }
　　　　
    }
} 

//-------------------------------------------图片的等比例缩放,多功能
function resizeimg(ImgD,iwidth,iheight) {
    var image=new Image();
     image.src=ImgD.src;
     if(image.width>0 && image.height>0){
        if(image.width/image.height>= iwidth/iheight){
           if(image.width>iwidth){
               ImgD.width=iwidth;
               ImgD.height=(image.height*iwidth)/image.width;
           }else{
                  ImgD.width=image.width;
                  ImgD.height=image.height;
                }
               ImgD.alt=image.width+"×"+image.height;
        }
        else{
                if(image.height>iheight){
                       ImgD.height=iheight;
                       ImgD.width=(image.width*iheight)/image.height;
                }else{
                        ImgD.width=image.width;
                        ImgD.height=image.height;
                     }
                ImgD.alt=image.width+"×"+image.height;
            }
　　　　
    }
}
 

function hddiv(o){
o.style.display="none";
if(o.id="bqdiv1")xwly();
}

//-----------------------------------------------------------------------------给我留言验证
function isNumber(String) 
{   
var Letters = "1234567890-"; //可以自己增加可输入值 
var i; 
var c; 
if(String.charAt( 0 )=='-') 
return false; 
if( String.charAt( String.length - 1 ) == '-' ) 
return false; 
for( i = 0; i < String.length; i ++ ) 
{   
c = String.charAt( i ); 
if (Letters.indexOf( c ) < 0) 
return false; 
} 
return true; 
} 
function check(){
	if(document.form.user.value==""){
		alert("您的姓名不能为空！");
		document.form.user.focus();
		return false;
	}
	if(!isNumber(document.form.tel.value)) {   
        alert("您的电话号码不合法！"); 
         document.form.tel.focus(); 
          return false; 
      } 
	if(document.form.tel.value==""){
		alert("您的电话不能为空！");
		document.form.tel.focus();
		return false;
	}
	if(document.form.zhuti.value==""){
		alert("您的主题不能为空！");
		document.form.zhuti.focus();
		return false;
	}
	if(document.form.content.value==""){
		alert("您询问的内容不能为空！");
		document.form.content.focus();
		return false;
	}
	
		
		document.form.submit();
		hddiv(bqdiv1);
}

function msover(o){
	o.style.cursor="hand";
	o.style.position="relative";
	o.style.top=2;
	o.style.left=2;	
	
}
function msout(o){
	o.style.position="relative";
	o.style.top=-2;
	o.style.left=-2;	
	
}

var currentMoveObj = null;    //当前拖动对象
var relLeft;    //鼠标按下位置相对对象位置
var relTop;
function f_mdown(obj)
{
    currentMoveObj = obj;        //当对象被按下时，记录该对象
    currentMoveObj.style.position = "absolute";
    relLeft = event.x - currentMoveObj.style.pixelLeft;
    relTop = event.y - currentMoveObj.style.pixelTop;
}
window.document.onmouseup = function()
{
    currentMoveObj = null;    //当鼠标释放时同时释放拖动对象
}
function f_move(obj)
{
    if(currentMoveObj != null)
    {
        currentMoveObj.style.pixelLeft=event.x-relLeft;
        currentMoveObj.style.pixelTop=event.y-relTop;
    }
}
function nomove()
{currentMoveObj = null;

}
function moveovercplbt(o){
	o.style.backgroundColor="#FFFFD7";
}
function moveoutcplbt(o){
	o.style.backgroundColor="";
}  
  




