﻿// JavaScript Document
//function resizeHeight()   
//  {   
//          var indexcontent=document.getElementById("indexcontent");
 //         var hbody=document.documentElement.clientHeight;
 //         indexcontent.style.height   =   parseInt(hbody-120)+"px";	  
 // } 
  
  function getSize() { 
       var xScroll, yScroll;        
       if (window.innerHeight && window.scrollMaxY) {        
              xScroll = document.body.scrollWidth; 
              yScroll = window.innerHeight + window.scrollMaxY; 
       } else if (document.body.scrollHeight > document.body.offsetHeight){       // all but Explorer Mac 
              xScroll = document.body.scrollWidth; 
              yScroll = document.body.scrollHeight; 
       } else {       // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari 
              xScroll = document.body.offsetWidth; 
              yScroll = document.body.offsetHeight; 
       } 
       var windowWidth, windowHeight; 
       if (self.innerHeight) {       // all except Explorer 
              windowWidth = self.innerWidth; 
              windowHeight = self.innerHeight; 
       } else if (document.documentElement && document.documentElement.clientHeight) {       // Explorer 6 Strict Mode 
              windowWidth = document.documentElement.clientWidth; 
              windowHeight = document.documentElement.clientHeight; 
       } else if (document.body) {       // other Explorers 
              windowWidth = document.body.clientWidth; 
              windowHeight = document.body.clientHeight; 
       }        
       // for small pages with total height less then height of the viewport 
       if(yScroll < windowHeight){ 
              pageHeight = windowHeight; 
              y = pageHeight; 
       } else {  
              pageHeight = yScroll; 
              y = pageHeight; 
       } 
       if(xScroll < windowWidth){        
              pageWidth = windowWidth; 
       } else { 
              pageWidth = xScroll; 
       } 
       arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)  
       return arrayPageSize; 
} 
 
function resizeHeight() { 
       var x = new getSize(); 
       document.getElementById("indexcontent").style.height=x[1]-119+"px"; 
} 

function resizeHeight1() { 
       var x = new getSize(); 
       document.getElementById("indexcontent").style.height=x[1]-119+"px"; 
	   document.getElementById("shipdet").style.height=x[1]-569+"px"; 
} 

function changeclassandposition(str,str1,str2)
{
	var myobj1 = document.getElementById(str1);	
	myobj1.className = str2;
	
	if (str!="")
	{
	var mytableleft = 0;
	var e_l = str;
	while(e_l)
	{
	mytableleft = mytableleft + e_l.offsetLeft;
	e_l = e_l.offsetParent;
	}
	myobj1.style.left = mytableleft ;
	}
}



var flag=false;
function DrawImage(ImgD){
var image=new Image();
var iwidth = 130; //定义允许图片宽度，当宽度大于这个值时等比例缩小
var iheight = 172; //定义允许图片高度，当宽度大于这个值时等比例缩小
image.src=ImgD.src;
if(image.width>0 && image.height>0){
flag=true;
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;
}
}
} 

